From owner-svn-src-head@freebsd.org Sun Mar 27 00:37:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA4F4AD585B; Sun, 27 Mar 2016 00:37:55 +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 mx1.freebsd.org (Postfix) with ESMTPS id AF48E1223; Sun, 27 Mar 2016 00:37:55 +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 u2R0bsIZ002106; Sun, 27 Mar 2016 00:37:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2R0bsQH002104; Sun, 27 Mar 2016 00:37:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201603270037.u2R0bsQH002104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 27 Mar 2016 00:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297299 - in head: contrib/libcxxrt lib/libcxxrt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 00:37:56 -0000 Author: dim Date: Sun Mar 27 00:37:54 2016 New Revision: 297299 URL: https://svnweb.freebsd.org/changeset/base/297299 Log: Compile libcxxrt as C++11, since it is only really used in combination with libc++, which is also C++11. Also change one _Static_assert (which is really C11) back into static_assert, like upstream. This should help when compiling libcxxrt with newer versions of gcc, which refuse to recognize any form of static assertions, if not compiling for C++11 or higher. While here, add -nostdinc++ to CFLAGS, to prevent picking up any C++ headers outside the source tree. Modified: head/contrib/libcxxrt/guard.cc head/lib/libcxxrt/Makefile Modified: head/contrib/libcxxrt/guard.cc ============================================================================== --- head/contrib/libcxxrt/guard.cc Sat Mar 26 23:39:53 2016 (r297298) +++ head/contrib/libcxxrt/guard.cc Sun Mar 27 00:37:54 2016 (r297299) @@ -101,7 +101,7 @@ typedef struct { uint32_t init_half; uint32_t lock_half; } guard_t; -_Static_assert(sizeof(guard_t) == sizeof(uint64_t), ""); +static_assert(sizeof(guard_t) == sizeof(uint64_t), ""); static const uint32_t LOCKED = 1; static const uint32_t INITIALISED = static_cast(1) << 24; # endif Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Sat Mar 26 23:39:53 2016 (r297298) +++ head/lib/libcxxrt/Makefile Sun Mar 27 00:37:54 2016 (r297299) @@ -20,7 +20,10 @@ SRCS+= libelftc_dem_gnu3.c\ guard.cc WARNS= 0 -CFLAGS+= -I${SRCDIR} +CFLAGS+= -I${SRCDIR} -nostdinc++ +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif VERSION_MAP= ${.CURDIR}/Version.map .include From owner-svn-src-head@freebsd.org Sun Mar 27 08:07:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9879ADFE36; Sun, 27 Mar 2016 08:07:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A280214D6; Sun, 27 Mar 2016 08:07:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2R87COq040146; Sun, 27 Mar 2016 08:07:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2R87CBo040145; Sun, 27 Mar 2016 08:07:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603270807.u2R87CBo040145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 27 Mar 2016 08:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297308 - head/sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 08:07:14 -0000 Author: kib Date: Sun Mar 27 08:07:12 2016 New Revision: 297308 URL: https://svnweb.freebsd.org/changeset/base/297308 Log: Style: wrap long lines. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ufs/ufsmount.h ============================================================================== --- head/sys/ufs/ufs/ufsmount.h Sun Mar 27 08:00:51 2016 (r297307) +++ head/sys/ufs/ufs/ufsmount.h Sun Mar 27 08:07:12 2016 (r297308) @@ -85,11 +85,13 @@ struct ufsmount { int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */ int um_candelete; /* devvp supports TRIM */ int um_writesuspended; /* suspension in progress */ - int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); + int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, + int, struct buf **); int (*um_blkatoff)(struct vnode *, off_t, char **, struct buf **); int (*um_truncate)(struct vnode *, off_t, int, struct ucred *); int (*um_update)(struct vnode *, int); - int (*um_valloc)(struct vnode *, int, struct ucred *, struct vnode **); + int (*um_valloc)(struct vnode *, int, struct ucred *, + struct vnode **); int (*um_vfree)(struct vnode *, ino_t, int); void (*um_ifree)(struct ufsmount *, struct inode *); int (*um_rdonly)(struct inode *); From owner-svn-src-head@freebsd.org Sun Mar 27 08:10:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E330ADFF76; Sun, 27 Mar 2016 08:10:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C01B71718; Sun, 27 Mar 2016 08:10:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2R8AK5i040311; Sun, 27 Mar 2016 08:10:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2R8AKek040310; Sun, 27 Mar 2016 08:10:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603270810.u2R8AKek040310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 27 Mar 2016 08:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297309 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 08:10:22 -0000 Author: dchagin Date: Sun Mar 27 08:10:20 2016 New Revision: 297309 URL: https://svnweb.freebsd.org/changeset/base/297309 Log: Whitespaces and style(9) fix. No functional changes. MFC after: 1 week Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun Mar 27 08:07:12 2016 (r297308) +++ head/sys/compat/linux/linux_socket.c Sun Mar 27 08:10:20 2016 (r297309) @@ -448,7 +448,7 @@ linux_to_bsd_msg_flags(int flags) if (flags & LINUX_MSG_ERRQUEUE) ; #endif - return ret_flags; + return (ret_flags); } /* @@ -463,15 +463,12 @@ bsd_to_linux_sockaddr(struct sockaddr *a struct sockaddr sa; size_t sa_len = sizeof(struct sockaddr); int error; - + if ((error = copyin(arg, &sa, sa_len))) return (error); - + *(u_short *)&sa = sa.sa_family; - - error = copyout(&sa, arg, sa_len); - - return (error); + return (copyout(&sa, arg, sa_len)); } static int @@ -486,10 +483,7 @@ linux_to_bsd_sockaddr(struct sockaddr *a sa.sa_family = *(sa_family_t *)&sa; sa.sa_len = len; - - error = copyout(&sa, arg, sa_len); - - return (error); + return (copyout(&sa, arg, sa_len)); } static int @@ -511,11 +505,7 @@ linux_sa_put(struct osockaddr *osa) return (EINVAL); sa.sa_family = bdom; - error = copyout(&sa, osa, sizeof(sa.sa_family)); - if (error) - return (error); - - return (0); + return (copyout(&sa, osa, sizeof(sa.sa_family))); } static int @@ -912,10 +902,7 @@ linux_getsockname(struct thread *td, str bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.asa); if (error) return (error); - error = linux_sa_put(PTRIN(args->addr)); - if (error) - return (error); - return (0); + return (linux_sa_put(PTRIN(args->addr))); } int @@ -935,10 +922,7 @@ linux_getpeername(struct thread *td, str bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.asa); if (error) return (error); - error = linux_sa_put(PTRIN(args->addr)); - if (error) - return (error); - return (0); + return (linux_sa_put(PTRIN(args->addr))); } int @@ -1003,7 +987,7 @@ linux_send(struct thread *td, struct lin bsd_args.flags = args->flags; bsd_args.to = NULL; bsd_args.tolen = 0; - return sys_sendto(td, &bsd_args); + return (sys_sendto(td, &bsd_args)); } struct linux_recv_args { @@ -1040,7 +1024,6 @@ linux_sendto(struct thread *td, struct l { struct msghdr msg; struct iovec aiov; - int error; if (linux_check_hdrincl(td, args->s) == 0) /* IP_HDRINCL set, tweak the packet before sending */ @@ -1054,9 +1037,8 @@ linux_sendto(struct thread *td, struct l msg.msg_flags = 0; aiov.iov_base = PTRIN(args->msg); aiov.iov_len = args->len; - error = linux_sendit(td, args->s, &msg, args->flags, NULL, - UIO_USERSPACE); - return (error); + return (linux_sendit(td, args->s, &msg, args->flags, NULL, + UIO_USERSPACE)); } int From owner-svn-src-head@freebsd.org Sun Mar 27 08:12:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E800ADC0C9; Sun, 27 Mar 2016 08:12:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 457F91AB6; Sun, 27 Mar 2016 08:12:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2R8C25v043024; Sun, 27 Mar 2016 08:12:02 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2R8C2x3043020; Sun, 27 Mar 2016 08:12:02 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603270812.u2R8C2x3043020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 27 Mar 2016 08:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297310 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 08:12:03 -0000 Author: dchagin Date: Sun Mar 27 08:12:01 2016 New Revision: 297310 URL: https://svnweb.freebsd.org/changeset/base/297310 Log: iConvert Linux SOL_IPV6 level. MFC after: 1 week Modified: head/sys/amd64/linux/linux.h head/sys/amd64/linux32/linux.h head/sys/compat/linux/linux_socket.c head/sys/i386/linux/linux.h Modified: head/sys/amd64/linux/linux.h ============================================================================== --- head/sys/amd64/linux/linux.h Sun Mar 27 08:10:20 2016 (r297309) +++ head/sys/amd64/linux/linux.h Sun Mar 27 08:12:01 2016 (r297310) @@ -404,6 +404,7 @@ struct l_ipc_perm { #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0 +#define LINUX_SOL_IPV6 41 #define LINUX_SOL_IPX 256 #define LINUX_SOL_AX25 257 #define LINUX_SOL_TCP 6 Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Sun Mar 27 08:10:20 2016 (r297309) +++ head/sys/amd64/linux32/linux.h Sun Mar 27 08:12:01 2016 (r297310) @@ -494,6 +494,7 @@ struct l_ipc_perm { */ #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0 +#define LINUX_SOL_IPV6 41 #define LINUX_SOL_IPX 256 #define LINUX_SOL_AX25 257 #define LINUX_SOL_TCP 6 Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun Mar 27 08:10:20 2016 (r297309) +++ head/sys/compat/linux/linux_socket.c Sun Mar 27 08:12:01 2016 (r297310) @@ -246,6 +246,8 @@ linux_to_bsd_sockopt_level(int level) switch (level) { case LINUX_SOL_SOCKET: return (SOL_SOCKET); + case LINUX_SOL_IPV6: + return (IPPROTO_IPV6); } return (level); } Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Sun Mar 27 08:10:20 2016 (r297309) +++ head/sys/i386/linux/linux.h Sun Mar 27 08:12:01 2016 (r297310) @@ -473,6 +473,7 @@ struct l_ipc_perm { */ #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0 +#define LINUX_SOL_IPV6 41 #define LINUX_SOL_IPX 256 #define LINUX_SOL_AX25 257 #define LINUX_SOL_TCP 6 From owner-svn-src-head@freebsd.org Sun Mar 27 08:21:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 276CBADC1F2; Sun, 27 Mar 2016 08:21:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5E501D7E; Sun, 27 Mar 2016 08:21:18 +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 u2R8LInN045379; Sun, 27 Mar 2016 08:21:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2R8LHT5045376; Sun, 27 Mar 2016 08:21:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603270821.u2R8LHT5045376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 27 Mar 2016 08:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297311 - in head/sys/ufs: ffs ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 08:21:19 -0000 Author: kib Date: Sun Mar 27 08:21:17 2016 New Revision: 297311 URL: https://svnweb.freebsd.org/changeset/base/297311 Log: Split the global taskqueue used to process all UFS trim completions, into per-mount taskqueue with the private taskqueue processing thread. This allows to drain the taskqueue on unmount, to ensure that all TRIMs are finished before mount structures are freed. But just draining the taskqueue where TRIM biodone geom-up completions are processed is not enough, since ffs_blkfree(), called by the task, might result in more writes. Count inflight delayed blkfree's and pause() unmount until the counter drains as well. Reported by: Nick Evans Tested by: Nick Evans , pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Mar 27 08:12:01 2016 (r297310) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Mar 27 08:21:17 2016 (r297311) @@ -2270,8 +2270,6 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size bdwrite(bp); } -TASKQUEUE_DEFINE_THREAD(ffs_trim); - struct ffs_blkfree_trim_params { struct task task; struct ufsmount *ump; @@ -2294,6 +2292,7 @@ ffs_blkfree_trim_task(ctx, pending) ffs_blkfree_cg(tp->ump, tp->ump->um_fs, tp->devvp, tp->bno, tp->size, tp->inum, tp->pdephd); vn_finished_secondary_write(UFSTOVFS(tp->ump)); + atomic_add_int(&tp->ump->um_trim_inflight, -1); free(tp, M_TEMP); } @@ -2306,7 +2305,7 @@ ffs_blkfree_trim_completed(bip) tp = bip->bio_caller2; g_destroy_bio(bip); TASK_INIT(&tp->task, 0, ffs_blkfree_trim_task, tp); - taskqueue_enqueue(taskqueue_ffs_trim, &tp->task); + taskqueue_enqueue(tp->ump->um_trim_tq, &tp->task); } void @@ -2350,6 +2349,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, i * reordering, TRIM might be issued after we reuse the block * and write some new data into it. */ + atomic_add_int(&ump->um_trim_inflight, 1); tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TEMP, M_WAITOK); tp->ump = ump; tp->devvp = devvp; Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sun Mar 27 08:12:01 2016 (r297310) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun Mar 27 08:21:17 2016 (r297311) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1005,6 +1006,12 @@ ffs_mountfs(devvp, mp, td) mp->mnt_stat.f_mntonname); ump->um_candelete = 0; } + if (ump->um_candelete) { + ump->um_trim_tq = taskqueue_create("trim", M_WAITOK, + taskqueue_thread_enqueue, &ump->um_trim_tq); + taskqueue_start_threads(&ump->um_trim_tq, 1, PVFS, + "%s trim", mp->mnt_stat.f_mntonname); + } } ump->um_mountp = mp; @@ -1260,6 +1267,12 @@ ffs_unmount(mp, mntflags) } if (susp) vfs_write_resume(mp, VR_START_WRITE); + if (ump->um_trim_tq != NULL) { + while (ump->um_trim_inflight != 0) + pause("ufsutr", hz); + taskqueue_drain_all(ump->um_trim_tq); + taskqueue_free(ump->um_trim_tq); + } DROP_GIANT(); g_topology_lock(); if (ump->um_fsckpid > 0) { Modified: head/sys/ufs/ufs/ufsmount.h ============================================================================== --- head/sys/ufs/ufs/ufsmount.h Sun Mar 27 08:12:01 2016 (r297310) +++ head/sys/ufs/ufs/ufsmount.h Sun Mar 27 08:21:17 2016 (r297311) @@ -50,6 +50,7 @@ MALLOC_DECLARE(M_UFSMNT); struct buf; struct inode; struct nameidata; +struct taskqueue; struct timeval; struct ucred; struct uio; @@ -85,6 +86,8 @@ struct ufsmount { int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */ int um_candelete; /* devvp supports TRIM */ int um_writesuspended; /* suspension in progress */ + u_int um_trim_inflight; + struct taskqueue *um_trim_tq; int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); int (*um_blkatoff)(struct vnode *, off_t, char **, struct buf **); From owner-svn-src-head@freebsd.org Sun Mar 27 10:04:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB3FBADDD2E; Sun, 27 Mar 2016 10:04:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D244117C; Sun, 27 Mar 2016 10:04:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RA4QT0076136; Sun, 27 Mar 2016 10:04:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RA4Qaf076127; Sun, 27 Mar 2016 10:04:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201603271004.u2RA4Qaf076127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 27 Mar 2016 10:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297312 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 10:04:27 -0000 Author: tuexen Date: Sun Mar 27 10:04:25 2016 New Revision: 297312 URL: https://svnweb.freebsd.org/changeset/base/297312 Log: Improve compilation on windows 64-bit (for the userland stack). MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sun Mar 27 08:21:17 2016 (r297311) +++ head/sys/netinet/sctp_constants.h Sun Mar 27 10:04:25 2016 (r297312) @@ -68,6 +68,8 @@ __FBSDID("$FreeBSD$"); /* Largest length of a chunk */ #define SCTP_MAX_CHUNK_LENGTH 0xffff +/* Largest length of an error cause */ +#define SCTP_MAX_CAUSE_LENGTH 0xffff /* Number of addresses where we just skip the counting */ #define SCTP_COUNT_LIMIT 40 Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Mar 27 08:21:17 2016 (r297311) +++ head/sys/netinet/sctp_indata.c Sun Mar 27 10:04:25 2016 (r297312) @@ -2495,7 +2495,7 @@ sctp_process_data(struct mbuf **mm, int if (op_err != NULL) { cause = mtod(op_err, struct sctp_gen_error_cause *); cause->code = htons(SCTP_CAUSE_UNRECOG_CHUNK); - cause->length = htons(chk_length + sizeof(struct sctp_gen_error_cause)); + cause->length = htons((uint16_t) (chk_length + sizeof(struct sctp_gen_error_cause))); SCTP_BUF_LEN(op_err) = sizeof(struct sctp_gen_error_cause); SCTP_BUF_NEXT(op_err) = SCTP_M_COPYM(m, *offset, chk_length, M_NOWAIT); if (SCTP_BUF_NEXT(op_err) != NULL) { @@ -2688,7 +2688,7 @@ sctp_process_segment_range(struct sctp_t sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_GAP, tp1->whoTo->flight_size, tp1->book_size, - (uintptr_t) tp1->whoTo, + (uint32_t) (uintptr_t) tp1->whoTo, tp1->rec.data.TSN_seq); } sctp_flight_size_decrease(tp1); @@ -2897,7 +2897,7 @@ sctp_check_for_revoked(struct sctp_tcb * sctp_misc_ints(SCTP_FLIGHT_LOG_UP_REVOKE, tp1->whoTo->flight_size, tp1->book_size, - (uintptr_t) tp1->whoTo, + (uint32_t) (uintptr_t) tp1->whoTo, tp1->rec.data.TSN_seq); } sctp_flight_size_increase(tp1); @@ -3211,7 +3211,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_RSND, (tp1->whoTo ? (tp1->whoTo->flight_size) : 0), tp1->book_size, - (uintptr_t) tp1->whoTo, + (uint32_t) (uintptr_t) tp1->whoTo, tp1->rec.data.TSN_seq); } if (tp1->whoTo) { @@ -3523,7 +3523,7 @@ sctp_window_probe_recovery(struct sctp_t sctp_misc_ints(SCTP_FLIGHT_LOG_DWN_WP_FWD, tp1->whoTo ? tp1->whoTo->flight_size : 0, tp1->book_size, - (uintptr_t) tp1->whoTo, + (uint32_t) (uintptr_t) tp1->whoTo, tp1->rec.data.TSN_seq); return; } @@ -3542,7 +3542,7 @@ sctp_window_probe_recovery(struct sctp_t sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_WP, tp1->whoTo->flight_size, tp1->book_size, - (uintptr_t) tp1->whoTo, + (uint32_t) (uintptr_t) tp1->whoTo, tp1->rec.data.TSN_seq); } } @@ -3661,7 +3661,7 @@ sctp_express_handle_sack(struct sctp_tcb sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_CA, tp1->whoTo->flight_size, tp1->book_size, - (uintptr_t) tp1->whoTo, + (uint32_t) (uintptr_t) tp1->whoTo, tp1->rec.data.TSN_seq); } sctp_flight_size_decrease(tp1); @@ -4302,7 +4302,7 @@ sctp_handle_sack(struct mbuf *m, int off sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_CA, tp1->whoTo->flight_size, tp1->book_size, - (uintptr_t) tp1->whoTo, + (uint32_t) (uintptr_t) tp1->whoTo, tp1->rec.data.TSN_seq); } sctp_flight_size_decrease(tp1); @@ -4575,7 +4575,7 @@ sctp_handle_sack(struct mbuf *m, int off sctp_misc_ints(SCTP_FLIGHT_LOG_UP_REVOKE, tp1->whoTo->flight_size, tp1->book_size, - (uintptr_t) tp1->whoTo, + (uint32_t) (uintptr_t) tp1->whoTo, tp1->rec.data.TSN_seq); } sctp_flight_size_increase(tp1); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Mar 27 08:21:17 2016 (r297311) +++ head/sys/netinet/sctp_input.c Sun Mar 27 10:04:25 2016 (r297312) @@ -2358,7 +2358,7 @@ sctp_process_cookie_new(struct mbuf *m, SCTP_RTT_FROM_NON_DATA); #if defined(INET) || defined(INET6) if (((*netp)->port == 0) && (port != 0)) { - sctp_pathmtu_adjustment(stcb, (*netp)->mtu - sizeof(struct udphdr)); + sctp_pathmtu_adjustment(stcb, (uint16_t) ((*netp)->mtu - sizeof(struct udphdr))); } (*netp)->port = port; #endif @@ -3339,7 +3339,7 @@ process_chunk_drop(struct sctp_tcb *stcb sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_PDRP, tp1->whoTo->flight_size, tp1->book_size, - (uintptr_t) stcb, + (uint32_t) (uintptr_t) stcb, tp1->rec.data.TSN_seq); } if (tp1->sent < SCTP_DATAGRAM_RESEND) { @@ -5596,7 +5596,7 @@ process_control_chunks: len = min(SCTP_SIZE32(chk_length), (uint32_t) (length - *offset)); cause = mtod(op_err, struct sctp_gen_error_cause *); cause->code = htons(SCTP_CAUSE_UNRECOG_CHUNK); - cause->length = htons(len + sizeof(struct sctp_gen_error_cause)); + cause->length = htons((uint16_t) (len + sizeof(struct sctp_gen_error_cause))); SCTP_BUF_LEN(op_err) = sizeof(struct sctp_gen_error_cause); SCTP_BUF_NEXT(op_err) = SCTP_M_COPYM(m, *offset, len, M_NOWAIT); if (SCTP_BUF_NEXT(op_err) != NULL) { Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Mar 27 08:21:17 2016 (r297311) +++ head/sys/netinet/sctp_output.c Sun Mar 27 10:04:25 2016 (r297312) @@ -3508,7 +3508,7 @@ sctp_find_cmsg(int c_type, void *data, s return (found); } /* It is exactly what we want. Copy it out. */ - m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), cpsize, (caddr_t)data); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), (int)cpsize, (caddr_t)data); return (1); } else { struct sctp_sndrcvinfo *sndrcvinfo; @@ -4186,7 +4186,7 @@ sctp_lowlevel_chunk_output(struct sctp_i udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; - udp->uh_ulen = htons(packet_length - sizeof(struct ip)); + udp->uh_ulen = htons((uint16_t) (packet_length - sizeof(struct ip))); if (V_udp_cksum) { udp->uh_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); } else { @@ -4414,7 +4414,7 @@ sctp_lowlevel_chunk_output(struct sctp_i } else { ip6h->ip6_nxt = IPPROTO_SCTP; } - ip6h->ip6_plen = (packet_length - sizeof(struct ip6_hdr)); + ip6h->ip6_plen = (uint16_t) (packet_length - sizeof(struct ip6_hdr)); ip6h->ip6_dst = sin6->sin6_addr; /* @@ -4533,7 +4533,7 @@ sctp_lowlevel_chunk_output(struct sctp_i udp = (struct udphdr *)((caddr_t)ip6h + sizeof(struct ip6_hdr)); udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; - udp->uh_ulen = htons(packet_length - sizeof(struct ip6_hdr)); + udp->uh_ulen = htons((uint16_t) (packet_length - sizeof(struct ip6_hdr))); udp->uh_sum = 0; sctphdr = (struct sctphdr *)((caddr_t)udp + sizeof(struct udphdr)); } else { @@ -6479,10 +6479,10 @@ error_out: } } /* get the new end of length */ - len = M_TRAILINGSPACE(*endofchain); + len = (int)M_TRAILINGSPACE(*endofchain); } else { /* how much is left at the end? */ - len = M_TRAILINGSPACE(*endofchain); + len = (int)M_TRAILINGSPACE(*endofchain); } /* Find the end of the data, for appending */ cp = (mtod((*endofchain), caddr_t)+SCTP_BUF_LEN((*endofchain))); @@ -6636,7 +6636,7 @@ sctp_sendall_iterator(struct sctp_inpcb ph = mtod(m, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); - ph->param_length = htons(sizeof(struct sctp_paramhdr) + ca->sndlen); + ph->param_length = htons((uint16_t) (sizeof(struct sctp_paramhdr) + ca->sndlen)); } /* * We add one here to keep the assoc from dis-appearing on @@ -6814,7 +6814,7 @@ sctp_copy_out_all(struct uio *uio, int l left = len; SCTP_BUF_LEN(ret) = 0; /* save space for the data chunk header */ - cancpy = M_TRAILINGSPACE(ret); + cancpy = (int)M_TRAILINGSPACE(ret); willcpy = min(cancpy, left); at = ret; while (left > 0) { @@ -6835,7 +6835,7 @@ sctp_copy_out_all(struct uio *uio, int l } at = SCTP_BUF_NEXT(at); SCTP_BUF_LEN(at) = 0; - cancpy = M_TRAILINGSPACE(at); + cancpy = (int)M_TRAILINGSPACE(at); willcpy = min(cancpy, left); } } @@ -6869,7 +6869,7 @@ sctp_sendall(struct sctp_inpcb *inp, str ca->sndrcv.sinfo_flags &= ~SCTP_SENDALL; /* get length and mbuf chain */ if (uio) { - ca->sndlen = uio->uio_resid; + ca->sndlen = (int)uio->uio_resid; ca->m = sctp_copy_out_all(uio, ca->sndlen); if (ca->m == NULL) { SCTP_FREE(ca, SCTP_M_COPYAL); @@ -7019,7 +7019,7 @@ all_done: sctp_misc_ints(SCTP_FLIGHT_LOG_UP, data_list[i]->whoTo->flight_size, data_list[i]->book_size, - (uintptr_t) data_list[i]->whoTo, + (uint32_t) (uintptr_t) data_list[i]->whoTo, data_list[i]->rec.data.TSN_seq); } sctp_flight_size_increase(data_list[i]); @@ -7516,7 +7516,7 @@ dont_do_it: goto out_of; } sctp_snd_sb_alloc(stcb, sizeof(struct sctp_data_chunk)); - chk->book_size = chk->send_size = (to_move + sizeof(struct sctp_data_chunk)); + chk->book_size = chk->send_size = (uint16_t) (to_move + sizeof(struct sctp_data_chunk)); chk->book_size_scale = 0; chk->sent = SCTP_DATAGRAM_UNSENT; @@ -7551,7 +7551,7 @@ dont_do_it: chk->rec.data.TSN_seq = atomic_fetchadd_int(&asoc->sending_seq, 1); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_AT_SEND_2_OUTQ) { sctp_misc_ints(SCTP_STRMOUT_LOG_SEND, - (uintptr_t) stcb, sp->length, + (uint32_t) (uintptr_t) stcb, sp->length, (uint32_t) ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq), chk->rec.data.TSN_seq); } @@ -9827,7 +9827,7 @@ one_chunk_around: sctp_misc_ints(SCTP_FLIGHT_LOG_UP_RSND, data_list[i]->whoTo->flight_size, data_list[i]->book_size, - (uintptr_t) data_list[i]->whoTo, + (uint32_t) (uintptr_t) data_list[i]->whoTo, data_list[i]->rec.data.TSN_seq); } sctp_flight_size_increase(data_list[i]); @@ -10288,7 +10288,7 @@ sctp_fill_in_rest: space_needed = (sizeof(struct sctp_forward_tsn_chunk) + (cnt_of_skipped * sizeof(struct sctp_strseq))); - cnt_of_space = M_TRAILINGSPACE(chk->data); + cnt_of_space = (unsigned int)M_TRAILINGSPACE(chk->data); if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { ovh = SCTP_MIN_OVERHEAD; @@ -10546,7 +10546,7 @@ sctp_send_sack(struct sctp_tcb *stcb, in } /* ok, lets go through and fill it in */ SCTP_BUF_RESV_UF(a_chk->data, SCTP_MIN_OVERHEAD); - space = M_TRAILINGSPACE(a_chk->data); + space = (unsigned int)M_TRAILINGSPACE(a_chk->data); if (space > (a_chk->whoTo->mtu - SCTP_MIN_OVERHEAD)) { space = (a_chk->whoTo->mtu - SCTP_MIN_OVERHEAD); } @@ -10760,9 +10760,9 @@ sctp_send_sack(struct sctp_tcb *stcb, in * queue. */ if (type == SCTP_SELECTIVE_ACK) { - a_chk->send_size = sizeof(struct sctp_sack_chunk) + + a_chk->send_size = (uint16_t) (sizeof(struct sctp_sack_chunk) + (num_gap_blocks + num_nr_gap_blocks) * sizeof(struct sctp_gap_ack_block) + - num_dups * sizeof(int32_t); + num_dups * sizeof(int32_t)); SCTP_BUF_LEN(a_chk->data) = a_chk->send_size; sack->sack.cum_tsn_ack = htonl(asoc->cumulative_tsn); sack->sack.a_rwnd = htonl(asoc->my_rwnd); @@ -10772,9 +10772,9 @@ sctp_send_sack(struct sctp_tcb *stcb, in sack->ch.chunk_flags = flags; sack->ch.chunk_length = htons(a_chk->send_size); } else { - a_chk->send_size = sizeof(struct sctp_nr_sack_chunk) + + a_chk->send_size = (uint16_t) (sizeof(struct sctp_nr_sack_chunk) + (num_gap_blocks + num_nr_gap_blocks) * sizeof(struct sctp_gap_ack_block) + - num_dups * sizeof(int32_t); + num_dups * sizeof(int32_t)); SCTP_BUF_LEN(a_chk->data) = a_chk->send_size; nr_sack->nr_sack.cum_tsn_ack = htonl(asoc->cumulative_tsn); nr_sack->nr_sack.a_rwnd = htonl(asoc->my_rwnd); @@ -11082,10 +11082,10 @@ sctp_send_resp_msg(struct sockaddr *src, udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; udp->uh_sum = 0; - udp->uh_ulen = htons(sizeof(struct udphdr) + + udp->uh_ulen = htons((uint16_t) (sizeof(struct udphdr) + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr) + - cause_len + padding_len); + cause_len + padding_len)); len += sizeof(struct udphdr); shout = (struct sctphdr *)((caddr_t)shout + sizeof(struct udphdr)); } else { @@ -11108,7 +11108,7 @@ sctp_send_resp_msg(struct sockaddr *src, } else { ch->chunk_flags = SCTP_HAD_NO_TCB; } - ch->chunk_length = htons(sizeof(struct sctp_chunkhdr) + cause_len); + ch->chunk_length = htons((uint16_t) (sizeof(struct sctp_chunkhdr) + cause_len)); len += sizeof(struct sctp_chunkhdr); len += cause_len + padding_len; @@ -11157,7 +11157,7 @@ sctp_send_resp_msg(struct sockaddr *src, #endif #ifdef INET6 case AF_INET6: - ip6->ip6_plen = len - sizeof(struct ip6_hdr); + ip6->ip6_plen = (uint16_t) (len - sizeof(struct ip6_hdr)); if (port) { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); @@ -11484,7 +11484,7 @@ jump_out: * Len is already adjusted to size minus overhead above take * out the pkt_drop chunk itself from it. */ - chk->send_size = len - sizeof(struct sctp_pktdrop_chunk); + chk->send_size = (uint16_t) (len - sizeof(struct sctp_pktdrop_chunk)); len = chk->send_size; } else { /* no truncation needed */ @@ -11624,7 +11624,7 @@ sctp_add_stream_reset_out(struct sctp_tc if (number_entries > SCTP_MAX_STREAMS_AT_ONCE_RESET) { number_entries = SCTP_MAX_STREAMS_AT_ONCE_RESET; } - len = (sizeof(struct sctp_stream_reset_out_request) + (sizeof(uint16_t) * number_entries)); + len = (uint16_t) (sizeof(struct sctp_stream_reset_out_request) + (sizeof(uint16_t) * number_entries)); req_out->ph.param_type = htons(SCTP_STR_RESET_OUT_REQUEST); req_out->ph.param_length = htons(len); req_out->request_seq = htonl(seq); @@ -11681,7 +11681,7 @@ sctp_add_stream_reset_in(struct sctp_tmi /* get to new offset for the param. */ req_in = (struct sctp_stream_reset_in_request *)((caddr_t)ch + len); /* now how long will this param be? */ - len = (sizeof(struct sctp_stream_reset_in_request) + (sizeof(uint16_t) * number_entries)); + len = (uint16_t) (sizeof(struct sctp_stream_reset_in_request) + (sizeof(uint16_t) * number_entries)); req_in->ph.param_type = htons(SCTP_STR_RESET_IN_REQUEST); req_in->ph.param_length = htons(len); req_in->request_seq = htonl(seq); @@ -12313,7 +12313,7 @@ sctp_copy_it_in(struct sctp_tcb *stcb, (void)SCTP_GETTIME_TIMEVAL(&sp->ts); sp->stream = srcv->sinfo_stream; - sp->length = min(uio->uio_resid, max_send_len); + sp->length = (uint32_t) min(uio->uio_resid, max_send_len); if ((sp->length == (uint32_t) uio->uio_resid) && ((user_marks_eor == 0) || (srcv->sinfo_flags & SCTP_EOF) || @@ -12472,7 +12472,7 @@ sctp_lower_sosend(struct socket *so, SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); } - sndlen = uio->uio_resid; + sndlen = (unsigned int)uio->uio_resid; } else { top = SCTP_HEADER_TO_CHAIN(i_pak); sndlen = SCTP_HEADER_LEN(i_pak); @@ -12871,7 +12871,7 @@ sctp_lower_sosend(struct socket *so, /* now move forward the data pointer */ ph = mtod(mm, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); - ph->param_length = htons(sizeof(struct sctp_paramhdr) + tot_out); + ph->param_length = htons((uint16_t) (sizeof(struct sctp_paramhdr) + tot_out)); ph++; SCTP_BUF_LEN(mm) = tot_out + sizeof(struct sctp_paramhdr); if (top == NULL) { @@ -13291,7 +13291,7 @@ skip_preblock: min(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTP_SB_LIMIT_SND(so)))) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_BLK_LOGGING_ENABLE) { sctp_log_block(SCTP_BLOCK_LOG_INTO_BLK, - asoc, uio->uio_resid); + asoc, (size_t)uio->uio_resid); } be.error = 0; stcb->block_entry = &be; Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sun Mar 27 08:21:17 2016 (r297311) +++ head/sys/netinet/sctp_timer.c Sun Mar 27 10:04:25 2016 (r297312) @@ -662,7 +662,7 @@ start_again: sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_RSND_TO, chk->whoTo->flight_size, chk->book_size, - (uintptr_t) chk->whoTo, + (uint32_t) (uintptr_t) chk->whoTo, chk->rec.data.TSN_seq); } sctp_flight_size_decrease(chk); @@ -790,7 +790,7 @@ start_again: sctp_misc_ints(SCTP_FLIGHT_LOG_UP, chk->whoTo->flight_size, chk->book_size, - (uintptr_t) chk->whoTo, + (uint32_t) (uintptr_t) chk->whoTo, chk->rec.data.TSN_seq); } sctp_flight_size_increase(chk); Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Mar 27 08:21:17 2016 (r297311) +++ head/sys/netinet/sctp_usrreq.c Sun Mar 27 10:04:25 2016 (r297312) @@ -132,7 +132,7 @@ sctp_pathmtu_adjustment(struct sctp_tcb sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_PMTU, chk->whoTo->flight_size, chk->book_size, - (uintptr_t) chk->whoTo, + (uint32_t) (uintptr_t) chk->whoTo, chk->rec.data.TSN_seq); } /* Clear any time so NO RTT is being done */ @@ -1413,7 +1413,7 @@ sctp_do_connect_x(struct socket *so, str int creat_lock_on = 0; struct sctp_tcb *stcb = NULL; struct sockaddr *sa; - int num_v6 = 0, num_v4 = 0, *totaddrp, totaddr; + unsigned int num_v6 = 0, num_v4 = 0, *totaddrp, totaddr; uint32_t vrf_id; int bad_addresses = 0; sctp_assoc_t *a_id; @@ -1449,10 +1449,10 @@ sctp_do_connect_x(struct socket *so, str error = EFAULT; goto out_now; } - totaddrp = (int *)optval; + totaddrp = (unsigned int *)optval; totaddr = *totaddrp; sa = (struct sockaddr *)(totaddrp + 1); - stcb = sctp_connectx_helper_find(inp, sa, &totaddr, &num_v4, &num_v6, &error, (optsize - sizeof(int)), &bad_addresses); + stcb = sctp_connectx_helper_find(inp, sa, &totaddr, &num_v4, &num_v6, &error, (unsigned int)(optsize - sizeof(int)), &bad_addresses); if ((stcb != NULL) || bad_addresses) { /* Already have or am bring up an association */ SCTP_ASOC_CREATE_UNLOCK(inp); @@ -1903,7 +1903,8 @@ flags_out: case SCTP_GET_ASSOC_ID_LIST: { struct sctp_assoc_ids *ids; - unsigned int at, limit; + uint32_t at; + size_t limit; SCTP_CHECK_AND_CAST(ids, optval, struct sctp_assoc_ids, *optsize); SCTP_INP_RLOCK(inp); @@ -1919,6 +1920,11 @@ flags_out: LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { if (at < limit) { ids->gaids_assoc_id[at++] = sctp_get_associd(stcb); + if (at == 0) { + error = EINVAL; + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } } else { error = EINVAL; SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Mar 27 08:21:17 2016 (r297311) +++ head/sys/netinet/sctputil.c Sun Mar 27 10:04:25 2016 (r297312) @@ -503,7 +503,7 @@ sctp_wakeup_log(struct sctp_tcb *stcb, u } void -sctp_log_block(uint8_t from, struct sctp_association *asoc, int sendlen) +sctp_log_block(uint8_t from, struct sctp_association *asoc, size_t sendlen) { struct sctp_cwnd_log sctp_clog; @@ -513,7 +513,7 @@ sctp_log_block(uint8_t from, struct sctp sctp_clog.x.blk.stream_qcnt = (uint16_t) asoc->stream_queue_cnt; sctp_clog.x.blk.chunks_on_oque = (uint16_t) asoc->chunks_on_out_queue; sctp_clog.x.blk.flight_size = (uint16_t) (asoc->total_flight / 1024); - sctp_clog.x.blk.sndlen = sendlen; + sctp_clog.x.blk.sndlen = (uint32_t) sendlen; SCTP_CTR6(KTR_SCTP, "SCTP:%d[%d]:%x-%x-%x-%x", SCTP_LOG_EVENT_BLOCK, from, @@ -2679,7 +2679,8 @@ sctp_notify_assoc_change(uint16_t state, struct mbuf *m_notify; struct sctp_assoc_change *sac; struct sctp_queued_to_read *control; - size_t notif_len, abort_len; + unsigned int notif_len; + uint16_t abort_len; unsigned int i; #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -2691,7 +2692,7 @@ sctp_notify_assoc_change(uint16_t state, return; } if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) { - notif_len = sizeof(struct sctp_assoc_change); + notif_len = (unsigned int)sizeof(struct sctp_assoc_change); if (abort != NULL) { abort_len = ntohs(abort->ch.chunk_length); } else { @@ -2705,7 +2706,7 @@ sctp_notify_assoc_change(uint16_t state, m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { /* Retry with smaller value. */ - notif_len = sizeof(struct sctp_assoc_change); + notif_len = (unsigned int)sizeof(struct sctp_assoc_change); m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { goto set_error; @@ -3570,7 +3571,8 @@ sctp_notify_remote_error(struct sctp_tcb struct mbuf *m_notify; struct sctp_remote_error *sre; struct sctp_queued_to_read *control; - size_t notif_len, chunk_len; + unsigned int notif_len; + uint16_t chunk_len; if ((stcb == NULL) || sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVPEERERR)) { @@ -3581,11 +3583,11 @@ sctp_notify_remote_error(struct sctp_tcb } else { chunk_len = 0; } - notif_len = sizeof(struct sctp_remote_error) + chunk_len; + notif_len = (unsigned int)(sizeof(struct sctp_remote_error) + chunk_len); m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { /* Retry with smaller value. */ - notif_len = sizeof(struct sctp_remote_error); + notif_len = (unsigned int)sizeof(struct sctp_remote_error); m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { return; @@ -4739,19 +4741,23 @@ sctp_generate_cause(uint16_t code, char { struct mbuf *m; struct sctp_gen_error_cause *cause; - size_t info_len, len; + size_t info_len; + uint16_t len; if ((code == 0) || (info == NULL)) { return (NULL); } info_len = strlen(info); - len = sizeof(struct sctp_paramhdr) + info_len; + if (info_len > (SCTP_MAX_CAUSE_LENGTH - sizeof(struct sctp_paramhdr))) { + return (NULL); + } + len = (uint16_t) (sizeof(struct sctp_paramhdr) + info_len); m = sctp_get_mbuf_for_msg(len, 0, M_NOWAIT, 1, MT_DATA); if (m != NULL) { SCTP_BUF_LEN(m) = len; cause = mtod(m, struct sctp_gen_error_cause *); cause->code = htons(code); - cause->length = htons((uint16_t) len); + cause->length = htons(len); memcpy(cause->info, info, info_len); } return (m); @@ -4762,15 +4768,15 @@ sctp_generate_no_user_data_cause(uint32_ { struct mbuf *m; struct sctp_error_no_user_data *no_user_data_cause; - size_t len; + uint16_t len; - len = sizeof(struct sctp_error_no_user_data); + len = (uint16_t) sizeof(struct sctp_error_no_user_data); m = sctp_get_mbuf_for_msg(len, 0, M_NOWAIT, 1, MT_DATA); if (m != NULL) { SCTP_BUF_LEN(m) = len; no_user_data_cause = mtod(m, struct sctp_error_no_user_data *); no_user_data_cause->cause.code = htons(SCTP_CAUSE_NO_USER_DATA); - no_user_data_cause->cause.length = htons((uint16_t) len); + no_user_data_cause->cause.length = htons(len); no_user_data_cause->tsn = tsn; /* tsn is passed in as NBO */ } return (m); @@ -5295,7 +5301,7 @@ sctp_sorecvmsg(struct socket *so, uint32_t rwnd_req = 0; int hold_sblock = 0; int hold_rlock = 0; - int slen = 0; + ssize_t slen = 0; uint32_t held_length = 0; int sockbuf_lock = 0; @@ -5340,11 +5346,11 @@ sctp_sorecvmsg(struct socket *so, in_eeor_mode = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RECV_RWND_LOGGING_ENABLE) { sctp_misc_ints(SCTP_SORECV_ENTER, - rwnd_req, in_eeor_mode, so->so_rcv.sb_cc, uio->uio_resid); + rwnd_req, in_eeor_mode, so->so_rcv.sb_cc, (uint32_t) uio->uio_resid); } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RECV_RWND_LOGGING_ENABLE) { sctp_misc_ints(SCTP_SORECV_ENTERPL, - rwnd_req, block_allowed, so->so_rcv.sb_cc, uio->uio_resid); + rwnd_req, block_allowed, so->so_rcv.sb_cc, (uint32_t) uio->uio_resid); } error = sblock(&so->so_rcv, (block_allowed ? SBL_WAIT : 0)); if (error) { @@ -6219,13 +6225,13 @@ out: if (stcb) { sctp_misc_ints(SCTP_SORECV_DONE, freed_so_far, - ((uio) ? (slen - uio->uio_resid) : slen), + (uint32_t) ((uio) ? (slen - uio->uio_resid) : slen), stcb->asoc.my_rwnd, so->so_rcv.sb_cc); } else { sctp_misc_ints(SCTP_SORECV_DONE, freed_so_far, - ((uio) ? (slen - uio->uio_resid) : slen), + (uint32_t) ((uio) ? (slen - uio->uio_resid) : slen), 0, so->so_rcv.sb_cc); } @@ -6452,30 +6458,30 @@ out_now: struct sctp_tcb * sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr, - int *totaddr, int *num_v4, int *num_v6, int *error, - int limit, int *bad_addr) + unsigned int *totaddr, + unsigned int *num_v4, unsigned int *num_v6, int *error, + unsigned int limit, int *bad_addr) { struct sockaddr *sa; struct sctp_tcb *stcb = NULL; - size_t incr, at, i; + unsigned int incr, at, i; at = incr = 0; sa = addr; - *error = *num_v6 = *num_v4 = 0; /* account and validate addresses */ - for (i = 0; i < (size_t)*totaddr; i++) { + for (i = 0; i < *totaddr; i++) { switch (sa->sa_family) { #ifdef INET case AF_INET: - (*num_v4) += 1; - incr = sizeof(struct sockaddr_in); if (sa->sa_len != incr) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); *error = EINVAL; *bad_addr = 1; return (NULL); } + (*num_v4) += 1; + incr = (unsigned int)sizeof(struct sockaddr_in); break; #endif #ifdef INET6 @@ -6491,14 +6497,14 @@ sctp_connectx_helper_find(struct sctp_in *bad_addr = 1; return (NULL); } - (*num_v6) += 1; - incr = sizeof(struct sockaddr_in6); if (sa->sa_len != incr) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); *error = EINVAL; *bad_addr = 1; return (NULL); } + (*num_v6) += 1; + incr = (unsigned int)sizeof(struct sockaddr_in6); break; } #endif @@ -6507,7 +6513,7 @@ sctp_connectx_helper_find(struct sctp_in /* we are done */ break; } - if (i == (size_t)*totaddr) { + if (i == *totaddr) { break; } SCTP_INP_INCR_REF(inp); @@ -6518,7 +6524,7 @@ sctp_connectx_helper_find(struct sctp_in } else { SCTP_INP_DECR_REF(inp); } - if ((at + incr) > (size_t)limit) { + if ((at + incr) > limit) { *totaddr = i; break; } Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sun Mar 27 08:21:17 2016 (r297311) +++ head/sys/netinet/sctputil.h Sun Mar 27 10:04:25 2016 (r297312) @@ -220,7 +220,8 @@ sctp_connectx_helper_add(struct sctp_tcb struct sctp_tcb * sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr, - int *totaddr, int *num_v4, int *num_v6, int *error, int limit, int *bad_addr); + unsigned int *totaddr, unsigned int *num_v4, unsigned int *num_v6, + int *error, unsigned int limit, int *bad_addr); int sctp_is_there_an_abort_here(struct mbuf *, int, uint32_t *); @@ -376,7 +377,7 @@ void sctp_log_closing(struct sctp_inpcb void sctp_log_lock(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint8_t from); void sctp_log_maxburst(struct sctp_tcb *stcb, struct sctp_nets *, int, int, uint8_t); -void sctp_log_block(uint8_t, struct sctp_association *, int); +void sctp_log_block(uint8_t, struct sctp_association *, size_t); void sctp_log_rwnd(uint8_t, uint32_t, uint32_t, uint32_t); void sctp_log_rwnd_set(uint8_t, uint32_t, uint32_t, uint32_t, uint32_t); int sctp_fill_stat_log(void *, size_t *); From owner-svn-src-head@freebsd.org Sun Mar 27 10:09:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A85A8ADDEA5; Sun, 27 Mar 2016 10:09:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EE6E132E; Sun, 27 Mar 2016 10:09:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RA9ATR076346; Sun, 27 Mar 2016 10:09:10 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RA9A5A076342; Sun, 27 Mar 2016 10:09:10 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603271009.u2RA9A5A076342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 27 Mar 2016 10:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297313 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 10:09:11 -0000 Author: dchagin Date: Sun Mar 27 10:09:10 2016 New Revision: 297313 URL: https://svnweb.freebsd.org/changeset/base/297313 Log: Revert r297310 as the SOL_XXX are equal to the IPPROTO_XX except SOL_SOCKET. Pointed out by: ae@ Modified: head/sys/amd64/linux/linux.h head/sys/amd64/linux32/linux.h head/sys/compat/linux/linux_socket.c head/sys/i386/linux/linux.h Modified: head/sys/amd64/linux/linux.h ============================================================================== --- head/sys/amd64/linux/linux.h Sun Mar 27 10:04:25 2016 (r297312) +++ head/sys/amd64/linux/linux.h Sun Mar 27 10:09:10 2016 (r297313) @@ -404,7 +404,6 @@ struct l_ipc_perm { #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0 -#define LINUX_SOL_IPV6 41 #define LINUX_SOL_IPX 256 #define LINUX_SOL_AX25 257 #define LINUX_SOL_TCP 6 Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Sun Mar 27 10:04:25 2016 (r297312) +++ head/sys/amd64/linux32/linux.h Sun Mar 27 10:09:10 2016 (r297313) @@ -494,7 +494,6 @@ struct l_ipc_perm { */ #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0 -#define LINUX_SOL_IPV6 41 #define LINUX_SOL_IPX 256 #define LINUX_SOL_AX25 257 #define LINUX_SOL_TCP 6 Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun Mar 27 10:04:25 2016 (r297312) +++ head/sys/compat/linux/linux_socket.c Sun Mar 27 10:09:10 2016 (r297313) @@ -246,8 +246,6 @@ linux_to_bsd_sockopt_level(int level) switch (level) { case LINUX_SOL_SOCKET: return (SOL_SOCKET); - case LINUX_SOL_IPV6: - return (IPPROTO_IPV6); } return (level); } Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Sun Mar 27 10:04:25 2016 (r297312) +++ head/sys/i386/linux/linux.h Sun Mar 27 10:09:10 2016 (r297313) @@ -473,7 +473,6 @@ struct l_ipc_perm { */ #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0 -#define LINUX_SOL_IPV6 41 #define LINUX_SOL_IPX 256 #define LINUX_SOL_AX25 257 #define LINUX_SOL_TCP 6 From owner-svn-src-head@freebsd.org Sun Mar 27 13:07:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D125ADE784; Sun, 27 Mar 2016 13:07:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AEBF1367; Sun, 27 Mar 2016 13:07:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2RD76di002911 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 27 Mar 2016 16:07:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2RD76di002911 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2RD76WU002910; Sun, 27 Mar 2016 16:07:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 27 Mar 2016 16:07:06 +0300 From: Konstantin Belousov To: Bruce Evans Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160327130706.GA1741@kib.kiev.ua> References: <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> <20160325010649.H898@besplex.bde.org> <20160324162447.GD1741@kib.kiev.ua> <20160325060901.N2059@besplex.bde.org> <20160325084902.GH1741@kib.kiev.ua> <20160326021219.X911@besplex.bde.org> <20160326174210.GU1741@kib.kiev.ua> <20160327051601.S2318@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160327051601.S2318@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 13:07:17 -0000 On Sun, Mar 27, 2016 at 06:49:40AM +1100, Bruce Evans wrote: > On Sat, 26 Mar 2016, Konstantin Belousov wrote: > > > On Sat, Mar 26, 2016 at 03:17:43AM +1100, Bruce Evans wrote: > >> This uses the i8254. > > Well, this is the part which I do not like most. It is ridiculous > > to calibrate relatively high-quality CPU oscillator with 8245 timer, > > which often fed from separate, low-quality crystal which currently > > selected by cost and exists only for legacy purposes. At least > > I haven't seen a single (hardware) system since I started measuring > this 15-20 yeas ago on which the i8524 is not fed from the same clock > as the TSC. Normally there is a PLL that can derives hundreds of > different frequencies from the same clock. One is fed to the i8254, > one to the ACPI timer and one to the CPU clock/TSC. Hm, I was able to track this down in the public documents. I was wrong, but your description is not completely correct either. Please see http://www.intel.com/content/dam/www/public/us/en/documents/datasheets/x99-chipset-pch-datasheet.pdf page 64 for the diagram of the clock signals interconnect on Romley and later. Also the CK420BQ (clock synthesizer) and DB1200Z (clock buffer for PCIe and CPU) datasheets are available on the idt.com site, but there I can only understand the claims about jitter. >From the diagram at the page 64, main clock is fed into CPU PLL (directly driving TSC and LAPIC timer) and into PCH (south bridge, where all other counters reside). In PCH, misc. PLLs are used to drive all counters except RTC. RTC needs its own dedicated crystal. I was not able to find any specifications for allowed jitter in PCH PLLs, but I would expect that above IDT chips have much better stability than something in overheating PCH. > > > some hypervisors start offering modes where old ISA peripherals > > are not emulated, and I suspect that hardware would start do the > > same. Quite possible, some variants of SoCs already do this. > > Bug in these hypervisors. A slow clock like the i8254 is much easier > to emulate than a fast one. It is impossible to emulate real time on > a non-real-time system anyway, so almost all calibration code is likely > to break in inverse proportion to its accuracy on real hardware. RTC does not require any emulation at all, only some adjustments which are already facilitated by the virtualization hardware. > > > More, we do not have any hooks to recalibrate our thought about > > TSC frequency during normal runtime. Often, system does have very > > precise measurement of the timecounter drift due to ntp/ptp. > > cpu_tick_calibrate() does exactly this (if the ticker is the TSC). > > My version has a precise (~1-10 usec) measurement of the timecounter drift > relative to the RTC (or vice-versa). This is used some time after > exit from ddb to fix up the timecounter. This depends on RTC seconds > interrupts being perfectly periodic with low (or at least measurable) > latency. This should be used to fix up the timecounter after suspend/ > resume. An error of 1-10 usec is good enough for an ntpd server, but > the current ACPI error in resume is not good enough for an nptd client. > > >> xdel() is a specialized version of i8254 DELAY() > >> with getit() inline. It returns the initial and final values of the > > It can use any readable timer, but only the i8254 is easy to use and > available on all (non-broken) x86 systems. Just the > ifdefs/configuratation to use another timer would be very complicated. > Using the cputicker or timecounter read functions doesn't quite work > because these functions have unknown internals which might involve > unusable timing or lockimg. I think we have no choice but do something for ISA/LPC-less configurations. We could even trust CPU report about its frequency as the last resort. >From what I saw, the calibrated RTC frequency is very close to the reported frequency, and if runtime recalibration based on ntp client feedback is implemented, all would be good. From owner-svn-src-head@freebsd.org Sun Mar 27 14:21:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E44BADF45D; Sun, 27 Mar 2016 14:21:21 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 33DF619C7; Sun, 27 Mar 2016 14:21:20 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 565634FAE8; Sun, 27 Mar 2016 14:21:18 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTP id u2RELG0T087079; Sun, 27 Mar 2016 14:21:16 GMT (envelope-from phk@phk.freebsd.dk) To: Konstantin Belousov cc: Bruce Evans , John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 In-reply-to: <20160327130706.GA1741@kib.kiev.ua> From: "Poul-Henning Kamp" References: <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> <20160325010649.H898@besplex.bde.org> <20160324162447.GD1741@kib.kiev.ua> <20160325060901.N2059@besplex.bde.org> <20160325084902.GH1741@kib.kiev.ua> <20160326021219.X911@besplex.bde.org> <20160326174210.GU1741@kib.kiev.ua> <20160327051601.S2318@besplex.bde.org> <20160327130706.GA1741@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <87077.1459088476.1@critter.freebsd.dk> Date: Sun, 27 Mar 2016 14:21:16 +0000 Message-ID: <87078.1459088476@critter.freebsd.dk> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 14:21:21 -0000 -------- In message <20160327130706.GA1741@kib.kiev.ua>, Konstantin Belousov writes: >> I haven't seen a single (hardware) system since I started measuring >> this 15-20 yeas ago on which the i8524 is not fed from the same clock >> as the TSC. A very important and relevant detail here is that the *only* clock/counter which has a standardized frequency *is* the i8254 counter. >RTC needs its own dedicated crystal. The RTC *crystal* may not even exist, only the RTC itself which may be driven by gremlins on a threadmill for all we care. Besides, getting hold of *precise* timing from the RTC is a nightmare, it's not meant to be used for that. >I was not able to find any specifications for allowed jitter in PCH PLLs, >but I would expect that above IDT chips have much better stability than >something in overheating PCH. Jitter requirements are pretty tight for anything you're going to PLL into the GHz range, but any quartz crystal is going to have much better phase-noise spec than anything we can measure in the digital noise of a modern computer. (Often the PLL chips modulate the quartz to spread out EMI spurs, look for "spread-spectrum" settings.) >> > some hypervisors start offering modes where old ISA peripherals >> > are not emulated, How do they expect people to run MS Flight Simulator then ? :-) >I think we have no choice but do something for ISA/LPC-less configurations. >We could even trust CPU report about its frequency as the last resort. Usually the errors will be magnificient, so a trivial sanity-check will catch them. Don't leave home without it. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@freebsd.org Sun Mar 27 16:26:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9821ADF0D0; Sun, 27 Mar 2016 16:26:55 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AF8201298; Sun, 27 Mar 2016 16:26:55 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from toad2.stack.nl (toad2.stack.nl [IPv6:2001:610:1108:5010::161]) by mx1.stack.nl (Postfix) with ESMTP id C6A61B8059; Sun, 27 Mar 2016 18:26:51 +0200 (CEST) Received: by toad2.stack.nl (Postfix, from userid 1677) id 3BFC6892DB; Sun, 27 Mar 2016 18:26:52 +0200 (CEST) Date: Sun, 27 Mar 2016 18:26:52 +0200 From: Jilles Tjoelker To: "Simon J. Gerraty" Cc: Bryan Drewery , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r296637 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests share/mk usr.bin/bmake Message-ID: <20160327162652.GB87149@stack.nl> References: <201603110135.u2B1Zd8a001604@repo.freebsd.org> <56E5C2EB.1070206@FreeBSD.org> <14946.1457908340@kaos.jnpr.net> <56E5F36E.2020205@FreeBSD.org> <15542.1457911750@kaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15542.1457911750@kaos.jnpr.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 16:26:56 -0000 On Sun, Mar 13, 2016 at 04:29:10PM -0700, Simon J. Gerraty wrote: > Bryan Drewery wrote: > > This code is only in head. My problem is now bmake can only build > > commits after this one which breaks bisecting and older project branches > > which haven't or can't merge in head yet. > > Is the :@ iterator variable deletion change in bmake change necessary? > In the sense of good hygiene, yes. > Obviously make will work without it since its been that way for 15 > years, but this AFAIK is the only makefile affected. I think the ability to bisect without weird local hacks is valuable, although I rarely do this in a FreeBSD context. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Sun Mar 27 16:27:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1E42ADF12C; Sun, 27 Mar 2016 16:27:50 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FAC81431; Sun, 27 Mar 2016 16:27:50 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RGRnog092688; Sun, 27 Mar 2016 16:27:49 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RGRn66092687; Sun, 27 Mar 2016 16:27:49 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201603271627.u2RGRn66092687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 27 Mar 2016 16:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297314 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 16:27:50 -0000 Author: jilles Date: Sun Mar 27 16:27:49 2016 New Revision: 297314 URL: https://svnweb.freebsd.org/changeset/base/297314 Log: rc.d: Make msgs a proper rc.d script. PR: 207149 Reported by: Jonathan de Boyne Pollard Modified: head/etc/rc.d/msgs Modified: head/etc/rc.d/msgs ============================================================================== --- head/etc/rc.d/msgs Sun Mar 27 10:09:10 2016 (r297313) +++ head/etc/rc.d/msgs Sun Mar 27 16:27:49 2016 (r297314) @@ -6,8 +6,20 @@ # PROVIDE: msgs # REQUIRE: LOGIN -# Make a bounds file for msgs(1) if there isn't one already -# -if [ -d /var/msgs -a ! -f /var/msgs/bounds -a ! -L /var/msgs/bounds ]; then - echo 0 > /var/msgs/bounds -fi +. /etc/rc.subr + +name="msgs" +start_cmd="msgs_start" +stop_cmd=":" + +msgs_start() +{ + # Make a bounds file for msgs(1) if there isn't one already + # + if [ -d /var/msgs -a ! -f /var/msgs/bounds -a ! -L /var/msgs/bounds ]; then + echo 0 > /var/msgs/bounds + fi +} + +load_rc_config $name +run_rc_command "$1" From owner-svn-src-head@freebsd.org Sun Mar 27 17:22:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37AC6ADFD6D; Sun, 27 Mar 2016 17:22:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0737E1C5E; Sun, 27 Mar 2016 17:22:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RHMRXb008759; Sun, 27 Mar 2016 17:22:27 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RHMRJw008751; Sun, 27 Mar 2016 17:22:27 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201603271722.u2RHMRJw008751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 27 Mar 2016 17:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297315 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 17:22:28 -0000 Author: kp Date: Sun Mar 27 17:22:27 2016 New Revision: 297315 URL: https://svnweb.freebsd.org/changeset/base/297315 Log: pf: Friendly error message for status if pf.ko is not loaded Check if pf.ko is loaded (i.e. /dev/pf exists) before trying to use it. This means that '/etc/rc.d/pf status' will no longer return 'pfctl: /dev/pf: No such file or directory' but 'pf.ko is not loaded'. PR: 205671 Submitted by: Johannes Jost Meixner Modified: head/etc/rc.d/pf Modified: head/etc/rc.d/pf ============================================================================== --- head/etc/rc.d/pf Sun Mar 27 16:27:49 2016 (r297314) +++ head/etc/rc.d/pf Sun Mar 27 17:22:27 2016 (r297315) @@ -66,7 +66,11 @@ pf_resync() pf_status() { - $pf_program -s info + if ! [ -c /dev/pf ] ; then + echo "pf.ko is not loaded" + else + $pf_program -s info + fi } run_rc_command "$1" From owner-svn-src-head@freebsd.org Sun Mar 27 17:23:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23E3FADFE02; Sun, 27 Mar 2016 17:23:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id C33561E5B; Sun, 27 Mar 2016 17:23:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 7D1DE783AC2; Mon, 28 Mar 2016 04:23:00 +1100 (AEDT) Date: Mon, 28 Mar 2016 04:22:59 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 In-Reply-To: <20160327130706.GA1741@kib.kiev.ua> Message-ID: <20160328033624.N850@besplex.bde.org> References: <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> <20160325010649.H898@besplex.bde.org> <20160324162447.GD1741@kib.kiev.ua> <20160325060901.N2059@besplex.bde.org> <20160325084902.GH1741@kib.kiev.ua> <20160326021219.X911@besplex.bde.org> <20160326174210.GU1741@kib.kiev.ua> <20160327051601.S2318@besplex.bde.org> <20160327130706.GA1741@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=QyXUC8HyAAAA:8 a=EvKqFsTwAAAA:8 a=NWmcdJ4kUMLG-LNHZ9wA:9 a=pLC86x-TDcFJlN1_:21 a=W5IfI8Gavtc64Nsx:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 17:23:10 -0000 On Sun, 27 Mar 2016, Konstantin Belousov wrote: > On Sun, Mar 27, 2016 at 06:49:40AM +1100, Bruce Evans wrote: >> On Sat, 26 Mar 2016, Konstantin Belousov wrote: >> >>> On Sat, Mar 26, 2016 at 03:17:43AM +1100, Bruce Evans wrote: >>>> This uses the i8254. >>> Well, this is the part which I do not like most. It is ridiculous >>> to calibrate relatively high-quality CPU oscillator with 8245 timer, >>> which often fed from separate, low-quality crystal which currently >>> selected by cost and exists only for legacy purposes. At least >> >> I haven't seen a single (hardware) system since I started measuring >> this 15-20 yeas ago on which the i8524 is not fed from the same clock >> as the TSC. Normally there is a PLL that can derives hundreds of >> different frequencies from the same clock. One is fed to the i8254, >> one to the ACPI timer and one to the CPU clock/TSC. > Hm, I was able to track this down in the public documents. I was wrong, > but your description is not completely correct either. Please see > http://www.intel.com/content/dam/www/public/us/en/documents/datasheets/x99-chipset-pch-datasheet.pdf > page 64 for the diagram of the clock signals interconnect on Romley and > later. Also the CK420BQ (clock synthesizer) and DB1200Z (clock buffer > for PCIe and CPU) datasheets are available on the idt.com site, but > there I can only understand the claims about jitter. Of course the details are machine-dependent. My oldest system on which I discovered PLL-like behaviour was from late 1997. The PLL might not have been in standard bus chips then. It had a K5 (?) running at 233 MHz. The ratio of the TSC to the i8254 was precisely 196. This was very easy to measure or to guess without measurement and then verify by measurements since it is an integer. This integer is just the one that gives the best approximation to the nominal TSC frequency of 233 MHz starting with the nominal i8254 frequency of 1193182. Newer systems have much higher resolution so the ratios are rarely integers. >> From the diagram at the page 64, main clock is fed into CPU PLL (directly > driving TSC and LAPIC timer) and into PCH (south bridge, where all other > counters reside). In PCH, misc. PLLs are used to drive all counters except > RTC. RTC needs its own dedicated crystal. > > I was not able to find any specifications for allowed jitter in PCH PLLs, > but I would expect that above IDT chips have much better stability than > something in overheating PCH. > >>> some hypervisors start offering modes where old ISA peripherals >>> are not emulated, and I suspect that hardware would start do the >>> same. Quite possible, some variants of SoCs already do this. >> >> Bug in these hypervisors. A slow clock like the i8254 is much easier >> to emulate than a fast one. It is impossible to emulate real time on >> a non-real-time system anyway, so almost all calibration code is likely >> to break in inverse proportion to its accuracy on real hardware. > RTC does not require any emulation at all, only some adjustments which > are already facilitated by the virtualization hardware. If the RTC is in direct hardware and the timecounters are partly in software, then it would be hard to preserve order and minimize (virtual) jitter in measurements comparing the timers. The timecounters would robably need additinal complications to keep them in step with the RTC. This care would usually be wasted since the RTC is rarely used like that. It would probably be easier to virtualise the RTC to keep it in step with the timecounters. >>>> xdel() is a specialized version of i8254 DELAY() >>>> with getit() inline. It returns the initial and final values of the >> >> It can use any readable timer, but only the i8254 is easy to use and >> available on all (non-broken) x86 systems. Just the >> ifdefs/configuratation to use another timer would be very complicated. >> Using the cputicker or timecounter read functions doesn't quite work >> because these functions have unknown internals which might involve >> unusable timing or lockimg. > I think we have no choice but do something for ISA/LPC-less configurations. Indeed. > We could even trust CPU report about its frequency as the last resort. > From what I saw, the calibrated RTC frequency is very close to the > reported frequency, and if runtime recalibration based on ntp client > feedback is implemented, all would be good. phk axed my RTC calibration code (actually i8254 and TSC calibration code starting from the RTC). It worked perfectly except it didn't adjust for the time to read the hardware. The problem with it is that the RTC is no more or less accurate than the other timers. It should be, but isn't in practice. Normally it it is controlled by different hardware (crystal?) with different temperature characteristics and different exposure to temperature changes by being physically separate. The i8254 is supposed to run at precisely 1193182 Hz but usually has an inaccuracy of 10-50 Hz. The RTC seconds update is supposed to occur at precisely 1 Hz but usually has an unrelated inaccuracy of similar magnitude. Calibrating these clocks relative to each other just gives the relative difference in their inaccuracy. The difference can be measured very accurately at any time. It varies later with temperature. I never finished code to track the termperature changes and calibrate adjustments based on the temperature. It is simpler to start with a hard-coded i8254 frequency of 1193182 and adjust everything later. ntpd handles adjustment of a single timer well enough. This works because the nominal frequency of 1193182 is so standard that inaccuracies in it are closer to 10 ppm than the 1000 ppm that would break ntpd. Bruce From owner-svn-src-head@freebsd.org Sun Mar 27 17:33:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E76C9ADF0D6; Sun, 27 Mar 2016 17:33:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D8F213BB; Sun, 27 Mar 2016 17:33:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2RHWrKP049331 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 27 Mar 2016 20:32:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2RHWrKP049331 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2RHWpF9049329; Sun, 27 Mar 2016 20:32:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 27 Mar 2016 20:32:51 +0300 From: Konstantin Belousov To: Bruce Evans Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160327173251.GB1741@kib.kiev.ua> References: <20160324090917.GC1741@kib.kiev.ua> <20160325010649.H898@besplex.bde.org> <20160324162447.GD1741@kib.kiev.ua> <20160325060901.N2059@besplex.bde.org> <20160325084902.GH1741@kib.kiev.ua> <20160326021219.X911@besplex.bde.org> <20160326174210.GU1741@kib.kiev.ua> <20160327051601.S2318@besplex.bde.org> <20160327130706.GA1741@kib.kiev.ua> <20160328033624.N850@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160328033624.N850@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 17:33:07 -0000 On Mon, Mar 28, 2016 at 04:22:59AM +1100, Bruce Evans wrote: > On Sun, 27 Mar 2016, Konstantin Belousov wrote: > > We could even trust CPU report about its frequency as the last resort. > > From what I saw, the calibrated RTC frequency is very close to the Err, that should have been TSC, and not RTC. > > reported frequency, and if runtime recalibration based on ntp client > > feedback is implemented, all would be good. > > phk axed my RTC calibration code (actually i8254 and TSC calibration code > starting from the RTC). It worked perfectly except it didn't adjust for > the time to read the hardware. The problem with it is that the RTC is no > more or less accurate than the other timers. It should be, but isn't in > practice. Normally it it is controlled by different hardware (crystal?) > with different temperature characteristics and different exposure to > temperature changes by being physically separate. The i8254 is supposed > to run at precisely 1193182 Hz but usually has an inaccuracy of 10-50 Hz. > The RTC seconds update is supposed to occur at precisely 1 Hz but usually > has an unrelated inaccuracy of similar magnitude. Calibrating these clocks > relative to each other just gives the relative difference in their > inaccuracy. The difference can be measured very accurately at any time. > It varies later with temperature. I never finished code to track the > termperature changes and calibrate adjustments based on the temperature. > It is simpler to start with a hard-coded i8254 frequency of 1193182 and > adjust everything later. ntpd handles adjustment of a single timer well > enough. This works because the nominal frequency of 1193182 is so standard > that inaccuracies in it are closer to 10 ppm than the 1000 ppm that would > break ntpd. > > Bruce From owner-svn-src-head@freebsd.org Sun Mar 27 18:10:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 445A7ADF9E3; Sun, 27 Mar 2016 18:10:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 0AF321D77; Sun, 27 Mar 2016 18:10:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 65192D4372F; Mon, 28 Mar 2016 05:09:57 +1100 (AEDT) Date: Mon, 28 Mar 2016 05:09:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Poul-Henning Kamp cc: Konstantin Belousov , Bruce Evans , John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 In-Reply-To: <87078.1459088476@critter.freebsd.dk> Message-ID: <20160328042313.N850@besplex.bde.org> References: <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> <20160325010649.H898@besplex.bde.org> <20160324162447.GD1741@kib.kiev.ua> <20160325060901.N2059@besplex.bde.org> <20160325084902.GH1741@kib.kiev.ua> <20160326021219.X911@besplex.bde.org> <20160326174210.GU1741@kib.kiev.ua> <20160327051601.S2318@besplex.bde.org> <20160327130706.GA1741@kib.kiev.ua> <87078.1459088476@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=EA5itrwUPoEA:10 a=kj9zAlcOel0A:10 a=pJS1LV0fTt-GtbNx0TQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 18:10:08 -0000 On Sun, 27 Mar 2016, Poul-Henning Kamp wrote: > -------- > In message <20160327130706.GA1741@kib.kiev.ua>, Konstantin Belousov writes: > >>> I haven't seen a single (hardware) system since I started measuring >>> this 15-20 yeas ago on which the i8524 is not fed from the same clock >>> as the TSC. > > A very important and relevant detail here is that the *only* > clock/counter which has a standardized frequency *is* the i8254 > counter. Not even the ACPI timer? >> RTC needs its own dedicated crystal. > > The RTC *crystal* may not even exist, only the RTC itself which may > be driven by gremlins on a threadmill for all we care. > > Besides, getting hold of *precise* timing from the RTC is a nightmare, > it's not meant to be used for that. It can give a precision of 1/32K seconds fairly easily (but with lots of overhead) by interrupting at 32 KHz. 1KHz is sometimes used for profiling. >> I was not able to find any specifications for allowed jitter in PCH PLLs, >> but I would expect that above IDT chips have much better stability than >> something in overheating PCH. > > Jitter requirements are pretty tight for anything you're going to > PLL into the GHz range, but any quartz crystal is going to have much > better phase-noise spec than anything we can measure in the digital > noise of a modern computer. > > (Often the PLL chips modulate the quartz to spread out EMI spurs, > look for "spread-spectrum" settings.) Jitter is what I'm most worried about for virtual systems. Jitter is quite good for a hardware RTC. I use the RTC for PPS mainly to determine its quality. Its hardware jitter is insignificant compared with the jitter from interrupt latency. >>>> some hypervisors start offering modes where old ISA peripherals >>>> are not emulated, > > How do they expect people to run MS Flight Simulator then ? :-) > >> I think we have no choice but do something for ISA/LPC-less configurations. >> We could even trust CPU report about its frequency as the last resort. > > Usually the errors will be magnificient, so a trivial sanity-check will > catch them. Don't leave home without it. But then you have the problem of handling them. There might be just 1 timecounter source that is emulated correctly, but you don't know which it is. There might be none. Bruce From owner-svn-src-head@freebsd.org Sun Mar 27 18:44:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6A53ADF055; Sun, 27 Mar 2016 18:44:39 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 6D6471F05; Sun, 27 Mar 2016 18:44:39 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id E33E24FAE8; Sun, 27 Mar 2016 18:44:36 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTP id u2RIiZDv087749; Sun, 27 Mar 2016 18:44:35 GMT (envelope-from phk@phk.freebsd.dk) To: Bruce Evans cc: Konstantin Belousov , John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 In-reply-to: <20160328033624.N850@besplex.bde.org> From: "Poul-Henning Kamp" References: <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> <20160325010649.H898@besplex.bde.org> <20160324162447.GD1741@kib.kiev.ua> <20160325060901.N2059@besplex.bde.org> <20160325084902.GH1741@kib.kiev.ua> <20160326021219.X911@besplex.bde.org> <20160326174210.GU1741@kib.kiev.ua> <20160327051601.S2318@besplex.bde.org> <20160327130706.GA1741@kib.kiev.ua> <20160328033624.N850@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <87747.1459104274.1@critter.freebsd.dk> Date: Sun, 27 Mar 2016 18:44:35 +0000 Message-ID: <87748.1459104275@critter.freebsd.dk> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 18:44:40 -0000 -------- In message <20160328033624.N850@besplex.bde.org>, Bruce Evans writes: >Of course the details are machine-dependent. My oldest system on which I >discovered PLL-like behaviour was from late 1997. The PLL might not have >been in standard bus chips then. It had a K5 (?) running at 233 MHz. >The ratio of the TSC to the i8254 was precisely 196. Which means the PLL probably was 49:3 from the 14.31818 MHz xtal to 233.8636 MHz CPU frequncy. >Newer systems have much higher resolution so the ratios are rarely integers. PLL's in EMI-spec'ed environments are never unity ratio because that would needlessly add to the EMI trouble. >It should be, but isn't in practice. The RTC was only expected to be better than the other timers, in the very long run - weeks to years. In particular, most of the RTC xtals run 20-40K hotter than their turn-over point ~23C, so they keep awful time while the system is running. (The 32.768kHz xtals are designed for wristwatches where you body-temperature keeps them at stable temperature. Don't take your wrist-watch off at night if you want it to precise.) >The i8254 is supposed >to run at precisely 1193182 Hz but usually has an inaccuracy of 10-50 Hz. 50PPM is a very common crystal spec, that would be +/- 60Hz. (merging emails here) >> A very important and relevant detail here is that the *only* >> clock/counter which has a standardized frequency *is* the i8254 >> counter. > >Not even the ACPI timer? Not that I'm aware of. In most cases it runs at 14.31818 MHz, but I've seen it as low as 1MHz and as high as 25 MHz. >> The RTC *crystal* may not even exist, [...] > >It can give a precision of 1/32K seconds fairly easily (but with lots of >overhead) by interrupting at 32 KHz. 1KHz is sometimes used for profiling. Only if the 32.768 kHz RTC xtal exists. These days silicon oscillators are gaining ground in that segment. > Jitter is what I'm most worried about for virtual systems. > Jitter is quite good for a hardware RTC. [...] > Its hardware jitter is insignificant compared with the jitter > from interrupt latency. If interrupts are involved their latency+jitter will overshadow any other noise source, if nothing else because of the quantization to clock/bus frequencies. Jitter on the raw xtal is in picoseconds if not femtoseconds, as it needs to be when you PLL it up to GHz. >> Usually the errors will be magnificient, so a trivial sanity-check will >> catch them. Don't leave home without it. > >But then you have the problem of handling them. There might be just 1 >timecounter source that is emulated correctly, but you don't know which >it is. There might be none. Indeed: One clock or three, never two. John R. Vig's famous tutorial is the ultimate collection of wisdom about care and feeding of quartz: http://www.ieee-uffc.org/frequency-control/learning-vig-tut.asp Highly recommended. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@freebsd.org Sun Mar 27 19:46:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DA78ADFD02; Sun, 27 Mar 2016 19:46:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE8711986; Sun, 27 Mar 2016 19:46:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x22b.google.com with SMTP id c63so160982763iof.0; Sun, 27 Mar 2016 12:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=oVqWXhwHKlSCahTVN5I/J00Lzo/pTYQSlpOyOcYrGks=; b=Ynoj8cv7DXoUyp6crYlu/e3fIYQiWSEHaO4tpG9ljeNdV9LDfljZ0yix5tEWYEBNmu cTLTNUaRpfsBiJ9mCa5NkNkIMiOjNe6aqRBMlYUxlqCVm+SA+0tgmvGG6B5f9xfBrnhF e5t+GMCAOSqhlmxRP+TEGSUXF5B4YzxXWHyjSiNREuvJkaivCAoQVYuLqmeB8Rttydol oYn39GxklBPdF/ysLANgKjg+gz+qSV2wRwBsi7pc94yTd6PithBQIawCTOaPVsXUy0PT kKtEWya817sD8DCTsvslvCoS4ZWC6yHn9bslhepQCf5cY1gXdgBV0r95Ml21LTsiEYyr lbyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=oVqWXhwHKlSCahTVN5I/J00Lzo/pTYQSlpOyOcYrGks=; b=KVAHi/wANKAu82QlrBkZCwNRpb9lChbSJBl3lvxo4TIGP1eNsUFzGALttiu2a+w/99 YCFFNvwqonsP8MTUlJfJhumm/Y/iIAaBXs05zvki+wh4EL1tsfQDdfF6b/jGDe52HRWG Rr591TNMr67DHVC+1aPYkTeFdy0tJ1ZyTR8dIDIMA6P7bBwAxXmUL9WaZLJ6Ul7TaTDi XmXG64OdTPhwVLJdiMLVoZqtZjGtb7CX8wgOxoYoD8WWhFPCb3w8/Ou+aJFI5Xw+Ni1h eSMODiq9TSLeKgDcCoLVIhStj0NE5fd7utAGpZViq0Ix3tR+REPtDpieisk0wFPYbwXJ 4+fA== X-Gm-Message-State: AD7BkJJSQar1jlG8edMXTzkySw4EA/snsNk+or8o/XoSCldJsH6DKu+P7VFLtVI0kiyahw== X-Received: by 10.107.164.100 with SMTP id n97mr2946792ioe.93.1459107997079; Sun, 27 Mar 2016 12:46:37 -0700 (PDT) Received: from ?IPv6:2601:601:800:126d:98d4:9e5c:ca5b:45c6? ([2601:601:800:126d:98d4:9e5c:ca5b:45c6]) by smtp.gmail.com with ESMTPSA id g6sm2749098igi.13.2016.03.27.12.46.34 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Mar 2016 12:46:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r297315 - head/etc/rc.d From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201603271722.u2RHMRJw008751@repo.freebsd.org> Date: Sun, 27 Mar 2016 12:46:33 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2324618D-B96F-494C-A1D7-3DDB694B6DDF@gmail.com> References: <201603271722.u2RHMRJw008751@repo.freebsd.org> To: Kristof Provost X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 19:46:38 -0000 > On Mar 27, 2016, at 10:22, Kristof Provost wrote: >=20 > Author: kp > Date: Sun Mar 27 17:22:27 2016 > New Revision: 297315 > URL: https://svnweb.freebsd.org/changeset/base/297315 =E2=80=A6 > Modified: head/etc/rc.d/pf > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/etc/rc.d/pf Sun Mar 27 16:27:49 2016 (r297314) > +++ head/etc/rc.d/pf Sun Mar 27 17:22:27 2016 (r297315) > @@ -66,7 +66,11 @@ pf_resync() >=20 > pf_status() > { > - $pf_program -s info > + if ! [ -c /dev/pf ] ; then > + echo "pf.ko is not loaded" > + else > + $pf_program -s info > + fi This might be better: load_kld pf || return 1 $pf_program -s info= From owner-svn-src-head@freebsd.org Sun Mar 27 20:02:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AD67ADFF78; Sun, 27 Mar 2016 20:02:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C0451FC2; Sun, 27 Mar 2016 20:02:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RK2LZw060127; Sun, 27 Mar 2016 20:02:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RK2LrG060126; Sun, 27 Mar 2016 20:02:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603272002.u2RK2LrG060126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 27 Mar 2016 20:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297321 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 20:02:22 -0000 Author: pfg Date: Sun Mar 27 20:02:21 2016 New Revision: 297321 URL: https://svnweb.freebsd.org/changeset/base/297321 Log: netstat: avoid returning uninitialized value in p_sockaddr(). In the case the width is less than 0, we are returning an uninitialized value. For practical purposes the return value is ignored but initialize it to avoid trouble. CID: 1341619 Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Sun Mar 27 19:43:26 2016 (r297320) +++ head/usr.bin/netstat/route.c Sun Mar 27 20:02:21 2016 (r297321) @@ -417,6 +417,7 @@ p_sockaddr(const char *name, struct sock if (width < 0) { snprintf(buf, sizeof(buf), "{:%s/%%s} ", name); xo_emit(buf, cp); + protrusion = 0; } else { if (Wflag != 0 || numeric_addr) { snprintf(buf, sizeof(buf), "{[:%d}{:%s/%%s}{]:} ", From owner-svn-src-head@freebsd.org Sun Mar 27 20:38:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1873ADF51C for ; Sun, 27 Mar 2016 20:38:07 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 788231C58 for ; Sun, 27 Mar 2016 20:38:07 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: bc4165ca-f45b-11e5-827e-7d17a39bef25 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sun, 27 Mar 2016 20:37:33 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u2RKbxkb025913; Sun, 27 Mar 2016 14:37:59 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1459111079.1091.116.camel@freebsd.org> Subject: Re: svn commit: r297315 - head/etc/rc.d From: Ian Lepore To: "Ngie Cooper (yaneurabeya)" , Kristof Provost Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 27 Mar 2016 14:37:59 -0600 In-Reply-To: <2324618D-B96F-494C-A1D7-3DDB694B6DDF@gmail.com> References: <201603271722.u2RHMRJw008751@repo.freebsd.org> <2324618D-B96F-494C-A1D7-3DDB694B6DDF@gmail.com> Content-Type: text/plain; charset="windows-1251" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 20:38:07 -0000 On Sun, 2016-03-27 at 12:46 -0700, Ngie Cooper (yaneurabeya) wrote: > > On Mar 27, 2016, at 10:22, Kristof Provost wrote: > > > > Author: kp > > Date: Sun Mar 27 17:22:27 2016 > > New Revision: 297315 > > URL: https://svnweb.freebsd.org/changeset/base/297315 > > … > > > Modified: head/etc/rc.d/pf > > =================================================================== > > =========== > > --- head/etc/rc.d/pf Sun Mar 27 16:27:49 2016 (r29731 > > 4) > > +++ head/etc/rc.d/pf Sun Mar 27 17:22:27 2016 (r29731 > > 5) > > @@ -66,7 +66,11 @@ pf_resync() > > > > pf_status() > > { > > - $pf_program -s info > > + if ! [ -c /dev/pf ] ; then > > + echo "pf.ko is not loaded" > > + else > > + $pf_program -s info > > + fi > > This might be better: > > load_kld pf || return 1 > $pf_program -s info > Having a status command say "module is not loaded" makes more sense to me than having it load the module so that it could tell you that pf is not active (which must surely be the bottom-line status if the module wasn't loaded to begin with). -- Ian From owner-svn-src-head@freebsd.org Sun Mar 27 21:20:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96F25ADF117; Sun, 27 Mar 2016 21:20:44 +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 mx1.freebsd.org (Postfix) with ESMTPS id 614711384; Sun, 27 Mar 2016 21:20:44 +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 u2RLKh2s083604; Sun, 27 Mar 2016 21:20:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RLKhma083603; Sun, 27 Mar 2016 21:20:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201603272120.u2RLKhma083603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 27 Mar 2016 21:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297322 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 21:20:44 -0000 Author: dim Date: Sun Mar 27 21:20:43 2016 New Revision: 297322 URL: https://svnweb.freebsd.org/changeset/base/297322 Log: Pull in r255683 from upstream libc++ trunk (by Eric Fiselier): [libcxx] Enable noexcept for GCC 4.6 and greater Summary: This patch allows GCC 4.6 and above to use `noexcept` as opposed to `throw()`. Is it an ABI safe change to suddenly switch on `noexcept`? I imagine it must be because it's disabled in w/ clang in C++03 but not C++11. Reviewers: danalbert, jroelofs, mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15516 This should fix errors from gcc 4.6 and higher when compiling llvm-cov and/or other llvm tools. Reported by: bdrewery Modified: head/contrib/libc++/include/__config Modified: head/contrib/libc++/include/__config ============================================================================== --- head/contrib/libc++/include/__config Sun Mar 27 20:02:21 2016 (r297321) +++ head/contrib/libc++/include/__config Sun Mar 27 21:20:43 2016 (r297322) @@ -364,14 +364,8 @@ typedef __char32_t char32_t; #endif #endif -#if (__has_feature(cxx_noexcept)) -# define _NOEXCEPT noexcept -# define _NOEXCEPT_(x) noexcept(x) -# define _NOEXCEPT_OR_FALSE(x) noexcept(x) -#else -# define _NOEXCEPT throw() -# define _NOEXCEPT_(x) -# define _NOEXCEPT_OR_FALSE(x) false +#if !(__has_feature(cxx_noexcept)) +#define _LIBCPP_HAS_NO_NOEXCEPT #endif #if __has_feature(underlying_type) @@ -439,10 +433,6 @@ namespace std { #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES #endif -#define _NOEXCEPT throw() -#define _NOEXCEPT_(x) -#define _NOEXCEPT_OR_FALSE(x) false - #ifndef __GXX_EXPERIMENTAL_CXX0X__ #define _LIBCPP_HAS_NO_ADVANCED_SFINAE @@ -456,6 +446,7 @@ namespace std { #define _LIBCPP_HAS_NO_RVALUE_REFERENCES #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS #define _LIBCPP_HAS_NO_STRONG_ENUMS +#define _LIBCPP_HAS_NO_NOEXCEPT #else // __GXX_EXPERIMENTAL_CXX0X__ @@ -479,6 +470,7 @@ namespace std { #endif // _GNUC_VER < 404 #if _GNUC_VER < 406 +#define _LIBCPP_HAS_NO_NOEXCEPT #define _LIBCPP_HAS_NO_NULLPTR #endif @@ -513,15 +505,14 @@ using namespace _LIBCPP_NAMESPACE __attr #define _LIBCPP_HAS_NO_UNICODE_CHARS #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS +#define _LIBCPP_HAS_NO_NOEXCEPT #define __alignof__ __alignof #define _LIBCPP_NORETURN __declspec(noreturn) #define _LIBCPP_UNUSED #define _ALIGNAS(x) __declspec(align(x)) #define _LIBCPP_HAS_NO_VARIADICS -#define _NOEXCEPT throw () -#define _NOEXCEPT_(x) -#define _NOEXCEPT_OR_FALSE(x) false + #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { #define _LIBCPP_END_NAMESPACE_STD } @@ -541,14 +532,11 @@ namespace std { #define _LIBCPP_NORETURN __attribute__((noreturn)) #define _LIBCPP_UNUSED -#define _NOEXCEPT throw() -#define _NOEXCEPT_(x) -#define _NOEXCEPT_OR_FALSE(x) false - #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES #define _LIBCPP_HAS_NO_ADVANCED_SFINAE #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#define _LIBCPP_HAS_NO_NOEXCEPT #define _LIBCPP_HAS_NO_NULLPTR #define _LIBCPP_HAS_NO_UNICODE_CHARS #define _LIBCPP_HAS_IS_BASE_OF @@ -572,6 +560,14 @@ namespace std { #endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__ +#ifndef _LIBCPP_HAS_NO_NOEXCEPT +# define _NOEXCEPT noexcept +# define _NOEXCEPT_(x) noexcept(x) +#else +# define _NOEXCEPT throw() +# define _NOEXCEPT_(x) +#endif + #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS typedef unsigned short char16_t; typedef unsigned int char32_t; From owner-svn-src-head@freebsd.org Sun Mar 27 22:21:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07F39ADFDE4; Sun, 27 Mar 2016 22:21:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9E921F94; Sun, 27 Mar 2016 22:21:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RMLYdk002973; Sun, 27 Mar 2016 22:21:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RMLYUL002972; Sun, 27 Mar 2016 22:21:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603272221.u2RMLYUL002972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 27 Mar 2016 22:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297323 - head/sys/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 22:21:36 -0000 Author: ian Date: Sun Mar 27 22:21:34 2016 New Revision: 297323 URL: https://svnweb.freebsd.org/changeset/base/297323 Log: Set ifctx->gotrootpath=1 only when the root path came from the dhcp/bootp server (and not when it came from a fallback method such as the ROOTDEVNAME option). This makes the code in bootpc_init() choose the first interface that provided a rootpath name. Previously it was choosing the first interface that got an IP address, which could be on a different and potentially unreachable subnet than the server providing the rootfs. If the rootpath name actually does come from a fallback source, then the code continues to use the first interface in the list that got configured. Note that this wasn't directly reported in the PR cited below, but was discovered while working on that PR. PR: 187094 Modified: head/sys/nfs/bootp_subr.c Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Sun Mar 27 21:20:43 2016 (r297322) +++ head/sys/nfs/bootp_subr.c Sun Mar 27 22:21:34 2016 (r297323) @@ -1478,6 +1478,8 @@ bootpc_decode_reply(struct nfsv3_diskles if (p == NULL) { p = bootpc_tag(&gctx->tag, &ifctx->reply, ifctx->replylen, TAG_ROOT); + if (p != NULL) + ifctx->gotrootpath = 1; } #ifdef ROOTDEVNAME if ((p == NULL || (boothowto & RB_DFLTROOT) != 0) && @@ -1497,7 +1499,6 @@ bootpc_decode_reply(struct nfsv3_diskles } printf("rootfs %s ", p); gctx->gotrootpath = 1; - ifctx->gotrootpath = 1; gctx->setrootfs = ifctx; p = bootpc_tag(&gctx->tag, &ifctx->reply, From owner-svn-src-head@freebsd.org Sun Mar 27 22:36:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09CA2ADF18F; Sun, 27 Mar 2016 22:36:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B59A91603; Sun, 27 Mar 2016 22:36:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RMaWSv006129; Sun, 27 Mar 2016 22:36:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RMaW4o006128; Sun, 27 Mar 2016 22:36:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603272236.u2RMaW4o006128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 27 Mar 2016 22:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297324 - head/sys/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 22:36:34 -0000 Author: ian Date: Sun Mar 27 22:36:32 2016 New Revision: 297324 URL: https://svnweb.freebsd.org/changeset/base/297324 Log: Switch bootpc_adjust_interface() from returning int to void. Its one caller doesn't check for errors, and all the errors that can happen result in it calling panic anyway, except for one that's really more of a warning (and is going to disappear on an upcoming commit anyway). Modified: head/sys/nfs/bootp_subr.c Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Sun Mar 27 22:21:34 2016 (r297323) +++ head/sys/nfs/bootp_subr.c Sun Mar 27 22:36:32 2016 (r297324) @@ -276,7 +276,7 @@ static int bootpc_call(struct bootpc_glo static void bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, struct thread *td); -static int bootpc_adjust_interface(struct bootpc_ifcontext *ifctx, +static void bootpc_adjust_interface(struct bootpc_ifcontext *ifctx, struct bootpc_globalcontext *gctx, struct thread *td); static void bootpc_decode_reply(struct nfsv3_diskless *nd, @@ -1011,7 +1011,7 @@ bootpc_shutdown_interface(struct bootpc_ panic("%s: SIOCDIFADDR, error=%d", __func__, error); } -static int +static void bootpc_adjust_interface(struct bootpc_ifcontext *ifctx, struct bootpc_globalcontext *gctx, struct thread *td) { @@ -1034,7 +1034,7 @@ bootpc_adjust_interface(struct bootpc_if if (bootpc_ifctx_isresolved(ifctx) == 0) { /* Shutdown interfaces where BOOTP failed */ bootpc_shutdown_interface(ifctx, td); - return (0); + return; } printf("Adjusted interface %s", ifctx->ireq.ifr_name); @@ -1082,11 +1082,9 @@ bootpc_adjust_interface(struct bootpc_if (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL, RT_DEFAULT_FIB); if (error != 0) { printf("%s: RTM_ADD, error=%d\n", __func__, error); - return (error); + return; } } - - return (0); } static int From owner-svn-src-head@freebsd.org Sun Mar 27 22:58:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CA87ADF5B3; Sun, 27 Mar 2016 22:58:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B83E1F60; Sun, 27 Mar 2016 22:58:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RMwuPC012284; Sun, 27 Mar 2016 22:58:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RMwuGk012283; Sun, 27 Mar 2016 22:58:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603272258.u2RMwuGk012283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 27 Mar 2016 22:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297325 - head/sys/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 22:58:57 -0000 Author: ian Date: Sun Mar 27 22:58:56 2016 New Revision: 297325 URL: https://svnweb.freebsd.org/changeset/base/297325 Log: Stop setting the default route to the IP of the interface itself when the bootp/dhcp server doesn't provide a router option. Doing so prevents setting defaultrouter= in rc.conf (it fails because there's already a bogus default route installed by bootpc_init). When an admin wants to use this style of proxy arp on an interface, the proper mechanism is to set the "use-lease-addr-for-default-route" flag in the dhcp server config. That causes the lease address to be delivered in the routers option, and the normal handling of the routers option will then install the self-ip as the default route. PR: 187094 Modified: head/sys/nfs/bootp_subr.c Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Sun Mar 27 22:36:32 2016 (r297324) +++ head/sys/nfs/bootp_subr.c Sun Mar 27 22:58:56 2016 (r297325) @@ -1072,7 +1072,7 @@ bootpc_adjust_interface(struct bootpc_if /* Add new default route */ - if (ifctx->gotgw != 0 || gctx->gotgw == 0) { + if (ifctx->gw.sin_addr.s_addr != htonl(INADDR_ANY)) clear_sinaddr(&defdst); clear_sinaddr(&defmask); /* XXX MRT just table 0 */ @@ -1552,10 +1552,6 @@ bootpc_decode_reply(struct nfsv3_diskles else ifctx->netmask.sin_addr.s_addr = htonl(IN_CLASSC_NET); } - if (ifctx->gotgw == 0) { - /* Use proxyarp */ - ifctx->gw.sin_addr.s_addr = ifctx->myaddr.sin_addr.s_addr; - } } void From owner-svn-src-head@freebsd.org Sun Mar 27 23:16:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D9F2ADF98E; Sun, 27 Mar 2016 23:16:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2905E173F; Sun, 27 Mar 2016 23:16:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RNGber018382; Sun, 27 Mar 2016 23:16:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RNGbwi018381; Sun, 27 Mar 2016 23:16:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603272316.u2RNGbwi018381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 27 Mar 2016 23:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297326 - head/sys/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 23:16:38 -0000 Author: ian Date: Sun Mar 27 23:16:37 2016 New Revision: 297326 URL: https://svnweb.freebsd.org/changeset/base/297326 Log: Do not try to install a default route for each interface found, because only the first one will actually work and all the others just result in errors (which would get printed but otherwise ignored). Instead, wait until we make a choice of which interface will be used to mount the rootfs, and install the default route associated with it (if any). After doing the md_mount() call to obtain the needed info, remove the default route again, and transcribe the route info into the nfs_diskless structure. If the system eventually chooses to mount the nfs rootfs, the default route will be installed again when the nfs_diskless code re-initializes the interface. The theory here is that since we can only have one default route, the one most likely to be correct for mounting the rootfs is the one that was delivered along with the rootpath option. Modified: head/sys/nfs/bootp_subr.c Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Sun Mar 27 22:58:56 2016 (r297325) +++ head/sys/nfs/bootp_subr.c Sun Mar 27 23:16:37 2016 (r297326) @@ -1016,20 +1016,16 @@ bootpc_adjust_interface(struct bootpc_if struct bootpc_globalcontext *gctx, struct thread *td) { int error; - struct sockaddr_in defdst; - struct sockaddr_in defmask; struct sockaddr_in *sin; struct ifreq *ifr; struct in_aliasreq *ifra; struct sockaddr_in *myaddr; struct sockaddr_in *netmask; - struct sockaddr_in *gw; ifr = &ifctx->ireq; ifra = &ifctx->iareq; myaddr = &ifctx->myaddr; netmask = &ifctx->netmask; - gw = &ifctx->gw; if (bootpc_ifctx_isresolved(ifctx) == 0) { /* Shutdown interfaces where BOOTP failed */ @@ -1069,21 +1065,47 @@ bootpc_adjust_interface(struct bootpc_if error = ifioctl(bootp_so, SIOCAIFADDR, (caddr_t)ifra, td); if (error != 0) panic("%s: SIOCAIFADDR, error=%d", __func__, error); +} + +static void +bootpc_add_default_route(struct bootpc_ifcontext *ifctx) +{ + int error; + struct sockaddr_in defdst; + struct sockaddr_in defmask; - /* Add new default route */ + if (ifctx->gw.sin_addr.s_addr == htonl(INADDR_ANY)) + return; - if (ifctx->gw.sin_addr.s_addr != htonl(INADDR_ANY)) - clear_sinaddr(&defdst); - clear_sinaddr(&defmask); - /* XXX MRT just table 0 */ - error = rtrequest_fib(RTM_ADD, - (struct sockaddr *) &defdst, (struct sockaddr *) gw, - (struct sockaddr *) &defmask, - (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL, RT_DEFAULT_FIB); - if (error != 0) { - printf("%s: RTM_ADD, error=%d\n", __func__, error); - return; - } + clear_sinaddr(&defdst); + clear_sinaddr(&defmask); + + error = rtrequest_fib(RTM_ADD, (struct sockaddr *)&defdst, + (struct sockaddr *) &ifctx->gw, (struct sockaddr *)&defmask, + (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL, RT_DEFAULT_FIB); + if (error != 0) { + printf("%s: RTM_ADD, error=%d\n", __func__, error); + } +} + +static void +bootpc_remove_default_route(struct bootpc_ifcontext *ifctx) +{ + int error; + struct sockaddr_in defdst; + struct sockaddr_in defmask; + + if (ifctx->gw.sin_addr.s_addr == htonl(INADDR_ANY)) + return; + + clear_sinaddr(&defdst); + clear_sinaddr(&defmask); + + error = rtrequest_fib(RTM_DELETE, (struct sockaddr *)&defdst, + (struct sockaddr *) &ifctx->gw, (struct sockaddr *)&defmask, + (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL, RT_DEFAULT_FIB); + if (error != 0) { + printf("%s: RTM_DELETE, error=%d\n", __func__, error); } } @@ -1743,9 +1765,11 @@ retry: kern_setenv("boot.netif.name", ifctx->ifp->if_xname); + bootpc_add_default_route(ifctx); error = md_mount(&nd->root_saddr, nd->root_hostnam, nd->root_fh, &nd->root_fhsize, &nd->root_args, td); + bootpc_remove_default_route(ifctx); if (error != 0) { if (gctx->any_root_overrides == 0) panic("nfs_boot: mount root, error=%d", error); @@ -1763,6 +1787,7 @@ retry: ifctx->myaddr.sin_addr.s_addr | ~ ifctx->netmask.sin_addr.s_addr; bcopy(&ifctx->netmask, &nd->myif.ifra_mask, sizeof(ifctx->netmask)); + bcopy(&ifctx->gw, &nd->mygateway, sizeof(ifctx->gw)); out: while((ifctx = STAILQ_FIRST(&gctx->interfaces)) != NULL) { From owner-svn-src-head@freebsd.org Sun Mar 27 23:19:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA75DADFA00; Sun, 27 Mar 2016 23:19:15 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A23C1950; Sun, 27 Mar 2016 23:19:15 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RNJEtQ018507; Sun, 27 Mar 2016 23:19:14 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RNJEX0018506; Sun, 27 Mar 2016 23:19:14 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201603272319.u2RNJEX0018506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sun, 27 Mar 2016 23:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297327 - head/libexec/dma X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 23:19:15 -0000 Author: kan Date: Sun Mar 27 23:19:14 2016 New Revision: 297327 URL: https://svnweb.freebsd.org/changeset/base/297327 Log: Do not override top level CFLAGS in libexec/dma Modified: head/libexec/dma/Makefile.inc Modified: head/libexec/dma/Makefile.inc ============================================================================== --- head/libexec/dma/Makefile.inc Sun Mar 27 23:16:37 2016 (r297326) +++ head/libexec/dma/Makefile.inc Sun Mar 27 23:19:14 2016 (r297327) @@ -4,7 +4,7 @@ DMA_SOURCES= ${.CURDIR}/../../../contrib/dma .PATH: ${DMA_SOURCES} -CFLAGS= -I${DMA_SOURCES} \ +CFLAGS+= -I${DMA_SOURCES} \ -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME \ -DCONF_PATH='"/etc/dma"' \ -DLIBEXEC_PATH='"/usr/libexec"' -DDMA_VERSION='"v0.10"' \ From owner-svn-src-head@freebsd.org Sun Mar 27 23:19:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81CB2ADFA29; Sun, 27 Mar 2016 23:19:21 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DDBB19D7; Sun, 27 Mar 2016 23:19:21 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RNJKre018553; Sun, 27 Mar 2016 23:19:20 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RNJKRS018552; Sun, 27 Mar 2016 23:19:20 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201603272319.u2RNJKRS018552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sun, 27 Mar 2016 23:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297328 - head/sys/dev/extres/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 23:19:21 -0000 Author: kan Date: Sun Mar 27 23:19:20 2016 New Revision: 297328 URL: https://svnweb.freebsd.org/changeset/base/297328 Log: Do nothing if requested clk frequency is already correct. Reviewed by: mmel Modified: head/sys/dev/extres/clk/clk.c Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Sun Mar 27 23:19:14 2016 (r297327) +++ head/sys/dev/extres/clk/clk.c Sun Mar 27 23:19:20 2016 (r297328) @@ -818,6 +818,10 @@ clknode_set_freq(struct clknode *clknode /* We have exclusive topology lock, node lock is not needed. */ CLK_TOPO_XASSERT(); + /* Check for no change */ + if (clknode->freq == freq) + return (0); + parent_freq = 0; /* From owner-svn-src-head@freebsd.org Sun Mar 27 23:19:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52945ADFA32; Sun, 27 Mar 2016 23:19:23 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D40731A63; Sun, 27 Mar 2016 23:19:22 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RNJLKb018596; Sun, 27 Mar 2016 23:19:21 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RNJLQ1018595; Sun, 27 Mar 2016 23:19:21 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201603272319.u2RNJLQ1018595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sun, 27 Mar 2016 23:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297329 - head/sys/dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 23:19:23 -0000 Author: kan Date: Sun Mar 27 23:19:21 2016 New Revision: 297329 URL: https://svnweb.freebsd.org/changeset/base/297329 Log: Use correct response bits for MMC_RSP_R4-R7 types Modified: head/sys/dev/mmc/mmcreg.h Modified: head/sys/dev/mmc/mmcreg.h ============================================================================== --- head/sys/dev/mmc/mmcreg.h Sun Mar 27 23:19:20 2016 (r297328) +++ head/sys/dev/mmc/mmcreg.h Sun Mar 27 23:19:21 2016 (r297329) @@ -85,8 +85,11 @@ struct mmc_command { #define MMC_RSP_R1B (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE | MMC_RSP_BUSY) #define MMC_RSP_R2 (MMC_RSP_PRESENT | MMC_RSP_136 | MMC_RSP_CRC) #define MMC_RSP_R3 (MMC_RSP_PRESENT) -#define MMC_RSP_R6 (MMC_RSP_PRESENT | MMC_RSP_CRC) -#define MMC_RSP_R7 (MMC_RSP_PRESENT | MMC_RSP_CRC) +#define MMC_RSP_R4 (MMC_RSP_PRESENT) +#define MMC_RSP_R5 (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE) +#define MMC_RSP_R5B (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE | MMC_RSP_BUSY) +#define MMC_RSP_R6 (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE) +#define MMC_RSP_R7 (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE) #define MMC_RSP(x) ((x) & MMC_RSP_MASK) uint32_t retries; uint32_t error; From owner-svn-src-head@freebsd.org Mon Mar 28 02:05:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51715ADF9EB; Mon, 28 Mar 2016 02:05:36 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21AA41BBC; Mon, 28 Mar 2016 02:05:36 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2S25Znx069636; Mon, 28 Mar 2016 02:05:35 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2S25ZFc069635; Mon, 28 Mar 2016 02:05:35 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201603280205.u2S25ZFc069635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Mon, 28 Mar 2016 02:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297330 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 02:05:36 -0000 Author: wblock (doc committer) Date: Mon Mar 28 02:05:35 2016 New Revision: 297330 URL: https://svnweb.freebsd.org/changeset/base/297330 Log: Adjust misleading wording of the -G option and simplify a few surrounding sentences. From a discussion on -ports. Reviewed by: David Wolfskill Modified: head/usr.sbin/pw/pw.8 Modified: head/usr.sbin/pw/pw.8 ============================================================================== --- head/usr.sbin/pw/pw.8 Sun Mar 27 23:19:21 2016 (r297329) +++ head/usr.sbin/pw/pw.8 Mon Mar 28 02:05:35 2016 (r297330) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2015 +.Dd March 27, 2016 .Dt PW 8 .Os .Sh NAME @@ -420,18 +420,16 @@ Set the account's primary group to the g .Ar group may be defined by either its name or group number. .It Fl G Ar grouplist -Set additional group memberships for an account. +Set secondary group memberships for an account. .Ar grouplist -is a comma, space or tab-separated list of group names or group numbers. -The user's name is added to the group lists in -.Pa /etc/group , -and -removed from any groups not specified in -.Ar grouplist . -Note: a user should not be added to their primary group with +is a comma, space, or tab-separated list of group names or group numbers. +The user is added to the groups specified in +.Ar grouplist , +and removed from all groups not specified. +The current login session is not affected by group membership changes, +which only take effect when the user reconnects. +Note: do not add a user to their primary group with .Ar grouplist . -Also, group membership changes do not take effect for current user login -sessions, requiring the user to reconnect to be affected by the changes. .It Fl L Ar class This option sets the login class for the user being created. See From owner-svn-src-head@freebsd.org Mon Mar 28 04:22:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94484AE065E; Mon, 28 Mar 2016 04:22:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C7131319; Mon, 28 Mar 2016 04:22:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2S4MM0e012242; Mon, 28 Mar 2016 04:22:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2S4MMRH012240; Mon, 28 Mar 2016 04:22:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201603280422.u2S4MMRH012240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 28 Mar 2016 04:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297331 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 04:22:23 -0000 Author: imp Date: Mon Mar 28 04:22:22 2016 New Revision: 297331 URL: https://svnweb.freebsd.org/changeset/base/297331 Log: Sometimes, it's useful to export the entire line to an external program without listening to the devd socket for all events. Define two new pseudo variables $*, the entire event from devctl and $_, the entire event without the type character, since it might be easier to use in some circumstances. Modified: head/sbin/devd/devd.cc head/sbin/devd/devd.conf.5 Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Mon Mar 28 02:05:35 2016 (r297330) +++ head/sbin/devd/devd.cc Mon Mar 28 04:22:22 2016 (r297331) @@ -648,8 +648,8 @@ config::expand_one(const char *&src, str return; } - // $[^A-Za-z] -> $\1 - if (!isalpha(*src)) { + // $[^-A-Za-z_*] -> $\1 + if (!isalpha(*src) && *src != '_' && *src != '-' && *src != '*') { dst += '$'; dst += *src++; return; @@ -793,10 +793,15 @@ process_event(char *buffer) devdlog(LOG_INFO, "Processing event '%s'\n", buffer); type = *buffer++; cfg.push_var_table(); + // $* is the entire line + cfg.set_variable("*", buffer - 1); + // $_ is the entire line without the initial character + cfg.set_variable("_", buffer - 1); // No match doesn't have a device, and the format is a little // different, so handle it separately. switch (type) { case notify: + //! (k=v)* sp = cfg.set_vars(sp); break; case nomatch: Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Mon Mar 28 02:05:35 2016 (r297330) +++ head/sbin/devd/devd.conf.5 Mon Mar 28 04:22:22 2016 (r297331) @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd July 11, 2015 +.Dd March 28, 2016 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -234,10 +234,17 @@ A partial list of variables and their po with the .Ic match statement. +The variables are published by the bus based on characteristics of the device +that generated the event (for device events). +Variables for other classes of events are dependent on those events. .Pp .Bl -tag -width ".Li manufacturer" -compact .It Ic Variable .Ic Description +.It Li * +The entire message from the current event +.It Li _ +The entire message from the current event, after the initial type character .It Li bus Device name of parent bus. .It Li cdev From owner-svn-src-head@freebsd.org Mon Mar 28 07:36:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5DC6AE085A; Mon, 28 Mar 2016 07:36:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 648DB1DEC; Mon, 28 Mar 2016 07:36:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2S7asOb069199; Mon, 28 Mar 2016 07:36:54 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2S7as7a069198; Mon, 28 Mar 2016 07:36:54 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603280736.u2S7as7a069198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Mar 2016 07:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297334 - head/sys/dev/vt/hw/vga X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 07:36:55 -0000 Author: sephe Date: Mon Mar 28 07:36:54 2016 New Revision: 297334 URL: https://svnweb.freebsd.org/changeset/base/297334 Log: vt: Use textmode when we're running on hypervisors The graphic mode is noticeably slow on hypervisors, especially on Hyper-V (1 second to each line). Submitted by: Dexuan Cui Reviewed by: kib, sephe, royger (early loader version) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5739 Modified: head/sys/dev/vt/hw/vga/vt_vga.c Modified: head/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vt_vga.c Mon Mar 28 05:42:15 2016 (r297333) +++ head/sys/dev/vt/hw/vga/vt_vga.c Mon Mar 28 07:36:54 2016 (r297334) @@ -1214,7 +1214,6 @@ vga_init(struct vt_device *vd) if (vd->vd_softc == NULL) vd->vd_softc = (void *)&vga_conssoftc; sc = vd->vd_softc; - textmode = 0; if (vd->vd_flags & VDF_DOWNGRADE && vd->vd_video_dev != NULL) vga_pci_repost(vd->vd_video_dev); @@ -1229,6 +1228,13 @@ vga_init(struct vt_device *vd) bus_space_map(sc->vga_reg_tag, VGA_REG_BASE, VGA_REG_SIZE, 0, &sc->vga_reg_handle); + /* + * If "hw.vga.textmode" is not set and we're running on hypervisor, + * we use text mode by default, this is because when we're on + * hypervisor, vt(4) is usually much slower in graphics mode than + * in text mode, especially when we're on Hyper-V. + */ + textmode = vm_guest != VM_GUEST_NO; TUNABLE_INT_FETCH("hw.vga.textmode", &textmode); if (textmode) { vd->vd_flags |= VDF_TEXTMODE; From owner-svn-src-head@freebsd.org Mon Mar 28 07:44:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AA7DAE0B2A; Mon, 28 Mar 2016 07:44:56 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CA4B1268; Mon, 28 Mar 2016 07:44:56 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2S7itHp072099; Mon, 28 Mar 2016 07:44:55 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2S7itjV072097; Mon, 28 Mar 2016 07:44:55 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201603280744.u2S7itjV072097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Mon, 28 Mar 2016 07:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297335 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 07:44:56 -0000 Author: kevlo Date: Mon Mar 28 07:44:55 2016 New Revision: 297335 URL: https://svnweb.freebsd.org/changeset/base/297335 Log: Update superblock and inode structs for ext4. Reviewed by: pfg Modified: head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2fs.h Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Mon Mar 28 07:36:54 2016 (r297334) +++ head/sys/fs/ext2fs/ext2_dinode.h Mon Mar 28 07:44:55 2016 (r297335) @@ -131,6 +131,7 @@ struct ext2fs_dinode { uint32_t e2di_crtime; /* 144: Creation (birth)time */ uint32_t e2di_crtime_extra; /* 148: Extra creation (birth)time */ uint32_t e2di_version_hi; /* 152: High bits of inode version */ + uint32_t e2di_projid; /* 156: Project ID */ }; #endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */ Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Mon Mar 28 07:36:54 2016 (r297334) +++ head/sys/fs/ext2fs/ext2fs.h Mon Mar 28 07:44:55 2016 (r297335) @@ -72,7 +72,7 @@ struct ext2fs { uint32_t e2fs_first_ino; /* first non-reserved inode */ uint16_t e2fs_inode_size; /* size of inode structure */ uint16_t e2fs_block_group_nr; /* block grp number of this sblk*/ - uint32_t e2fs_features_compat; /* compatible feature set */ + uint32_t e2fs_features_compat; /* compatible feature set */ uint32_t e2fs_features_incompat; /* incompatible feature set */ uint32_t e2fs_features_rocompat; /* RO-compatible feature set */ uint8_t e2fs_uuid[16]; /* 128-bit uuid for volume */ @@ -88,25 +88,54 @@ struct ext2fs { uint32_t e3fs_last_orphan; /* start of list of inodes to delete */ uint32_t e3fs_hash_seed[4]; /* HTREE hash seed */ char e3fs_def_hash_version; /* Default hash version to use */ - char e3fs_reserved_char_pad; + char e3fs_jnl_backup_type; + uint16_t e3fs_desc_size; /* size of group descriptor */ uint32_t e3fs_default_mount_opts; uint32_t e3fs_first_meta_bg; /* First metablock block group */ - uint32_t e3fs_mkfs_time; /* when the fs was created */ - uint32_t e3fs_jnl_blks[17]; /* backup of the journal inode */ - uint32_t e4fs_bcount_hi; /* block count */ - uint32_t e4fs_rbcount_hi; /* reserved blocks count */ - uint32_t e4fs_fbcount_hi; /* free blocks count */ - uint16_t e4fs_min_extra_isize;/* all inodes have at least some bytes */ + uint32_t e3fs_mkfs_time; /* when the fs was created */ + uint32_t e3fs_jnl_blks[17]; /* backup of the journal inode */ + uint32_t e4fs_bcount_hi; /* high bits of blocks count */ + uint32_t e4fs_rbcount_hi; /* high bits of reserved blocks count */ + uint32_t e4fs_fbcount_hi; /* high bits of free blocks count */ + uint16_t e4fs_min_extra_isize; /* all inodes have at least some bytes */ uint16_t e4fs_want_extra_isize; /* inodes must reserve some bytes */ - uint32_t e4fs_flags; /* miscellaneous flags */ - uint16_t e4fs_raid_stride; /* RAID stride */ - uint16_t e4fs_mmpintv; /* number of seconds to wait in MMP checking */ - uint64_t e4fs_mmpblk; /* block for multi-mount protection */ - uint32_t e4fs_raid_stripe_wid;/* blocks on all data disks (N * stride) */ - uint8_t e4fs_log_gpf; /* FLEX_BG group size */ - uint8_t e4fs_char_pad2; - uint16_t e4fs_pad; - uint32_t reserved2[162]; /* Padding to the end of the block */ + uint32_t e4fs_flags; /* miscellaneous flags */ + uint16_t e4fs_raid_stride; /* RAID stride */ + uint16_t e4fs_mmpintv; /* number of seconds to wait in MMP checking */ + uint64_t e4fs_mmpblk; /* block for multi-mount protection */ + uint32_t e4fs_raid_stripe_wid; /* blocks on all data disks (N * stride) */ + uint8_t e4fs_log_gpf; /* FLEX_BG group size */ + uint8_t e4fs_chksum_type; /* metadata checksum algorithm used */ + uint8_t e4fs_encrypt; /* versioning level for encryption */ + uint8_t e4fs_reserved_pad; + uint64_t e4fs_kbytes_written; /* number of lifetime kilobytes */ + uint32_t e4fs_snapinum; /* inode number of active snapshot */ + uint32_t e4fs_snapid; /* sequential ID of active snapshot */ + uint64_t e4fs_snaprbcount; /* reserved blocks for active snapshot */ + uint32_t e4fs_snaplist; /* inode number for on-disk snapshot */ + uint32_t e4fs_errcount; /* number of file system errors */ + uint32_t e4fs_first_errtime; /* first time an error happened */ + uint32_t e4fs_first_errino; /* inode involved in first error */ + uint64_t e4fs_first_errblk; /* block involved of first error */ + uint8_t e4fs_first_errfunc[32]; /* function where error happened */ + uint32_t e4fs_first_errline; /* line number where error happened */ + uint32_t e4fs_last_errtime; /* most recent time of an error */ + uint32_t e4fs_last_errino; /* inode involved in last error */ + uint32_t e4fs_last_errline; /* line number where error happened */ + uint64_t e4fs_last_errblk; /* block involved of last error */ + uint8_t e4fs_last_errfunc[32]; /* function where error happened */ + uint8_t e4fs_mount_opts[64]; + uint32_t e4fs_usrquota_inum; /* inode for tracking user quota */ + uint32_t e4fs_grpquota_inum; /* inode for tracking group quota */ + uint32_t e4fs_overhead_clusters; /* overhead blocks/clusters */ + uint32_t e4fs_backup_bgs[2]; /* groups with sparse_super2 SBs */ + uint8_t e4fs_encrypt_algos[4]; /* encryption algorithms in use */ + uint8_t e4fs_encrypt_pw_salt[16]; /* salt used for string2key */ + uint32_t e4fs_lpf_ino; /* location of the lost+found inode */ + uint32_t e4fs_proj_quota_inum; /* inode for tracking project quota */ + uint32_t e4fs_chksum_seed; /* checksum seed */ + uint32_t e4fs_reserved[98]; /* padding to the end of the block */ + uint32_t e4fs_sbchksum; /* superblock checksum */ }; /* From owner-svn-src-head@freebsd.org Mon Mar 28 08:12:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3E7CAE02E7; Mon, 28 Mar 2016 08:12:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id 71733102D; Mon, 28 Mar 2016 08:12:30 +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 u2S8CTFT080967; Mon, 28 Mar 2016 08:12:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2S8CTde080966; Mon, 28 Mar 2016 08:12:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603280812.u2S8CTde080966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 28 Mar 2016 08:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297337 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 08:12:30 -0000 Author: mav Date: Mon Mar 28 08:12:29 2016 New Revision: 297337 URL: https://svnweb.freebsd.org/changeset/base/297337 Log: Pass through error code from make_dev_p(). ENAMETOOLONG is much more informative in logs then ENXIO. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Mar 28 08:01:38 2016 (r297336) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Mar 28 08:12:29 2016 (r297337) @@ -688,13 +688,14 @@ zvol_create_minor(const char *name) bioq_init(&zv->zv_queue); mtx_init(&zv->zv_queue_mtx, "zvol", NULL, MTX_DEF); } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) { - if (make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, + error = make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, &dev, &zvol_cdevsw, NULL, UID_ROOT, GID_OPERATOR, - 0640, "%s/%s", ZVOL_DRIVER, name) != 0) { + 0640, "%s/%s", ZVOL_DRIVER, name); + if (error != 0) { kmem_free(zv, sizeof(*zv)); dmu_objset_disown(os, FTAG); mutex_exit(&zfsdev_state_lock); - return (SET_ERROR(ENXIO)); + return (error); } zv->zv_dev = dev; dev->si_iosize_max = MAXPHYS; From owner-svn-src-head@freebsd.org Mon Mar 28 09:41:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CD49ADFE9B; Mon, 28 Mar 2016 09:41:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A22B1087; Mon, 28 Mar 2016 09:41:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2S9frFM084156 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 28 Mar 2016 12:41:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2S9frFM084156 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2S9frma084155; Mon, 28 Mar 2016 12:41:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 28 Mar 2016 12:41:53 +0300 From: Konstantin Belousov To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297337 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20160328094153.GD1741@kib.kiev.ua> References: <201603280812.u2S8CTde080966@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603280812.u2S8CTde080966@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 09:41:59 -0000 On Mon, Mar 28, 2016 at 08:12:29AM +0000, Alexander Motin wrote: > Author: mav > Date: Mon Mar 28 08:12:29 2016 > New Revision: 297337 > URL: https://svnweb.freebsd.org/changeset/base/297337 > > Log: > Pass through error code from make_dev_p(). > > ENAMETOOLONG is much more informative in logs then ENXIO. > > MFC after: 1 week > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Mar 28 08:01:38 2016 (r297336) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Mar 28 08:12:29 2016 (r297337) > @@ -688,13 +688,14 @@ zvol_create_minor(const char *name) > bioq_init(&zv->zv_queue); > mtx_init(&zv->zv_queue_mtx, "zvol", NULL, MTX_DEF); > } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) { > - if (make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, > + error = make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, > &dev, &zvol_cdevsw, NULL, UID_ROOT, GID_OPERATOR, > - 0640, "%s/%s", ZVOL_DRIVER, name) != 0) { > + 0640, "%s/%s", ZVOL_DRIVER, name); > + if (error != 0) { > kmem_free(zv, sizeof(*zv)); > dmu_objset_disown(os, FTAG); > mutex_exit(&zfsdev_state_lock); > - return (SET_ERROR(ENXIO)); > + return (error); > } > zv->zv_dev = dev; > dev->si_iosize_max = MAXPHYS; Did you considered switching to make_dev_s(9) KPI ? The next line, not shown in the diff, is dev->si_drv2 = zv; The make_dev_s() use would solve an issue where user mode request might be executed before si_drv2 is assigned. From owner-svn-src-head@freebsd.org Mon Mar 28 09:43:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E913ADFF67; Mon, 28 Mar 2016 09:43:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C49512CD; Mon, 28 Mar 2016 09:43:41 +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 u2S9hekw008355; Mon, 28 Mar 2016 09:43:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2S9heWM008353; Mon, 28 Mar 2016 09:43:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603280943.u2S9heWM008353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 28 Mar 2016 09:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297347 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 09:43:41 -0000 Author: kib Date: Mon Mar 28 09:43:40 2016 New Revision: 297347 URL: https://svnweb.freebsd.org/changeset/base/297347 Log: Add defines for the LAPIC TSC deadline timer mode. The LVT timer mode field is two-bit, extend the mask. Also add comments about all MSRs writes to which are not serializing. Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/include/apicreg.h head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/apicreg.h ============================================================================== --- head/sys/x86/include/apicreg.h Mon Mar 28 09:36:52 2016 (r297346) +++ head/sys/x86/include/apicreg.h Mon Mar 28 09:43:40 2016 (r297347) @@ -399,10 +399,11 @@ typedef struct IOAPIC ioapic_t; #define APIC_LVTT_VECTOR 0x000000ff #define APIC_LVTT_DS 0x00001000 #define APIC_LVTT_M 0x00010000 -#define APIC_LVTT_TM 0x00020000 +#define APIC_LVTT_TM 0x00060000 # define APIC_LVTT_TM_ONE_SHOT 0x00000000 # define APIC_LVTT_TM_PERIODIC 0x00020000 - +# define APIC_LVTT_TM_TSCDLT 0x00040000 +# define APIC_LVTT_TM_RSRV 0x00060000 /* APIC timer current count */ #define APIC_TIMER_MAX_COUNT 0xffffffff Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Mon Mar 28 09:36:52 2016 (r297346) +++ head/sys/x86/include/specialreg.h Mon Mar 28 09:43:40 2016 (r297347) @@ -457,6 +457,7 @@ #define MSR_DRAM_ENERGY_STATUS 0x619 #define MSR_PP0_ENERGY_STATUS 0x639 #define MSR_PP1_ENERGY_STATUS 0x641 +#define MSR_TSC_DEADLINE 0x6e0 /* Writes are not serializing */ /* * VMX MSRs @@ -478,7 +479,8 @@ #define MSR_VMX_TRUE_ENTRY_CTLS 0x490 /* - * X2APIC MSRs + * X2APIC MSRs. + * Writes are not serializing. */ #define MSR_APIC_000 0x800 #define MSR_APIC_ID 0x802 From owner-svn-src-head@freebsd.org Mon Mar 28 09:52:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD094AE0382; Mon, 28 Mar 2016 09:52:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C73F19C7; Mon, 28 Mar 2016 09:52:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2S9qix0011535; Mon, 28 Mar 2016 09:52:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2S9qicL011534; Mon, 28 Mar 2016 09:52:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603280952.u2S9qicL011534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 28 Mar 2016 09:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297348 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 09:52:46 -0000 Author: kib Date: Mon Mar 28 09:52:44 2016 New Revision: 297348 URL: https://svnweb.freebsd.org/changeset/base/297348 Log: Use TSC deadline mode for LAPIC timer, when available. The mode fires LAPIC timer iinterrupt when TSC reaches the value written to the IA32_TSC_DEADLINE MSR. To arm or reset the timer in deadline mode, a single non-serializing MSR write is enough. This is an advance from the one-shot mode of LAPIC, where timer operated with the FSB frequency and required two (serialized in case of xAPIC) writes to the APIC registers. The LVT_TIMER register value is cached to avoid unneeded writes in the deadline mode. Unused arguments to specify period (which is passed in struct lapic as la_timer_period) and interrupt enable (which is always enabled) are removed from lapic_timer_{oneshot,periodic,deadline} functions. Instead, special lapic_timer_oneshot_nointr() function for interrupt-less one-shot calibration is added. Reviewed by: mav (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D5738 Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Mar 28 09:43:40 2016 (r297347) +++ head/sys/x86/x86/local_apic.c Mon Mar 28 09:52:44 2016 (r297348) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -94,6 +95,13 @@ CTASSERT(IPI_STOP < APIC_SPURIOUS_INT); #define IRQ_DTRACE_RET (NUM_IO_INTS + 3) #define IRQ_EVTCHN (NUM_IO_INTS + 4) +enum lat_timer_mode { + LAT_MODE_UNDEF = 0, + LAT_MODE_PERIODIC = 1, + LAT_MODE_ONESHOT = 2, + LAT_MODE_DEADLINE = 3, +}; + /* * Support for local APICs. Local APICs manage interrupts on each * individual processor as opposed to I/O APICs which receive interrupts @@ -119,9 +127,10 @@ struct lapic { u_int la_cluster_id:2; u_int la_present:1; u_long *la_timer_count; - u_long la_timer_period; - u_int la_timer_mode; - uint32_t lvt_timer_cache; + uint64_t la_timer_period; + enum lat_timer_mode la_timer_mode; + uint32_t lvt_timer_base; + uint32_t lvt_timer_last; /* Include IDT_SYSCALL to make indexing easier. */ int la_ioint_irqs[APIC_NUM_IOINTS + 1]; } static lapics[MAX_APIC_ID + 1]; @@ -160,6 +169,7 @@ volatile char *lapic_map; vm_paddr_t lapic_paddr; int x2apic_mode; int lapic_eoi_suppression; +static int lapic_timer_tsc_deadline; static u_long lapic_timer_divisor; static struct eventtimer lapic_et; @@ -167,6 +177,8 @@ SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG SYSCTL_INT(_hw_apic, OID_AUTO, x2apic_mode, CTLFLAG_RD, &x2apic_mode, 0, ""); SYSCTL_INT(_hw_apic, OID_AUTO, eoi_suppression, CTLFLAG_RD, &lapic_eoi_suppression, 0, ""); +SYSCTL_INT(_hw_apic, OID_AUTO, timer_tsc_deadline, CTLFLAG_RD, + &lapic_timer_tsc_deadline, 0, ""); static uint32_t lapic_read32(enum LAPIC_REGISTERS reg) @@ -256,10 +268,10 @@ native_lapic_enable_x2apic(void) static void lapic_enable(void); static void lapic_resume(struct pic *pic, bool suspend_cancelled); -static void lapic_timer_oneshot(struct lapic *, - u_int count, int enable_int); -static void lapic_timer_periodic(struct lapic *, - u_int count, int enable_int); +static void lapic_timer_oneshot(struct lapic *); +static void lapic_timer_oneshot_nointr(struct lapic *, uint32_t); +static void lapic_timer_periodic(struct lapic *); +static void lapic_timer_deadline(struct lapic *); static void lapic_timer_stop(struct lapic *); static void lapic_timer_set_divisor(u_int divisor); static uint32_t lvt_mode(struct lapic *la, u_int pin, uint32_t value); @@ -450,7 +462,14 @@ native_lapic_init(vm_paddr_t addr) if (!arat) { lapic_et.et_flags |= ET_FLAGS_C3STOP; lapic_et.et_quality -= 200; + } else if ((cpu_feature & CPUID_TSC) != 0 && + (cpu_feature2 & CPUID2_TSCDLT) != 0 && + tsc_is_invariant && tsc_freq != 0) { + lapic_timer_tsc_deadline = 1; + TUNABLE_INT_FETCH("hw.lapic_tsc_deadline", + &lapic_timer_tsc_deadline); } + lapic_et.et_frequency = 0; /* We don't know frequency yet, so trying to guess. */ lapic_et.et_min_period = 0x00001000LL; @@ -604,23 +623,34 @@ native_lapic_setup(int boot) } /* Program timer LVT and setup handler. */ - la->lvt_timer_cache = lvt_mode(la, APIC_LVT_TIMER, + la->lvt_timer_base = lvt_mode(la, APIC_LVT_TIMER, lapic_read32(LAPIC_LVT_TIMER)); - lapic_write32(LAPIC_LVT_TIMER, la->lvt_timer_cache); + la->lvt_timer_last = la->lvt_timer_base; + lapic_write32(LAPIC_LVT_TIMER, la->lvt_timer_base); if (boot) { snprintf(buf, sizeof(buf), "cpu%d:timer", PCPU_GET(cpuid)); intrcnt_add(buf, &la->la_timer_count); } /* Setup the timer if configured. */ - if (la->la_timer_mode != 0) { + if (la->la_timer_mode != LAT_MODE_UNDEF) { KASSERT(la->la_timer_period != 0, ("lapic%u: zero divisor", lapic_id())); lapic_timer_set_divisor(lapic_timer_divisor); - if (la->la_timer_mode == 1) - lapic_timer_periodic(la, la->la_timer_period, 1); - else - lapic_timer_oneshot(la, la->la_timer_period, 1); + switch (la->la_timer_mode) { + case LAT_MODE_PERIODIC: + lapic_timer_periodic(la); + break; + case LAT_MODE_ONESHOT: + lapic_timer_oneshot(la); + break; + case LAT_MODE_DEADLINE: + lapic_timer_deadline(la); + break; + default: + panic("corrupted la_timer_mode %p %d", la, + la->la_timer_mode); + } } /* Program error LVT and clear any existing errors. */ @@ -722,46 +752,73 @@ native_lapic_disable_pmc(void) #endif } +static void +lapic_calibrate_initcount(struct eventtimer *et, struct lapic *la) +{ + u_long value; + + /* Start off with a divisor of 2 (power on reset default). */ + lapic_timer_divisor = 2; + /* Try to calibrate the local APIC timer. */ + do { + lapic_timer_set_divisor(lapic_timer_divisor); + lapic_timer_oneshot_nointr(la, APIC_TIMER_MAX_COUNT); + DELAY(1000000); + value = APIC_TIMER_MAX_COUNT - lapic_read32(LAPIC_CCR_TIMER); + if (value != APIC_TIMER_MAX_COUNT) + break; + lapic_timer_divisor <<= 1; + } while (lapic_timer_divisor <= 128); + if (lapic_timer_divisor > 128) + panic("lapic: Divisor too big"); + if (bootverbose) { + printf("lapic: Divisor %lu, Frequency %lu Hz\n", + lapic_timer_divisor, value); + } + et->et_frequency = value; +} + +static void +lapic_calibrate_deadline(struct eventtimer *et, struct lapic *la __unused) +{ + + et->et_frequency = tsc_freq; + if (bootverbose) { + printf("lapic: deadline tsc mode, Frequency %ju Hz\n", + (uintmax_t)et->et_frequency); + } +} + static int lapic_et_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { struct lapic *la; - u_long value; la = &lapics[PCPU_GET(apic_id)]; if (et->et_frequency == 0) { - /* Start off with a divisor of 2 (power on reset default). */ - lapic_timer_divisor = 2; - /* Try to calibrate the local APIC timer. */ - do { - lapic_timer_set_divisor(lapic_timer_divisor); - lapic_timer_oneshot(la, APIC_TIMER_MAX_COUNT, 0); - DELAY(1000000); - value = APIC_TIMER_MAX_COUNT - - lapic_read32(LAPIC_CCR_TIMER); - if (value != APIC_TIMER_MAX_COUNT) - break; - lapic_timer_divisor <<= 1; - } while (lapic_timer_divisor <= 128); - if (lapic_timer_divisor > 128) - panic("lapic: Divisor too big"); - if (bootverbose) - printf("lapic: Divisor %lu, Frequency %lu Hz\n", - lapic_timer_divisor, value); - et->et_frequency = value; + if (lapic_timer_tsc_deadline) + lapic_calibrate_deadline(et, la); + else + lapic_calibrate_initcount(et, la); et->et_min_period = (0x00000002LLU << 32) / et->et_frequency; et->et_max_period = (0xfffffffeLLU << 32) / et->et_frequency; } - if (la->la_timer_mode == 0) + if (la->la_timer_mode == LAT_MODE_UNDEF) lapic_timer_set_divisor(lapic_timer_divisor); if (period != 0) { - la->la_timer_mode = 1; - la->la_timer_period = ((uint32_t)et->et_frequency * period) >> 32; - lapic_timer_periodic(la, la->la_timer_period, 1); + la->la_timer_mode = LAT_MODE_PERIODIC; + la->la_timer_period = ((uint32_t)et->et_frequency * period) >> + 32; + lapic_timer_periodic(la); + } else if (lapic_timer_tsc_deadline) { + la->la_timer_mode = LAT_MODE_DEADLINE; + la->la_timer_period = (et->et_frequency * first) >> 32; + lapic_timer_deadline(la); } else { - la->la_timer_mode = 2; - la->la_timer_period = ((uint32_t)et->et_frequency * first) >> 32; - lapic_timer_oneshot(la, la->la_timer_period, 1); + la->la_timer_mode = LAT_MODE_ONESHOT; + la->la_timer_period = ((uint32_t)et->et_frequency * first) >> + 32; + lapic_timer_oneshot(la); } return (0); } @@ -769,10 +826,11 @@ lapic_et_start(struct eventtimer *et, sb static int lapic_et_stop(struct eventtimer *et) { - struct lapic *la = &lapics[PCPU_GET(apic_id)]; + struct lapic *la; - la->la_timer_mode = 0; + la = &lapics[PCPU_GET(apic_id)]; lapic_timer_stop(la); + la->la_timer_mode = LAT_MODE_UNDEF; return (0); } @@ -1071,42 +1129,76 @@ lapic_timer_set_divisor(u_int divisor) } static void -lapic_timer_oneshot(struct lapic *la, u_int count, int enable_int) +lapic_timer_oneshot(struct lapic *la) { uint32_t value; - value = la->lvt_timer_cache; - value &= ~APIC_LVTT_TM; + value = la->lvt_timer_base; + value &= ~(APIC_LVTT_TM | APIC_LVT_M); value |= APIC_LVTT_TM_ONE_SHOT; - if (enable_int) - value &= ~APIC_LVT_M; + la->lvt_timer_last = value; lapic_write32(LAPIC_LVT_TIMER, value); - lapic_write32(LAPIC_ICR_TIMER, count); + lapic_write32(LAPIC_ICR_TIMER, la->la_timer_period); } static void -lapic_timer_periodic(struct lapic *la, u_int count, int enable_int) +lapic_timer_oneshot_nointr(struct lapic *la, uint32_t count) { uint32_t value; - value = la->lvt_timer_cache; + value = la->lvt_timer_base; value &= ~APIC_LVTT_TM; - value |= APIC_LVTT_TM_PERIODIC; - if (enable_int) - value &= ~APIC_LVT_M; + value |= APIC_LVTT_TM_ONE_SHOT | APIC_LVT_M; + la->lvt_timer_last = value; lapic_write32(LAPIC_LVT_TIMER, value); lapic_write32(LAPIC_ICR_TIMER, count); } static void -lapic_timer_stop(struct lapic *la) +lapic_timer_periodic(struct lapic *la) { uint32_t value; - value = la->lvt_timer_cache; - value &= ~APIC_LVTT_TM; - value |= APIC_LVT_M; + value = la->lvt_timer_base; + value &= ~(APIC_LVTT_TM | APIC_LVT_M); + value |= APIC_LVTT_TM_PERIODIC; + la->lvt_timer_last = value; lapic_write32(LAPIC_LVT_TIMER, value); + lapic_write32(LAPIC_ICR_TIMER, la->la_timer_period); +} + +static void +lapic_timer_deadline(struct lapic *la) +{ + uint32_t value; + + value = la->lvt_timer_base; + value &= ~(APIC_LVTT_TM | APIC_LVT_M); + value |= APIC_LVTT_TM_TSCDLT; + if (value != la->lvt_timer_last) { + la->lvt_timer_last = value; + lapic_write32_nofence(LAPIC_LVT_TIMER, value); + if (!x2apic_mode) + mfence(); + } + wrmsr(MSR_TSC_DEADLINE, la->la_timer_period + rdtsc()); +} + +static void +lapic_timer_stop(struct lapic *la) +{ + uint32_t value; + + if (la->la_timer_mode == LAT_MODE_DEADLINE) { + wrmsr(MSR_TSC_DEADLINE, 0); + mfence(); + } else { + value = la->lvt_timer_base; + value &= ~APIC_LVTT_TM; + value |= APIC_LVT_M; + la->lvt_timer_last = value; + lapic_write32(LAPIC_LVT_TIMER, value); + } } void From owner-svn-src-head@freebsd.org Mon Mar 28 11:32:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBDEFADE1F3; Mon, 28 Mar 2016 11:32:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F03614C1; Mon, 28 Mar 2016 11:32:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2SBWK2B039789; Mon, 28 Mar 2016 11:32:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SBWK4s039788; Mon, 28 Mar 2016 11:32:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201603281132.u2SBWK4s039788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 28 Mar 2016 11:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297349 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 11:32:21 -0000 Author: tuexen Date: Mon Mar 28 11:32:20 2016 New Revision: 297349 URL: https://svnweb.freebsd.org/changeset/base/297349 Log: Trigger sending of queued ASCONF chunks if outstanding ones are ACKED. MFC after: 1 week Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon Mar 28 09:52:44 2016 (r297348) +++ head/sys/netinet/sctp_input.c Mon Mar 28 11:32:20 2016 (r297349) @@ -6033,7 +6033,9 @@ trigger_send: if (!TAILQ_EMPTY(&stcb->asoc.control_send_queue)) { cnt_ctrl_ready = stcb->asoc.ctrl_queue_cnt - stcb->asoc.ecn_echo_cnt_onq; } - if (cnt_ctrl_ready || stcb->asoc.trigger_reset || + if (!TAILQ_EMPTY(&stcb->asoc.asconf_send_queue) || + cnt_ctrl_ready || + stcb->asoc.trigger_reset || ((un_sent) && (stcb->asoc.peers_rwnd > 0 || (stcb->asoc.peers_rwnd <= 0 && stcb->asoc.total_flight == 0)))) { From owner-svn-src-head@freebsd.org Mon Mar 28 11:51:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D857ADE72E; Mon, 28 Mar 2016 11:51:37 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9F421D79; Mon, 28 Mar 2016 11:51:36 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2SBpaPx045258; Mon, 28 Mar 2016 11:51:36 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SBpauN045257; Mon, 28 Mar 2016 11:51:36 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201603281151.u2SBpauN045257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Mon, 28 Mar 2016 11:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297350 - head/sys/dev/extres/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 11:51:37 -0000 Author: jmcneill Date: Mon Mar 28 11:51:35 2016 New Revision: 297350 URL: https://svnweb.freebsd.org/changeset/base/297350 Log: Pass clkdev_if methods through to parent device by default. Reviewed by: mmel, adrian (mentor) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5750 Modified: head/sys/dev/extres/clk/clkdev_if.m Modified: head/sys/dev/extres/clk/clkdev_if.m ============================================================================== --- head/sys/dev/extres/clk/clkdev_if.m Mon Mar 28 11:32:20 2016 (r297349) +++ head/sys/dev/extres/clk/clkdev_if.m Mon Mar 28 11:51:35 2016 (r297350) @@ -32,18 +32,66 @@ INTERFACE clkdev; CODE { #include + #include + static int + clkdev_default_write_4(device_t dev, bus_addr_t addr, uint32_t val) + { + device_t pdev; + + pdev = device_get_parent(dev); + if (pdev == NULL) + return (ENXIO); + + return (CLKDEV_WRITE_4(pdev, addr, val)); + } + + static int + clkdev_default_read_4(device_t dev, bus_addr_t addr, uint32_t *val) + { + device_t pdev; + + pdev = device_get_parent(dev); + if (pdev == NULL) + return (ENXIO); + + return (CLKDEV_READ_4(pdev, addr, val)); + } + + static int + clkdev_default_modify_4(device_t dev, bus_addr_t addr, + uint32_t clear_mask, uint32_t set_mask) + { + device_t pdev; + + pdev = device_get_parent(dev); + if (pdev == NULL) + return (ENXIO); + + return (CLKDEV_MODIFY_4(pdev, addr, clear_mask, set_mask)); + } + static void clkdev_default_device_lock(device_t dev) { + device_t pdev; - panic("clkdev_device_lock() is not implemented"); + pdev = device_get_parent(dev); + if (pdev == NULL) + panic("clkdev_device_lock not implemented"); + + CLKDEV_DEVICE_LOCK(pdev); } static void clkdev_default_device_unlock(device_t dev) { + device_t pdev; + + pdev = device_get_parent(dev); + if (pdev == NULL) + panic("clkdev_device_unlock not implemented"); - panic("clkdev_device_unlock() is not implemented"); + CLKDEV_DEVICE_UNLOCK(pdev); } } @@ -54,7 +102,7 @@ METHOD int write_4 { device_t dev; bus_addr_t addr; uint32_t val; -}; +} DEFAULT clkdev_default_write_4; # # Read single register @@ -63,7 +111,7 @@ METHOD int read_4 { device_t dev; bus_addr_t addr; uint32_t *val; -}; +} DEFAULT clkdev_default_read_4; # # Modify single register @@ -73,7 +121,7 @@ METHOD int modify_4 { bus_addr_t addr; uint32_t clear_mask; uint32_t set_mask; -}; +} DEFAULT clkdev_default_modify_4; # # Get exclusive access to underlying device From owner-svn-src-head@freebsd.org Mon Mar 28 12:44:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DFD7AE00FE; Mon, 28 Mar 2016 12:44:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 540B61BE0; Mon, 28 Mar 2016 12:44:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::ad9c:32e8:3e6c:1da3] (unknown [IPv6:2001:7b8:3a7:0:ad9c:32e8:3e6c:1da3]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id D3199253AA; Mon, 28 Mar 2016 14:44:26 +0200 (CEST) Subject: Re: svn commit: r297334 - head/sys/dev/vt/hw/vga Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_4A4E1015-3ECE-4706-86E0-E5719DED4FDB"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: <201603280736.u2S7as7a069198@repo.freebsd.org> Date: Mon, 28 Mar 2016 14:44:19 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <4DFDE838-6C66-4C61-A7D8-A8A78BBFD9A7@FreeBSD.org> References: <201603280736.u2S7as7a069198@repo.freebsd.org> To: Sepherosa Ziehau X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 12:44:30 -0000 --Apple-Mail=_4A4E1015-3ECE-4706-86E0-E5719DED4FDB Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 28 Mar 2016, at 09:36, Sepherosa Ziehau wrote: > > Author: sephe > Date: Mon Mar 28 07:36:54 2016 > New Revision: 297334 > URL: https://svnweb.freebsd.org/changeset/base/297334 > > Log: > vt: Use textmode when we're running on hypervisors > > The graphic mode is noticeably slow on hypervisors, especially > on Hyper-V (1 second to each line). > > Submitted by: Dexuan Cui > Reviewed by: kib, sephe, royger (early loader version) > MFC after: 1 week > Sponsored by: Microsoft OSTC > Differential Revision: https://reviews.freebsd.org/D5739 Ah yes, this is very nice, thanks. The graphical console was also *extremely* slow on VMware guests. It could take 15 minutes to reach the login prompt! That said, it would be still be interesting to see if it is possible to speed up the graphical console somehow. The Linux kernel can also use a graphical console, but it isn't nearly as slow as that of FreeBSD... -Dimitry --Apple-Mail=_4A4E1015-3ECE-4706-86E0-E5719DED4FDB Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.29 iEYEARECAAYFAlb5JykACgkQsF6jCi4glqM9nwCgjuW971jlGR+Q++GNxvRRey17 0ecAn2JLn5V8BZBMTCm7EBajV8igLIAF =JcsO -----END PGP SIGNATURE----- --Apple-Mail=_4A4E1015-3ECE-4706-86E0-E5719DED4FDB-- From owner-svn-src-head@freebsd.org Mon Mar 28 15:05:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FAB9AE039D; Mon, 28 Mar 2016 15:05:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38C011DEE; Mon, 28 Mar 2016 15:05:01 +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 u2SF50Pb005806; Mon, 28 Mar 2016 15:05:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SF50JE005805; Mon, 28 Mar 2016 15:05:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603281505.u2SF50JE005805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 28 Mar 2016 15:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297351 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 15:05:01 -0000 Author: kib Date: Mon Mar 28 15:05:00 2016 New Revision: 297351 URL: https://svnweb.freebsd.org/changeset/base/297351 Log: Do not load LAPIC_DCR_TIMER with an undefined value. If we are in the deadline mode the divide configuration is not used and lapic_timer_divisor is not set. Reported by: dhw, mav Tested by: mav Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Mar 28 11:51:35 2016 (r297350) +++ head/sys/x86/x86/local_apic.c Mon Mar 28 15:05:00 2016 (r297351) @@ -636,12 +636,13 @@ native_lapic_setup(int boot) if (la->la_timer_mode != LAT_MODE_UNDEF) { KASSERT(la->la_timer_period != 0, ("lapic%u: zero divisor", lapic_id())); - lapic_timer_set_divisor(lapic_timer_divisor); switch (la->la_timer_mode) { case LAT_MODE_PERIODIC: + lapic_timer_set_divisor(lapic_timer_divisor); lapic_timer_periodic(la); break; case LAT_MODE_ONESHOT: + lapic_timer_set_divisor(lapic_timer_divisor); lapic_timer_oneshot(la); break; case LAT_MODE_DEADLINE: @@ -803,9 +804,9 @@ lapic_et_start(struct eventtimer *et, sb et->et_min_period = (0x00000002LLU << 32) / et->et_frequency; et->et_max_period = (0xfffffffeLLU << 32) / et->et_frequency; } - if (la->la_timer_mode == LAT_MODE_UNDEF) - lapic_timer_set_divisor(lapic_timer_divisor); if (period != 0) { + if (la->la_timer_mode == LAT_MODE_UNDEF) + lapic_timer_set_divisor(lapic_timer_divisor); la->la_timer_mode = LAT_MODE_PERIODIC; la->la_timer_period = ((uint32_t)et->et_frequency * period) >> 32; @@ -815,6 +816,8 @@ lapic_et_start(struct eventtimer *et, sb la->la_timer_period = (et->et_frequency * first) >> 32; lapic_timer_deadline(la); } else { + if (la->la_timer_mode == LAT_MODE_UNDEF) + lapic_timer_set_divisor(lapic_timer_divisor); la->la_timer_mode = LAT_MODE_ONESHOT; la->la_timer_period = ((uint32_t)et->et_frequency * first) >> 32; From owner-svn-src-head@freebsd.org Mon Mar 28 16:48:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7512AAE04AC; Mon, 28 Mar 2016 16:48:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32B0C1BBB; Mon, 28 Mar 2016 16:48:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2SGmUfI037272; Mon, 28 Mar 2016 16:48:30 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SGmTAC037259; Mon, 28 Mar 2016 16:48:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603281648.u2SGmTAC037259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 28 Mar 2016 16:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297355 - in head: bin/freebsd-version lib/libc/stdio lib/libc/sys lib/libfetch sbin/atm/atmconfig share/man/man4 share/man/man5 share/man/man7 share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 16:48:31 -0000 Author: trasz Date: Mon Mar 28 16:48:28 2016 New Revision: 297355 URL: https://svnweb.freebsd.org/changeset/base/297355 Log: Fix bunch of .Xrs. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/bin/freebsd-version/freebsd-version.1 head/lib/libc/stdio/open_memstream.3 head/lib/libc/sys/ptrace.2 head/lib/libfetch/fetch.3 head/sbin/atm/atmconfig/atmconfig.8 head/share/man/man4/cyapa.4 head/share/man/man4/ddb.4 head/share/man/man4/pcm.4 head/share/man/man4/sppp.4 head/share/man/man4/vxlan.4 head/share/man/man5/periodic.conf.5 head/share/man/man7/ports.7 head/share/man/man9/netisr.9 Modified: head/bin/freebsd-version/freebsd-version.1 ============================================================================== --- head/bin/freebsd-version/freebsd-version.1 Mon Mar 28 16:25:07 2016 (r297354) +++ head/bin/freebsd-version/freebsd-version.1 Mon Mar 28 16:48:28 2016 (r297355) @@ -110,8 +110,7 @@ env ROOT=/mnt /mnt/bin/freebsd-version - .Ed .Sh SEE ALSO .Xr uname 1 , -.Xr loader.conf 5 , -.Xr freebsd-version 8 +.Xr loader.conf 5 .Sh HISTORY The .Nm Modified: head/lib/libc/stdio/open_memstream.3 ============================================================================== --- head/lib/libc/stdio/open_memstream.3 Mon Mar 28 16:25:07 2016 (r297354) +++ head/lib/libc/stdio/open_memstream.3 Mon Mar 28 16:48:28 2016 (r297355) @@ -144,8 +144,8 @@ Memory for the stream or buffer could no .Xr fopen 3 , .Xr free 3 , .Xr fseek 3 , -.Xr sbuf 3 , -.Xr stdio 3 +.Xr stdio 3 , +.Xr sbuf 9 .Sh STANDARDS The .Fn open_memstream Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Mon Mar 28 16:25:07 2016 (r297354) +++ head/lib/libc/sys/ptrace.2 Mon Mar 28 16:48:28 2016 (r297355) @@ -103,7 +103,7 @@ be ignored. If the child was created by .Xr vfork 2 system call or -.Xr rfork(2) +.Xr rfork 2 call with the .Dv RFMEM flag specified, the debugging events are reported to the parent Modified: head/lib/libfetch/fetch.3 ============================================================================== --- head/lib/libfetch/fetch.3 Mon Mar 28 16:25:07 2016 (r297354) +++ head/lib/libfetch/fetch.3 Mon Mar 28 16:48:28 2016 (r297355) @@ -724,7 +724,6 @@ SSL_CA_CERT_FILE=/path/to/myca.pem .Ed .Sh SEE ALSO .Xr fetch 1 , -.Xr ftpio 3 , .Xr ip 4 .Rs .%A J. Postel Modified: head/sbin/atm/atmconfig/atmconfig.8 ============================================================================== --- head/sbin/atm/atmconfig/atmconfig.8 Mon Mar 28 16:25:07 2016 (r297354) +++ head/sbin/atm/atmconfig/atmconfig.8 Mon Mar 28 16:48:28 2016 (r297355) @@ -313,7 +313,6 @@ List all NATM routes. .El .Sh SEE ALSO .Xr natm 4 , -.Xr natmip 4 , -.Xr atm 8 +.Xr natmip 4 .Sh AUTHORS .An Hartmut Brandt Aq Mt harti@FreeBSD.org Modified: head/share/man/man4/cyapa.4 ============================================================================== --- head/share/man/man4/cyapa.4 Mon Mar 28 16:25:07 2016 (r297354) +++ head/share/man/man4/cyapa.4 Mon Mar 28 16:48:28 2016 (r297355) @@ -175,9 +175,9 @@ file: .Dl debug.cyapa_enable_tapclick=2 .Sh SEE ALSO .Xr ig4 4 , -.Xr moused 4 , .Xr smbus 4 , -.Xr sysmouse 4 +.Xr sysmouse 4 , +.Xr moused 8 .Sh AUTHORS .An -nosplit The original Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Mon Mar 28 16:25:07 2016 (r297354) +++ head/share/man/man4/ddb.4 Mon Mar 28 16:48:28 2016 (r297355) @@ -1132,7 +1132,7 @@ abbreviations. .Nm supports a basic output capture facility, which can be used to retrieve the results of debugging commands from userspace using -.Xr sysctl 2 . +.Xr sysctl 3 . .Ic capture on enables output capture; .Ic capture off Modified: head/share/man/man4/pcm.4 ============================================================================== --- head/share/man/man4/pcm.4 Mon Mar 28 16:25:07 2016 (r297354) +++ head/share/man/man4/pcm.4 Mon Mar 28 16:48:28 2016 (r297355) @@ -233,7 +233,7 @@ Most bridge device drivers are still mis support, but in most cases this should be trivial to implement. Use the .Va dev.pcm.%d.[play|rec].vchanformat -.Xr sysctl(8) +.Xr sysctl 8 to adjust the number of channels used. The current multichannel interleaved structure and arrangement was implemented by inspecting various popular UNIX applications. Modified: head/share/man/man4/sppp.4 ============================================================================== --- head/share/man/man4/sppp.4 Mon Mar 28 16:25:07 2016 (r297354) +++ head/share/man/man4/sppp.4 Mon Mar 28 16:48:28 2016 (r297355) @@ -175,7 +175,6 @@ take place. .Sh SEE ALSO .Xr inet 4 , .Xr intro 4 , -.Xr ppp 4 , .Xr ifconfig 8 , .Xr spppcontrol 8 .Rs Modified: head/share/man/man4/vxlan.4 ============================================================================== --- head/share/man/man4/vxlan.4 Mon Mar 28 16:25:07 2016 (r297354) +++ head/share/man/man4/vxlan.4 Mon Mar 28 16:48:28 2016 (r297355) @@ -217,9 +217,9 @@ interface can be configured with .Sh SEE ALSO .Xr inet 4 , .Xr inet6 4 , +.Xr vlan 4 , .Xr ifconfig 8 , -.Xr sysctl 8 , -.Xr vlan 8 +.Xr sysctl 8 .Rs .%A "M. Mahalingam" .%A "et al" Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Mon Mar 28 16:25:07 2016 (r297354) +++ head/share/man/man5/periodic.conf.5 Mon Mar 28 16:48:28 2016 (r297355) @@ -617,7 +617,7 @@ Weekly counterpart of Set to .Dq Li YES if you want to use -.Xr pkg_version 1 +.Xr pkg-version 8 to list installed packages which are out of date. .It Va pkg_version .Pq Vt str @@ -628,7 +628,7 @@ is set to this variable specifies the program that is used to determine the out of date packages. If unset, the -.Xr pkg_version 1 +.Xr pkg-version 8 program is used. As an example, this variable might be set to .Dq Li portversion @@ -642,7 +642,7 @@ This variable specifies the file from .Pa /usr/ports that should be used by -.Xr pkg_version 1 . +.Xr pkg-version 8 . Because the dependency tree may be substantially different between versions of .Fx , there may be more than one @@ -975,7 +975,6 @@ is shared or distributed. .Xr msgs 1 , .Xr netstat 1 , .Xr nice 1 , -.Xr pkg_version 1 , .Xr login.conf 5 , .Xr rc.conf 5 , .Xr ac 8 , @@ -983,6 +982,7 @@ is shared or distributed. .Xr dump 8 , .Xr newsyslog 8 , .Xr periodic 8 , +.Xr pkg-version 8 , .Xr sendmail 8 .Sh HISTORY The Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Mon Mar 28 16:25:07 2016 (r297354) +++ head/share/man/man7/ports.7 Mon Mar 28 16:48:28 2016 (r297355) @@ -214,12 +214,12 @@ portion never recurses (this is perhaps a bug). .It Cm reinstall Use this to restore a port after using -.Xr pkg_delete 1 +.Xr pkg-delete 8 when you should have used .Cm deinstall . .It Cm deinstall Remove an installed port from the system, similar to -.Xr pkg_delete 1 . +.Xr pkg-delete 8 . .It Cm deinstall-all Remove all installed ports with the same .Va PKGORIGIN @@ -231,7 +231,7 @@ The package is a .Pa .tbz file that you can use to install the port on other machines with -.Xr pkg_add 1 . +.Xr pkg-add 8 . If the directory specified by .Va PACKAGES does not exist, the package will be put into the current directory. Modified: head/share/man/man9/netisr.9 ============================================================================== --- head/share/man/man9/netisr.9 Mon Mar 28 16:25:07 2016 (r297354) +++ head/share/man/man9/netisr.9 Mon Mar 28 16:48:28 2016 (r297355) @@ -120,7 +120,7 @@ whose fields are defined as follows: .Bl -tag -width "netisr_handler_t nh_handler" .It Vt "const char *" Va nh_name Unique character string name of the protocol, which may be included in -.Xr sysctl 2 +.Xr sysctl 3 MIB names, so should not contain whitespace. .It Vt netisr_handler_t Va nh_handler Protocol handler function that will be invoked on each packet received for From owner-svn-src-head@freebsd.org Mon Mar 28 17:32:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E782AE12D3; Mon, 28 Mar 2016 17:32:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 371BD166A; Mon, 28 Mar 2016 17:32:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2SHWVQ9052699; Mon, 28 Mar 2016 17:32:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SHWVVZ052698; Mon, 28 Mar 2016 17:32:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201603281732.u2SHWVVZ052698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 28 Mar 2016 17:32:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297356 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 17:32:32 -0000 Author: imp Date: Mon Mar 28 17:32:31 2016 New Revision: 297356 URL: https://svnweb.freebsd.org/changeset/base/297356 Log: Support simple soft floating point abi for CPUTYPE in arm. Complex types to follow. Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Mon Mar 28 16:48:28 2016 (r297355) +++ head/share/mk/bsd.cpu.mk Mon Mar 28 17:32:31 2016 (r297356) @@ -108,21 +108,24 @@ _CPUCFLAGS = -march=${CPUTYPE} #XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself #_CPUCFLAGS = -mcpu=xscale _CPUCFLAGS = -march=armv5te -D__XSCALE__ -. elif ${CPUTYPE} == "armv6" +. elif ${CPUTYPE:M*soft*} != "" +_CPUCFLAGS = -mfloat-abi=softfp +. elif ${CPUTYPE} == "armv6" +# Not sure we still need ARM_ARCH_6=1 here. _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1 -. elif ${CPUTYPE} == "cortexa" +. elif ${CPUTYPE} == "cortexa" _CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp -. elif ${CPUTYPE:Marmv[4567]*} != "" +. elif ${CPUTYPE:Marmv[4567]*} != "" # Handle all the armvX types that FreeBSD runs: # armv4, armv4t, armv5, armv5te, armv6, armv6t2, armv7, armv7-a, armv7ve # they require -march=. All the others require -mcpu=. _CPUCFLAGS = -march=${CPUTYPE} -. else +. else # Common values for FreeBSD -# arm: +# arm: (any arm v4 or v5 processor you are targetting) # arm920t, arm926ej-s, marvell-pj4, fa526, fa626, # fa606te, fa626te, fa726te -# armv6: +# armv6: (any arm v7 or v8 processor you are targetting and the arm1176jzf-s) # arm1176jzf-s, generic-armv7-a, cortex-a5, cortex-a7, cortex-a8, # cortex-a9, cortex-a12, cortex-a15, cortex-a17, cortex-a53, cortex-a57, # cortex-a72, exynos-m1 From owner-svn-src-head@freebsd.org Mon Mar 28 17:42:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A1B9AE152F; Mon, 28 Mar 2016 17:42:16 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8ACF1B9F; Mon, 28 Mar 2016 17:42:15 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2SHgFV1055884; Mon, 28 Mar 2016 17:42:15 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SHgFgN055883; Mon, 28 Mar 2016 17:42:15 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201603281742.u2SHgFgN055883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Mon, 28 Mar 2016 17:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297357 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 17:42:16 -0000 Author: wblock (doc committer) Date: Mon Mar 28 17:42:14 2016 New Revision: 297357 URL: https://svnweb.freebsd.org/changeset/base/297357 Log: Replace "user land", which, for any definition of the word "user", sounds like some kind of horrific theme park. "Hey kids, want to go to User Land?" "No! We'll be good!" The obvious replacement is "userland", a compound word replete with term-of-art meaning and just a hint of cautionary tale. The alternate terms "flugelhorn" and "bullfrog", while also good, are less well-known and were voted down in committee. MFC after: 1 week Modified: head/share/man/man7/hier.7 Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Mon Mar 28 17:32:31 2016 (r297356) +++ head/share/man/man7/hier.7 Mon Mar 28 17:42:14 2016 (r297357) @@ -546,7 +546,7 @@ Chinese translations of documents in /us .It Pa examples/ various examples for users and programmers .It Pa firmware/ -Firmware images loaded by user land programs +Firmware images loaded by userland programs .It Pa games/ ASCII text files used by various games .It Pa groff_font/ From owner-svn-src-head@freebsd.org Mon Mar 28 17:55:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AEC8AE17EA; Mon, 28 Mar 2016 17:55:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id F054313AE; Mon, 28 Mar 2016 17:55:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id E851A1460; Mon, 28 Mar 2016 17:55:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 999091D9EC; Mon, 28 Mar 2016 17:55:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id W0tP9qHHAGxr; Mon, 28 Mar 2016 17:55:48 +0000 (UTC) Subject: Re: svn commit: r297357 - head/share/man/man7 DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 06D911D9E6 To: Warren Block , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603281742.u2SHgFgN055883@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <56F97023.6010908@FreeBSD.org> Date: Mon, 28 Mar 2016 10:55:47 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <201603281742.u2SHgFgN055883@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 17:55:51 -0000 On 3/28/16 10:42 AM, Warren Block wrote: > Author: wblock (doc committer) > Date: Mon Mar 28 17:42:14 2016 > New Revision: 297357 > URL: https://svnweb.freebsd.org/changeset/base/297357 > > Log: > Replace "user land", which, for any definition of the word "user", > sounds like some kind of horrific theme park. "Hey kids, want to go to > User Land?" "No! We'll be good!" share/man/man4/iscsi_initiator.4:protocol standard, the user land companion is share/man/man9/kqueue.9:Using this function could leak user land resources if a process uses the -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Mon Mar 28 18:04:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8935AAE1AF4; Mon, 28 Mar 2016 18:04:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D9B71B3E; Mon, 28 Mar 2016 18:04:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2SI4msp080650 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 28 Mar 2016 21:04:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2SI4msp080650 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2SI4mop080649; Mon, 28 Mar 2016 21:04:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 28 Mar 2016 21:04:48 +0300 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297356 - head/share/mk Message-ID: <20160328180448.GL1741@kib.kiev.ua> References: <201603281732.u2SHWVVZ052698@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603281732.u2SHWVVZ052698@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 18:04:55 -0000 On Mon, Mar 28, 2016 at 05:32:31PM +0000, Warner Losh wrote: > -# armv6: > +# armv6: (any arm v7 or v8 processor you are targetting and the arm1176jzf-s) I think it would be useful to say there any arm v7 or v8 in aarch32 mode you are targetting ... > # arm1176jzf-s, generic-armv7-a, cortex-a5, cortex-a7, cortex-a8, > # cortex-a9, cortex-a12, cortex-a15, cortex-a17, cortex-a53, cortex-a57, > # cortex-a72, exynos-m1 From owner-svn-src-head@freebsd.org Mon Mar 28 18:25:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B74FAE011F; Mon, 28 Mar 2016 18:25:56 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1DD71964; Mon, 28 Mar 2016 18:25:55 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2SIPttk069260; Mon, 28 Mar 2016 18:25:55 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SIPtSI069259; Mon, 28 Mar 2016 18:25:55 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201603281825.u2SIPtSI069259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Mon, 28 Mar 2016 18:25:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297358 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 18:25:56 -0000 Author: gnn Date: Mon Mar 28 18:25:54 2016 New Revision: 297358 URL: https://svnweb.freebsd.org/changeset/base/297358 Log: Add ethertype reserved for network testing MFC after: 2 weeks Modified: head/sys/net/ethernet.h Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Mon Mar 28 17:42:14 2016 (r297357) +++ head/sys/net/ethernet.h Mon Mar 28 18:25:54 2016 (r297358) @@ -333,6 +333,7 @@ struct ether_vlan_header { #define ETHERTYPE_SLOW 0x8809 /* 802.3ad link aggregation (LACP) */ #define ETHERTYPE_PPP 0x880B /* PPP (obsolete by PPPoE) */ #define ETHERTYPE_HITACHI 0x8820 /* Hitachi Cable (Optoelectronic Systems Laboratory) */ +#define ETHERTYPE_TEST 0x8822 /* Network Conformance Testing */ #define ETHERTYPE_MPLS 0x8847 /* MPLS Unicast */ #define ETHERTYPE_MPLS_MCAST 0x8848 /* MPLS Multicast */ #define ETHERTYPE_AXIS 0x8856 /* Axis Communications AB proprietary bootstrap/config */ From owner-svn-src-head@freebsd.org Mon Mar 28 18:36:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63339AE03B0; Mon, 28 Mar 2016 18:36:38 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0136.outbound.protection.outlook.com [65.55.169.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A50651E12; Mon, 28 Mar 2016 18:36:36 +0000 (UTC) (envelope-from jtl@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-junipernetworks-onmicrosoft-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=a2LisWjCcrgrK+AJcJkMxVJo5UT1jyar4NdRPmDI+nM=; b=ncaH3X1qEKfAWWHiy7hP2FZGX1r8mDIxSH3h2HSWNQjsmwh4ppVBGbOBdzJmh5xVfAgJNnFgv30OnXxpzjbvej+IH7Enc24/y8HbCbA8pIawR63O69QgUiqeGc9GRLhIDtQLbiyONNc7+3g3SJgo4JGkK4DEFxCtAGceOujz9a0= Received: from BL2PR05CA0044.namprd05.prod.outlook.com (10.255.226.44) by BN3PR05MB2675.namprd05.prod.outlook.com (10.166.72.154) with Microsoft SMTP Server (TLS) id 15.1.447.15; Mon, 28 Mar 2016 18:36:30 +0000 Received: from BY2FFO11FD037.protection.gbl (2a01:111:f400:7c0c::101) by BL2PR05CA0044.outlook.office365.com (2a01:111:e400:c04::44) with Microsoft SMTP Server (TLS) id 15.1.447.15 via Frontend Transport; Mon, 28 Mar 2016 18:36:29 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=freebsd.org; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=freebsd.org; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning freebsd.org discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BY2FFO11FD037.mail.protection.outlook.com (10.1.14.222) with Microsoft SMTP Server (TLS) id 15.1.453.6 via Frontend Transport; Mon, 28 Mar 2016 18:36:29 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 28 Mar 2016 11:36:29 -0700 Received: from [172.29.32.74] (nmmanju-sslvpn-nc.jnpr.net [172.29.32.74]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u2SIaRA59026; Mon, 28 Mar 2016 11:36:27 -0700 (PDT) (envelope-from jtl@freebsd.org) User-Agent: Microsoft-MacOutlook/0.0.0.160212 Date: Mon, 28 Mar 2016 14:36:27 -0400 Subject: Re: svn commit: r297358 - head/sys/net From: "Jonathan T. Looney" Sender: Jonathan Looney To: "George V. Neville-Neil" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <351BC901-1C12-4A4C-9B69-46D14608B24D@juniper.net> Thread-Topic: svn commit: r297358 - head/sys/net References: <201603281825.u2SIPtSI069259@repo.freebsd.org> In-Reply-To: <201603281825.u2SIPtSI069259@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.19; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(24454002)(377454003)(189002)(199003)(586003)(87936001)(1220700001)(1096002)(2950100001)(2201001)(16796002)(92566002)(5001770100001)(77096005)(15975445007)(33656002)(106466001)(450100001)(107886002)(4001350100001)(50466002)(6806005)(2501003)(189998001)(105596002)(2906002)(47776003)(23676002)(86362001)(50986999)(76176999)(54356999)(19580405001)(19580395003)(83506001)(81166005)(82746002)(11100500001)(230700001)(83716003)(5820100001)(36756003)(104396002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR05MB2675; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD037; 1:1hT7Sg7ZeDduVdIgxcHwTa5dP2TJMVnn9bzFWCbEgkxCi8TdVTmhZ2esHzdCw55uDmVsD5oWQXoFtmRY6Tt3Xo6vbC+tai6T/p4bYVLWqhqVNOkq/4gqQL9Te7ysaW6/c4fomZhr6r3cz9ro6RQSTlHq2YJ/U1gHXlolc8rpaJ9r1vKrWRGLLvZwaUVt7vFWlxzRUsW+vAcPfJ2K7Ja94j1iobNoaQSuS9uldPj+j68mjrPlysKnYa7m7jQ/kLtYqhwjFF9Kc3mYm30UiM4iPKnuxRN5gk4e8h9H+InpDdXaTOKj1Y9m9KQ9Td12whgPlDbUSVL7FWdKk2eLqRbkYW00+Oj4rfDxLpEnW3p5++dr+0noxnsZACztshL750bb4wDkEnbF5cE6GfFUwf0J+Yx3FAASfXiZR5XIAUwnLWbNlY8TsO2wz451QAF17Z9j9KgTzSzO6r5ziwmiJDysZeyHRdPIYJ/Np/iihTkD79tptWmMO+IJyusDFFwZHxpo X-MS-Office365-Filtering-Correlation-Id: 176c5a19-690d-4d17-38b1-08d35737e0dc X-Microsoft-Exchange-Diagnostics: 1; BN3PR05MB2675; 2:5ioUtjpH59XLr+RFMWsfweXYpuPOPeQ/Nud7JromSHC6hwxtxWcuDja7iSzcc042bkdOUbhEN/T1BHPKrCy4rghOTMdUeAP3v6Uu1rAhpaSRVX6vVy7VjreeNspa6KWWO77qtYUqIOTsrjAu3zQU65SwMjJJhCDGM3/Wyqd+jCVXbXoGlqQzzqsSxX44unxP; 3:FiWBq4tvZFtOkxbxHYdToblo5phtOq4y9VQcNC2mKNF77NUQwhpnSfh2JIMKRcC3WqCA/HKnfg2ab/dffRxJA2fynie1OGvN9/HstdsBVk8BmFuRybJVwNJ2thKlkllQcvQcyHF12hXyFT/6WoUXVj2qFdGzjVDW2CLgFuBFf5HxopYO3DnJqiEgYBNJEYnji5QwMqpYtxXIGagMD/UCePWr5UWbD82fz7DfVFTA+so= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR05MB2675; X-Microsoft-Exchange-Diagnostics: 1; BN3PR05MB2675; 25:poCSXL+RufOhVzWJ1YN4FCOYrTMp+5p4U3POgkPdqC1X4+UAtXAyMFjHQPNnIngObpC+CKCyf1aJYM0lhHBTvE1uMcf91Dy9KhiGBWWJN1pg5NO43twUeiMTGmeXPGx4L6k7UNSDihJlzlFt7exl/ZBb2f63DFO9cF+Kv7NiWfFDME9z475Ugm90PvE/xNQe8EYwx94Oro79H/090kVqlf3gz50WGFZ04eDuEDtYSKlzsOZYWAAM1U2UPFqShzxHlVBCIM22qSaXOl+EunIPLSj/hhBpRRhIYY3lPsYvxEaSNMy+TeONEDnfI61TeG6gFOnWVvy474TqyYzHVUJPgW8aaeTElMRLKQF4Zpx76S6r511v1UbMmGN4TpKxPT9zFe3aXm6Spl09sDOImRRpbS3OsjYp82/wnic5A6UHdZcXxEG4FPYUarjSbUexoVWqjlgLPsmNxgljKKTZhvghmHN4mvMpk7Edvv+dbmfw0QTPDD/VVhEarGWYnlbDv9OD2FzwJZqjsmMqztFPpOAshUy9bJrak9Qm7GndUGHs/lS+JKHuVMOpp/hwAA0SP+QmrTrCKfXaet+mXJ3TjEJjR9JjNdPVMxlCy9+5e8ocUaWe8Le+JOfLuRqkm4Fg/MbG X-JNPR-Received-From: outside X-Microsoft-Exchange-Diagnostics: 1; BN3PR05MB2675; 20:4LtUPm22z1vj3IXIeECWhNyuZ61yhlyXwwwM4MFxi5KtHQh+gqDr/RVvhPJ/LX0H0bZzOw3FqzYvLSB3jaAA3FngBbveKMpkIHi61+FvAFIReK3/eLjk8IlJ6RiIA/wfK6wFxTd20fP09N0YT57gjzWO+J141uQ3asybxns+2v5zr05+dHJhUVUW4ZLGETP9dyCYZoDbCmDPIR9mrFQxJJfnM5+dxck5/mKysT8fcUxizJNVm9rZAJVLjaQh0SMpv+K2W0wGHWgubCCkQTE2KJ9brE5Xo1jwsgcV8MCrdDrdBl9VdU9ae/xvIV0ms1foZlYkx2lOpybgLEHkApX+68hihP4mlrS2ZtMR9hFpGWU0ORTWgFblefrqE43pjBbwGrAF8C+8A+xqcJfoVdf0m3W4fHcOihzenWdlhZTradSG7SYPAoaIs1y88huNJjYiVvzkRKYmOMAYXrSIg9m81zVqcX5to08xCZBAZ2i0z1SEfK/GORsVw4IgRdOdA5BN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(13023025)(13024025)(13018025)(13015025)(8121501046)(5005006)(3002001)(10201501046); SRVR:BN3PR05MB2675; BCL:0; PCL:0; RULEID:; SRVR:BN3PR05MB2675; X-Microsoft-Exchange-Diagnostics: 1; BN3PR05MB2675; 4:bL8GvDjOj0I1dRI72bb1/x3B3IwdjHKJXfLewwbbYmVqSLCf7YKyfwqBEecIvmQ2m3Zse2KL1F8fYiaDzPWaOxJlwgm9Bq6KvA6oVgq1H2bED3Q9dMQTbK5gHWiZDML0SmtAdEJHJjb/NIa9qTIu4vKWMXc0fWctiohnwgKnZah7gb3PW6H3n6K1f5l0PjN+ds4tK6/40m0km4bjfPBK0I+Ih2mw6EIr3aW3OCFl2NA9bLg0reAs75/4TTszCydaYQ2ZlK7pajd35jsRGEdoe+ZlkxMXzy1moz6RPMli1vtlBk//yar/Nf4w+rflKwXywiXnPLU7eIlbZWVsFBZHoKUUGaFOqdhwyZh9x+Fj3WLeChBANiIkUMhcK6CLfZFWqCAiGypWJkDhHj+jy/uwx4DoKzcjMsRQjc4iC1cr2bgUEj+nsEJWVEELWQ1HypwPdQyMpi9In/SFrnGYVB43mg== X-Forefront-PRVS: 0895DF8FFD X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjNQUjA1TUIyNjc1OzIzOmV0WWZvMzFQZFdPMG92TEc2cW40RGpCSUZn?= =?utf-8?B?bTUxNFVSVldxbzhNR1YwVFpROXlUZTk4RVA4OXBKWUtSUkQ4RHpQcm4rWlFq?= =?utf-8?B?eHVlMTFXaFBvcUF0UG90RXlVa2ViL3diTzRVK1orUWdWSjI4dUJxUWRQWTZU?= =?utf-8?B?L3NGMEllbmRPakpHTFdoZ1kvYSsyeUptaVJidGRTVXAvM2o2UFV2TTJsVDNl?= =?utf-8?B?MDQyVjh4S1hGOFVHVndqVlZUM3E0ek91SHBTVzhkRi94NWZDWVliL2ZlcTBt?= =?utf-8?B?L0h3UDg5MWoraENmOFhSVWNVMStCWUVCR2NvbW1BMllmb0ZGa0FvQm1xN3ZG?= =?utf-8?B?Sm1QamRZczdhLzUvVmxWM0F3ajMyMXdJUDVXNDNQbVdDV0hZR2oxNlJxa0No?= =?utf-8?B?bmpWVmtmR2JKbkNQNHMvU3A3NDVJVTE2dlhGbDVJMmJoUng2NytweTVTTi82?= =?utf-8?B?MUxUVkNsWkV1V2NXV04vOW5zMm9rNW9BMEhubXlQRy9LZkxqYTFqT3AzdHps?= =?utf-8?B?NGhyZ09pY1U0QUlBSkJKRWplUHVzQ1dTNHlSMGRjMFFhaDFkY29zOWpBV0JN?= =?utf-8?B?NW5LWW9HRnhzMFU0ZmZCV3Q3VlVrN2VhUGJSeW5mQ1RleVh5UmN1WEQzVXJE?= =?utf-8?B?VjhuaXYzaVFEU29Ka3RnTGdCYVZ6UW56MjlKdDJRU1F2TDVPUWFmc3JEZ1ZQ?= =?utf-8?B?Sm9ZdEhHQ0Jsb2N6MG40MkdacExXWTBScWVQdHV0cmFIRjUwUnhEZ3FQcXpq?= =?utf-8?B?cndaZTFpSHlaODQzenZlTys5NVFPMlhEZENic0F2RE4vQUwvV09OMUFSN3RF?= =?utf-8?B?V1N2WTQ3TlFKSXVGR2Rka05hNjVwN1ludWZRUXFDL1pRK21neW9xL1RTKzM5?= =?utf-8?B?MFVMVDJ0UmE2aThSQjBzdVFRQlRhL1BDZ0wwVGNJRS9aVEhES2ppeFpKU2c5?= =?utf-8?B?SFo1UkhYN2NQUGxxMGVkamdvNmcwVmJ4N2JwbUM2d2l3NkxZMC9JbVVGeEpO?= =?utf-8?B?QjIySldBc2ZKRG1PY1NFc3RPTlRtWW5BUGl2aXlPaWNneWIyMHZIV1dkd2dQ?= =?utf-8?B?a2NXSnJzWWpncldhUXQ4MzBvTTZ6WGttTmN0NkNpNGVCZHlWRWl2NUtxNWZj?= =?utf-8?B?cHdkQTlWcE9iQy9pb25hVWlWb3ROMVV5SmFaMjJzbFd4bHQ5QWV2a3hPYjVQ?= =?utf-8?B?RUVDT3d5LzhQMkczNUpRUDR3RzVOSWh3UXdrTThHblhYbkl3Mm5MOU4wZzc5?= =?utf-8?B?QjVhc0VJYVQxUU1WVE9OeSttMHVHem14TEpEeDY4cmVoNTBLZHc3K211UEsw?= =?utf-8?B?TitOakozNi9tR1NXdngwM1Y0V2hQdTlqMUtSYmpnNktVNnUzclVMRkxmZ043?= =?utf-8?B?aFI1MWV5Y29JVDlVUWJlWGczcVFFK21iSkQwUUgxWmdSUTVVa0tuR3pJdWtu?= =?utf-8?B?bUJiV09Jd0NuVytCQ09iMFRDTnVaWlN5N25sNXA3QlBDdzR6ZU1KQWlMRitK?= =?utf-8?B?YlQ3eEI2TnFlUFhxTkwrV3BVQ3BndytvMUVmRk1pUWNHOVBJcFBmR2JIRm5O?= =?utf-8?Q?XCsdt/wRkOyP6Ts/gBduHUXv6tiSz7dGmoDPM/ZoqKiA=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR05MB2675; 5:YH2+MeMaZq3toW7PrpCLZEDvofwVa96hSg5ckMjk+XOQ6YP+ZxoWQJQSpoelxygTd66MosBOYbu+89JU4Tz2w9crVfDcSG0AdAA3QYAb+g/uP5TpbNG5s0NjFBC30la2m18qIxGW9NsP+W0DJsgnHA==; 24:Je9XjzbQniEGsrSVcEFxoxoO/KKYKg4X/uwj+jJ7OC276hFtXwysZyRDgUJow2fIStQ5q31ja6mjL3UXESijQ1R2BG/6taPiCnBNnQSSqwE= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2016 18:36:29.4378 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR05MB2675 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 18:36:38 -0000 On 3/28/16, 2:25 PM, "owner-src-committers@freebsd.org on behalf of George V. Neville-Neil" wrote: >Author: gnn >Date: Mon Mar 28 18:25:54 2016 >New Revision: 297358 >URL: https://svnweb.freebsd.org/changeset/base/297358 > >Log: > Add ethertype reserved for network testing > > MFC after: 2 weeks > >Modified: > head/sys/net/ethernet.h > >Modified: head/sys/net/ethernet.h >============================================================================== >--- head/sys/net/ethernet.h Mon Mar 28 17:42:14 2016 (r297357) >+++ head/sys/net/ethernet.h Mon Mar 28 18:25:54 2016 (r297358) >@@ -333,6 +333,7 @@ struct ether_vlan_header { > #define ETHERTYPE_SLOW 0x8809 /* 802.3ad link aggregation (LACP) */ > #define ETHERTYPE_PPP 0x880B /* PPP (obsolete by PPPoE) */ > #define ETHERTYPE_HITACHI 0x8820 /* Hitachi Cable (Optoelectronic Systems Laboratory) */ >+#define ETHERTYPE_TEST 0x8822 /* Network Conformance Testing */ > #define ETHERTYPE_MPLS 0x8847 /* MPLS Unicast */ > #define ETHERTYPE_MPLS_MCAST 0x8848 /* MPLS Multicast */ > #define ETHERTYPE_AXIS 0x8856 /* Axis Communications AB proprietary bootstrap/config */ The IEEE registry shows this Ethertype as being allocated to Wind River Systems. Do we know that Wind River Systems has further allocated that to be used for network conformance testing? If not, I fear we could end up causing problems down the road. Jonathan From owner-svn-src-head@freebsd.org Mon Mar 28 18:41:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09B1AAE0717; Mon, 28 Mar 2016 18:41:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB6F8145D; Mon, 28 Mar 2016 18:41:49 +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 u2SIfm7e072737; Mon, 28 Mar 2016 18:41:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SIfmmS072736; Mon, 28 Mar 2016 18:41:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201603281841.u2SIfmmS072736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 28 Mar 2016 18:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297359 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 18:41:50 -0000 Author: jhb Date: Mon Mar 28 18:41:48 2016 New Revision: 297359 URL: https://svnweb.freebsd.org/changeset/base/297359 Log: Fix parsing of a 1GB page table entry. Use 'pdpe' to extract the PA of the 1GB page instead of 'pde' (which was a copy and paste bug from the 2MB page case further down). CID: 1341467 Reported by: pfg Modified: head/lib/libkvm/kvm_amd64.c Modified: head/lib/libkvm/kvm_amd64.c ============================================================================== --- head/lib/libkvm/kvm_amd64.c Mon Mar 28 18:25:54 2016 (r297358) +++ head/lib/libkvm/kvm_amd64.c Mon Mar 28 18:41:48 2016 (r297359) @@ -227,7 +227,7 @@ _amd64_vatop(kvm_t *kd, kvaddr_t va, off /* * No next-level page table; pdpe describes one 1GB page. */ - a = (pde & AMD64_PG_1GB_FRAME) + (va & AMD64_PDPMASK); + a = (pdpe & AMD64_PG_1GB_FRAME) + (va & AMD64_PDPMASK); s = _kvm_pa2off(kd, a, pa); if (s == 0) { _kvm_err(kd, kd->program, From owner-svn-src-head@freebsd.org Mon Mar 28 18:58:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C892DAE0C80; Mon, 28 Mar 2016 18:58:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A313011D2; Mon, 28 Mar 2016 18:58:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A06F7B977; Mon, 28 Mar 2016 14:58:20 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 Date: Mon, 28 Mar 2016 11:55:18 -0700 Message-ID: <2869679.kmLIC3GSQk@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160324090917.GC1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 28 Mar 2016 14:58:20 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 18:58:21 -0000 On Thursday, March 24, 2016 11:09:17 AM Konstantin Belousov wrote: > On Wed, Mar 23, 2016 at 02:21:59PM -0700, John Baldwin wrote: > > As you noted, the issue is if a timecounter needs locks (e.g. i8254) though > > outside of that I think the patch is great. :-/ Of course, if the TSC > > isn't advertised as invariant, DELAY() is talking to the timecounter > > directly as well. > > > > However, I think we probably can use the TSC. The only specific note I got > > from Ryan (cc'd) was about the TSC being unstable as a timecounter under KVM. > > That doesn't mean that the TSC is non-mononotic on a single vCPU. In fact, > > thinking about this more I have a different theory to explain how the TSC > > can be out of whack on different vCPUs even if the hardware TSC is in sync > > in the physical CPUs underneath. > In fact, if we can use TSC with the only requirement of being monotonic, > I do not see why do we need TSC at all. We can return to pre-r278325 > loop, but calibrate the number of loop iterations for known delay in > 1us, once on boot. Do you agree with this ? Yes, I think this is fine. What we really want is to be sure the minimum wait times aren't too low, but we just need to be reasonably close. > > One of the things present in the VCMS on Intel CPUs using VT-x is a TSC > > adjustment. The hypervisor can alter this TSC adjustment during a VM-exit to > > alter the offset between the TSC in the guest and the "real" TSC value in the > > physical CPU itself. One way a hypervisor might use this is to try to > > "pause" the TSC during a VM-exit by taking TSC timestamps at the start and > > end of a VM-exit and adding that delta to the TSC offset just before each > > VM-entry. However, if you have two vCPUs, one of which is running in the > > guest and one of which is handling a VM-exit in the hypervisor, the TSC on > > the first vCPU will run while the effective TSC of the second vCPU is paused. > > When the second vCPU resumes after a VM-entry, it's TSC will now "unpause", > > but it will lag the first vCPU by however long it took to handle its VM-exit. > > > > It wouldn't surprise me if KVM was doing this. bhyve does not do this to my > > knowledge (so the TSC is actually still usable as a timecounter under bhyve > > for some value of "usable"). However, even with this TSC pausing/unpausing, > > the TSC would still increase monotonically on a single vCPU. For the purposes > > of DELAY() (and other spin loops on a pinned thread such as in > > lapic_ipi_wait()), that is all you need. > BTW, Intel exported this mechanism to the non-VT environment as well, on > recent chips. So I would be not too surprised if SMM handlers start > 'compensate' for some long delays in near future. I think this is more to allow you to keep the TSCs in sync across cores more sanely by being able to adjust TSC_ADJ instead of trying to time a write to the TSC to apply an offset (which is racy). If it was targeted at SMM, it wouldn't be exposed to the host OS. I think Intel understands at this point that OS's want a synchronized TSC on bare metal for "cheap" timekeeping (at this point the TSC is more about that then about counting CPU "instructions"). I think your patch later in the thread looks fine. Most of the worry about older hardware with variable TSC's later in the thread is becoming less and less relevant. Intel hasn't shipped a CPU with a variable TSC in close to a decade now? Bruce's points about the hardcoded timeouts for things like mutxes are well founded. I'm not sure about how best to fix those however. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Mar 28 18:58:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0E52AE0CF8; Mon, 28 Mar 2016 18:58:41 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 896271337; Mon, 28 Mar 2016 18:58:41 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2SIwehT078713; Mon, 28 Mar 2016 18:58:40 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SIwegA078710; Mon, 28 Mar 2016 18:58:40 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201603281858.u2SIwegA078710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Mon, 28 Mar 2016 18:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297360 - in head/bin/sh: . tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 18:58:41 -0000 Author: jilles Date: Mon Mar 28 18:58:40 2016 New Revision: 297360 URL: https://svnweb.freebsd.org/changeset/base/297360 Log: sh: Fix use-after-free if a trap replaces itself. MFC after: 1 week Added: head/bin/sh/tests/builtins/trap17.0 (contents, props changed) Modified: head/bin/sh/tests/builtins/Makefile head/bin/sh/trap.c Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Mon Mar 28 18:41:48 2016 (r297359) +++ head/bin/sh/tests/builtins/Makefile Mon Mar 28 18:58:40 2016 (r297360) @@ -149,6 +149,7 @@ FILES+= trap13.0 FILES+= trap14.0 FILES+= trap15.0 FILES+= trap16.0 +FILES+= trap17.0 FILES+= trap2.0 FILES+= trap3.0 FILES+= trap4.0 Added: head/bin/sh/tests/builtins/trap17.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/trap17.0 Mon Mar 28 18:58:40 2016 (r297360) @@ -0,0 +1,10 @@ +# $FreeBSD$ +# This use-after-free bug probably needs non-default settings to show up. + +v1=nothing v2=nothing +trap 'trap "echo bad" USR1 +v1=trap_received +v2=trap_invoked +:' USR1 +kill -USR1 "$$" +[ "$v1.$v2" = trap_received.trap_invoked ] Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Mon Mar 28 18:41:48 2016 (r297359) +++ head/bin/sh/trap.c Mon Mar 28 18:58:40 2016 (r297360) @@ -412,6 +412,7 @@ onsig(int signo) void dotrap(void) { + struct stackmark smark; int i; int savestatus, prev_evalskip, prev_skipcount; @@ -445,7 +446,9 @@ dotrap(void) last_trapsig = i; savestatus = exitstatus; - evalstring(trap[i], 0); + setstackmark(&smark); + evalstring(stsavestr(trap[i]), 0); + popstackmark(&smark); /* * If such a command was not From owner-svn-src-head@freebsd.org Mon Mar 28 19:31:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CFB6AE1550; Mon, 28 Mar 2016 19:31:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3A1122D; Mon, 28 Mar 2016 19:31:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2SJVAK0088169; Mon, 28 Mar 2016 19:31:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SJVAnc088168; Mon, 28 Mar 2016 19:31:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201603281931.u2SJVAnc088168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 28 Mar 2016 19:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297361 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 19:31:11 -0000 Author: tuexen Date: Mon Mar 28 19:31:10 2016 New Revision: 297361 URL: https://svnweb.freebsd.org/changeset/base/297361 Log: Restrict local addresses until they are acked by the peer. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Mar 28 18:58:40 2016 (r297360) +++ head/sys/netinet/sctp_pcb.c Mon Mar 28 19:31:10 2016 (r297361) @@ -5357,6 +5357,7 @@ void sctp_add_local_addr_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa, uint32_t action) { struct sctp_laddr *laddr; + struct sctp_tcb *stcb; int fnd, error = 0; fnd = 0; @@ -5402,6 +5403,9 @@ sctp_add_local_addr_ep(struct sctp_inpcb default: break; } + LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { + sctp_add_local_addr_restricted(stcb, ifa); + } } return; } From owner-svn-src-head@freebsd.org Mon Mar 28 19:32:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FDB5AE1672; Mon, 28 Mar 2016 19:32:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 501181589; Mon, 28 Mar 2016 19:32:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2SJWDlJ090826; Mon, 28 Mar 2016 19:32:13 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SJWDNG090825; Mon, 28 Mar 2016 19:32:13 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201603281932.u2SJWDNG090825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 28 Mar 2016 19:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297362 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 19:32:14 -0000 Author: tuexen Date: Mon Mar 28 19:32:13 2016 New Revision: 297362 URL: https://svnweb.freebsd.org/changeset/base/297362 Log: Don't allow the user to set a peer primary which is restricted and not pending. MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Mon Mar 28 19:31:10 2016 (r297361) +++ head/sys/netinet/sctp_usrreq.c Mon Mar 28 19:32:13 2016 (r297362) @@ -5816,6 +5816,10 @@ sctp_setopt(struct socket *so, int optna __func__); continue; } + if ((sctp_is_addr_restricted(stcb, laddr->ifa)) && + (!sctp_is_addr_pending(stcb, laddr->ifa))) { + continue; + } if (laddr->ifa == ifa) { found = 1; break; From owner-svn-src-head@freebsd.org Mon Mar 28 19:51:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24E51AE1AD6; Mon, 28 Mar 2016 19:51:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id F2DDE1F6C; Mon, 28 Mar 2016 19:51:46 +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 u2SJpkNF094969; Mon, 28 Mar 2016 19:51:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SJpjS6094963; Mon, 28 Mar 2016 19:51:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603281951.u2SJpjS6094963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 28 Mar 2016 19:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297363 - in head: . sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 19:51:47 -0000 Author: emaste Date: Mon Mar 28 19:51:45 2016 New Revision: 297363 URL: https://svnweb.freebsd.org/changeset/base/297363 Log: simplify compile-time default keyboard map generation In r296926 the -P option was added to kbdcontrol, which enables this change for a simplified compile-time default keymap build process. PR: 193865 Reviewed by: Oliver Pinter Tested by: Oliver Pinter MFC After: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5708 Modified: head/Makefile.inc1 head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/conf/files.sparc64 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Mar 28 19:32:13 2016 (r297362) +++ head/Makefile.inc1 Mon Mar 28 19:51:45 2016 (r297363) @@ -1361,6 +1361,11 @@ _crunch= usr.sbin/crunch _awk= usr.bin/awk .endif +# r296926 -P keymap search path +.if ${BOOTSTRAPPING} < 1100103 +_kbdcontrol= usr.sbin/kbdcontrol +.endif + _yacc= lib/liby \ usr.bin/yacc @@ -1425,6 +1430,7 @@ bootstrap-tools: .PHONY ${_awk} \ ${_cat} \ ${_dd} \ + ${_kbdcontrol} \ usr.bin/lorder \ ${_libopenbsd} \ ${_makewhatis} \ Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Mar 28 19:32:13 2016 (r297362) +++ head/sys/conf/files.amd64 Mon Mar 28 19:51:45 2016 (r297363) @@ -50,12 +50,12 @@ font.h optional sc_dflt_font \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" # atkbdmap.h optional atkbd_dflt_keymap \ - compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${ATKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h; else echo Error: atkbd_dflt_keymap not found; exit 1; fi" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "atkbdmap.h" # ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${UKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h; else echo Error: ukbd_dflt_keymap not found; exit 1; fi" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Mar 28 19:32:13 2016 (r297362) +++ head/sys/conf/files.i386 Mon Mar 28 19:51:45 2016 (r297363) @@ -49,12 +49,12 @@ font.h optional sc_dflt_font \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" # atkbdmap.h optional atkbd_dflt_keymap \ - compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${ATKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h; else echo Error: atkbd_dflt_keymap not found; exit 1; fi" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "atkbdmap.h" # ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${UKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h; else echo Error: ukbd_dflt_keymap not found; exit 1; fi" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Mon Mar 28 19:32:13 2016 (r297362) +++ head/sys/conf/files.pc98 Mon Mar 28 19:51:45 2016 (r297363) @@ -46,7 +46,7 @@ svr4_assym.h optional compat_svr4 \ clean "svr4_assym.h" # ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${UKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h; else echo Error: ukbd_dflt_keymap not found; exit 1; fi" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Mon Mar 28 19:32:13 2016 (r297362) +++ head/sys/conf/files.sparc64 Mon Mar 28 19:51:45 2016 (r297363) @@ -8,17 +8,17 @@ # dependency lines other than the first are silently ignored. # atkbdmap.h optional atkbd_dflt_keymap \ - compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${ATKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h; else echo Error: atkbd_dflt_keymap not found; exit 1; fi" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "atkbdmap.h" # sunkbdmap.h optional sunkbd_dflt_keymap \ - compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${SUNKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${SUNKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > sunkbdmap.h; else echo Error: sunkbd_dflt_keymap not found; exit 1; fi" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${SUNKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > sunkbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "sunkbdmap.h" # ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${UKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h; else echo Error: ukbd_dflt_keymap not found; exit 1; fi" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # From owner-svn-src-head@freebsd.org Mon Mar 28 19:55:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5D25AE1C20; Mon, 28 Mar 2016 19:55:31 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93138127E; Mon, 28 Mar 2016 19:55:31 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2SJtUsa097296; Mon, 28 Mar 2016 19:55:30 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SJtUiq097294; Mon, 28 Mar 2016 19:55:30 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201603281955.u2SJtUiq097294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Mon, 28 Mar 2016 19:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297364 - in head/share/man: man4 man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 19:55:31 -0000 Author: wblock (doc committer) Date: Mon Mar 28 19:55:30 2016 New Revision: 297364 URL: https://svnweb.freebsd.org/changeset/base/297364 Log: Fix two more unhappy instances of "user land". Submitted by: bdrewery MFC after: 1 week Modified: head/share/man/man4/iscsi_initiator.4 head/share/man/man9/kqueue.9 Modified: head/share/man/man4/iscsi_initiator.4 ============================================================================== --- head/share/man/man4/iscsi_initiator.4 Mon Mar 28 19:51:45 2016 (r297363) +++ head/share/man/man4/iscsi_initiator.4 Mon Mar 28 19:55:30 2016 (r297364) @@ -57,7 +57,7 @@ instead. The .Nm implements the kernel side of the Internet SCSI (iSCSI) network -protocol standard, the user land companion is +protocol standard, the userland companion is .Xr iscontrol 8 , and permits access to remote .Em virtual Modified: head/share/man/man9/kqueue.9 ============================================================================== --- head/share/man/man9/kqueue.9 Mon Mar 28 19:51:45 2016 (r297363) +++ head/share/man/man9/kqueue.9 Mon Mar 28 19:55:30 2016 (r297364) @@ -372,7 +372,7 @@ The function will not be called, and the .Vt knote will not be returned on the next scan. -Using this function could leak user land resources if a process uses the +Using this function could leak userland resources if a process uses the .Vt knote to track resources. .Pp From owner-svn-src-head@freebsd.org Mon Mar 28 20:16:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F3DCAE1FF8; Mon, 28 Mar 2016 20:16:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B13A1B8D; Mon, 28 Mar 2016 20:16:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2SKGTps003352; Mon, 28 Mar 2016 20:16:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SKGT6H003349; Mon, 28 Mar 2016 20:16:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201603282016.u2SKGT6H003349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 28 Mar 2016 20:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297365 - in head/sys: dev/pccard kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 20:16:30 -0000 Author: imp Date: Mon Mar 28 20:16:29 2016 New Revision: 297365 URL: https://svnweb.freebsd.org/changeset/base/297365 Log: Move pccard_safe_quote() up to subr_bus.c and rename to devctl_safe_quote() so it can be used more generally. Modified: head/sys/dev/pccard/pccard.c head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/sys/dev/pccard/pccard.c ============================================================================== --- head/sys/dev/pccard/pccard.c Mon Mar 28 19:55:30 2016 (r297364) +++ head/sys/dev/pccard/pccard.c Mon Mar 28 20:16:29 2016 (r297365) @@ -1025,26 +1025,6 @@ pccard_child_location_str(device_t bus, return (0); } -/* XXX Maybe this should be in subr_bus? */ -static void -pccard_safe_quote(char *dst, const char *src, size_t len) -{ - char *walker = dst, *ep = dst + len - 1; - - if (len == 0) - return; - while (src != NULL && walker < ep) - { - if (*src == '"') { - if (ep - walker < 2) - break; - *walker++ = '\\'; - } - *walker++ = *src++; - } - *walker = '\0'; -} - static int pccard_child_pnpinfo_str(device_t bus, device_t child, char *buf, size_t buflen) @@ -1054,8 +1034,8 @@ pccard_child_pnpinfo_str(device_t bus, d struct pccard_softc *sc = PCCARD_SOFTC(bus); char cis0[128], cis1[128]; - pccard_safe_quote(cis0, sc->card.cis1_info[0], sizeof(cis0)); - pccard_safe_quote(cis1, sc->card.cis1_info[1], sizeof(cis1)); + devctl_safe_quote(cis0, sc->card.cis1_info[0], sizeof(cis0)); + devctl_safe_quote(cis1, sc->card.cis1_info[1], sizeof(cis1)); snprintf(buf, buflen, "manufacturer=0x%04x product=0x%04x " "cisvendor=\"%s\" cisproduct=\"%s\" function_type=%d", sc->card.manufacturer, sc->card.product, cis0, cis1, pf->function); Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Mar 28 19:55:30 2016 (r297364) +++ head/sys/kern/subr_bus.c Mon Mar 28 20:16:29 2016 (r297365) @@ -839,6 +839,38 @@ sysctl_devctl_queue(SYSCTL_HANDLER_ARGS) return (0); } +/** + * @brief safely quotes strings that might have double quotes in them. + * + * The devctl protocol relies on quoted strings having matching quotes. + * This routine quotes any internal quotes so the resulting string + * is safe to pass to snprintf to construct, for example pnp info strings. + * Strings are always terminated with a NUL, but may be truncated if longer + * than @p len bytes after quotes. + * + * @param dst Buffer to hold the string. Must be at least @p len bytes long + * @param src Original buffer. + * @param len Length of buffer pointed to by @dst, including trailing NUL + */ +void +devctl_safe_quote(char *dst, const char *src, size_t len) +{ + char *walker = dst, *ep = dst + len - 1; + + if (len == 0) + return; + while (src != NULL && walker < ep) + { + if (*src == '"') { + if (ep - walker < 2) + break; + *walker++ = '\\'; + } + *walker++ = *src++; + } + *walker = '\0'; +} + /* End of /dev/devctl code */ static TAILQ_HEAD(,device) bus_data_devices; Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Mon Mar 28 19:55:30 2016 (r297364) +++ head/sys/sys/bus.h Mon Mar 28 20:16:29 2016 (r297365) @@ -141,6 +141,7 @@ void devctl_notify(const char *__system, const char *__type, const char *__data); void devctl_queue_data_f(char *__data, int __flags); void devctl_queue_data(char *__data); +void devctl_safe_quote(char *__dst, const char *__src, size_t len); /** * Device name parsers. Hook to allow device enumerators to map From owner-svn-src-head@freebsd.org Mon Mar 28 20:37:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E05DDAE05E9; Mon, 28 Mar 2016 20:37:34 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AE570149B; Mon, 28 Mar 2016 20:37:34 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id u2SKbW16053234 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 28 Mar 2016 14:37:32 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id u2SKbWlu053231; Mon, 28 Mar 2016 14:37:32 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Mon, 28 Mar 2016 14:37:32 -0600 (MDT) From: Warren Block To: Bryan Drewery cc: Warren Block , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297357 - head/share/man/man7 In-Reply-To: <56F97023.6010908@FreeBSD.org> Message-ID: References: <201603281742.u2SHgFgN055883@repo.freebsd.org> <56F97023.6010908@FreeBSD.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Mon, 28 Mar 2016 14:37:32 -0600 (MDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 20:37:35 -0000 On Mon, 28 Mar 2016, Bryan Drewery wrote: > On 3/28/16 10:42 AM, Warren Block wrote: >> Author: wblock (doc committer) >> Date: Mon Mar 28 17:42:14 2016 >> New Revision: 297357 >> URL: https://svnweb.freebsd.org/changeset/base/297357 >> >> Log: >> Replace "user land", which, for any definition of the word "user", >> sounds like some kind of horrific theme park. "Hey kids, want to go to >> User Land?" "No! We'll be good!" > > share/man/man4/iscsi_initiator.4:protocol standard, the user land > companion is > share/man/man9/kqueue.9:Using this function could leak user land > resources if a process uses the Fixed in r297364: https://svnweb.freebsd.org/base?view=revision&revision=297364 Remaining instances appear to only be in source file comments or plain text files: find -X . -not -path "./.svn/*" -print | xargs grep -Hi 'user land' \ | cut -c 1-70 ./cddl/contrib/dtracetoolkit/Notes/ALLoverhead.txt: then perhaps this ./lib/libc/rpc/svc.c: * The storage is trivially management on the cal ./sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c: * user l ./sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c: * (curr ./sys/contrib/ipfilter/netinet/fil.c:/* compatible at the ABI for user ./sys/contrib/ipfilter/netinet/fil.c:/* it backward compatible at the ./sys/dev/atkbdc/psm.c: /* copy data to the user land */ ./sys/dev/atkbdc/psm.c: /* copy data from the user land */ ./sys/fs/ext2fs/ext2fs.h: * macros from user land. */ ./sys/gnu/fs/reiserfs/reiserfs_namei.c: /* Copy to user land */ ./sys/gnu/fs/reiserfs/reiserfs_namei.c: reiserfs_log(LOG_DEBUG, " ./sys/netinet/sctp.h: * Main SCTP chunk types we place these here so n ./sys/netinet6/raw_ip6.c: * Send RA/RS messages to user land for prot ./sys/netinet6/in6_var.h: * user land command(ifconfig) and daemon(rta ./sys/netipsec/key.c: * from a user land process, and return ./sys/netipsec/key.c: * This message is from user land. ./sys/netipsec/key.c: * application in user land. ./sys/netipsec/key.c: * a waiting application in user land. ./sys/netpfil/ipfw/dummynet.txt:The dummynet user land will format the The contrib software is usually better fixed by submitting upstream. Fixing the homegrown stuff would remove more than half of these. From owner-svn-src-head@freebsd.org Mon Mar 28 21:51:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72E17AE1672; Mon, 28 Mar 2016 21:51:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 446121D94; Mon, 28 Mar 2016 21:51:57 +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 u2SLpu9X031634; Mon, 28 Mar 2016 21:51:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SLpuva031633; Mon, 28 Mar 2016 21:51:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201603282151.u2SLpuva031633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 28 Mar 2016 21:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297366 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 21:51:57 -0000 Author: jhb Date: Mon Mar 28 21:51:56 2016 New Revision: 297366 URL: https://svnweb.freebsd.org/changeset/base/297366 Log: Don't start the random harvester process until timers are working. This is a no-op currently, but in kernels with earlier AP startup, the random kthread was trying to use timeouts with sleeps before timers are working. Wait until SI_SUB_KICK_SCHEDULER to start the random kproc. Reviewed by: delphij, imp, markm Approved by: so Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D5712 Modified: head/sys/dev/random/random_harvestq.c Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Mon Mar 28 20:16:29 2016 (r297365) +++ head/sys/dev/random/random_harvestq.c Mon Mar 28 21:51:56 2016 (r297366) @@ -183,7 +183,8 @@ random_kthread(void) /* NOTREACHED */ } /* This happens well after SI_SUB_RANDOM */ -SYSINIT(random_device_h_proc, SI_SUB_CREATE_INIT, SI_ORDER_ANY, kproc_start, &random_proc_kp); +SYSINIT(random_device_h_proc, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, kproc_start, + &random_proc_kp); /* * Run through all fast sources reading entropy for the given From owner-svn-src-head@freebsd.org Mon Mar 28 22:18:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62509AE1BB8; Mon, 28 Mar 2016 22:18:38 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 338E51CB4; Mon, 28 Mar 2016 22:18:38 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2SMIb26039731; Mon, 28 Mar 2016 22:18:37 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2SMIbs8039730; Mon, 28 Mar 2016 22:18:37 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201603282218.u2SMIbs8039730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 28 Mar 2016 22:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297367 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 22:18:38 -0000 Author: jamie Date: Mon Mar 28 22:18:37 2016 New Revision: 297367 URL: https://svnweb.freebsd.org/changeset/base/297367 Log: Move the various per-type arrays of OSD data into a single structure array. Modified: head/sys/kern/kern_osd.c Modified: head/sys/kern/kern_osd.c ============================================================================== --- head/sys/kern/kern_osd.c Mon Mar 28 21:51:56 2016 (r297366) +++ head/sys/kern/kern_osd.c Mon Mar 28 22:18:37 2016 (r297367) @@ -44,6 +44,23 @@ __FBSDID("$FreeBSD$"); /* OSD (Object Specific Data) */ +/* + * Lock key: + * (m) osd_module_lock + * (o) osd_object_lock + * (l) osd_list_lock + */ +struct osd_master { + struct sx osd_module_lock; + struct rmlock osd_object_lock; + struct mtx osd_list_lock; + LIST_HEAD(, osd) osd_list; /* (m) */ + osd_destructor_t *osd_destructors; /* (o) */ + osd_method_t *osd_methods; /* (m) */ + u_int osd_ntslots; /* (m) */ + const u_int osd_nmethods; +}; + static MALLOC_DEFINE(M_OSD, "osd", "Object Specific Data"); static int osd_debug = 0; @@ -61,25 +78,12 @@ static void do_osd_del(u_int type, struc int list_locked); /* - * Lists of objects with OSD. - * - * Lock key: - * (m) osd_module_lock - * (o) osd_object_lock - * (l) osd_list_lock + * List of objects with OSD. */ -static LIST_HEAD(, osd) osd_list[OSD_LAST + 1]; /* (m) */ -static osd_method_t *osd_methods[OSD_LAST + 1]; /* (m) */ -static u_int osd_nslots[OSD_LAST + 1]; /* (m) */ -static osd_destructor_t *osd_destructors[OSD_LAST + 1]; /* (o) */ -static const u_int osd_nmethods[OSD_LAST + 1] = { - [OSD_JAIL] = PR_MAXMETHOD, +struct osd_master osdm[OSD_LAST + 1] = { + [OSD_JAIL] = { .osd_nmethods = PR_MAXMETHOD }, }; -static struct sx osd_module_lock[OSD_LAST + 1]; -static struct rmlock osd_object_lock[OSD_LAST + 1]; -static struct mtx osd_list_lock[OSD_LAST + 1]; - static void osd_default_destructor(void *value __unused) { @@ -101,12 +105,12 @@ osd_register(u_int type, osd_destructor_ if (destructor == NULL) destructor = osd_default_destructor; - sx_xlock(&osd_module_lock[type]); + sx_xlock(&osdm[type].osd_module_lock); /* * First, we try to find unused slot. */ - for (i = 0; i < osd_nslots[type]; i++) { - if (osd_destructors[type][i] == NULL) { + for (i = 0; i < osdm[type].osd_ntslots; i++) { + if (osdm[type].osd_destructors[i] == NULL) { OSD_DEBUG("Unused slot found (type=%u, slot=%u).", type, i); break; @@ -115,31 +119,31 @@ osd_register(u_int type, osd_destructor_ /* * If no unused slot was found, allocate one. */ - if (i == osd_nslots[type]) { - osd_nslots[type]++; - if (osd_nmethods[type] != 0) - osd_methods[type] = realloc(osd_methods[type], - sizeof(osd_method_t) * osd_nslots[type] * - osd_nmethods[type], M_OSD, M_WAITOK); - newptr = malloc(sizeof(osd_destructor_t) * osd_nslots[type], - M_OSD, M_WAITOK); - rm_wlock(&osd_object_lock[type]); - bcopy(osd_destructors[type], newptr, + if (i == osdm[type].osd_ntslots) { + osdm[type].osd_ntslots++; + if (osdm[type].osd_nmethods != 0) + osdm[type].osd_methods = realloc(osdm[type].osd_methods, + sizeof(osd_method_t) * osdm[type].osd_ntslots * + osdm[type].osd_nmethods, M_OSD, M_WAITOK); + newptr = malloc(sizeof(osd_destructor_t) * + osdm[type].osd_ntslots, M_OSD, M_WAITOK); + rm_wlock(&osdm[type].osd_object_lock); + bcopy(osdm[type].osd_destructors, newptr, sizeof(osd_destructor_t) * i); - free(osd_destructors[type], M_OSD); - osd_destructors[type] = newptr; - rm_wunlock(&osd_object_lock[type]); + free(osdm[type].osd_destructors, M_OSD); + osdm[type].osd_destructors = newptr; + rm_wunlock(&osdm[type].osd_object_lock); OSD_DEBUG("New slot allocated (type=%u, slot=%u).", type, i + 1); } - osd_destructors[type][i] = destructor; - if (osd_nmethods[type] != 0) { - for (m = 0; m < osd_nmethods[type]; m++) - osd_methods[type][i * osd_nmethods[type] + m] = - methods != NULL ? methods[m] : NULL; + osdm[type].osd_destructors[i] = destructor; + if (osdm[type].osd_nmethods != 0) { + for (m = 0; m < osdm[type].osd_nmethods; m++) + osdm[type].osd_methods[i * osdm[type].osd_nmethods + m] + = methods != NULL ? methods[m] : NULL; } - sx_xunlock(&osd_module_lock[type]); + sx_xunlock(&osdm[type].osd_module_lock); return (i + 1); } @@ -150,45 +154,45 @@ osd_deregister(u_int type, u_int slot) KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); KASSERT(slot > 0, ("Invalid slot.")); - KASSERT(osd_destructors[type][slot - 1] != NULL, ("Unused slot.")); + KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); - sx_xlock(&osd_module_lock[type]); - rm_wlock(&osd_object_lock[type]); + sx_xlock(&osdm[type].osd_module_lock); + rm_wlock(&osdm[type].osd_object_lock); /* * Free all OSD for the given slot. */ - mtx_lock(&osd_list_lock[type]); - LIST_FOREACH_SAFE(osd, &osd_list[type], osd_next, tosd) + mtx_lock(&osdm[type].osd_list_lock); + LIST_FOREACH_SAFE(osd, &osdm[type].osd_list, osd_next, tosd) do_osd_del(type, osd, slot, 1); - mtx_unlock(&osd_list_lock[type]); + mtx_unlock(&osdm[type].osd_list_lock); /* * Set destructor to NULL to free the slot. */ - osd_destructors[type][slot - 1] = NULL; - if (slot == osd_nslots[type]) { - osd_nslots[type]--; - osd_destructors[type] = realloc(osd_destructors[type], - sizeof(osd_destructor_t) * osd_nslots[type], M_OSD, + osdm[type].osd_destructors[slot - 1] = NULL; + if (slot == osdm[type].osd_ntslots) { + osdm[type].osd_ntslots--; + osdm[type].osd_destructors = realloc(osdm[type].osd_destructors, + sizeof(osd_destructor_t) * osdm[type].osd_ntslots, M_OSD, M_NOWAIT | M_ZERO); - if (osd_nmethods[type] != 0) - osd_methods[type] = realloc(osd_methods[type], - sizeof(osd_method_t) * osd_nslots[type] * - osd_nmethods[type], M_OSD, M_NOWAIT | M_ZERO); + if (osdm[type].osd_nmethods != 0) + osdm[type].osd_methods = realloc(osdm[type].osd_methods, + sizeof(osd_method_t) * osdm[type].osd_ntslots * + osdm[type].osd_nmethods, M_OSD, M_NOWAIT | M_ZERO); /* * We always reallocate to smaller size, so we assume it will * always succeed. */ - KASSERT(osd_destructors[type] != NULL && - (osd_nmethods[type] == 0 || osd_methods[type] != NULL), - ("realloc() failed")); + KASSERT(osdm[type].osd_destructors != NULL && + (osdm[type].osd_nmethods == 0 || + osdm[type].osd_methods != NULL), ("realloc() failed")); OSD_DEBUG("Deregistration of the last slot (type=%u, slot=%u).", type, slot); } else { OSD_DEBUG("Slot deregistration (type=%u, slot=%u).", type, slot); } - rm_wunlock(&osd_object_lock[type]); - sx_xunlock(&osd_module_lock[type]); + rm_wunlock(&osdm[type].osd_object_lock); + sx_xunlock(&osdm[type].osd_module_lock); } int @@ -198,15 +202,15 @@ osd_set(u_int type, struct osd *osd, u_i KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); KASSERT(slot > 0, ("Invalid slot.")); - KASSERT(osd_destructors[type][slot - 1] != NULL, ("Unused slot.")); + KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); - rm_rlock(&osd_object_lock[type], &tracker); + rm_rlock(&osdm[type].osd_object_lock, &tracker); if (slot > osd->osd_nslots) { if (value == NULL) { OSD_DEBUG( "Not allocating null slot (type=%u, slot=%u).", type, slot); - rm_runlock(&osd_object_lock[type], &tracker); + rm_runlock(&osdm[type].osd_object_lock, &tracker); return (0); } else if (osd->osd_nslots == 0) { /* @@ -216,13 +220,14 @@ osd_set(u_int type, struct osd *osd, u_i osd->osd_slots = malloc(sizeof(void *) * slot, M_OSD, M_NOWAIT | M_ZERO); if (osd->osd_slots == NULL) { - rm_runlock(&osd_object_lock[type], &tracker); + rm_runlock(&osdm[type].osd_object_lock, + &tracker); return (ENOMEM); } osd->osd_nslots = slot; - mtx_lock(&osd_list_lock[type]); - LIST_INSERT_HEAD(&osd_list[type], osd, osd_next); - mtx_unlock(&osd_list_lock[type]); + mtx_lock(&osdm[type].osd_list_lock); + LIST_INSERT_HEAD(&osdm[type].osd_list, osd, osd_next); + mtx_unlock(&osdm[type].osd_list_lock); OSD_DEBUG("Setting first slot (type=%u).", type); } else { void *newptr; @@ -234,7 +239,8 @@ osd_set(u_int type, struct osd *osd, u_i newptr = realloc(osd->osd_slots, sizeof(void *) * slot, M_OSD, M_NOWAIT | M_ZERO); if (newptr == NULL) { - rm_runlock(&osd_object_lock[type], &tracker); + rm_runlock(&osdm[type].osd_object_lock, + &tracker); return (ENOMEM); } osd->osd_slots = newptr; @@ -245,7 +251,7 @@ osd_set(u_int type, struct osd *osd, u_i OSD_DEBUG("Setting slot value (type=%u, slot=%u, value=%p).", type, slot, value); osd->osd_slots[slot - 1] = value; - rm_runlock(&osd_object_lock[type], &tracker); + rm_runlock(&osdm[type].osd_object_lock, &tracker); return (0); } @@ -257,9 +263,9 @@ osd_get(u_int type, struct osd *osd, u_i KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); KASSERT(slot > 0, ("Invalid slot.")); - KASSERT(osd_destructors[type][slot - 1] != NULL, ("Unused slot.")); + KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); - rm_rlock(&osd_object_lock[type], &tracker); + rm_rlock(&osdm[type].osd_object_lock, &tracker); if (slot > osd->osd_nslots) { value = NULL; OSD_DEBUG("Slot doesn't exist (type=%u, slot=%u).", type, slot); @@ -268,7 +274,7 @@ osd_get(u_int type, struct osd *osd, u_i OSD_DEBUG("Returning slot value (type=%u, slot=%u, value=%p).", type, slot, value); } - rm_runlock(&osd_object_lock[type], &tracker); + rm_runlock(&osdm[type].osd_object_lock, &tracker); return (value); } @@ -277,9 +283,9 @@ osd_del(u_int type, struct osd *osd, u_i { struct rm_priotracker tracker; - rm_rlock(&osd_object_lock[type], &tracker); + rm_rlock(&osdm[type].osd_object_lock, &tracker); do_osd_del(type, osd, slot, 0); - rm_runlock(&osd_object_lock[type], &tracker); + rm_runlock(&osdm[type].osd_object_lock, &tracker); } static void @@ -289,7 +295,7 @@ do_osd_del(u_int type, struct osd *osd, KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); KASSERT(slot > 0, ("Invalid slot.")); - KASSERT(osd_destructors[type][slot - 1] != NULL, ("Unused slot.")); + KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); OSD_DEBUG("Deleting slot (type=%u, slot=%u).", type, slot); @@ -298,7 +304,7 @@ do_osd_del(u_int type, struct osd *osd, return; } if (osd->osd_slots[slot - 1] != NULL) { - osd_destructors[type][slot - 1](osd->osd_slots[slot - 1]); + osdm[type].osd_destructors[slot - 1](osd->osd_slots[slot - 1]); osd->osd_slots[slot - 1] = NULL; } for (i = osd->osd_nslots - 1; i >= 0; i--) { @@ -312,10 +318,10 @@ do_osd_del(u_int type, struct osd *osd, /* No values left for this object. */ OSD_DEBUG("No more slots left (type=%u).", type); if (!list_locked) - mtx_lock(&osd_list_lock[type]); + mtx_lock(&osdm[type].osd_list_lock); LIST_REMOVE(osd, osd_next); if (!list_locked) - mtx_unlock(&osd_list_lock[type]); + mtx_unlock(&osdm[type].osd_list_lock); free(osd->osd_slots, M_OSD); osd->osd_slots = NULL; osd->osd_nslots = 0; @@ -341,21 +347,21 @@ osd_call(u_int type, u_int method, void int error, i; KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); - KASSERT(method < osd_nmethods[type], ("Invalid method.")); + KASSERT(method < osdm[type].osd_nmethods, ("Invalid method.")); /* * Call this method for every slot that defines it, stopping if an * error is encountered. */ error = 0; - sx_slock(&osd_module_lock[type]); - for (i = 0; i < osd_nslots[type]; i++) { - methodfun = - osd_methods[type][i * osd_nmethods[type] + method]; + sx_slock(&osdm[type].osd_module_lock); + for (i = 0; i < osdm[type].osd_ntslots; i++) { + methodfun = osdm[type].osd_methods[i * osdm[type].osd_nmethods + + method]; if (methodfun != NULL && (error = methodfun(obj, data)) != 0) break; } - sx_sunlock(&osd_module_lock[type]); + sx_sunlock(&osdm[type].osd_module_lock); return (error); } @@ -373,14 +379,14 @@ osd_exit(u_int type, struct osd *osd) return; } - rm_rlock(&osd_object_lock[type], &tracker); + rm_rlock(&osdm[type].osd_object_lock, &tracker); for (i = 1; i <= osd->osd_nslots; i++) { - if (osd_destructors[type][i - 1] != NULL) + if (osdm[type].osd_destructors[i - 1] != NULL) do_osd_del(type, osd, i, 0); else OSD_DEBUG("Unused slot (type=%u, slot=%u).", type, i); } - rm_runlock(&osd_object_lock[type], &tracker); + rm_runlock(&osdm[type].osd_object_lock, &tracker); OSD_DEBUG("Object exit (type=%u).", type); } @@ -390,13 +396,13 @@ osd_init(void *arg __unused) u_int i; for (i = OSD_FIRST; i <= OSD_LAST; i++) { - osd_nslots[i] = 0; - LIST_INIT(&osd_list[i]); - sx_init(&osd_module_lock[i], "osd_module"); - rm_init(&osd_object_lock[i], "osd_object"); - mtx_init(&osd_list_lock[i], "osd_list", NULL, MTX_DEF); - osd_destructors[i] = NULL; - osd_methods[i] = NULL; + sx_init(&osdm[i].osd_module_lock, "osd_module"); + rm_init(&osdm[i].osd_object_lock, "osd_object"); + mtx_init(&osdm[i].osd_list_lock, "osd_list", NULL, MTX_DEF); + LIST_INIT(&osdm[i].osd_list); + osdm[i].osd_destructors = NULL; + osdm[i].osd_ntslots = 0; + osdm[i].osd_methods = NULL; } } SYSINIT(osd, SI_SUB_LOCK, SI_ORDER_ANY, osd_init, NULL); From owner-svn-src-head@freebsd.org Mon Mar 28 23:05:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC729ADF677; Mon, 28 Mar 2016 23:05:17 +0000 (UTC) (envelope-from gnn@freebsd.org) Received: from smtp.hungerhost.com (smtp.hungerhost.com [216.38.51.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89D811665; Mon, 28 Mar 2016 23:05:17 +0000 (UTC) (envelope-from gnn@freebsd.org) Received: from pool-108-46-36-107.nycmny.fios.verizon.net ([108.46.36.107]:50255 helo=[192.168.1.11]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.86_1) (envelope-from ) id 1akgDk-0007eK-2F; Mon, 28 Mar 2016 19:05:16 -0400 From: "George Neville-Neil" To: "Jonathan T. Looney" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r297358 - head/sys/net Date: Mon, 28 Mar 2016 19:05:14 -0400 Message-ID: <752095E3-DF2D-425E-BA80-B1CF60E638CF@freebsd.org> In-Reply-To: <351BC901-1C12-4A4C-9B69-46D14608B24D@juniper.net> References: <201603281825.u2SIPtSI069259@repo.freebsd.org> <351BC901-1C12-4A4C-9B69-46D14608B24D@juniper.net> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Content-Transfer-Encoding: quoted-printable X-Mailer: MailMate (1.9.4r5234) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - freebsd.org X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com X-Authenticated-Sender: vps.hungerhost.com: gnn@neville-neil.com X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 23:05:17 -0000 On 28 Mar 2016, at 14:36, Jonathan T. Looney wrote: > On 3/28/16, 2:25 PM, "owner-src-committers@freebsd.org on behalf of = > George V. Neville-Neil" gnn@FreeBSD.org> wrote: > >> Author: gnn >> Date: Mon Mar 28 18:25:54 2016 >> New Revision: 297358 >> URL: https://svnweb.freebsd.org/changeset/base/297358 >> >> Log: >> Add ethertype reserved for network testing >> >> MFC after: 2 weeks >> >> Modified: >> head/sys/net/ethernet.h >> >> Modified: head/sys/net/ethernet.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/net/ethernet.h Mon Mar 28 17:42:14 2016 (r297357) >> +++ head/sys/net/ethernet.h Mon Mar 28 18:25:54 2016 (r297358) >> @@ -333,6 +333,7 @@ struct ether_vlan_header { >> #define ETHERTYPE_SLOW 0x8809 /* 802.3ad link aggregation (LACP) */ >> #define ETHERTYPE_PPP 0x880B /* PPP (obsolete by PPPoE) */ >> #define ETHERTYPE_HITACHI 0x8820 /* Hitachi Cable (Optoelectronic = >> Systems Laboratory) */ >> +#define ETHERTYPE_TEST 0x8822 /* Network Conformance Testing */ >> #define ETHERTYPE_MPLS 0x8847 /* MPLS Unicast */ >> #define ETHERTYPE_MPLS_MCAST 0x8848 /* MPLS Multicast */ >> #define ETHERTYPE_AXIS 0x8856 /* Axis Communications AB proprietary = >> bootstrap/config */ > > The IEEE registry shows this Ethertype as being allocated to Wind = > River Systems. Do we know that Wind River Systems has further = > allocated that to be used for network conformance testing? If not, I = > fear we could end up causing problems down the road. Guess who worked at Wind River and got that allocated :-) I am going to dig through my old mail archives from WR days and get the = IEEE to move it, since, clearly, not one kept the thing up after I left. = That address is over a decade out of date, and Wind River no longer = exists, as Intel bought them several years ago. Best, George From owner-svn-src-head@freebsd.org Tue Mar 29 00:10:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9502CAE0B2F; Tue, 29 Mar 2016 00:10:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65A4C17F2; Tue, 29 Mar 2016 00:10:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2T0Alj3073946; Tue, 29 Mar 2016 00:10:47 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2T0AlOe073945; Tue, 29 Mar 2016 00:10:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603290010.u2T0AlOe073945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 29 Mar 2016 00:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297368 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 00:10:48 -0000 Author: np Date: Tue Mar 29 00:10:47 2016 New Revision: 297368 URL: https://svnweb.freebsd.org/changeset/base/297368 Log: cxgbe/iw_cxgbe: Fix for stray "start_ep_timer timer already started!" messages. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Mar 28 22:18:37 2016 (r297367) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Tue Mar 29 00:10:47 2016 (r297368) @@ -1855,6 +1855,7 @@ process_mpa_request(struct c4iw_ep *ep) ep->mpa_attr.xmit_marker_enabled, ep->mpa_attr.version); state_set(&ep->com, MPA_REQ_RCVD); + STOP_EP_TIMER(ep); /* drive upcall */ mutex_lock(&ep->parent_ep->com.mutex); From owner-svn-src-head@freebsd.org Tue Mar 29 01:07:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0BC9AD5B27; Tue, 29 Mar 2016 01:07:08 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0143.outbound.protection.outlook.com [157.56.111.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CE9A1653; Tue, 29 Mar 2016 01:07:07 +0000 (UTC) (envelope-from jtl@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-junipernetworks-onmicrosoft-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4UFxl29VaWT8Ymvz+ICXWng0nAAqIlaQ818oW2L8AkE=; b=RI+7rGb2r8mXLGH15YQTZ2wlUyZ19kaGcGMMiX0tVvMsLV2VZW9rTotMNYb/KPxPDZoVo/icaWt9XCwLTGlWOFNBd/CUfOPIOThNMdIDaQH73nalJwrAh8iMK2LHbYdKWX48qHC6jtPqygoQbtIXA1ymT1tULCu2UCXS1FDvWAk= Received: from BLUPR05CA0062.namprd05.prod.outlook.com (10.141.20.32) by CO2PR05MB2677.namprd05.prod.outlook.com (10.166.95.17) with Microsoft SMTP Server (TLS) id 15.1.434.11; Tue, 29 Mar 2016 01:06:59 +0000 Received: from BL2FFO11FD030.protection.gbl (2a01:111:f400:7c09::102) by BLUPR05CA0062.outlook.office365.com (2a01:111:e400:855::32) with Microsoft SMTP Server (TLS) id 15.1.447.15 via Frontend Transport; Tue, 29 Mar 2016 01:06:58 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=freebsd.org; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=freebsd.org; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning freebsd.org discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BL2FFO11FD030.mail.protection.outlook.com (10.173.161.40) with Microsoft SMTP Server (TLS) id 15.1.453.6 via Frontend Transport; Tue, 29 Mar 2016 01:06:58 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 28 Mar 2016 18:06:40 -0700 Received: from [172.29.111.37] ([172.29.111.37]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u2T16cA62202; Mon, 28 Mar 2016 18:06:38 -0700 (PDT) (envelope-from jtl@freebsd.org) User-Agent: Microsoft-MacOutlook/0.0.0.160212 Date: Mon, 28 Mar 2016 21:06:38 -0400 Subject: Re: svn commit: r297358 - head/sys/net From: "Jonathan T. Looney" Sender: Jonathan Looney To: George Neville-Neil CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Thread-Topic: svn commit: r297358 - head/sys/net References: <201603281825.u2SIPtSI069259@repo.freebsd.org> <351BC901-1C12-4A4C-9B69-46D14608B24D@juniper.net> <752095E3-DF2D-425E-BA80-B1CF60E638CF@freebsd.org> In-Reply-To: <752095E3-DF2D-425E-BA80-B1CF60E638CF@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.19; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(189002)(377454003)(24454002)(199003)(52604005)(450100001)(19580405001)(19580395003)(230700001)(36756003)(2906002)(23676002)(33656002)(87936001)(2950100001)(77096005)(11100500001)(6806005)(1096002)(106466001)(83506001)(81166005)(4326007)(586003)(50466002)(1220700001)(50986999)(47776003)(86362001)(105596002)(110136002)(5820100001)(189998001)(16796002)(92566002)(76176999)(54356999)(42262002)(104396002); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR05MB2677; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD030; 1:fW2WA2daLnud8k5wVsKRU3AzrIYPt1u322TkHhAhimf4LUeuMx3Np6aZcycOdkgZXwEYKQTbMR8S4sS5mcXZIs+P3KZEweXtw1bag4CLrDGE9ZPjZmNAmwGaR51kdiIkFaeAQPnEEgjWxs8vlttil5OCwToFuYhBwTcUKCSinO8UiZVh9P/RFgjr6JA78CoZLwqBdtSWwtcZmnnHsoPaenLQXklJ95/RT3ZokblZZltGLeyTy/vkADhIC23KuxZy8oLrvXr0WkRmKUtmlFMKYzvmGUWBXZBmYaicPZMfPvUYAUtnY2tmbwv4nVpka4WlPaIfE9MQOJC4OaBetC6l+OONid6657wq4SpCH8u5mxCaQ6EAZzVOTzF+3HAV9ZSZzYctovNv/Mp3j9nMLfTN4eI2FNOoxluF8ALut5uMIHDTCWAp5WVniFSF3C4TIU4IStVjkOjqvgVWMA/eGGghm5QrAw72H0PghAXi+qo+nY2FgMY0wyXhF1SMC9/Hdltf X-MS-Office365-Filtering-Correlation-Id: eb5daf4b-f65f-4e8d-d06f-08d3576e6d78 X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2677; 2:dul06PAWzGP7ObM96cY3c5bIPOByTXsBo1RVy+OOJssu1S8Y3lzBm9gqvd/oXfRhkLkwt9YZMNOTwJiM5jatNyCoakAVV90Zmv3zznPFlqZ737EvaI/apf3V6etBhLJt5bywKao2bcnZsw6o5wVNCCryjIbFz7wUOWPwOVH4ddiSQv4rpYKl+PYB0lgU9lcV; 3:KGJzFYSrwO1S9fA0Y8YoZ43encN8hV0uBM4kBCIR28B6TrEFpemca8OiZ0+dExHlOTC+GUx1CJR1rmdmA/sULrXiovak/2lm6Mxr29bm9vH3dkjDKGbai6lTvkHoSAGKdqxhc5e9WD5oIm9BJLp3ZnRThD9wtKrmGFfa7Tb1sELaokbKz1i4tis0HasLtqOIdi+0kda3L1ajZPH9QwZYeldAQReIoAMd2wunw2YxHPc= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR05MB2677; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2677; 25:oWhn88bcDKsb6bSCsJfWY8GbQM/Bk6t/MqEYw7qCR9+E0OLPFHXmTjjQpx6SNSprIM5RozoemkXFql6F8LqEcnz20VTGYy+RhhVth1sU2jgK8N2K4dlx6yV4bgd4hLirSQMzOwpBpED4rPJFrVa8LPU4wjMPtmG5Ry0M2lKYXwGakgo7jo054aEnsSx2/rblppx0fjzd0c3eGKdNxOF+HxE3o4A0JptX9CydBwaiIncu0g0hpah+rEHJ2i332J0U7ESIcMirmXNH6pmpESQu9QkGLAKkvjtZWN1UQpBOHArfr0mhejdCoTHadodhSCm9OmobcO+GbNMJrbONcH5uDq1ftxNfNwBBlVL1i5WWsspo9e65Yzy3PgISRLnAfN3obHIAb5J4AGh1gRIWDkkRk1Ioy8f9MCQYoy5zmve9h8HY2Q40ZyBFddAdlvSsk6pxUpTSghYvjOWEufc6BuT/eta9GWj3jbkf02RjNuinAftRH530P/sDH8wYc/+IDRTLDYZ2pPOU39LTQ4T4O5QXWh+/TDwQuGmNQe4u6CFLWb7BAGhnEAgBLiKbNJS5D6xr X-JNPR-Received-From: outside X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2677; 20:9pB/7F7vdBV1UOCrcqJ5C/L8feWElmbyD3TNssiWv5E/4IT7jG8N/miL9rChlACjVV63jIYM/AXuhyp15vSW8YnW4WhkR701qO0i8zCpbxqOCVJqIRDnCv5G0G490OkP7oo2Iw4p4M2yWYkCmC2IIuVqH21ppGc1GvaW7cRfUP7yfYcq7cOQHr4qeyMM3+oQgsXUPJ7iUFWy6C6C7W1PMUQgIhn6bW/A0+92s/nB4GOwH0jtW+vGrS18fV54B9/QZcSP2LmvroV7prWYfzHu3KC/576OQJrlq8vGk0LN6neLunuaq0cTOciTUZZFsxYgStPLtIrehs2eRDvazvFSQHSDJTe0oZnsScxzJJOMZ4CblYPmQh97uOu6mQ5eVoEgTByVDHenzgf3HTILLs6wVDlrtqfKxKv9qGbo3ld74hHCPE1/icJRw6LOt1P3gUJLMp2e149MlE8wqD6In//2oxRzipyQw5YZusSZ3PA6gFCTGFK2Kp+9/LbghACODOAa X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(13018025)(13024025)(13015025)(5005006)(13017025)(13023025)(10201501046)(3002001); SRVR:CO2PR05MB2677; BCL:0; PCL:0; RULEID:; SRVR:CO2PR05MB2677; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2677; 4:JuywIjFKXsODsMvGtbRFtFXpI2gLpEBayJKQlXWUR6BSOV8CpzQ7UMg84FCzTFZuvcidkXQySjkMmHuGyW6yBe3BELof98ZEVC0YQf/KMFlkdTRqHJJvHOi6+zSP5VVGX1B5q8Txi39lvJkVumSlnx6SY3tPpVaPb/EPz3OT9+kOt4WQRtxJCOdLSybWgXsQ2hHVvu+7EzJUoXVtXJoT+ThFAVn2nT87zuJjoaYQs0+5aUtGFR7sbZEH+QeKGnNUT1XqPyLzHCSHDCqLfJPnBWWc+BYUiY9Vq03oO/wXVdxdPAjC4WYAPM0gBotGpy/Xy+kla0orRNelEkRg4arHDqv73mgB5UyIvFl8ifV12F62Yb/G9UGmBEZkC2+Q+yB6Xj5jvZvOXH+XJIocCqnc20gi1jgkBQjhL3wQEHiurSo4P83vm/UCu/1ZSf2k96u50eDNuJz77n7EornawOlbzw== X-Forefront-PRVS: 0896BFCE6C X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDTzJQUjA1TUIyNjc3OzIzOm0vVDQ4eXRwZDBRVTlmU1RVZ0ZkQ283c2JE?= =?utf-8?B?NlRveCtQdXEzdExUNWtaMmRUL2xOTm90L2lkSzd6YVY1Zm9qdkRSbTRNYlNp?= =?utf-8?B?R0hSMlJBZVhmOFNseEZWdUxpM05QNUFkSXZXVWx1NnZOS0kyek83WGtVbXZN?= =?utf-8?B?YVRkZm9tc0tnUCt2NnJOUVpiSElhbW00eU5WV1ZyMG41UWFuS2I0bzlNeElQ?= =?utf-8?B?Y1JPYTd5TGI3TzZlbjM1dENycEZRZUF5bjR5WGIybUo1a1k4NGtDeUVwcFFW?= =?utf-8?B?OFk4TzAzSGFnT1BsdDgrRFFqZlBmTHhUNVU1L2pqT3U2ZWlwMUs5VFF5V25k?= =?utf-8?B?V1JJNU1rVDRpdld2WHk5N2xKZit6UTZPSzRtYjdsRU8rRnhCcVpKU09uZXp1?= =?utf-8?B?VzdiTlJEKzNyOFpUYmdOY2hJMDJHTDVBZTFiUk5yV09WdW12MlUwSWgyWWx3?= =?utf-8?B?U2s0UmxaOGRwYlIxRUU5c05HL0VOSWxWRHJyL0N3czk4d29RSmtxM0NyamRO?= =?utf-8?B?aTlJcHh0dDlmV2x4NisraFRUSVNHbzlOQ1dUcWFyakpleW1aN3RMNlF5bndu?= =?utf-8?B?Vi9vQ1FUQlJyUXJPTldHZ3B3NHVTemlhdmpnayt5TG12Q3BVTWtNTFdhVVlL?= =?utf-8?B?MjEzTWZhbHowcW8wWXNDN1d6NkpzTFgxRzlUc3pNdExGaG1tZFBod2FMOFZJ?= =?utf-8?B?NkZaTGxhNHpaMTlUKytvSHVkMXZxWVAyV05nVWN1M1FVZ2xTTXZ4ck9EVnRs?= =?utf-8?B?RFlDZXVWUktDelhWYnhlb3RLYmZ3dDljZjZldEZUQUJQR1Jya3lmNlRsT2pm?= =?utf-8?B?SytDNC83RiszekNRMEo3dDlaZ3NhZnFMa3ppdHB6cEFnTXFVUGw3dm45bzJP?= =?utf-8?B?bzJRSnFweWZpUjVPM21OcEFyaUo5RmpJTlNVUEcxMXg0dCtqUjdQb09Ueld3?= =?utf-8?B?K3ZGMkU5NThWOWU4YlcvdGR2WkdyVW9WamNnclFmVUZuaGZFRW05czhEZ0Rj?= =?utf-8?B?Zmx3NWFkTEltT3FnY2ZyYWlMWWQxTE5HZ0dSYm9DU0g0TFVuN1dEWGVpdklH?= =?utf-8?B?WXBrTnBpUDZGdkIveWwrVmpyOHZha2g3amU5OHVnRE0ybVZlTGJ5WFNWaStL?= =?utf-8?B?WnNOY2lCVkwrbkF6RkFibkZqMHhaSmNPQys2NHhjZG9uYXZ0WE1uOVZXdWh6?= =?utf-8?B?di9oZHF6c1dTVFhDTWd3WE5XcXBOeTVTbGk5ZzhsVWo0WjZaZ3ZsK0lqVzFT?= =?utf-8?B?d2dNekdSeHdueUdjMnpFMVlaN1NKSUgvQ0k0MHVGcGk3b3ZhZm1ZTGwzWlRG?= =?utf-8?B?d1hrQ082eWI1RnZjM2IvQnhBNndnaDc5OU1CdXh4MTFMZlA5NDFuL3R4MENX?= =?utf-8?B?WnZZbUhuOExIdmszTGk4MVVTbnNvZ3pjUmhvcCt4NnBYaUFIbzV4a2hRc1Vu?= =?utf-8?Q?Zb1U3s=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2677; 5:m4CI+gqVGUSL38lfiWhL+RPv2a3vyO53guGk9kPsRGupSeKWPyxv59XIyYq4rchzgL+WgWpsmEvtBmXnCX8lJiqq2xP4Vw2ZvemtpdCNpd2VzousQzZ21S61p70kH/ANcvNij/Qmrrk8AZnnoTnF1A==; 24:SN2/GQ8mx/MKBCGoxj8AZeYeHZ9wRUwUEJan7uIdL0kek2G/ApUq+uW+PESMaH+RMmFLZzSi0VNY4cZtw9V9teGyJ7aHg5PFRlhXglYkm68= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2016 01:06:58.0437 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR05MB2677 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 01:07:08 -0000 On 3/28/16, 7:05 PM, "George Neville-Neil" wrote: >On 28 Mar 2016, at 14:36, Jonathan T. Looney wrote: > >>The IEEE registry shows this Ethertype as being allocated to Wind >> River Systems. Do we know that Wind River Systems has further >> allocated that to be used for network conformance testing? If not, I >> fear we could end up causing problems down the road. > >Guess who worked at Wind River and got that allocated :-) > >I am going to dig through my old mail archives from WR days and get the >IEEE to move it, since, clearly, not one kept the thing up after I left. > That address is over a decade out of date, and Wind River no longer >exists, as Intel bought them several years ago. Thanks for answering my question! I think its a great idea that *someone* allocated this. Its too bad IEEE didn't do it themselves, but I'm glad someone did. Jonathan From owner-svn-src-head@freebsd.org Tue Mar 29 01:41:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5A6FAE162C; Tue, 29 Mar 2016 01:41:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76BFC1830; Tue, 29 Mar 2016 01:41:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2T1f7OJ001666; Tue, 29 Mar 2016 01:41:07 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2T1f7ie001665; Tue, 29 Mar 2016 01:41:07 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603290141.u2T1f7ie001665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 29 Mar 2016 01:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297369 - head/sys/contrib/rdma/krping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 01:41:08 -0000 Author: np Date: Tue Mar 29 01:41:07 2016 New Revision: 297369 URL: https://svnweb.freebsd.org/changeset/base/297369 Log: krping wasn't designed to take more than one client. Fail any connect requests if cb->state is not IDLE. Submitted by: Krishnamraju Eraparaju @ Chelsio Reviewed by: Steve Wise @ Open Grid Computing Sponsored by: Chelsio Communications Modified: head/sys/contrib/rdma/krping/krping.c Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Tue Mar 29 00:10:47 2016 (r297368) +++ head/sys/contrib/rdma/krping/krping.c Tue Mar 29 01:41:07 2016 (r297369) @@ -266,8 +266,13 @@ static int krping_cma_event_handler(stru break; case RDMA_CM_EVENT_CONNECT_REQUEST: - cb->state = CONNECT_REQUEST; - cb->child_cm_id = cma_id; + if (cb->state == IDLE) { + cb->state = CONNECT_REQUEST; + cb->child_cm_id = cma_id; + } else { + PRINTF(cb, "Received connection request in wrong state" + " (%d)\n", cb->state); + } DEBUG_LOG(cb, "child cma %p\n", cb->child_cm_id); wake_up_interruptible(&cb->sem); break; From owner-svn-src-head@freebsd.org Tue Mar 29 06:56:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55094AE1536; Tue, 29 Mar 2016 06:56:48 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16B1D1611; Tue, 29 Mar 2016 06:56:48 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2T6ulsg097436; Tue, 29 Mar 2016 06:56:47 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2T6ul8U097434; Tue, 29 Mar 2016 06:56:47 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201603290656.u2T6ul8U097434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Tue, 29 Mar 2016 06:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297370 - in head/sys/cam: ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 06:56:48 -0000 Author: dumbbell Date: Tue Mar 29 06:56:46 2016 New Revision: 297370 URL: https://svnweb.freebsd.org/changeset/base/297370 Log: CAM: Generalize 4k quirk to all Samsung MZ7* SSDs This adds Samsung PM851 to the list. It can be found in Lenovo Thinkpad T440 for instance. Reviewed by: Kevin Bowling , Jason Wolfe Approved by: Kevin Bowling , Jason Wolfe MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5753 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Mar 29 01:41:07 2016 (r297369) +++ head/sys/cam/ata/ata_da.c Tue Mar 29 06:56:46 2016 (r297370) @@ -466,14 +466,6 @@ static struct ada_quirk_entry ada_quirk_ }, { /* - * Samsung 843T Series SSDs - * 4k optimised - */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG MZ7WD*", "*" }, - /*quirks*/ADA_Q_4K - }, - { - /* * Samsung 850 SSDs * 4k optimised */ @@ -482,18 +474,13 @@ static struct ada_quirk_entry ada_quirk_ }, { /* - * Samsung PM853T Series SSDs - * 4k optimised - */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG MZ7GE*", "*" }, - /*quirks*/ADA_Q_4K - }, - { - /* - * Samsung SM863 Series SSDs + * Samsung 843T Series SSDs (MZ7WD*) + * Samsung PM851 Series SSDs (MZ7TE*) + * Samsung PM853T Series SSDs (MZ7GE*) + * Samsung SM863 Series SSDs (MZ7KM*) * 4k optimised */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG MZ7KM*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG MZ7*", "*" }, /*quirks*/ADA_Q_4K }, { Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Mar 29 01:41:07 2016 (r297369) +++ head/sys/cam/scsi/scsi_da.c Tue Mar 29 06:56:46 2016 (r297370) @@ -1138,14 +1138,6 @@ static struct da_quirk_entry da_quirk_ta }, { /* - * Samsung 843T Series SSDs - * 4k optimised - */ - { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG MZ7WD*", "*" }, - /*quirks*/DA_Q_4K - }, - { - /* * Samsung 850 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ @@ -1154,18 +1146,13 @@ static struct da_quirk_entry da_quirk_ta }, { /* - * Samsung PM853T Series SSDs - * 4k optimised - */ - { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG MZ7GE*", "*" }, - /*quirks*/DA_Q_4K - }, - { - /* - * Samsung SM863 Series SSDs + * Samsung 843T Series SSDs (MZ7WD*) + * Samsung PM851 Series SSDs (MZ7TE*) + * Samsung PM853T Series SSDs (MZ7GE*) + * Samsung SM863 Series SSDs (MZ7KM*) * 4k optimised */ - { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG MZ7KM*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG MZ7*", "*" }, /*quirks*/DA_Q_4K }, { From owner-svn-src-head@freebsd.org Tue Mar 29 08:31:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23EC5AE12FD; Tue, 29 Mar 2016 08:31:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8D311F49; Tue, 29 Mar 2016 08:31:35 +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 u2T8VZK2024387; Tue, 29 Mar 2016 08:31:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2T8VZSG024386; Tue, 29 Mar 2016 08:31:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603290831.u2T8VZSG024386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 29 Mar 2016 08:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297373 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 08:31:36 -0000 Author: kib Date: Tue Mar 29 08:31:34 2016 New Revision: 297373 URL: https://svnweb.freebsd.org/changeset/base/297373 Log: Use ANSI function definition. Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Tue Mar 29 07:38:43 2016 (r297372) +++ head/sys/x86/x86/mp_x86.c Tue Mar 29 08:31:34 2016 (r297373) @@ -910,7 +910,7 @@ ipi_all_but_self(u_int ipi) } int -ipi_nmi_handler() +ipi_nmi_handler(void) { u_int cpuid; From owner-svn-src-head@freebsd.org Tue Mar 29 08:44:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C8B5AE16C0; Tue, 29 Mar 2016 08:44:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEFB615ED; Tue, 29 Mar 2016 08:44:57 +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 u2T8ivUO030046; Tue, 29 Mar 2016 08:44:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2T8ivrN030045; Tue, 29 Mar 2016 08:44:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603290844.u2T8ivrN030045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 29 Mar 2016 08:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297374 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 08:44:58 -0000 Author: kib Date: Tue Mar 29 08:44:56 2016 New Revision: 297374 URL: https://svnweb.freebsd.org/changeset/base/297374 Log: Calibrate the frequency of the of the native_lapic_ipi_wait() loop, and avoid a delay while waiting for IPI delivery acknowledgement in xAPIC mode. This makes the loop exit immediately after the delivery bit in APIC_ICR register is set, instead of waiting for some microseconds. We only need to ensure that some amount of time is allowed for the LAPIC to react to the command, and we need that the wait time is finite and reasonable. For that reasons, it is irrelevant if the CPU frequency or throttling decrease the speed and make the loop, calibrated for full CPU speed at boot time, execute somewhat slower. Discussed with: bde, jhb Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Tue Mar 29 08:31:34 2016 (r297373) +++ head/sys/x86/x86/local_apic.c Tue Mar 29 08:44:56 2016 (r297374) @@ -172,6 +172,7 @@ int lapic_eoi_suppression; static int lapic_timer_tsc_deadline; static u_long lapic_timer_divisor; static struct eventtimer lapic_et; +static uint64_t lapic_ipi_wait_mult; SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG_RD, 0, "APIC options"); SYSCTL_INT(_hw_apic, OID_AUTO, x2apic_mode, CTLFLAG_RD, &x2apic_mode, 0, ""); @@ -403,6 +404,7 @@ lvt_mode(struct lapic *la, u_int pin, ui static void native_lapic_init(vm_paddr_t addr) { + uint64_t r; uint32_t ver; u_int regs[4]; int i, arat; @@ -503,6 +505,34 @@ native_lapic_init(vm_paddr_t addr) TUNABLE_INT_FETCH("hw.lapic_eoi_suppression", &lapic_eoi_suppression); } + +#define LOOPS 1000000 + /* + * Calibrate the busy loop waiting for IPI ack in xAPIC mode. + * lapic_ipi_wait_mult contains the number of iterations which + * approximately delay execution for 1 microsecond (the + * argument to native_lapic_ipi_wait() is in microseconds). + * + * We assume that TSC is present and already measured. + * Possible TSC frequency jumps are irrelevant to the + * calibration loop below, the CPU clock management code is + * not yet started, and we do not enter sleep states. + */ + KASSERT((cpu_feature & CPUID_TSC) != 0 && tsc_freq != 0, + ("TSC not initialized")); + r = rdtsc(); + for (r = 0; r < LOOPS; r++) { + (void)lapic_read_icr_lo(); + ia32_pause(); + } + r = rdtsc() - r; + lapic_ipi_wait_mult = (r * 1000000) / tsc_freq / LOOPS; + if (bootverbose) { + printf("LAPIC: ipi_wait() us multiplier %jd (r %jd tsc %jd)\n", + (uintmax_t)lapic_ipi_wait_mult, (uintmax_t)r, + (uintmax_t)tsc_freq); + } +#undef LOOPS } /* @@ -1716,31 +1746,26 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_O * private to the MD code. The public interface for the rest of the * kernel is defined in mp_machdep.c. */ + +/* + * Wait delay microseconds for IPI to be sent. If delay is -1, we + * wait forever. + */ static int native_lapic_ipi_wait(int delay) { - int x; + uint64_t i, counter; /* LAPIC_ICR.APIC_DELSTAT_MASK is undefined in x2APIC mode */ - if (x2apic_mode) + if (x2apic_mode || delay == -1) return (1); - /* - * Wait delay microseconds for IPI to be sent. If delay is - * -1, we wait forever. - */ - if (delay == -1) { - while ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) != - APIC_DELSTAT_IDLE) - ia32_pause(); - return (1); - } - - for (x = 0; x < delay; x++) { + counter = lapic_ipi_wait_mult * delay; + for (i = 0; i < counter; i++) { if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == APIC_DELSTAT_IDLE) return (1); - DELAY(1); + ia32_pause(); } return (0); } From owner-svn-src-head@freebsd.org Tue Mar 29 08:45:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5680AE16F6; Tue, 29 Mar 2016 08:45:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51D97174C; Tue, 29 Mar 2016 08:45:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2T8j7Vo087921 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 29 Mar 2016 11:45:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2T8j7Vo087921 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2T8j7gH087919; Tue, 29 Mar 2016 11:45:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 29 Mar 2016 11:45:06 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160329084506.GM1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> <2869679.kmLIC3GSQk@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2869679.kmLIC3GSQk@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 08:45:16 -0000 On Mon, Mar 28, 2016 at 11:55:18AM -0700, John Baldwin wrote: > I think this is more to allow you to keep the TSCs in sync across cores > more sanely by being able to adjust TSC_ADJ instead of trying to time > a write to the TSC to apply an offset (which is racy). If it was targeted > at SMM, it wouldn't be exposed to the host OS. I think Intel understands > at this point that OS's want a synchronized TSC on bare metal for "cheap" > timekeeping (at this point the TSC is more about that then about counting > CPU "instructions"). There is RDTSCP instruction and IA32_TSC_AUX MSR, which provides atomic fetch of the per-cpu TSC offset and provides automatic serialization. Its use would avoid the need of LFENCE accompaining RDTSC, as it is done now. Hm, yes, IA32_TSC_ADJUST MSR is documented in latest SDM. > > I think your patch later in the thread looks fine. Thanks, committed as r297374. > > Most of the worry about older hardware with variable TSC's later in the > thread is becoming less and less relevant. Intel hasn't shipped a CPU with > a variable TSC in close to a decade now? Core2 were initially released in 2006, and latest models in mobile segment launched in the late 2009. Core2 has invariant TSC, but it stops in C3, which makes either TSC or C3 unusable (at least simultaneously). > > Bruce's points about the hardcoded timeouts for things like mutxes are well > founded. I'm not sure about how best to fix those however. I think we could use similar calibration with fake single-atomic loop. It would give us 2x-5x times error at runtime, but again it does not matter. From owner-svn-src-head@freebsd.org Tue Mar 29 10:47:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE7A4AE20B7; Tue, 29 Mar 2016 10:47:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9457117CA; Tue, 29 Mar 2016 10:47:15 +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 u2TAlEDI067755; Tue, 29 Mar 2016 10:47:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TAlEaM067754; Tue, 29 Mar 2016 10:47:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201603291047.u2TAlEaM067754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 29 Mar 2016 10:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297381 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 10:47:15 -0000 Author: hselasky Date: Tue Mar 29 10:47:14 2016 New Revision: 297381 URL: https://svnweb.freebsd.org/changeset/base/297381 Log: Verify that all segments in the loaded segment list are back to back with regard to the page offset, and not only the two first ones. Modified: head/sys/dev/usb/usb_busdma.c Modified: head/sys/dev/usb/usb_busdma.c ============================================================================== --- head/sys/dev/usb/usb_busdma.c Tue Mar 29 10:27:25 2016 (r297380) +++ head/sys/dev/usb/usb_busdma.c Tue Mar 29 10:47:14 2016 (r297381) @@ -472,17 +472,22 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ pc->page_offset_buf = rem; pc->page_offset_end += rem; #ifdef USB_DEBUG - if (nseg > 1 && - ((segs->ds_addr + segs->ds_len) & (USB_PAGE_SIZE - 1)) != - ((segs + 1)->ds_addr & (USB_PAGE_SIZE - 1))) { - /* - * This check verifies there is no page offset hole - * between the first and second segment. See the - * BUS_DMA_KEEP_PG_OFFSET flag. - */ - DPRINTFN(0, "Page offset was not preserved\n"); - error = 1; - goto done; + if (nseg > 1) { + int x; + + for (x = 0; x != nseg - 1; x++) { + if (((segs[x].ds_addr + segs[x].ds_len) & (USB_PAGE_SIZE - 1)) == + ((segs[x + 1].ds_addr & (USB_PAGE_SIZE - 1)))) + continue; + /* + * This check verifies there is no page offset + * hole between any of the segments. See the + * BUS_DMA_KEEP_PG_OFFSET flag. + */ + DPRINTFN(0, "Page offset was not preserved\n"); + error = 1; + goto done; + } } #endif while (pc->ismultiseg) { From owner-svn-src-head@freebsd.org Tue Mar 29 11:56:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F282AAE2491; Tue, 29 Mar 2016 11:56:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4FD91E1C; Tue, 29 Mar 2016 11:56:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2TBu1wE089026; Tue, 29 Mar 2016 11:56:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TBu1j8089025; Tue, 29 Mar 2016 11:56:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603291156.u2TBu1j8089025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 29 Mar 2016 11:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297384 - head/usr.bin/fetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 11:56:02 -0000 Author: trasz Date: Tue Mar 29 11:56:00 2016 New Revision: 297384 URL: https://svnweb.freebsd.org/changeset/base/297384 Log: Add phttpget(8) .Xr to fetch(1). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/fetch/fetch.1 Modified: head/usr.bin/fetch/fetch.1 ============================================================================== --- head/usr.bin/fetch/fetch.1 Tue Mar 29 11:25:27 2016 (r297383) +++ head/usr.bin/fetch/fetch.1 Tue Mar 29 11:56:00 2016 (r297384) @@ -385,7 +385,8 @@ argument is used and the remote file is specified file then the command will still return success, although no file is transferred. .Sh SEE ALSO -.Xr fetch 3 +.Xr fetch 3 , +.Xr phttpget 8 .Sh HISTORY The .Nm From owner-svn-src-head@freebsd.org Tue Mar 29 12:19:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D543BAE0132; Tue, 29 Mar 2016 12:19:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id B08681DDA; Tue, 29 Mar 2016 12:19:47 +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 u2TCJk1H095349; Tue, 29 Mar 2016 12:19:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TCJk3G095347; Tue, 29 Mar 2016 12:19:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603291219.u2TCJk3G095347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 29 Mar 2016 12:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297386 - in head: share/man/man4 sys/dev/amdsbwd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 12:19:47 -0000 Author: mav Date: Tue Mar 29 12:19:46 2016 New Revision: 297386 URL: https://svnweb.freebsd.org/changeset/base/297386 Log: Add support for AMD FCH watchdog timers. MFC after: 2 weeks Modified: head/share/man/man4/amdsbwd.4 head/sys/dev/amdsbwd/amdsbwd.c Modified: head/share/man/man4/amdsbwd.4 ============================================================================== --- head/share/man/man4/amdsbwd.4 Tue Mar 29 12:17:58 2016 (r297385) +++ head/share/man/man4/amdsbwd.4 Tue Mar 29 12:19:46 2016 (r297386) @@ -25,12 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd June 7, 2011 +.Dd March 29, 2016 .Dt AMDSBWD 4 .Os .Sh NAME .Nm amdsbwd -.Nd device driver for the AMD SB600/SB7xx/SB8xx watchdog timers +.Nd device driver for the AMD southbridge watchdog timers .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your @@ -51,7 +51,7 @@ The driver provides .Xr watchdog 4 support for the watchdog timers present on -AMD SB600, SB7xx and SB8xx southbridges. +AMD SB600, SB7xx, SB8xx and SB9xx southbridges and Axx FCHs. .Sh SEE ALSO .Xr watchdog 4 , .Xr watchdog 8 , Modified: head/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- head/sys/dev/amdsbwd/amdsbwd.c Tue Mar 29 12:17:58 2016 (r297385) +++ head/sys/dev/amdsbwd/amdsbwd.c Tue Mar 29 12:19:46 2016 (r297386) @@ -106,6 +106,8 @@ __FBSDID("$FreeBSD$"); /* SB7xx RRG 2.3.1.1, SB600 RRG 2.3.1.1, SB8xx RRG 2.3.1. */ #define AMDSB_SMBUS_DEVID 0x43851002 #define AMDSB8_SMBUS_REVID 0x40 +#define AMDHUDSON_SMBUS_DEVID 0x780b1022 +#define AMDKERNCZ_SMBUS_DEVID 0x790b1022 #define amdsbwd_verbose_printf(dev, ...) \ do { \ @@ -279,7 +281,9 @@ amdsbwd_identify(driver_t *driver, devic smb_dev = pci_find_bsf(0, 20, 0); if (smb_dev == NULL) return; - if (pci_get_devid(smb_dev) != AMDSB_SMBUS_DEVID) + if (pci_get_devid(smb_dev) != AMDSB_SMBUS_DEVID && + pci_get_devid(smb_dev) != AMDHUDSON_SMBUS_DEVID && + pci_get_devid(smb_dev) != AMDKERNCZ_SMBUS_DEVID) return; child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "amdsbwd", -1); @@ -309,10 +313,12 @@ amdsbwd_probe_sb7xx(device_t dev, struct *addr <<= 8; *addr |= pmio_read(pmres, AMDSB_PM_WDT_BASE_MSB - i); } + *addr &= ~0x07u; + /* Set watchdog timer tick to 1s. */ val = pmio_read(pmres, AMDSB_PM_WDT_CTRL); val &= ~AMDSB_WDT_RES_MASK; - val |= AMDSB_WDT_RES_10MS; + val |= AMDSB_WDT_RES_1S; pmio_write(pmres, AMDSB_PM_WDT_CTRL, val); /* Enable watchdog device (in stopped state). */ @@ -372,7 +378,7 @@ amdsbwd_probe_sb8xx(device_t dev, struct val = pmio_read(pmres, AMDSB8_PM_WDT_EN); device_printf(dev, "AMDSB8_PM_WDT_EN value = %#02x\n", val); #endif - device_set_desc(dev, "AMD SB8xx Watchdog Timer"); + device_set_desc(dev, "AMD SB8xx/SB9xx/Axx Watchdog Timer"); } static int @@ -404,7 +410,8 @@ amdsbwd_probe(device_t dev) smb_dev = pci_find_bsf(0, 20, 0); KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n")); - if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) + if (pci_get_devid(smb_dev) == AMDSB_SMBUS_DEVID && + pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) amdsbwd_probe_sb7xx(dev, res, &addr); else amdsbwd_probe_sb8xx(dev, res, &addr); @@ -440,10 +447,7 @@ amdsbwd_attach_sb(device_t dev, struct a smb_dev = pci_find_bsf(0, 20, 0); KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n")); - if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) - sc->ms_per_tick = 10; - else - sc->ms_per_tick = 1000; + sc->ms_per_tick = 1000; sc->res_ctrl = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid_ctrl, RF_ACTIVE); From owner-svn-src-head@freebsd.org Tue Mar 29 12:50:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49583AE098C; Tue, 29 Mar 2016 12:50:44 +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 mx1.freebsd.org (Postfix) with ESMTPS id 20BB51ED4; Tue, 29 Mar 2016 12:50:44 +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 u2TCohQs004767; Tue, 29 Mar 2016 12:50:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TCogEo004762; Tue, 29 Mar 2016 12:50:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603291250.u2TCogEo004762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 29 Mar 2016 12:50:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297387 - in head/sys/dev: sound/pci/hda usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 12:50:44 -0000 Author: mav Date: Tue Mar 29 12:50:42 2016 New Revision: 297387 URL: https://svnweb.freebsd.org/changeset/base/297387 Log: Add some device IDs found on AMD FCH shipsets. MFC after: 2 weeks Modified: head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/ohci_pci.c head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Tue Mar 29 12:19:46 2016 (r297386) +++ head/sys/dev/sound/pci/hda/hdac.c Tue Mar 29 12:50:42 2016 (r297387) @@ -159,6 +159,7 @@ static const struct { { HDA_ATI_RV940, "ATI RV940", 0, 0 }, { HDA_ATI_RV970, "ATI RV970", 0, 0 }, { HDA_ATI_R1000, "ATI R1000", 0, 0 }, + { HDA_AMD_HUDSON2, "AMD Hudson-2", 0, 0 }, { HDA_RDC_M3010, "RDC M3010", 0, 0 }, { HDA_VIA_VT82XX, "VIA VT8251/8237A",0, 0 }, { HDA_SIS_966, "SiS 966", 0, 0 }, @@ -167,6 +168,7 @@ static const struct { { HDA_INTEL_ALL, "Intel", 0, 0 }, { HDA_NVIDIA_ALL, "NVIDIA", 0, 0 }, { HDA_ATI_ALL, "ATI", 0, 0 }, + { HDA_AMD_ALL, "AMD", 0, 0 }, { HDA_VIA_ALL, "VIA", 0, 0 }, { HDA_SIS_ALL, "SiS", 0, 0 }, { HDA_ULI_ALL, "ULI", 0, 0 }, Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Tue Mar 29 12:19:46 2016 (r297386) +++ head/sys/dev/sound/pci/hda/hdac.h Tue Mar 29 12:50:42 2016 (r297387) @@ -136,6 +136,10 @@ #define HDA_ATI_R1000 HDA_MODEL_CONSTRUCT(ATI, 0xaaa0) #define HDA_ATI_ALL HDA_MODEL_CONSTRUCT(ATI, 0xffff) +#define AMD_VENDORID 0x1022 +#define HDA_AMD_HUDSON2 HDA_MODEL_CONSTRUCT(AMD, 0x780d) +#define HDA_AMD_ALL HDA_MODEL_CONSTRUCT(AMD, 0xffff) + /* RDC */ #define RDC_VENDORID 0x17f3 #define HDA_RDC_M3010 HDA_MODEL_CONSTRUCT(RDC, 0x3010) Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Tue Mar 29 12:19:46 2016 (r297386) +++ head/sys/dev/usb/controller/ehci_pci.c Tue Mar 29 12:50:42 2016 (r297387) @@ -112,6 +112,8 @@ ehci_pci_match(device_t self) case 0x20951022: return ("AMD CS5536 (Geode) USB 2.0 controller"); + case 0x78081022: + return ("AMD FCH USB 2.0 controller"); case 0x43451002: return "ATI SB200 USB 2.0 controller"; Modified: head/sys/dev/usb/controller/ohci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ohci_pci.c Tue Mar 29 12:19:46 2016 (r297386) +++ head/sys/dev/usb/controller/ohci_pci.c Tue Mar 29 12:50:42 2016 (r297387) @@ -124,9 +124,10 @@ ohci_pci_match(device_t self) case 0x740c1022: return ("AMD-756 USB Controller"); - case 0x74141022: return ("AMD-766 USB Controller"); + case 0x78071022: + return ("AMD FCH USB Controller"); case 0x43741002: return "ATI SB400 USB Controller"; Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Tue Mar 29 12:19:46 2016 (r297386) +++ head/sys/dev/usb/controller/xhci_pci.c Tue Mar 29 12:50:42 2016 (r297387) @@ -95,6 +95,9 @@ xhci_pci_match(device_t self) uint32_t device_id = pci_get_devid(self); switch (device_id) { + case 0x78141022: + return ("AMD FCH USB 3.0 controller"); + case 0x01941033: return ("NEC uPD720200 USB 3.0 controller"); From owner-svn-src-head@freebsd.org Tue Mar 29 13:28:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54FC3AE1474; Tue, 29 Mar 2016 13:28:14 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 264491454; Tue, 29 Mar 2016 13:28:14 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2TDSDil017061; Tue, 29 Mar 2016 13:28:13 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TDSDCg017060; Tue, 29 Mar 2016 13:28:13 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201603291328.u2TDSDCg017060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 29 Mar 2016 13:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297388 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 13:28:14 -0000 Author: zbb Date: Tue Mar 29 13:28:13 2016 New Revision: 297388 URL: https://svnweb.freebsd.org/changeset/base/297388 Log: Don't manage free SQ entry index by the atomic operations It is not necessary as entries are being manipulated under lock. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5536 Modified: head/sys/dev/vnic/nicvf_queues.c Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Tue Mar 29 12:50:42 2016 (r297387) +++ head/sys/dev/vnic/nicvf_queues.c Tue Mar 29 13:28:13 2016 (r297388) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1048,7 +1047,7 @@ nicvf_init_snd_queue(struct nicvf *nic, sq->desc = sq->dmem.base; sq->head = sq->tail = 0; - atomic_store_rel_int(&sq->free_cnt, q_len - 1); + sq->free_cnt = q_len - 1; sq->thresh = SND_QUEUE_THRESH; sq->idx = qidx; sq->nic = nic; @@ -1640,7 +1639,7 @@ nicvf_get_sq_desc(struct snd_queue *sq, int qentry; qentry = sq->tail; - atomic_subtract_int(&sq->free_cnt, desc_cnt); + sq->free_cnt -= desc_cnt; sq->tail += desc_cnt; sq->tail &= (sq->dmem.q_len - 1); @@ -1652,7 +1651,7 @@ static void nicvf_put_sq_desc(struct snd_queue *sq, int desc_cnt) { - atomic_add_int(&sq->free_cnt, desc_cnt); + sq->free_cnt += desc_cnt; sq->head += desc_cnt; sq->head &= (sq->dmem.q_len - 1); } From owner-svn-src-head@freebsd.org Tue Mar 29 13:31:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D297AE1600; Tue, 29 Mar 2016 13:31:10 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25B871816; Tue, 29 Mar 2016 13:31:10 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2TDV9WS019156; Tue, 29 Mar 2016 13:31:09 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TDV93m019155; Tue, 29 Mar 2016 13:31:09 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201603291331.u2TDV93m019155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 29 Mar 2016 13:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297389 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 13:31:10 -0000 Author: zbb Date: Tue Mar 29 13:31:09 2016 New Revision: 297389 URL: https://svnweb.freebsd.org/changeset/base/297389 Log: Improve HW checksums support in VNIC - Do not mark CSUM_IP_CHECKED and CSUM_IP_VALID on IPv6 packets. IPv6 does not have checksums by definition. - Set SCTP packets csum_flags CSUM_SCTP_VALID instead of CSUM_DATA_VALID and skip csum_data - Set csum_data simply as 0xffff without byteswap Pointed out by: yongari Reviewed by: yongari, wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5537 Modified: head/sys/dev/vnic/nicvf_queues.c Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Tue Mar 29 13:28:13 2016 (r297388) +++ head/sys/dev/vnic/nicvf_queues.c Tue Mar 29 13:31:09 2016 (r297389) @@ -1771,7 +1771,6 @@ nicvf_sq_add_hdr_subdesc(struct snd_queu } ip = (struct ip *)(mbuf->m_data + ehdrlen); - ip->ip_sum = 0; iphlen = ip->ip_hl << 2; poff = ehdrlen + iphlen; @@ -1984,19 +1983,23 @@ nicvf_get_rcv_mbuf(struct nicvf *nic, st /* * HW by default verifies IP & TCP/UDP/SCTP checksums */ - - /* XXX: Do we need to include IP with options too? */ - if (__predict_true(cqe_rx->l3_type == L3TYPE_IPV4 || - cqe_rx->l3_type == L3TYPE_IPV6)) { + if (__predict_true(cqe_rx->l3_type == L3TYPE_IPV4)) { mbuf->m_pkthdr.csum_flags = (CSUM_IP_CHECKED | CSUM_IP_VALID); } - if (cqe_rx->l4_type == L4TYPE_TCP || - cqe_rx->l4_type == L4TYPE_UDP || - cqe_rx->l4_type == L4TYPE_SCTP) { + + switch (cqe_rx->l4_type) { + case L4TYPE_UDP: + case L4TYPE_TCP: /* fall through */ mbuf->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); - mbuf->m_pkthdr.csum_data = htons(0xffff); + mbuf->m_pkthdr.csum_data = 0xffff; + break; + case L4TYPE_SCTP: + mbuf->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; + break; + default: + break; } } } From owner-svn-src-head@freebsd.org Tue Mar 29 13:51:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 471EEAE1D4C; Tue, 29 Mar 2016 13:51:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0087E11EB; Tue, 29 Mar 2016 13:51:27 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2TDpROh023063; Tue, 29 Mar 2016 13:51:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TDpRYd023061; Tue, 29 Mar 2016 13:51:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201603291351.u2TDpRYd023061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 29 Mar 2016 13:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297390 - in head/sys: arm/arm arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 13:51:28 -0000 Author: andrew Date: Tue Mar 29 13:51:26 2016 New Revision: 297390 URL: https://svnweb.freebsd.org/changeset/base/297390 Log: Read the CPU ID for the current CPU from the GIC. The GIC may have a different ID space than the kernel. Because of this we need to read the ID from the hardware. The hardware will provide this value to the CPU by reading any of the first 8 Interrupt Processor Targets Registers. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5706 Modified: head/sys/arm/arm/gic.c head/sys/arm64/arm64/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Tue Mar 29 13:31:09 2016 (r297389) +++ head/sys/arm/arm/gic.c Tue Mar 29 13:51:26 2016 (r297390) @@ -376,7 +376,7 @@ arm_gic_attach(device_t dev) { struct arm_gic_softc *sc; int i; - uint32_t icciidr; + uint32_t icciidr, mask; #ifdef ARM_INTRNG phandle_t pxref; intptr_t xref = gic_xref(dev); @@ -437,10 +437,28 @@ arm_gic_attach(device_t dev) gic_d_write_4(sc, GICD_ICENABLER(i >> 5), 0xFFFFFFFF); } + /* Read the current cpuid mask by reading ITARGETSR{0..7} */ + for (i = 0; i < 8; i++) { + mask = gic_d_read_4(sc, GICD_ITARGETSR(i)); + if (mask != 0) + break; + } + /* No mask found, assume we are on CPU interface 0 */ + if (mask == 0) + mask = 1; + + /* Collect the mask in the lower byte */ + mask |= mask >> 16; + mask |= mask >> 8; + /* Distribute this back to the upper bytes */ + mask |= mask << 8; + mask |= mask << 16; + for (i = 0; i < sc->nirqs; i += 4) { gic_d_write_4(sc, GICD_IPRIORITYR(i >> 2), 0); - gic_d_write_4(sc, GICD_ITARGETSR(i >> 2), - 1 << 0 | 1 << 8 | 1 << 16 | 1 << 24); + if (i > 32) { + gic_d_write_4(sc, GICD_ITARGETSR(i >> 2), mask); + } } /* Set all the interrupts to be in Group 0 (secure) */ Modified: head/sys/arm64/arm64/gic.c ============================================================================== --- head/sys/arm64/arm64/gic.c Tue Mar 29 13:31:09 2016 (r297389) +++ head/sys/arm64/arm64/gic.c Tue Mar 29 13:51:26 2016 (r297390) @@ -162,7 +162,7 @@ arm_gic_attach(device_t dev) { struct arm_gic_softc *sc; int i; - uint32_t icciidr; + uint32_t icciidr, mask; if (arm_gic_sc) return (ENXIO); @@ -212,10 +212,28 @@ arm_gic_attach(device_t dev) gic_d_write_4(sc, GICD_ICENABLER(i >> 5), 0xFFFFFFFF); } + /* Read the current cpuid mask by reading ITARGETSR{0..7} */ + for (i = 0; i < 8; i++) { + mask = gic_d_read_4(sc, GICD_ITARGETSR(i)); + if (mask != 0) + break; + } + /* No mask found, assume we are on CPU interface 0 */ + if (mask == 0) + mask = 1; + + /* Collect the mask in the lower byte */ + mask |= mask >> 16; + mask |= mask >> 8; + /* Distribute this back to the upper bytes */ + mask |= mask << 8; + mask |= mask << 16; + for (i = 0; i < sc->nirqs; i += 4) { gic_d_write_4(sc, GICD_IPRIORITYR(i >> 2), 0); - gic_d_write_4(sc, GICD_ITARGETSR(i >> 2), - 1 << 0 | 1 << 8 | 1 << 16 | 1 << 24); + if (i > 32) { + gic_d_write_4(sc, GICD_ITARGETSR(i >> 2), mask); + } } /* Set all the interrupts to be in Group 0 (secure) */ From owner-svn-src-head@freebsd.org Tue Mar 29 13:57:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81F09AE1FEE; Tue, 29 Mar 2016 13:57:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 456BA176F; Tue, 29 Mar 2016 13:57:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2TDv0U0026202; Tue, 29 Mar 2016 13:57:00 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TDuxxU026190; Tue, 29 Mar 2016 13:56:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603291356.u2TDuxxU026190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 29 Mar 2016 13:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297391 - in head/sys: kern net netinet rpc ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 13:57:01 -0000 Author: trasz Date: Tue Mar 29 13:56:59 2016 New Revision: 297391 URL: https://svnweb.freebsd.org/changeset/base/297391 Log: Remove some NULL checks for M_WAITOK allocations. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/imgact_elf.c head/sys/kern/kern_exec.c head/sys/kern/kern_linker.c head/sys/net/rtsock.c head/sys/netinet/tcp_subr.c head/sys/rpc/rpc_generic.c head/sys/ufs/ufs/ufs_extattr.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Tue Mar 29 13:51:26 2016 (r297390) +++ head/sys/kern/imgact_elf.c Tue Mar 29 13:56:59 2016 (r297391) @@ -1370,10 +1370,6 @@ __elfN(coredump)(struct thread *td, stru * and write it out following the notes. */ hdr = malloc(hdrsize, M_TEMP, M_WAITOK); - if (hdr == NULL) { - error = EINVAL; - goto done; - } error = __elfN(corehdr)(¶ms, seginfo.count, hdr, hdrsize, ¬elst, notesz); Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Tue Mar 29 13:51:26 2016 (r297390) +++ head/sys/kern/kern_exec.c Tue Mar 29 13:56:59 2016 (r297391) @@ -1570,8 +1570,6 @@ exec_register(execsw_arg) for (es = execsw; *es; es++) count++; newexecsw = malloc(count * sizeof(*es), M_TEMP, M_WAITOK); - if (newexecsw == NULL) - return (ENOMEM); xs = newexecsw; if (execsw) for (es = execsw; *es; es++) @@ -1604,8 +1602,6 @@ exec_unregister(execsw_arg) if (*es != execsw_arg) count++; newexecsw = malloc(count * sizeof(*es), M_TEMP, M_WAITOK); - if (newexecsw == NULL) - return (ENOMEM); xs = newexecsw; for (es = execsw; *es; es++) if (*es != execsw_arg) Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Tue Mar 29 13:51:26 2016 (r297390) +++ head/sys/kern/kern_linker.c Tue Mar 29 13:56:59 2016 (r297391) @@ -1763,8 +1763,6 @@ linker_hints_lookup(const char *path, in goto bad; } hints = malloc(vattr.va_size, M_TEMP, M_WAITOK); - if (hints == NULL) - goto bad; error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t)hints, vattr.va_size, 0, UIO_SYSSPACE, IO_NODELOCKED, cred, NOCRED, &reclen, td); if (error) Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Tue Mar 29 13:51:26 2016 (r297390) +++ head/sys/net/rtsock.c Tue Mar 29 13:56:59 2016 (r297391) @@ -275,8 +275,6 @@ rts_attach(struct socket *so, int proto, /* XXX */ rp = malloc(sizeof *rp, M_PCB, M_WAITOK | M_ZERO); - if (rp == NULL) - return ENOBUFS; so->so_pcb = (caddr_t)rp; so->so_fibnum = td->td_proc->p_fibnum; Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Mar 29 13:51:26 2016 (r297390) +++ head/sys/netinet/tcp_subr.c Tue Mar 29 13:56:59 2016 (r297391) @@ -1706,8 +1706,6 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) return (error); inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); - if (inp_list == NULL) - return (ENOMEM); INP_INFO_WLOCK(&V_tcbinfo); for (inp = LIST_FIRST(V_tcbinfo.ipi_listhead), i = 0; Modified: head/sys/rpc/rpc_generic.c ============================================================================== --- head/sys/rpc/rpc_generic.c Tue Mar 29 13:51:26 2016 (r297390) +++ head/sys/rpc/rpc_generic.c Tue Mar 29 13:56:59 2016 (r297391) @@ -390,15 +390,11 @@ __rpc_uaddr2taddr_af(int af, const char } ret = (struct netbuf *)malloc(sizeof *ret, M_RPC, M_WAITOK); - if (ret == NULL) - goto out; switch (af) { case AF_INET: sin = (struct sockaddr_in *)malloc(sizeof *sin, M_RPC, M_WAITOK); - if (sin == NULL) - goto out; memset(sin, 0, sizeof *sin); sin->sin_family = AF_INET; sin->sin_port = htons(port); @@ -415,8 +411,6 @@ __rpc_uaddr2taddr_af(int af, const char case AF_INET6: sin6 = (struct sockaddr_in6 *)malloc(sizeof *sin6, M_RPC, M_WAITOK); - if (sin6 == NULL) - goto out; memset(sin6, 0, sizeof *sin6); sin6->sin6_family = AF_INET6; sin6->sin6_port = htons(port); @@ -433,8 +427,6 @@ __rpc_uaddr2taddr_af(int af, const char case AF_LOCAL: sun = (struct sockaddr_un *)malloc(sizeof *sun, M_RPC, M_WAITOK); - if (sun == NULL) - goto out; memset(sun, 0, sizeof *sun); sun->sun_family = AF_LOCAL; strncpy(sun->sun_path, addrstr, sizeof(sun->sun_path) - 1); Modified: head/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- head/sys/ufs/ufs/ufs_extattr.c Tue Mar 29 13:51:26 2016 (r297390) +++ head/sys/ufs/ufs/ufs_extattr.c Tue Mar 29 13:56:59 2016 (r297391) @@ -597,8 +597,6 @@ ufs_extattr_enable(struct ufsmount *ump, attribute = malloc(sizeof(struct ufs_extattr_list_entry), M_UFS_EXTATTR, M_WAITOK); - if (attribute == NULL) - return (ENOMEM); if (!(ump->um_extattr.uepm_flags & UFS_EXTATTR_UEPM_STARTED)) { error = EOPNOTSUPP; From owner-svn-src-head@freebsd.org Tue Mar 29 14:09:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA4DDAE04B0; Tue, 29 Mar 2016 14:09:13 +0000 (UTC) (envelope-from rpokala@panasas.com) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0077.outbound.protection.outlook.com [207.46.100.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FDA111A5; Tue, 29 Mar 2016 14:09:12 +0000 (UTC) (envelope-from rpokala@panasas.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=panasas.onmicrosoft.com; s=selector1-panasas-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=K5up+jiLJu7cDSxsvn2jczW38oeLcXWuiBZcaXh/lFo=; b=Y6IaSONAu/R1sv06T98oehEvAr9NOEh3pVETSbOETdtB85mpEgo019n5vLNEEX83CoV7dSM5q/osn2jSqvVcZRdL+Yov0ZkFq5DzGWfshbkNQbH9nDMtBRKLvwdbFSSaaJmxvHbLQ8zII5sz4yVJqTLSTaSozji+JHSuqrjfbaw= Received: from CY1PR08MB1803.namprd08.prod.outlook.com (10.162.218.25) by CY1PR08MB1802.namprd08.prod.outlook.com (10.162.218.24) with Microsoft SMTP Server (TLS) id 15.1.443.12; Tue, 29 Mar 2016 14:09:06 +0000 Received: from CY1PR08MB1803.namprd08.prod.outlook.com ([10.162.218.25]) by CY1PR08MB1803.namprd08.prod.outlook.com ([10.162.218.25]) with mapi id 15.01.0443.017; Tue, 29 Mar 2016 14:09:05 +0000 From: "Pokala, Ravi" To: Konstantin Belousov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r297374 - head/sys/x86/x86 Thread-Topic: svn commit: r297374 - head/sys/x86/x86 Thread-Index: AQHRicSN+6qIdzMyRUGLRp9ENeNrYw== Date: Tue, 29 Mar 2016 14:09:05 +0000 Message-ID: References: <201603290844.u2T8ivrN030045@repo.freebsd.org> In-Reply-To: <201603290844.u2T8ivrN030045@repo.freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/0.0.0.160212 authentication-results: FreeBSD.org; dkim=none (message not signed) header.d=none;FreeBSD.org; dmarc=none action=none header.from=panasas.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [50.174.208.73] x-ms-office365-filtering-correlation-id: 2a7d0930-0d8d-405b-e5af-08d357dbb045 x-microsoft-exchange-diagnostics: 1; CY1PR08MB1802; 5:5YeGjElhEUzfWAILuMIk0+NUYdPlhOvbnaG8qED6nfWupqM+cho1uckvG+FVid+cqLQdcVFxJTqRd2nNzczJgsmyp52iQyWvwWhIev+KMSsm/P9oze7o3Drv8f9Kc/vfmk9ifymyNXOBIQmdHpwuYA==; 24:FTJsGGhREIbhlOdLFSbNlhc2DKsv0Ih2Vblsr8E5n7lCMYXpH8kr7/DzmodXgVFJd8F3R87hLLe1ApT9XdFWK4jhlgJV5iy6CEU6JQiTss4= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR08MB1802; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:CY1PR08MB1802; BCL:0; PCL:0; RULEID:; SRVR:CY1PR08MB1802; x-forefront-prvs: 0896BFCE6C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(377424004)(13464003)(50986999)(586003)(76176999)(54356999)(6116002)(102836003)(83506001)(33656002)(3846002)(86362001)(83716003)(5004730100002)(2201001)(5001770100001)(4001350100001)(189998001)(107886002)(5008740100001)(1096002)(122556002)(106116001)(66066001)(1220700001)(99286002)(19580405001)(19580395003)(15975445007)(77096005)(2950100001)(92566002)(450100001)(81166005)(10400500002)(3660700001)(2900100001)(36756003)(87936001)(2501003)(2906002)(82746002)(3280700002)(5002640100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR08MB1802; H:CY1PR08MB1803.namprd08.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: panasas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2016 14:09:05.1821 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: acf01c9d-c699-42af-bdbb-44bf582e60b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR08MB1802 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 14:09:13 -0000 SGkgS2liLA0KDQoNCg0KLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCkZyb206IDxvd25lci1z cmMtY29tbWl0dGVyc0BmcmVlYnNkLm9yZz4gb24gYmVoYWxmIG9mIEtvbnN0YW50aW4gQmVsb3Vz b3YgPGtpYkBGcmVlQlNELm9yZz4NCkRhdGU6IDIwMTYtMDMtMjksIFR1ZXNkYXkgYXQgMDE6NDQN ClRvOiA8c3JjLWNvbW1pdHRlcnNAZnJlZWJzZC5vcmc+LCA8c3ZuLXNyYy1hbGxAZnJlZWJzZC5v cmc+LCA8c3ZuLXNyYy1oZWFkQGZyZWVic2Qub3JnPg0KU3ViamVjdDogc3ZuIGNvbW1pdDogcjI5 NzM3NCAtIGhlYWQvc3lzL3g4Ni94ODYNCg0KPkF1dGhvcjoga2liDQo+RGF0ZTogVHVlIE1hciAy OSAwODo0NDo1NiAyMDE2DQo+TmV3IFJldmlzaW9uOiAyOTczNzQNCj5VUkw6IGh0dHBzOi8vc3Zu d2ViLmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzI5NzM3NA0KPg0KPi4uLg0KPiAgDQo+KwlL QVNTRVJUKChjcHVfZmVhdHVyZSAmIENQVUlEX1RTQykgIT0gMCAmJiB0c2NfZnJlcSAhPSAwLA0K PisJICAgICgiVFNDIG5vdCBpbml0aWFsaXplZCIpKTsNCj4rCXIgPSByZHRzYygpOw0KPisJZm9y IChyID0gMDsgciA8IExPT1BTOyByKyspIHsNCj4rCQkodm9pZClsYXBpY19yZWFkX2ljcl9sbygp Ow0KPisJCWlhMzJfcGF1c2UoKTsNCj4rCX0NCj4rCXIgPSByZHRzYygpIC0gcjsNCj4NCj4uLi4N Cg0KRG9lc24ndCB1c2Ugb2YgciBhcyB0aGUgbG9vcCBpbmRleCBvdmVyd3JpdGUgdGhlIGluaXRp YWwgdmFsdWUgcmV0dXJuZWQgYnkgcmR0c2MoKT8NCg0KLVJhdmkNCg== From owner-svn-src-head@freebsd.org Tue Mar 29 15:19:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08709AE18DA; Tue, 29 Mar 2016 15:19:59 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC4961BEA; Tue, 29 Mar 2016 15:19:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2TFJw2W051584; Tue, 29 Mar 2016 15:19:58 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TFJuXW051571; Tue, 29 Mar 2016 15:19:56 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201603291519.u2TFJuXW051571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 29 Mar 2016 15:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 15:19:59 -0000 Author: zbb Date: Tue Mar 29 15:19:56 2016 New Revision: 297392 URL: https://svnweb.freebsd.org/changeset/base/297392 Log: Reduce OFW PCI code duplication - involves ARM, PPC and SPARC64 Import portions of the PowerPC OF PCI implementation into new file "ofwpci.c", common for other platforms. The files ofw_pci.c and ofw_pci.h from sys/powerpc/ofw no longer exist. All required declarations are moved to sys/dev/ofw/ofwpci.h. This creates a new ofw_pci_write_ivar() function and modifies some others methods. Most functions contain existing ppc implementations in the majority unchanged. Now there is no need to have multiple identical copies of methods for various architectures. Requested by: jhibbits Reviewed by: jhibbits, marius Submitted by: Marcin Mazurek Obtained from: Semihalf Sponsored by: Annapurna Labs Differential Revision: https://reviews.freebsd.org/D4879 Added: head/sys/dev/ofw/ofwpci.c (contents, props changed) head/sys/dev/ofw/ofwpci.h (contents, props changed) Modified: head/sys/conf/files.arm head/sys/conf/files.arm64 head/sys/conf/files.i386 head/sys/conf/files.mips head/sys/conf/files.powerpc head/sys/powerpc/mpc85xx/pci_mpc85xx.c head/sys/powerpc/powermac/cpcht.c head/sys/powerpc/powermac/grackle.c head/sys/powerpc/powermac/uninorthpci.c head/sys/powerpc/powermac/uninorthvar.h head/sys/powerpc/pseries/rtas_pci.c Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Tue Mar 29 13:56:59 2016 (r297391) +++ head/sys/conf/files.arm Tue Mar 29 15:19:56 2016 (r297392) @@ -103,6 +103,7 @@ dev/hwpmc/hwpmc_arm.c optional hwpmc dev/hwpmc/hwpmc_armv7.c optional hwpmc armv6 dev/iicbus/twsi/twsi.c optional twsi dev/ofw/ofw_cpu.c optional fdt +dev/ofw/ofwpci.c optional fdt pci dev/pci/pci_host_generic.c optional pci_host_generic pci fdt dev/psci/psci.c optional psci dev/psci/psci_arm.S optional psci Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Mar 29 13:56:59 2016 (r297391) +++ head/sys/conf/files.arm64 Tue Mar 29 15:19:56 2016 (r297392) @@ -66,6 +66,7 @@ dev/hwpmc/hwpmc_arm64_md.c optional hwpm dev/mmc/host/dwmmc.c optional dwmmc dev/mmc/host/dwmmc_hisi.c optional dwmmc soc_hisi_hi6220 dev/ofw/ofw_cpu.c optional fdt +dev/ofw/ofwpci.c optional fdt pci dev/pci/pci_host_generic.c optional pci fdt dev/psci/psci.c optional psci dev/psci/psci_arm64.S optional psci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Mar 29 13:56:59 2016 (r297391) +++ head/sys/conf/files.i386 Tue Mar 29 15:19:56 2016 (r297392) @@ -285,6 +285,7 @@ dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa +dev/ofw/ofwpci.c optional fdt pci dev/pcf/pcf_isa.c optional pcf dev/random/ivy.c optional rdrand_rng dev/random/nehemiah.c optional padlock_rng Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Tue Mar 29 13:56:59 2016 (r297391) +++ head/sys/conf/files.mips Tue Mar 29 15:19:56 2016 (r297392) @@ -92,3 +92,6 @@ dev/nvram2env/nvram2env.c optional nvra dev/hwpmc/hwpmc_mips.c optional hwpmc dev/hwpmc/hwpmc_mips24k.c optional hwpmc_mips24k dev/hwpmc/hwpmc_mips74k.c optional hwpmc_mips74k + +# ofw support +dev/ofw/ofwpci.c optional fdt pci Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue Mar 29 13:56:59 2016 (r297391) +++ head/sys/conf/files.powerpc Tue Mar 29 15:19:56 2016 (r297392) @@ -57,6 +57,7 @@ dev/ofw/ofw_console.c optional aim dev/ofw/ofw_disk.c optional ofwd aim dev/ofw/ofw_iicbus.c optional iicbus aim dev/ofw/ofwbus.c optional aim | fdt +dev/ofw/ofwpci.c optional fdt pci dev/ofw/ofw_standard.c optional aim powerpc dev/ofw/ofw_subr.c optional aim powerpc dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac @@ -145,7 +146,6 @@ powerpc/mpc85xx/pci_mpc85xx.c optional p powerpc/mpc85xx/pci_mpc85xx_pcib.c optional pci mpc85xx | pci qoriq_dpaa powerpc/mpc85xx/qoriq_gpio.c optional mpc85xx gpio | qoriq_dpaa gpio powerpc/ofw/ofw_machdep.c standard -powerpc/ofw/ofw_pci.c optional pci powerpc/ofw/ofw_pcibus.c optional pci powerpc/ofw/ofw_pcib_pci.c optional pci powerpc/ofw/ofw_real.c optional aim Added: head/sys/dev/ofw/ofwpci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ofw/ofwpci.c Tue Mar 29 15:19:56 2016 (r297392) @@ -0,0 +1,628 @@ +/*- + * Copyright (c) 2011 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#include "pcib_if.h" + +/* + * If it is necessary to set another value of this for + * some platforms it should be set at fdt.h file + */ +#ifndef PCI_MAP_INTR +#define PCI_MAP_INTR 4 +#endif + +#define PCI_INTR_PINS 4 + +/* + * bus interface. + */ +static struct resource * ofw_pci_alloc_resource(device_t, device_t, + int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int ofw_pci_release_resource(device_t, device_t, int, int, + struct resource *); +static int ofw_pci_activate_resource(device_t, device_t, int, int, + struct resource *); +static int ofw_pci_deactivate_resource(device_t, device_t, int, int, + struct resource *); +static int ofw_pci_adjust_resource(device_t, device_t, int, + struct resource *, rman_res_t, rman_res_t); + +#ifdef __powerpc__ +static bus_space_tag_t ofw_pci_bus_get_bus_tag(device_t, device_t); +#endif + +/* + * pcib interface + */ +static int ofw_pci_maxslots(device_t); + +/* + * ofw_bus interface + */ +static phandle_t ofw_pci_get_node(device_t, device_t); + +/* + * local methods + */ +static int ofw_pci_fill_ranges(phandle_t, struct ofw_pci_range *); + +/* + * Driver methods. + */ +static device_method_t ofw_pci_methods[] = { + + /* Device interface */ + DEVMETHOD(device_attach, ofw_pci_attach), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_read_ivar, ofw_pci_read_ivar), + DEVMETHOD(bus_write_ivar, ofw_pci_write_ivar), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, ofw_pci_alloc_resource), + DEVMETHOD(bus_release_resource, ofw_pci_release_resource), + DEVMETHOD(bus_activate_resource, ofw_pci_activate_resource), + DEVMETHOD(bus_deactivate_resource, ofw_pci_deactivate_resource), + DEVMETHOD(bus_adjust_resource, ofw_pci_adjust_resource), +#ifdef __powerpc__ + DEVMETHOD(bus_get_bus_tag, ofw_pci_bus_get_bus_tag), +#endif + + /* pcib interface */ + DEVMETHOD(pcib_maxslots, ofw_pci_maxslots), + DEVMETHOD(pcib_route_interrupt, ofw_pci_route_interrupt), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, ofw_pci_get_node), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(ofw_pci, ofw_pci_driver, ofw_pci_methods, 0); + +int +ofw_pci_init(device_t dev) +{ + struct ofw_pci_softc *sc; + phandle_t node; + u_int32_t busrange[2]; + struct ofw_pci_range *rp; + int error; + struct ofw_pci_cell_info *cell_info; + + node = ofw_bus_get_node(dev); + sc = device_get_softc(dev); + sc->sc_initialized = 1; + sc->sc_range = NULL; + + cell_info = (struct ofw_pci_cell_info *)malloc(sizeof(*cell_info), + M_DEVBUF, M_WAITOK | M_ZERO); + + sc->sc_cell_info = cell_info; + + if (OF_getencprop(node, "bus-range", busrange, sizeof(busrange)) != 8) + busrange[0] = 0; + + sc->sc_dev = dev; + sc->sc_node = node; + sc->sc_bus = busrange[0]; + + if (sc->sc_quirks & OFW_PCI_QUIRK_RANGES_ON_CHILDREN) { + phandle_t c; + int n, i; + + sc->sc_nrange = 0; + for (c = OF_child(node); c != 0; c = OF_peer(c)) { + n = ofw_pci_nranges(c, cell_info); + if (n > 0) + sc->sc_nrange += n; + } + if (sc->sc_nrange == 0) { + error = ENXIO; + goto out; + } + sc->sc_range = malloc(sc->sc_nrange * sizeof(sc->sc_range[0]), + M_DEVBUF, M_WAITOK); + i = 0; + for (c = OF_child(node); c != 0; c = OF_peer(c)) { + n = ofw_pci_fill_ranges(c, &sc->sc_range[i]); + if (n > 0) + i += n; + } + KASSERT(i == sc->sc_nrange, ("range count mismatch")); + } else { + sc->sc_nrange = ofw_pci_nranges(node, cell_info); + if (sc->sc_nrange <= 0) { + device_printf(dev, "could not getranges\n"); + error = ENXIO; + goto out; + } + sc->sc_range = malloc(sc->sc_nrange * sizeof(sc->sc_range[0]), + M_DEVBUF, M_WAITOK); + ofw_pci_fill_ranges(node, sc->sc_range); + } + + sc->sc_io_rman.rm_type = RMAN_ARRAY; + sc->sc_io_rman.rm_descr = "PCI I/O Ports"; + error = rman_init(&sc->sc_io_rman); + if (error) { + device_printf(dev, "rman_init() failed. error = %d\n", error); + goto out; + } + + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "PCI Memory"; + error = rman_init(&sc->sc_mem_rman); + if (error) { + device_printf(dev, "rman_init() failed. error = %d\n", error); + goto out; + } + + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && + rp->pci_hi != 0; rp++) { + error = 0; + + switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { + case OFW_PCI_PHYS_HI_SPACE_CONFIG: + break; + case OFW_PCI_PHYS_HI_SPACE_IO: + error = rman_manage_region(&sc->sc_io_rman, rp->pci, + rp->pci + rp->size - 1); + break; + case OFW_PCI_PHYS_HI_SPACE_MEM32: + case OFW_PCI_PHYS_HI_SPACE_MEM64: + error = rman_manage_region(&sc->sc_mem_rman, rp->pci, + rp->pci + rp->size - 1); + break; + } + + if (error) { + device_printf(dev, + "rman_manage_region(%x, %#jx, %#jx) failed. " + "error = %d\n", rp->pci_hi & + OFW_PCI_PHYS_HI_SPACEMASK, rp->pci, + rp->pci + rp->size - 1, error); + goto out; + } + } + + ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(cell_t)); + return (0); + +out: + free(cell_info, M_DEVBUF); + free(sc->sc_range, M_DEVBUF); + rman_fini(&sc->sc_io_rman); + rman_fini(&sc->sc_mem_rman); + + return (error); +} + +int +ofw_pci_attach(device_t dev) +{ + struct ofw_pci_softc *sc; + int error; + + sc = device_get_softc(dev); + if (!sc->sc_initialized) { + error = ofw_pci_init(dev); + if (error) + return (error); + } + + device_add_child(dev, "pci", -1); + return (bus_generic_attach(dev)); +} + +static int +ofw_pci_maxslots(device_t dev) +{ + + return (PCI_SLOTMAX); +} + +int +ofw_pci_route_interrupt(device_t bus, device_t dev, int pin) +{ + struct ofw_pci_softc *sc; + struct ofw_pci_register reg; + uint32_t pintr, mintr[PCI_MAP_INTR]; + int intrcells; + phandle_t iparent; + + sc = device_get_softc(bus); + pintr = pin; + + /* Fabricate imap information in case this isn't an OFW device */ + bzero(®, sizeof(reg)); + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); + + intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), + &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), + mintr, sizeof(mintr), &iparent); + if (intrcells != 0) { + pintr = ofw_bus_map_intr(dev, iparent, intrcells, mintr); + return (pintr); + } + + /* + * Maybe it's a real interrupt, not an intpin + */ + if (pin > PCI_INTR_PINS) + return (pin); + + device_printf(bus, "could not route pin %d for device %d.%d\n", + pin, pci_get_slot(dev), pci_get_function(dev)); + return (PCI_INVALID_IRQ); +} + +int +ofw_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct ofw_pci_softc *sc; + + sc = device_get_softc(dev); + + switch (which) { + case PCIB_IVAR_DOMAIN: + *result = device_get_unit(dev); + return (0); + case PCIB_IVAR_BUS: + *result = sc->sc_bus; + return (0); + default: + break; + } + + return (ENOENT); +} + +int +ofw_pci_write_ivar(device_t dev, device_t child, int which, uintptr_t value) +{ + struct ofw_pci_softc *sc; + + sc = device_get_softc(dev); + + switch (which) { + case PCIB_IVAR_BUS: + sc->sc_bus = value; + return (0); + default: + break; + } + + return (ENOENT); +} + +int +ofw_pci_nranges(phandle_t node, struct ofw_pci_cell_info *info) +{ + ssize_t nbase_ranges; + + if (info == NULL) + return (-1); + + info->host_address_cells = 1; + info->size_cells = 2; + info->pci_address_cell = 3; + + OF_getencprop(OF_parent(node), "#address-cells", + &(info->host_address_cells), sizeof(info->host_address_cells)); + OF_getencprop(node, "#address-cells", + &(info->pci_address_cell), sizeof(info->pci_address_cell)); + OF_getencprop(node, "#size-cells", &(info->size_cells), + sizeof(info->size_cells)); + + nbase_ranges = OF_getproplen(node, "ranges"); + if (nbase_ranges <= 0) + return (-1); + + return (nbase_ranges / sizeof(cell_t) / + (info->pci_address_cell + info->host_address_cells + + info->size_cells)); +} + +static struct resource * +ofw_pci_alloc_resource(device_t bus, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ + struct ofw_pci_softc *sc; + struct resource *rv; + struct rman *rm; + int needactivate; + + needactivate = flags & RF_ACTIVE; + flags &= ~RF_ACTIVE; + + sc = device_get_softc(bus); + + switch (type) { + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + + case SYS_RES_IOPORT: + rm = &sc->sc_io_rman; + break; + + case SYS_RES_IRQ: + return (bus_alloc_resource(bus, type, rid, start, end, count, + flags)); + + default: + device_printf(bus, "unknown resource request from %s\n", + device_get_nameunit(child)); + return (NULL); + } + + rv = rman_reserve_resource(rm, start, end, count, flags, child); + if (rv == NULL) { + device_printf(bus, "failed to reserve resource for %s\n", + device_get_nameunit(child)); + return (NULL); + } + + rman_set_rid(rv, *rid); + + if (needactivate) { + if (bus_activate_resource(child, type, *rid, rv) != 0) { + device_printf(bus, + "failed to activate resource for %s\n", + device_get_nameunit(child)); + rman_release_resource(rv); + return (NULL); + } + } + + return (rv); +} + +static int +ofw_pci_release_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + if (rman_get_flags(res) & RF_ACTIVE) { + int error = bus_deactivate_resource(child, type, rid, res); + if (error) + return error; + } + + return (rman_release_resource(res)); +} + +static int +ofw_pci_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + struct ofw_pci_softc *sc; + bus_space_handle_t handle; + bus_space_tag_t tag; + int rv; + + sc = device_get_softc(bus); + + if (type == SYS_RES_IRQ) { + return (bus_activate_resource(bus, type, rid, res)); + } + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + struct ofw_pci_range *rp; + vm_paddr_t start; + int space; + + start = (vm_paddr_t)rman_get_start(res); + + /* + * Map this through the ranges list + */ + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && + rp->pci_hi != 0; rp++) { + if (start < rp->pci || start >= rp->pci + rp->size) + continue; + + switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { + case OFW_PCI_PHYS_HI_SPACE_IO: + space = SYS_RES_IOPORT; + break; + case OFW_PCI_PHYS_HI_SPACE_MEM32: + case OFW_PCI_PHYS_HI_SPACE_MEM64: + space = SYS_RES_MEMORY; + break; + default: + space = -1; + } + + if (type == space) { + start += (rp->host - rp->pci); + break; + } + } + + if (bootverbose) + printf("ofw_pci mapdev: start %jx, len %jd\n", + (rman_res_t)start, rman_get_size(res)); + + tag = BUS_GET_BUS_TAG(child, child); + if (tag == NULL) + return (ENOMEM); + + rman_set_bustag(res, tag); + rv = bus_space_map(tag, start, + rman_get_size(res), 0, &handle); + if (rv != 0) + return (ENOMEM); + + rman_set_bushandle(res, handle); + rman_set_virtual(res, (void *)handle); /* XXX for powerpc only ? */ + } + + return (rman_activate_resource(res)); +} + +#ifdef __powerpc__ +static bus_space_tag_t +ofw_pci_bus_get_bus_tag(device_t bus, device_t child) +{ + + return (&bs_le_tag); +} +#endif + +static int +ofw_pci_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + /* + * If this is a memory resource, unmap it. + */ + if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { + u_int32_t psize; + + psize = rman_get_size(res); + pmap_unmapdev((vm_offset_t)rman_get_virtual(res), psize); + } + + return (rman_deactivate_resource(res)); +} + +static int +ofw_pci_adjust_resource(device_t bus, device_t child, int type, + struct resource *res, rman_res_t start, rman_res_t end) +{ + struct rman *rm = NULL; + struct ofw_pci_softc *sc = device_get_softc(bus); + + KASSERT(!(rman_get_flags(res) & RF_ACTIVE), + ("active resources cannot be adjusted")); + if (rman_get_flags(res) & RF_ACTIVE) + return (EINVAL); + + switch (type) { + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + case SYS_RES_IOPORT: + rm = &sc->sc_io_rman; + break; + default: + return (ENXIO); + } + + if (!rman_is_region_manager(res, rm)) + return (EINVAL); + + return (rman_adjust_resource(res, start, end)); +} + +static phandle_t +ofw_pci_get_node(device_t bus, device_t dev) +{ + struct ofw_pci_softc *sc; + + sc = device_get_softc(bus); + /* We only have one child, the PCI bus, which needs our own node. */ + + return (sc->sc_node); +} + +static int +ofw_pci_fill_ranges(phandle_t node, struct ofw_pci_range *ranges) +{ + int host_address_cells = 1, pci_address_cells = 3, size_cells = 2; + cell_t *base_ranges; + ssize_t nbase_ranges; + int nranges; + int i, j, k; + + OF_getencprop(OF_parent(node), "#address-cells", &host_address_cells, + sizeof(host_address_cells)); + OF_getencprop(node, "#address-cells", &pci_address_cells, + sizeof(pci_address_cells)); + OF_getencprop(node, "#size-cells", &size_cells, sizeof(size_cells)); + + nbase_ranges = OF_getproplen(node, "ranges"); + if (nbase_ranges <= 0) + return (-1); + nranges = nbase_ranges / sizeof(cell_t) / + (pci_address_cells + host_address_cells + size_cells); + + base_ranges = malloc(nbase_ranges, M_DEVBUF, M_WAITOK); + OF_getencprop(node, "ranges", base_ranges, nbase_ranges); + + for (i = 0, j = 0; i < nranges; i++) { + ranges[i].pci_hi = base_ranges[j++]; + ranges[i].pci = 0; + for (k = 0; k < pci_address_cells - 1; k++) { + ranges[i].pci <<= 32; + ranges[i].pci |= base_ranges[j++]; + } + ranges[i].host = 0; + for (k = 0; k < host_address_cells; k++) { + ranges[i].host <<= 32; + ranges[i].host |= base_ranges[j++]; + } + ranges[i].size = 0; + for (k = 0; k < size_cells; k++) { + ranges[i].size <<= 32; + ranges[i].size |= base_ranges[j++]; + } + } + + free(base_ranges, M_DEVBUF); + return (nranges); +} Added: head/sys/dev/ofw/ofwpci.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ofw/ofwpci.h Tue Mar 29 15:19:56 2016 (r297392) @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 2011 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_OFW_OFWPCI_H_ +#define _DEV_OFW_OFWPCI_H_ + +/* + * Export class definition for inheritance purposes + */ +DECLARE_CLASS(ofw_pci_driver); + +struct ofw_pci_cell_info { + pcell_t host_address_cells; + pcell_t pci_address_cell; + pcell_t size_cells; + }; + +struct ofw_pci_range { + uint32_t pci_hi; + uint64_t pci; + uint64_t host; + uint64_t size; +}; + +/* + * Quirks for some adapters + */ +enum { + OFW_PCI_QUIRK_RANGES_ON_CHILDREN = 1, +}; + +struct ofw_pci_softc { + device_t sc_dev; + phandle_t sc_node; + int sc_bus; + int sc_initialized; + int sc_quirks; + + struct ofw_pci_range *sc_range; + int sc_nrange; + struct ofw_pci_cell_info *sc_cell_info; + + struct rman sc_io_rman; + struct rman sc_mem_rman; + bus_space_tag_t sc_memt; + bus_dma_tag_t sc_dmat; + + struct ofw_bus_iinfo sc_pci_iinfo; +}; + +int ofw_pci_init(device_t); +int ofw_pci_attach(device_t); +int ofw_pci_read_ivar(device_t, device_t, int, uintptr_t *); +int ofw_pci_write_ivar(device_t, device_t, int, uintptr_t); +int ofw_pci_route_interrupt(device_t, device_t, int); +int ofw_pci_nranges(phandle_t, struct ofw_pci_cell_info *); + +#endif /* _DEV_OFW_OFWPCI_H_ */ Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Tue Mar 29 13:56:59 2016 (r297391) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Tue Mar 29 15:19:56 2016 (r297392) @@ -58,12 +58,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include - #include "ofw_bus_if.h" #include "pcib_if.h" Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Tue Mar 29 13:56:59 2016 (r297391) +++ head/sys/powerpc/powermac/cpcht.c Tue Mar 29 15:19:56 2016 (r297392) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include Modified: head/sys/powerpc/powermac/grackle.c ============================================================================== --- head/sys/powerpc/powermac/grackle.c Tue Mar 29 13:56:59 2016 (r297391) +++ head/sys/powerpc/powermac/grackle.c Tue Mar 29 15:19:56 2016 (r297392) @@ -35,11 +35,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include #include @@ -50,9 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - -#include #include #include Modified: head/sys/powerpc/powermac/uninorthpci.c ============================================================================== --- head/sys/powerpc/powermac/uninorthpci.c Tue Mar 29 13:56:59 2016 (r297391) +++ head/sys/powerpc/powermac/uninorthpci.c Tue Mar 29 15:19:56 2016 (r297392) @@ -32,11 +32,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include #include @@ -47,9 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - -#include #include #include Modified: head/sys/powerpc/powermac/uninorthvar.h ============================================================================== --- head/sys/powerpc/powermac/uninorthvar.h Tue Mar 29 13:56:59 2016 (r297391) +++ head/sys/powerpc/powermac/uninorthvar.h Tue Mar 29 15:19:56 2016 (r297392) @@ -30,7 +30,7 @@ #include #include -#include +#include struct uninorth_softc { struct ofw_pci_softc pci_sc; Modified: head/sys/powerpc/pseries/rtas_pci.c ============================================================================== --- head/sys/powerpc/pseries/rtas_pci.c Tue Mar 29 13:56:59 2016 (r297391) +++ head/sys/powerpc/pseries/rtas_pci.c Tue Mar 29 15:19:56 2016 (r297392) @@ -32,11 +32,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include #include @@ -48,12 +50,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include -#include #include #include "pcib_if.h" From owner-svn-src-head@freebsd.org Tue Mar 29 15:26:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76AA7AE1C96; Tue, 29 Mar 2016 15:26:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4813F135C; Tue, 29 Mar 2016 15:26:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2TFQrQo054473; Tue, 29 Mar 2016 15:26:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TFQrXQ054472; Tue, 29 Mar 2016 15:26:53 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603291526.u2TFQrXQ054472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 29 Mar 2016 15:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297393 - head/sys/modules/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 15:26:54 -0000 Author: bdrewery Date: Tue Mar 29 15:26:53 2016 New Revision: 297393 URL: https://svnweb.freebsd.org/changeset/base/297393 Log: Use proper kern.opts.mk rather than src.opts.mk from r297058. Reported by: kib Sponsored by: EMC / Isilon Storage Division Modified: head/sys/modules/urtwn/Makefile Modified: head/sys/modules/urtwn/Makefile ============================================================================== --- head/sys/modules/urtwn/Makefile Tue Mar 29 15:19:56 2016 (r297392) +++ head/sys/modules/urtwn/Makefile Tue Mar 29 15:26:53 2016 (r297393) @@ -2,7 +2,8 @@ .PATH: ${.CURDIR}/../../dev/urtwn -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" KMOD = if_urtwn SRCS = if_urtwn.c if_urtwnreg.h if_urtwnvar.h \ From owner-svn-src-head@freebsd.org Tue Mar 29 16:07:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B652AE2962; Tue, 29 Mar 2016 16:07:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23EDE1E0B; Tue, 29 Mar 2016 16:07:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2TG7p4i067045; Tue, 29 Mar 2016 16:07:51 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TG7p9d067043; Tue, 29 Mar 2016 16:07:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603291607.u2TG7p9d067043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 29 Mar 2016 16:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297394 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 16:07:52 -0000 Author: bdrewery Date: Tue Mar 29 16:07:51 2016 New Revision: 297394 URL: https://svnweb.freebsd.org/changeset/base/297394 Log: Reword descriptions of asserting locks held without WITNESS. This corrects an error in r296947 in that it is not possible to assert which thread holds a shared (or read) lock, but it is possible to assert that one is held. Just not very useful. MFC after: 1 week Submitted by: wblock, jhb Reviewed by: kib (earlier version), jhb, wblock Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5659 Modified: head/share/man/man9/rwlock.9 head/share/man/man9/sx.9 Modified: head/share/man/man9/rwlock.9 ============================================================================== --- head/share/man/man9/rwlock.9 Tue Mar 29 15:26:53 2016 (r297393) +++ head/share/man/man9/rwlock.9 Tue Mar 29 16:07:51 2016 (r297394) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2014 +.Dd March 28, 2016 .Dt RWLOCK 9 .Os .Sh NAME @@ -313,18 +313,19 @@ facility was written by This manual page was written by .An "Gleb Smirnoff" . .Sh BUGS -If +A kernel without .Dv WITNESS -is not included in the kernel, -then it is impossible to assert that the current thread does or does not -hold a read lock. -In the -.Pf non- Dv WITNESS -case, the +cannot assert whether the current thread does or does not hold a read lock. .Dv RA_LOCKED and .Dv RA_RLOCKED -assertions merely check that some thread holds a read lock. +can only assert that +.Em any +thread holds a read lock. +They cannot ensure that the current thread holds a read lock. +Further, +.Dv RA_UNLOCKED +can only assert that the current thread does not hold a write lock. .Pp Reader/writer is a bit of an awkward name. An Modified: head/share/man/man9/sx.9 ============================================================================== --- head/share/man/man9/sx.9 Tue Mar 29 15:26:53 2016 (r297393) +++ head/share/man/man9/sx.9 Tue Mar 29 16:07:51 2016 (r297394) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 16, 2016 +.Dd March 28, 2016 .Dt SX 9 .Os .Sh NAME @@ -320,11 +320,16 @@ end up sleeping while holding a mutex, w .Xr rwlock 9 , .Xr sema 9 .Sh BUGS -In the -.No non- Ns Dv WITNESS -case, the +A kernel without +.Dv WITNESS +cannot assert whether the current thread does or does not hold a shared lock. .Dv SA_LOCKED and .Dv SA_SLOCKED -assertions merely check that some thread holds a shared lock. -They do not ensure that the current thread holds a shared lock. +can only assert that +.Em any +thread holds a shared lock. +They cannot ensure that the current thread holds a shared lock. +Further, +.Dv SA_UNLOCKED +can only assert that the current thread does not hold an exclusive lock. From owner-svn-src-head@freebsd.org Tue Mar 29 19:11:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADF5DAE28C5; Tue, 29 Mar 2016 19:11:05 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F4691322; Tue, 29 Mar 2016 19:11:05 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2TJB4i0021687; Tue, 29 Mar 2016 19:11:04 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TJB4PE021680; Tue, 29 Mar 2016 19:11:04 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603291911.u2TJB4PE021680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 29 Mar 2016 19:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297395 - in head/sys/arm/ti: . am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 19:11:05 -0000 Author: loos Date: Tue Mar 29 19:11:04 2016 New Revision: 297395 URL: https://svnweb.freebsd.org/changeset/base/297395 Log: Add the SPI driver for am335x. This driver works in PIO mode for now, interrupts are available only when FIFO is enabled. The FIFO cannot be used with arbitrary sizes which defeat its general use. At some point we can add DMA transfers where the FIFO can be more useful. Tested on uBMC (microBMC) and BBB. Sponsored by: Rubicon Communications (Netgate) Added: head/sys/arm/ti/ti_spi.c (contents, props changed) head/sys/arm/ti/ti_spireg.h (contents, props changed) head/sys/arm/ti/ti_spivar.h (contents, props changed) Modified: head/sys/arm/ti/am335x/am335x_prcm.c head/sys/arm/ti/files.ti head/sys/arm/ti/ti_hwmods.c head/sys/arm/ti/ti_prcm.h Modified: head/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_prcm.c Tue Mar 29 16:07:51 2016 (r297394) +++ head/sys/arm/ti/am335x/am335x_prcm.c Tue Mar 29 19:11:04 2016 (r297395) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #define CM_PER_MMC0_CLKCTRL (CM_PER + 0x03C) #define CM_PER_I2C2_CLKCTRL (CM_PER + 0x044) #define CM_PER_I2C1_CLKCTRL (CM_PER + 0x048) +#define CM_PER_SPI0_CLKCTRL (CM_PER + 0x04C) +#define CM_PER_SPI1_CLKCTRL (CM_PER + 0x050) #define CM_PER_UART1_CLKCTRL (CM_PER + 0x06C) #define CM_PER_UART2_CLKCTRL (CM_PER + 0x070) #define CM_PER_UART3_CLKCTRL (CM_PER + 0x074) @@ -274,6 +276,10 @@ struct ti_clock_dev ti_am335x_clk_devmap AM335X_GENERIC_CLOCK_DEV(I2C2_CLK), AM335X_GENERIC_CLOCK_DEV(I2C3_CLK), + /* McSPI we use hwmods as reference, not units in spec */ + AM335X_GENERIC_CLOCK_DEV(SPI0_CLK), + AM335X_GENERIC_CLOCK_DEV(SPI1_CLK), + /* TSC_ADC */ AM335X_GENERIC_CLOCK_DEV(TSC_ADC_CLK), @@ -356,6 +362,10 @@ static struct am335x_clk_details g_am335 _CLK_DETAIL(I2C2_CLK, CM_PER_I2C1_CLKCTRL, 0), _CLK_DETAIL(I2C3_CLK, CM_PER_I2C2_CLKCTRL, 0), + /* McSPI modules, hwmods start with spi0 */ + _CLK_DETAIL(SPI0_CLK, CM_PER_SPI0_CLKCTRL, 0), + _CLK_DETAIL(SPI1_CLK, CM_PER_SPI1_CLKCTRL, 0), + /* TSC_ADC module */ _CLK_DETAIL(TSC_ADC_CLK, CM_WKUP_ADC_TSC_CLKCTRL, 0), Modified: head/sys/arm/ti/files.ti ============================================================================== --- head/sys/arm/ti/files.ti Tue Mar 29 16:07:51 2016 (r297394) +++ head/sys/arm/ti/files.ti Tue Mar 29 19:11:04 2016 (r297395) @@ -18,6 +18,7 @@ arm/ti/ti_gpio.c optional gpio arm/ti/ti_gpio_if.m optional gpio arm/ti/ti_i2c.c optional ti_i2c arm/ti/ti_sdhci.c optional sdhci +arm/ti/ti_spi.c optional ti_spi dev/uart/uart_dev_ti8250.c optional uart dev/uart/uart_dev_ns8250.c optional uart Modified: head/sys/arm/ti/ti_hwmods.c ============================================================================== --- head/sys/arm/ti/ti_hwmods.c Tue Mar 29 16:07:51 2016 (r297394) +++ head/sys/arm/ti/ti_hwmods.c Tue Mar 29 19:11:04 2016 (r297395) @@ -76,6 +76,9 @@ struct hwmod ti_hwmods[] = { {"epwmss1", PWMSS1_CLK}, {"epwmss2", PWMSS2_CLK}, + {"spi0", SPI0_CLK}, + {"spi1", SPI1_CLK}, + {"timer1", TIMER1_CLK}, {"timer2", TIMER2_CLK}, {"timer3", TIMER3_CLK}, Modified: head/sys/arm/ti/ti_prcm.h ============================================================================== --- head/sys/arm/ti/ti_prcm.h Tue Mar 29 16:07:51 2016 (r297394) +++ head/sys/arm/ti/ti_prcm.h Tue Mar 29 19:11:04 2016 (r297395) @@ -158,6 +158,10 @@ typedef enum { /* RTC module */ RTC_CLK = 1900, + + /* McSPI */ + SPI0_CLK = 2000, + SPI1_CLK, } clk_ident_t; /* Added: head/sys/arm/ti/ti_spi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/ti_spi.c Tue Mar 29 19:11:04 2016 (r297395) @@ -0,0 +1,582 @@ +/*- + * Copyright (c) 2016 Rubicon Communications, LLC (Netgate) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "spibus_if.h" + +static void ti_spi_intr(void *); +static int ti_spi_detach(device_t); + +#undef TI_SPI_DEBUG +#ifdef TI_SPI_DEBUG +#define IRQSTATUSBITS \ + "\020\1TX0_EMPTY\2TX0_UNDERFLOW\3RX0_FULL\4RX0_OVERFLOW" \ + "\5TX1_EMPTY\6TX1_UNDERFLOW\7RX1_FULL\11TX2_EMPTY" \ + "\12TX1_UNDERFLOW\13RX2_FULL\15TX3_EMPTY\16TX3_UNDERFLOW" \ + "\17RX3_FULL\22EOW" +#define CONFBITS \ + "\020\1PHA\2POL\7EPOL\17DMAW\20DMAR\21DPE0\22DPE1\23IS" \ + "\24TURBO\25FORCE\30SBE\31SBPOL\34FFEW\35FFER\36CLKG" +#define STATBITS \ + "\020\1RXS\2TXS\3EOT\4TXFFE\5TXFFF\6RXFFE\7RXFFFF" +#define MODULCTRLBITS \ + "\020\1SINGLE\2NOSPIEN\3SLAVE\4SYST\10MOA\11FDAA" +#define CTRLBITS \ + "\020\1ENABLED" + +static void +ti_spi_printr(device_t dev) +{ + int clk, conf, ctrl, div, i, j, wl; + struct ti_spi_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + reg = TI_SPI_READ(sc, MCSPI_SYSCONFIG); + device_printf(dev, "SYSCONFIG: %#x\n", reg); + reg = TI_SPI_READ(sc, MCSPI_SYSSTATUS); + device_printf(dev, "SYSSTATUS: %#x\n", reg); + reg = TI_SPI_READ(sc, MCSPI_IRQSTATUS); + device_printf(dev, "IRQSTATUS: 0x%b\n", reg, IRQSTATUSBITS); + reg = TI_SPI_READ(sc, MCSPI_IRQENABLE); + device_printf(dev, "IRQENABLE: 0x%b\n", reg, IRQSTATUSBITS); + reg = TI_SPI_READ(sc, MCSPI_MODULCTRL); + device_printf(dev, "MODULCTRL: 0x%b\n", reg, MODULCTRLBITS); + for (i = 0; i < sc->sc_numcs; i++) { + ctrl = TI_SPI_READ(sc, MCSPI_CTRL_CH(i)); + conf = TI_SPI_READ(sc, MCSPI_CONF_CH(i)); + device_printf(dev, "CH%dCONF: 0x%b\n", i, conf, CONFBITS); + if (conf & MCSPI_CONF_CLKG) { + div = (conf >> MCSPI_CONF_CLK_SHIFT) & MCSPI_CONF_CLK_MSK; + div |= ((ctrl >> MCSPI_CTRL_EXTCLK_SHIFT) & MCSPI_CTRL_EXTCLK_MSK) << 4; + } else { + div = 1; + j = (conf >> MCSPI_CONF_CLK_SHIFT) & MCSPI_CONF_CLK_MSK; + while (j-- > 0) + div <<= 1; + } + clk = TI_SPI_GCLK / div; + wl = ((conf >> MCSPI_CONF_WL_SHIFT) & MCSPI_CONF_WL_MSK) + 1; + device_printf(dev, "wordlen: %-2d clock: %d\n", wl, clk); + reg = TI_SPI_READ(sc, MCSPI_STAT_CH(i)); + device_printf(dev, "CH%dSTAT: 0x%b\n", i, reg, STATBITS); + device_printf(dev, "CH%dCTRL: 0x%b\n", i, ctrl, CTRLBITS); + } + reg = TI_SPI_READ(sc, MCSPI_XFERLEVEL); + device_printf(dev, "XFERLEVEL: %#x\n", reg); +} +#endif + +static void +ti_spi_set_clock(struct ti_spi_softc *sc, int ch, int freq) +{ + uint32_t clkdiv, conf, div, extclk, reg; + + clkdiv = TI_SPI_GCLK / freq; + if (clkdiv > MCSPI_EXTCLK_MSK) { + extclk = 0; + clkdiv = 0; + div = 1; + while (TI_SPI_GCLK / div > freq && clkdiv <= 0xf) { + clkdiv++; + div <<= 1; + } + conf = clkdiv << MCSPI_CONF_CLK_SHIFT; + } else { + extclk = clkdiv >> 4; + clkdiv &= MCSPI_CONF_CLK_MSK; + conf = MCSPI_CONF_CLKG | clkdiv << MCSPI_CONF_CLK_SHIFT; + } + + reg = TI_SPI_READ(sc, MCSPI_CTRL_CH(ch)); + reg &= ~(MCSPI_CTRL_EXTCLK_MSK << MCSPI_CTRL_EXTCLK_SHIFT); + reg |= extclk << MCSPI_CTRL_EXTCLK_SHIFT; + TI_SPI_WRITE(sc, MCSPI_CTRL_CH(ch), reg); + + reg = TI_SPI_READ(sc, MCSPI_CONF_CH(ch)); + reg &= ~(MCSPI_CONF_CLKG | MCSPI_CONF_CLK_MSK << MCSPI_CONF_CLK_SHIFT); + TI_SPI_WRITE(sc, MCSPI_CONF_CH(ch), reg | conf); +} + +static int +ti_spi_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,omap4-mcspi")) + return (ENXIO); + + device_set_desc(dev, "TI McSPI controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +ti_spi_attach(device_t dev) +{ + int clk_id, err, i, rid, timeout; + struct ti_spi_softc *sc; + uint32_t rev; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + /* + * Get the MMCHS device id from FDT. If it's not there use the newbus + * unit number (which will work as long as the devices are in order and + * none are skipped in the fdt). Note that this is a property we made + * up and added in freebsd, it doesn't exist in the published bindings. + */ + clk_id = ti_hwmods_get_clock(dev); + if (clk_id == INVALID_CLK_IDENT) { + device_printf(dev, + "failed to get clock based on hwmods property\n"); + return (EINVAL); + } + + /* Activate the McSPI module. */ + err = ti_prcm_clk_enable(clk_id); + if (err) { + device_printf(dev, "Error: failed to activate source clock\n"); + return (err); + } + + /* Get the number of available channels. */ + if ((OF_getencprop(ofw_bus_get_node(dev), "ti,spi-num-cs", + &sc->sc_numcs, sizeof(sc->sc_numcs))) <= 0) { + sc->sc_numcs = 2; + } + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + + sc->sc_bst = rman_get_bustag(sc->sc_mem_res); + sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot allocate interrupt\n"); + return (ENXIO); + } + + /* Hook up our interrupt handler. */ + if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, ti_spi_intr, sc, &sc->sc_intrhand)) { + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot setup the interrupt handler\n"); + return (ENXIO); + } + + mtx_init(&sc->sc_mtx, "ti_spi", NULL, MTX_DEF); + + /* Issue a softreset to the controller */ + TI_SPI_WRITE(sc, MCSPI_SYSCONFIG, MCSPI_SYSCONFIG_SOFTRESET); + timeout = 1000; + while (!(TI_SPI_READ(sc, MCSPI_SYSSTATUS) & + MCSPI_SYSSTATUS_RESETDONE)) { + if (--timeout == 0) { + device_printf(dev, + "Error: Controller reset operation timed out\n"); + ti_spi_detach(dev); + return (ENXIO); + } + DELAY(100); + } + + /* Print the McSPI module revision. */ + rev = TI_SPI_READ(sc, MCSPI_REVISION); + device_printf(dev, + "scheme: %#x func: %#x rtl: %d rev: %d.%d custom rev: %d\n", + (rev >> MCSPI_REVISION_SCHEME_SHIFT) & MCSPI_REVISION_SCHEME_MSK, + (rev >> MCSPI_REVISION_FUNC_SHIFT) & MCSPI_REVISION_FUNC_MSK, + (rev >> MCSPI_REVISION_RTL_SHIFT) & MCSPI_REVISION_RTL_MSK, + (rev >> MCSPI_REVISION_MAJOR_SHIFT) & MCSPI_REVISION_MAJOR_MSK, + (rev >> MCSPI_REVISION_MINOR_SHIFT) & MCSPI_REVISION_MINOR_MSK, + (rev >> MCSPI_REVISION_CUSTOM_SHIFT) & MCSPI_REVISION_CUSTOM_MSK); + + /* Set Master mode, single channel. */ + TI_SPI_WRITE(sc, MCSPI_MODULCTRL, MCSPI_MODULCTRL_SINGLE); + + /* Clear pending interrupts and disable interrupts. */ + TI_SPI_WRITE(sc, MCSPI_IRQENABLE, 0x0); + TI_SPI_WRITE(sc, MCSPI_IRQSTATUS, 0xffff); + + for (i = 0; i < sc->sc_numcs; i++) { + /* + * Default to SPI mode 0, CS active low, 8 bits word length and + * 500kHz clock. + */ + TI_SPI_WRITE(sc, MCSPI_CONF_CH(i), + MCSPI_CONF_DPE0 | MCSPI_CONF_EPOL | + (8 - 1) << MCSPI_CONF_WL_SHIFT); + /* Set initial clock - 500kHz. */ + ti_spi_set_clock(sc, i, 500000); + } + +#ifdef TI_SPI_DEBUG + ti_spi_printr(dev); +#endif + + device_add_child(dev, "spibus", -1); + + return (bus_generic_attach(dev)); +} + +static int +ti_spi_detach(device_t dev) +{ + struct ti_spi_softc *sc; + + sc = device_get_softc(dev); + + /* Clear pending interrupts and disable interrupts. */ + TI_SPI_WRITE(sc, MCSPI_IRQENABLE, 0); + TI_SPI_WRITE(sc, MCSPI_IRQSTATUS, 0xffff); + + /* Reset controller. */ + TI_SPI_WRITE(sc, MCSPI_SYSCONFIG, MCSPI_SYSCONFIG_SOFTRESET); + + bus_generic_detach(dev); + + mtx_destroy(&sc->sc_mtx); + if (sc->sc_intrhand) + bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand); + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + + return (0); +} + +static int +ti_spi_fill_fifo(struct ti_spi_softc *sc) +{ + int bytes, timeout; + struct spi_command *cmd; + uint32_t written; + uint8_t *data; + + cmd = sc->sc_cmd; + bytes = min(sc->sc_len - sc->sc_written, sc->sc_fifolvl); + while (bytes-- > 0) { + data = (uint8_t *)cmd->tx_cmd; + written = sc->sc_written++; + if (written >= cmd->tx_cmd_sz) { + data = (uint8_t *)cmd->tx_data; + written -= cmd->tx_cmd_sz; + } + if (sc->sc_fifolvl == 1) { + /* FIFO disabled. */ + timeout = 1000; + while (--timeout > 0 && (TI_SPI_READ(sc, + MCSPI_STAT_CH(sc->sc_cs)) & MCSPI_STAT_TXS) == 0) { + DELAY(1); + } + if (timeout == 0) + return (-1); + } + TI_SPI_WRITE(sc, MCSPI_TX_CH(sc->sc_cs), data[written]); + } + + return (0); +} + +static int +ti_spi_drain_fifo(struct ti_spi_softc *sc) +{ + int bytes, timeout; + struct spi_command *cmd; + uint32_t read; + uint8_t *data; + + cmd = sc->sc_cmd; + bytes = min(sc->sc_len - sc->sc_read, sc->sc_fifolvl); + while (bytes-- > 0) { + data = (uint8_t *)cmd->rx_cmd; + read = sc->sc_read++; + if (read >= cmd->rx_cmd_sz) { + data = (uint8_t *)cmd->rx_data; + read -= cmd->rx_cmd_sz; + } + if (sc->sc_fifolvl == 1) { + /* FIFO disabled. */ + timeout = 1000; + while (--timeout > 0 && (TI_SPI_READ(sc, + MCSPI_STAT_CH(sc->sc_cs)) & MCSPI_STAT_RXS) == 0) { + DELAY(1); + } + if (timeout == 0) + return (-1); + } + data[read] = TI_SPI_READ(sc, MCSPI_RX_CH(sc->sc_cs)); + } + + return (0); +} + +static void +ti_spi_intr(void *arg) +{ + int eow; + struct ti_spi_softc *sc; + uint32_t status; + + eow = 0; + sc = (struct ti_spi_softc *)arg; + TI_SPI_LOCK(sc); + status = TI_SPI_READ(sc, MCSPI_IRQSTATUS); + + /* + * No new TX_empty or RX_full event will be asserted while the CPU has + * not performed the number of writes or reads defined by + * MCSPI_XFERLEVEL[AEL] and MCSPI_XFERLEVEL[AFL]. It is responsibility + * of CPU perform the right number of writes and reads. + */ + if (status & MCSPI_IRQ_TX0_EMPTY) + ti_spi_fill_fifo(sc); + if (status & MCSPI_IRQ_RX0_FULL) + ti_spi_drain_fifo(sc); + + if (status & MCSPI_IRQ_EOW) + eow = 1; + + /* Clear interrupt status. */ + TI_SPI_WRITE(sc, MCSPI_IRQSTATUS, status); + + /* Check for end of transfer. */ + if (sc->sc_written == sc->sc_len && sc->sc_read == sc->sc_len) { + sc->sc_flags |= TI_SPI_DONE; + wakeup(sc->sc_dev); + } + + TI_SPI_UNLOCK(sc); +} + +static int +ti_spi_pio_transfer(struct ti_spi_softc *sc) +{ + + while (sc->sc_len - sc->sc_written > 0) { + if (ti_spi_fill_fifo(sc) == -1) + return (EIO); + if (ti_spi_drain_fifo(sc) == -1) + return (EIO); + } + + return (0); +} + +static int +ti_spi_gcd(int a, int b) +{ + int m; + + while ((m = a % b) != 0) { + a = b; + b = m; + } + + return (b); +} + +static int +ti_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + int cs, err; + struct ti_spi_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, + ("TX/RX command sizes should be equal")); + KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, + ("TX/RX data sizes should be equal")); + + /* Get the proper chip select for this child. */ + spibus_get_cs(child, &cs); + if (cs < 0 || cs > sc->sc_numcs) { + device_printf(dev, "Invalid chip select %d requested by %s\n", + cs, device_get_nameunit(child)); + return (EINVAL); + } + + TI_SPI_LOCK(sc); + + /* If the controller is in use wait until it is available. */ + while (sc->sc_flags & TI_SPI_BUSY) + mtx_sleep(dev, &sc->sc_mtx, 0, "ti_spi", 0); + + /* Now we have control over SPI controller. */ + sc->sc_flags = TI_SPI_BUSY; + + /* Save the SPI command data. */ + sc->sc_cs = cs; + sc->sc_cmd = cmd; + sc->sc_read = 0; + sc->sc_written = 0; + sc->sc_len = cmd->tx_cmd_sz + cmd->tx_data_sz; + sc->sc_fifolvl = ti_spi_gcd(sc->sc_len, TI_SPI_FIFOSZ); + if (sc->sc_fifolvl < 2 || sc->sc_len > 0xffff) + sc->sc_fifolvl = 1; /* FIFO disabled. */ + /* Disable FIFO for now. */ + sc->sc_fifolvl = 1; + + /* Use a safe clock - 500kHz. */ + ti_spi_set_clock(sc, sc->sc_cs, 500000); + + /* Disable the FIFO. */ + TI_SPI_WRITE(sc, MCSPI_XFERLEVEL, 0); + + /* 8 bits word, d0 miso, d1 mosi, mode 0 and CS active low. */ + reg = TI_SPI_READ(sc, MCSPI_CONF_CH(sc->sc_cs)); + reg &= ~(MCSPI_CONF_FFER | MCSPI_CONF_FFEW | MCSPI_CONF_SBPOL | + MCSPI_CONF_SBE | MCSPI_CONF_TURBO | MCSPI_CONF_IS | + MCSPI_CONF_DPE1 | MCSPI_CONF_DPE0 | MCSPI_CONF_DMAR | + MCSPI_CONF_DMAW | MCSPI_CONF_EPOL); + reg |= MCSPI_CONF_DPE0 | MCSPI_CONF_EPOL | MCSPI_CONF_WL8BITS; + TI_SPI_WRITE(sc, MCSPI_CONF_CH(sc->sc_cs), reg); + +#if 0 + /* Enable channel interrupts. */ + reg = TI_SPI_READ(sc, MCSPI_IRQENABLE); + reg |= 0xf; + TI_SPI_WRITE(sc, MCSPI_IRQENABLE, reg); +#endif + + /* Start the transfer. */ + reg = TI_SPI_READ(sc, MCSPI_CTRL_CH(sc->sc_cs)); + TI_SPI_WRITE(sc, MCSPI_CTRL_CH(sc->sc_cs), reg | MCSPI_CTRL_ENABLE); + + /* Force CS on. */ + reg = TI_SPI_READ(sc, MCSPI_CONF_CH(sc->sc_cs)); + TI_SPI_WRITE(sc, MCSPI_CONF_CH(sc->sc_cs), reg |= MCSPI_CONF_FORCE); + + err = 0; + if (sc->sc_fifolvl == 1) + err = ti_spi_pio_transfer(sc); + + /* Force CS off. */ + reg = TI_SPI_READ(sc, MCSPI_CONF_CH(sc->sc_cs)); + reg &= ~MCSPI_CONF_FORCE; + TI_SPI_WRITE(sc, MCSPI_CONF_CH(sc->sc_cs), reg); + + /* Disable IRQs. */ + reg = TI_SPI_READ(sc, MCSPI_IRQENABLE); + reg &= ~0xf; + TI_SPI_WRITE(sc, MCSPI_IRQENABLE, reg); + TI_SPI_WRITE(sc, MCSPI_IRQSTATUS, 0xf); + + /* Disable the SPI channel. */ + reg = TI_SPI_READ(sc, MCSPI_CTRL_CH(sc->sc_cs)); + reg &= ~MCSPI_CTRL_ENABLE; + TI_SPI_WRITE(sc, MCSPI_CTRL_CH(sc->sc_cs), reg); + + /* Disable FIFO. */ + reg = TI_SPI_READ(sc, MCSPI_CONF_CH(sc->sc_cs)); + reg &= ~(MCSPI_CONF_FFER | MCSPI_CONF_FFEW); + TI_SPI_WRITE(sc, MCSPI_CONF_CH(sc->sc_cs), reg); + + /* Release the controller and wakeup the next thread waiting for it. */ + sc->sc_flags = 0; + wakeup_one(dev); + TI_SPI_UNLOCK(sc); + + return (err); +} + +static phandle_t +ti_spi_get_node(device_t bus, device_t dev) +{ + + /* Share controller node with spibus. */ + return (ofw_bus_get_node(bus)); +} + +static device_method_t ti_spi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ti_spi_probe), + DEVMETHOD(device_attach, ti_spi_attach), + DEVMETHOD(device_detach, ti_spi_detach), + + /* SPI interface */ + DEVMETHOD(spibus_transfer, ti_spi_transfer), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, ti_spi_get_node), + + DEVMETHOD_END +}; + +static devclass_t ti_spi_devclass; + +static driver_t ti_spi_driver = { + "spi", + ti_spi_methods, + sizeof(struct ti_spi_softc), +}; + +DRIVER_MODULE(ti_spi, simplebus, ti_spi_driver, ti_spi_devclass, 0, 0); Added: head/sys/arm/ti/ti_spireg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/ti_spireg.h Tue Mar 29 19:11:04 2016 (r297395) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2016 Rubicon Communications, LLC (Netgate) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _TI_SPIREG_H_ +#define _TI_SPIREG_H_ + +#define TI_SPI_GCLK 48000000U +#define TI_SPI_FIFOSZ 32 +#define MCSPI_REVISION 0x0 +#define MCSPI_REVISION_SCHEME_SHIFT 30 +#define MCSPI_REVISION_SCHEME_MSK 0x3 +#define MCSPI_REVISION_FUNC_SHIFT 16 +#define MCSPI_REVISION_FUNC_MSK 0xfff +#define MCSPI_REVISION_RTL_SHIFT 11 +#define MCSPI_REVISION_RTL_MSK 0x1f +#define MCSPI_REVISION_MAJOR_SHIFT 8 +#define MCSPI_REVISION_MAJOR_MSK 0x7 +#define MCSPI_REVISION_CUSTOM_SHIFT 6 +#define MCSPI_REVISION_CUSTOM_MSK 0x3 +#define MCSPI_REVISION_MINOR_SHIFT 0 +#define MCSPI_REVISION_MINOR_MSK 0x3f +#define MCSPI_SYSCONFIG 0x110 +#define MCSPI_SYSCONFIG_SOFTRESET (1 << 1) +#define MCSPI_SYSSTATUS 0x114 +#define MCSPI_SYSSTATUS_RESETDONE (1 << 0) +#define MCSPI_MODULCTRL 0x128 +#define MCSPI_MODULCTRL_SLAVE (1 << 2) +#define MCSPI_MODULCTRL_SINGLE (1 << 0) +#define MCSPI_IRQSTATUS 0x118 +#define MCSPI_IRQENABLE 0x11c +#define MCSPI_IRQ_EOW (1 << 17) +#define MCSPI_IRQ_RX0_OVERFLOW (1 << 3) +#define MCSPI_IRQ_RX0_FULL (1 << 2) +#define MCSPI_IRQ_TX0_UNDERFLOW (1 << 1) +#define MCSPI_IRQ_TX0_EMPTY (1 << 0) +#define MCSPI_CONF_CH(_c) (0x12c + 0x14 * (_c)) +#define MCSPI_CONF_CLKG (1 << 29) +#define MCSPI_CONF_FFER (1 << 28) +#define MCSPI_CONF_FFEW (1 << 27) +#define MCSPI_CONF_SBPOL (1 << 24) +#define MCSPI_CONF_SBE (1 << 23) +#define MCSPI_CONF_FORCE (1 << 20) +#define MCSPI_CONF_TURBO (1 << 19) +#define MCSPI_CONF_IS (1 << 18) +#define MCSPI_CONF_DPE1 (1 << 17) +#define MCSPI_CONF_DPE0 (1 << 16) +#define MCSPI_CONF_DMAR (1 << 15) +#define MCSPI_CONF_DMAW (1 << 14) +#define MCSPI_CONF_WL_MSK 0x1f +#define MCSPI_CONF_WL_SHIFT 7 +#define MCSPI_CONF_WL8BITS (7 << MCSPI_CONF_WL_SHIFT) +#define MCSPI_CONF_EPOL (1 << 6) +#define MCSPI_CONF_CLK_MSK 0xf +#define MCSPI_CONF_CLK_SHIFT 2 +#define MCSPI_CONF_POL (1 << 1) +#define MCSPI_CONF_PHA (1 << 0) +#define MCSPI_STAT_CH(_c) (0x130 + 0x14 * (_c)) +#define MCSPI_STAT_TXFFF (1 << 4) +#define MCSPI_STAT_TXS (1 << 1) +#define MCSPI_STAT_RXS (1 << 0) +#define MCSPI_CTRL_CH(_c) (0x134 + 0x14 * (_c)) +#define MCSPI_EXTCLK_MSK 0xfff +#define MCSPI_CTRL_EXTCLK_MSK 0xff +#define MCSPI_CTRL_EXTCLK_SHIFT 8 +#define MCSPI_CTRL_ENABLE (1 << 0) +#define MCSPI_TX_CH(_c) (0x138 + 0x14 * (_c)) +#define MCSPI_RX_CH(_c) (0x13c + 0x14 * (_c)) +#define MCSPI_XFERLEVEL 0x17c +#define MCSPI_XFERLEVEL_AFL(_a) (((_a) >> 8) & 0xff) +#define MCSPI_XFERLEVEL_AEL(_a) (((_a) >> 0) & 0xff) + +#endif /* _TI_SPIREG_H_ */ Added: head/sys/arm/ti/ti_spivar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/ti_spivar.h Tue Mar 29 19:11:04 2016 (r297395) @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 2016 Rubicon Communications, LLC (Netgate) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _TI_SPIVAR_H_ +#define _TI_SPIVAR_H_ + +struct ti_spi_softc { + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + device_t sc_dev; + int sc_numcs; + struct mtx sc_mtx; + struct resource *sc_mem_res; + struct resource *sc_irq_res; + struct { + int cs; + int fifolvl; + struct spi_command *cmd; + uint32_t len; + uint32_t read; + uint32_t written; + } xfer; + uint32_t sc_flags; + void *sc_intrhand; +#define sc_cs xfer.cs +#define sc_fifolvl xfer.fifolvl +#define sc_cmd xfer.cmd +#define sc_len xfer.len +#define sc_read xfer.read +#define sc_written xfer.written +}; + +#define TI_SPI_BUSY 0x1 +#define TI_SPI_DONE 0x2 + +#define TI_SPI_WRITE(_sc, _off, _val) \ + bus_space_write_4((_sc)->sc_bst, (_sc)->sc_bsh, (_off), (_val)) +#define TI_SPI_READ(_sc, _off) \ + bus_space_read_4((_sc)->sc_bst, (_sc)->sc_bsh, (_off)) + +#define TI_SPI_LOCK(_sc) \ + mtx_lock(&(_sc)->sc_mtx) +#define TI_SPI_UNLOCK(_sc) \ + mtx_unlock(&(_sc)->sc_mtx) + +#endif /* _TI_SPIVAR_H_ */ From owner-svn-src-head@freebsd.org Tue Mar 29 19:18:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA88EAE2A42; Tue, 29 Mar 2016 19:18:35 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6F9621A2A; Tue, 29 Mar 2016 19:18:35 +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 u2TJIYKC024553; Tue, 29 Mar 2016 19:18:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TJIYRp024552; Tue, 29 Mar 2016 19:18:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603291918.u2TJIYRp024552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 29 Mar 2016 19:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297396 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 19:18:35 -0000 Author: mav Date: Tue Mar 29 19:18:34 2016 New Revision: 297396 URL: https://svnweb.freebsd.org/changeset/base/297396 Log: Modify "4958 zdb trips assert on pools with ashift >= 0xe". Unlike Illumos FreeBSD has concept of logical ashift, that specifies really minimal vdev block size that can be accessed. This knowledge allows properly pad physical I/O and correctly assert its alignment. This change fixes L2ARC write errors when device has logical sector size above 512 bytes. MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Mar 29 19:11:04 2016 (r297395) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Mar 29 19:18:34 2016 (r297396) @@ -2775,10 +2775,19 @@ zio_vdev_io_start(zio_t *zio) (void) atomic_cas_64(&spa->spa_last_io, old, new); } +#ifdef illumos align = 1ULL << vd->vdev_top->vdev_ashift; if (!(zio->io_flags & ZIO_FLAG_PHYSICAL) && P2PHASE(zio->io_size, align) != 0) { +#else + if (zio->io_flags & ZIO_FLAG_PHYSICAL) + align = 1ULL << vd->vdev_top->vdev_logical_ashift; + else + align = 1ULL << vd->vdev_top->vdev_ashift; + + if (P2PHASE(zio->io_size, align) != 0) { +#endif /* Transform logical writes to be a full physical block size. */ uint64_t asize = P2ROUNDUP(zio->io_size, align); char *abuf = NULL; @@ -2794,6 +2803,7 @@ zio_vdev_io_start(zio_t *zio) zio_subblock); } +#ifdef illumos /* * If this is not a physical io, make sure that it is properly aligned * before proceeding. @@ -2809,6 +2819,10 @@ zio_vdev_io_start(zio_t *zio) ASSERT0(P2PHASE(zio->io_offset, SPA_MINBLOCKSIZE)); ASSERT0(P2PHASE(zio->io_size, SPA_MINBLOCKSIZE)); } +#else + ASSERT0(P2PHASE(zio->io_offset, align)); + ASSERT0(P2PHASE(zio->io_size, align)); +#endif VERIFY(zio->io_type == ZIO_TYPE_READ || spa_writeable(spa)); From owner-svn-src-head@freebsd.org Tue Mar 29 19:23:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95FAAAE2BB8; Tue, 29 Mar 2016 19:23:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B7E31E59; Tue, 29 Mar 2016 19:23:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2TJN04r027435; Tue, 29 Mar 2016 19:23:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TJN0TP027434; Tue, 29 Mar 2016 19:23:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201603291923.u2TJN0TP027434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 29 Mar 2016 19:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297397 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 19:23:01 -0000 Author: markj Date: Tue Mar 29 19:23:00 2016 New Revision: 297397 URL: https://svnweb.freebsd.org/changeset/base/297397 Log: Modify nd6_llinfo_timer() to acquire the nd6 lock before the LLE lock. When expiring a neighbour cache entry we may need to look up the associated default router, which requires the nd6 read lock. To avoid an LOR, the nd6 lock should be acquired first. X-MFC-With: r296063 Tested by: Larry Rosenman (previous revision) Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue Mar 29 19:18:34 2016 (r297396) +++ head/sys/netinet6/nd6.c Tue Mar 29 19:23:00 2016 (r297397) @@ -127,7 +127,7 @@ static int nd6_is_new_addr_neighbor(cons static void nd6_setmtu0(struct ifnet *, struct nd_ifinfo *); static void nd6_slowtimo(void *); static int regen_tmpaddr(struct in6_ifaddr *); -static void nd6_free(struct llentry *, int); +static void nd6_free(struct llentry **, int); static void nd6_free_redirect(const struct llentry *); static void nd6_llinfo_timer(void *); static void nd6_llinfo_settimer_locked(struct llentry *, long); @@ -727,12 +727,16 @@ nd6_llinfo_timer(void *arg) struct llentry *ln; struct in6_addr *dst, *pdst, *psrc, src; struct ifnet *ifp; - struct nd_ifinfo *ndi = NULL; + struct nd_ifinfo *ndi; int do_switch, send_ns; long delay; KASSERT(arg != NULL, ("%s: arg NULL", __func__)); ln = (struct llentry *)arg; + ifp = lltable_get_ifp(ln->lle_tbl); + CURVNET_SET(ifp->if_vnet); + + ND6_RLOCK(); LLE_WLOCK(ln); if (callout_pending(&ln->lle_timer)) { /* @@ -752,10 +756,10 @@ nd6_llinfo_timer(void *arg) * would have been 1. */ LLE_WUNLOCK(ln); + ND6_RUNLOCK(); + CURVNET_RESTORE(); return; } - ifp = ln->lle_tbl->llt_ifp; - CURVNET_SET(ifp->if_vnet); ndi = ND_IFINFO(ifp); send_ns = 0; dst = &ln->r_l3addr.addr6; @@ -777,8 +781,7 @@ nd6_llinfo_timer(void *arg) } if (ln->la_flags & LLE_DELETED) { - nd6_free(ln, 0); - ln = NULL; + nd6_free(&ln, 0); goto done; } @@ -803,9 +806,7 @@ nd6_llinfo_timer(void *arg) ln->la_hold = m0; clear_llinfo_pqueue(ln); } - EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_TIMEDOUT); - nd6_free(ln, 0); - ln = NULL; + nd6_free(&ln, 0); if (m != NULL) icmp6_error2(m, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADDR, 0, ifp); @@ -834,12 +835,8 @@ nd6_llinfo_timer(void *arg) * GC timer has ended and entry hasn't been used. * Run Garbage collector (RFC 4861, 5.3) */ - if (!ND6_LLINFO_PERMANENT(ln)) { - EVENTHANDLER_INVOKE(lle_event, ln, - LLENTRY_EXPIRED); - nd6_free(ln, 1); - ln = NULL; - } + if (!ND6_LLINFO_PERMANENT(ln)) + nd6_free(&ln, 1); break; } @@ -861,9 +858,7 @@ nd6_llinfo_timer(void *arg) ln->la_asked++; send_ns = 1; } else { - EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_EXPIRED); - nd6_free(ln, 0); - ln = NULL; + nd6_free(&ln, 0); } break; default: @@ -871,6 +866,8 @@ nd6_llinfo_timer(void *arg) __func__, ln->ln_state); } done: + if (ln != NULL) + ND6_RUNLOCK(); if (send_ns != 0) { nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); psrc = nd6_llinfo_get_holdsrc(ln, &src); @@ -1367,12 +1364,27 @@ nd6_is_addr_neighbor(const struct sockad * Set noinline to be dtrace-friendly */ static __noinline void -nd6_free(struct llentry *ln, int gc) +nd6_free(struct llentry **lnp, int gc) { - struct nd_defrouter *dr; struct ifnet *ifp; + struct llentry *ln; + struct nd_defrouter *dr; + + ln = *lnp; + *lnp = NULL; LLE_WLOCK_ASSERT(ln); + ND6_RLOCK_ASSERT(); + + ifp = lltable_get_ifp(ln->lle_tbl); + if ((ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) != 0) + dr = defrouter_lookup_locked(&ln->r_l3addr.addr6, ifp); + else + dr = NULL; + ND6_RUNLOCK(); + + if ((ln->la_flags & LLE_DELETED) == 0) + EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_EXPIRED); /* * we used to have pfctlinput(PRC_HOSTDEAD) here. @@ -1382,11 +1394,7 @@ nd6_free(struct llentry *ln, int gc) /* cancel timer */ nd6_llinfo_settimer_locked(ln, -1); - dr = NULL; - ifp = ln->lle_tbl->llt_ifp; if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) { - dr = defrouter_lookup(&ln->r_l3addr.addr6, ifp); - if (dr != NULL && dr->expire && ln->ln_state == ND6_LLINFO_STALE && gc) { /* From owner-svn-src-head@freebsd.org Tue Mar 29 19:54:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48D61AE22B1; Tue, 29 Mar 2016 19:54:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AA2B1EF1; Tue, 29 Mar 2016 19:54:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2TJsDQC036509; Tue, 29 Mar 2016 19:54:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TJsDSC036508; Tue, 29 Mar 2016 19:54:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603291954.u2TJsDSC036508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 29 Mar 2016 19:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297398 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 19:54:14 -0000 Author: kib Date: Tue Mar 29 19:54:13 2016 New Revision: 297398 URL: https://svnweb.freebsd.org/changeset/base/297398 Log: Fix several bugs in r297374: - fix UP build [1] - do not obliterate initial reading of rdtsc by the loop counter [2] - restore the meaning of the argument -1 to native_lapic_ipi_wait() as wait until LAPIC acknowledge without timeout - correct formula for calculating loop iteration count for 1us, it was inverted, and ensure that even on unlikely slow CPUs at least one check for ack is performed. Reported by: Michael Butler [1], rpokala[2], jhb[3] Tested by: Michael Butler Pointy hat to: kib Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Tue Mar 29 19:23:00 2016 (r297397) +++ head/sys/x86/x86/local_apic.c Tue Mar 29 19:54:13 2016 (r297398) @@ -172,7 +172,9 @@ int lapic_eoi_suppression; static int lapic_timer_tsc_deadline; static u_long lapic_timer_divisor; static struct eventtimer lapic_et; +#ifdef SMP static uint64_t lapic_ipi_wait_mult; +#endif SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG_RD, 0, "APIC options"); SYSCTL_INT(_hw_apic, OID_AUTO, x2apic_mode, CTLFLAG_RD, &x2apic_mode, 0, ""); @@ -404,7 +406,9 @@ lvt_mode(struct lapic *la, u_int pin, ui static void native_lapic_init(vm_paddr_t addr) { - uint64_t r; +#ifdef SMP + uint64_t r, r1, r2, rx; +#endif uint32_t ver; u_int regs[4]; int i, arat; @@ -506,6 +510,7 @@ native_lapic_init(vm_paddr_t addr) &lapic_eoi_suppression); } +#ifdef SMP #define LOOPS 1000000 /* * Calibrate the busy loop waiting for IPI ack in xAPIC mode. @@ -521,18 +526,21 @@ native_lapic_init(vm_paddr_t addr) KASSERT((cpu_feature & CPUID_TSC) != 0 && tsc_freq != 0, ("TSC not initialized")); r = rdtsc(); - for (r = 0; r < LOOPS; r++) { + for (rx = 0; rx < LOOPS; rx++) { (void)lapic_read_icr_lo(); ia32_pause(); } r = rdtsc() - r; - lapic_ipi_wait_mult = (r * 1000000) / tsc_freq / LOOPS; + r1 = tsc_freq * LOOPS; + r2 = r * 1000000; + lapic_ipi_wait_mult = r1 >= r2 ? r1 / r2 : 1; if (bootverbose) { printf("LAPIC: ipi_wait() us multiplier %jd (r %jd tsc %jd)\n", (uintmax_t)lapic_ipi_wait_mult, (uintmax_t)r, (uintmax_t)tsc_freq); } #undef LOOPS +#endif /* SMP */ } /* @@ -1757,11 +1765,11 @@ native_lapic_ipi_wait(int delay) uint64_t i, counter; /* LAPIC_ICR.APIC_DELSTAT_MASK is undefined in x2APIC mode */ - if (x2apic_mode || delay == -1) + if (x2apic_mode) return (1); counter = lapic_ipi_wait_mult * delay; - for (i = 0; i < counter; i++) { + for (i = 0; delay == -1 || i < counter; i++) { if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == APIC_DELSTAT_IDLE) return (1); From owner-svn-src-head@freebsd.org Tue Mar 29 19:56:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08ECDAE2595; Tue, 29 Mar 2016 19:56:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C00AB13D2; Tue, 29 Mar 2016 19:56:49 +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 u2TJumPL036785; Tue, 29 Mar 2016 19:56:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TJum7Z036780; Tue, 29 Mar 2016 19:56:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603291956.u2TJum7Z036780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 29 Mar 2016 19:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297399 - in head/sys: amd64/include i386/include x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 19:56:50 -0000 Author: kib Date: Tue Mar 29 19:56:48 2016 New Revision: 297399 URL: https://svnweb.freebsd.org/changeset/base/297399 Log: Type of the interrupt handlers on x86 cannot be expressed in C. Simplify and unify placeholder type definitions. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D5771 Modified: head/sys/amd64/include/intr_machdep.h head/sys/amd64/include/md_var.h head/sys/i386/include/intr_machdep.h head/sys/i386/include/md_var.h head/sys/x86/include/x86_var.h Modified: head/sys/amd64/include/intr_machdep.h ============================================================================== --- head/sys/amd64/include/intr_machdep.h Tue Mar 29 19:54:13 2016 (r297398) +++ head/sys/amd64/include/intr_machdep.h Tue Mar 29 19:56:48 2016 (r297399) @@ -83,7 +83,7 @@ #ifndef LOCORE -typedef void inthand_t(u_int cs, u_int ef, u_int esp, u_int ss); +typedef void inthand_t(void); #define IDTVEC(name) __CONCAT(X,name) Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Tue Mar 29 19:54:13 2016 (r297398) +++ head/sys/amd64/include/md_var.h Tue Mar 29 19:56:48 2016 (r297399) @@ -36,9 +36,6 @@ extern uint64_t *vm_page_dump; -/* XXX */ -typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss); - struct savefpu; void amd64_db_resume_dbreg(void); Modified: head/sys/i386/include/intr_machdep.h ============================================================================== --- head/sys/i386/include/intr_machdep.h Tue Mar 29 19:54:13 2016 (r297398) +++ head/sys/i386/include/intr_machdep.h Tue Mar 29 19:56:48 2016 (r297399) @@ -83,7 +83,7 @@ #ifndef LOCORE -typedef void inthand_t(u_int cs, u_int ef, u_int esp, u_int ss); +typedef void inthand_t(void); #define IDTVEC(name) __CONCAT(X,name) Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Tue Mar 29 19:54:13 2016 (r297398) +++ head/sys/i386/include/md_var.h Tue Mar 29 19:56:48 2016 (r297399) @@ -46,7 +46,6 @@ extern int szosigcode; #endif extern uint32_t *vm_page_dump; -typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss); struct segment_descriptor; union savefpu; Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Tue Mar 29 19:54:13 2016 (r297398) +++ head/sys/x86/include/x86_var.h Tue Mar 29 19:56:48 2016 (r297399) @@ -86,6 +86,13 @@ struct fpreg; struct dbreg; struct dumperinfo; +/* + * The interface type of the interrupt handler entry point cannot be + * expressed in C. Use simplest non-variadic function type as an + * approximation. + */ +typedef void alias_for_inthand_t(void); + void *alloc_fpusave(int flags); void busdma_swi(void); bool cpu_mwait_usable(void); From owner-svn-src-head@freebsd.org Tue Mar 29 19:57:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECF27AE25F0; Tue, 29 Mar 2016 19:57:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F296315D8; Tue, 29 Mar 2016 19:57:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2TJvBtn036853; Tue, 29 Mar 2016 19:57:11 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TJvBsf036848; Tue, 29 Mar 2016 19:57:11 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201603291957.u2TJvBsf036848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 29 Mar 2016 19:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297400 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 19:57:14 -0000 Author: glebius Date: Tue Mar 29 19:57:11 2016 New Revision: 297400 URL: https://svnweb.freebsd.org/changeset/base/297400 Log: The sendfile(2) allows to send extra data from userspace before the file data (headers). Historically the size of the headers was not checked against the socket buffer space. Application could easily overcommit the socket buffer space. With the new sendfile (r293439) the problem remained, but a KASSERT was inserted that checked that amount of data written to the socket matches its space. In case when size of headers is bigger that socket space, KASSERT fires. Without INVARIANTS the new sendfile won't panic, but would report incorrect amount of bytes sent. o With this change, the headers copyin is moved down into the cycle, after the sbspace() check. The uio size is trimmed by socket space there, which fixes the overcommit problem and its consequences. o The compatibility handling for FreeBSD 4 sendfile headers API is pushed up the stack to syscall wrappers. This required a copy and paste of the code, but in turn this allowed to remove extra stack carried parameter from fo_sendfile_t, and embrace entire compat code into #ifdef. If in future we got more fo_sendfile_t function, the copy and paste level would even reduce. Reviewed by: emax, gallatin, Maxim Dounin Tested by: Vitalij Satanivskij Sponsored by: Netflix Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_descrip.c head/sys/kern/kern_sendfile.c head/sys/sys/file.h head/sys/sys/socket.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Mar 29 19:56:48 2016 (r297399) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Mar 29 19:57:11 2016 (r297400) @@ -1653,6 +1653,19 @@ freebsd32_do_sendfile(struct thread *td, hdtr32.hdr_cnt, &hdr_uio); if (error) goto out; +#ifdef COMPAT_FREEBSD4 + /* + * In FreeBSD < 5.0 the nbytes to send also included + * the header. If compat is specified subtract the + * header size from nbytes. + */ + if (compat) { + if (uap->nbytes > hdr_uio->uio_resid) + uap->nbytes -= hdr_uio->uio_resid; + else + uap->nbytes = 0; + } +#endif } if (hdtr.trailers != NULL) { iov32 = PTRIN(hdtr32.trailers); @@ -1670,7 +1683,7 @@ freebsd32_do_sendfile(struct thread *td, goto out; error = fo_sendfile(fp, uap->s, hdr_uio, trl_uio, offset, - uap->nbytes, &sbytes, uap->flags, compat ? SFK_COMPAT : 0, td); + uap->nbytes, &sbytes, uap->flags, td); fdrop(fp, td); if (uap->sbytes != NULL) Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Mar 29 19:56:48 2016 (r297399) +++ head/sys/kern/kern_descrip.c Tue Mar 29 19:57:11 2016 (r297400) @@ -3958,7 +3958,7 @@ badfo_chown(struct file *fp, uid_t uid, static int badfo_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, - int kflags, struct thread *td) + struct thread *td) { return (EBADF); @@ -4044,7 +4044,7 @@ invfo_chown(struct file *fp, uid_t uid, int invfo_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, - int kflags, struct thread *td) + struct thread *td) { return (EINVAL); Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Tue Mar 29 19:56:48 2016 (r297399) +++ head/sys/kern/kern_sendfile.c Tue Mar 29 19:57:11 2016 (r297400) @@ -516,7 +516,7 @@ sendfile_getsock(struct thread *td, int int vn_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, - int kflags, struct thread *td) + struct thread *td) { struct file *sock_fp; struct vnode *vp; @@ -534,7 +534,7 @@ vn_sendfile(struct file *fp, int sockfd, so = NULL; m = mh = NULL; sfs = NULL; - sbytes = 0; + hdrlen = sbytes = 0; softerr = 0; error = sendfile_getobj(td, fp, &obj, &vp, &shmfd, &obj_size, &bsize); @@ -560,26 +560,6 @@ vn_sendfile(struct file *fp, int sockfd, cv_init(&sfs->cv, "sendfile"); } - /* If headers are specified copy them into mbufs. */ - if (hdr_uio != NULL && hdr_uio->uio_resid > 0) { - hdr_uio->uio_td = td; - hdr_uio->uio_rw = UIO_WRITE; - /* - * In FBSD < 5.0 the nbytes to send also included - * the header. If compat is specified subtract the - * header size from nbytes. - */ - if (kflags & SFK_COMPAT) { - if (nbytes > hdr_uio->uio_resid) - nbytes -= hdr_uio->uio_resid; - else - nbytes = 0; - } - mh = m_uiotombuf(hdr_uio, M_WAITOK, 0, 0, 0); - hdrlen = m_length(mh, &mhtail); - } else - hdrlen = 0; - rem = nbytes ? omin(nbytes, obj_size - offset) : obj_size - offset; /* @@ -668,11 +648,20 @@ retry_space: SOCKBUF_UNLOCK(&so->so_snd); /* - * Reduce space in the socket buffer by the size of - * the header mbuf chain. - * hdrlen is set to 0 after the first loop. + * At the beginning of the first loop check if any headers + * are specified and copy them into mbufs. Reduce space in + * the socket buffer by the size of the header mbuf chain. + * Clear hdr_uio here and hdrlen at the end of the first loop. */ - space -= hdrlen; + if (hdr_uio != NULL && hdr_uio->uio_resid > 0) { + hdr_uio->uio_td = td; + hdr_uio->uio_rw = UIO_WRITE; + hdr_uio->uio_resid = min(hdr_uio->uio_resid, space); + mh = m_uiotombuf(hdr_uio, M_WAITOK, 0, 0, 0); + hdrlen = m_length(mh, &mhtail); + space -= hdrlen; + hdr_uio = NULL; + } if (vp != NULL) { error = vn_lock(vp, LK_SHARED); @@ -944,6 +933,19 @@ sendfile(struct thread *td, struct sendf &hdr_uio); if (error != 0) goto out; +#ifdef COMPAT_FREEBSD4 + /* + * In FreeBSD < 5.0 the nbytes to send also included + * the header. If compat is specified subtract the + * header size from nbytes. + */ + if (compat) { + if (uap->nbytes > hdr_uio->uio_resid) + uap->nbytes -= hdr_uio->uio_resid; + else + uap->nbytes = 0; + } +#endif } if (hdtr.trailers != NULL) { error = copyinuio(hdtr.trailers, hdtr.trl_cnt, @@ -965,7 +967,7 @@ sendfile(struct thread *td, struct sendf } error = fo_sendfile(fp, uap->s, hdr_uio, trl_uio, uap->offset, - uap->nbytes, &sbytes, uap->flags, compat ? SFK_COMPAT : 0, td); + uap->nbytes, &sbytes, uap->flags, td); fdrop(fp, td); if (uap->sbytes != NULL) Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Tue Mar 29 19:56:48 2016 (r297399) +++ head/sys/sys/file.h Tue Mar 29 19:57:11 2016 (r297400) @@ -112,7 +112,7 @@ typedef int fo_chown_t(struct file *fp, struct ucred *active_cred, struct thread *td); typedef int fo_sendfile_t(struct file *fp, int sockfd, struct uio *hdr_uio, struct uio *trl_uio, off_t offset, size_t nbytes, - off_t *sent, int flags, int kflags, struct thread *td); + off_t *sent, int flags, struct thread *td); typedef int fo_seek_t(struct file *fp, off_t offset, int whence, struct thread *td); typedef int fo_fill_kinfo_t(struct file *fp, struct kinfo_file *kif, @@ -376,11 +376,11 @@ fo_chown(struct file *fp, uid_t uid, gid static __inline int fo_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, - int kflags, struct thread *td) + struct thread *td) { return ((*fp->f_ops->fo_sendfile)(fp, sockfd, hdr_uio, trl_uio, offset, - nbytes, sent, flags, kflags, td)); + nbytes, sent, flags, td)); } static __inline int Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Tue Mar 29 19:56:48 2016 (r297399) +++ head/sys/sys/socket.h Tue Mar 29 19:57:11 2016 (r297400) @@ -594,7 +594,6 @@ struct sf_hdtr { #define SF_FLAGS(rh, flags) (((rh) << 16) | (flags)) #ifdef _KERNEL -#define SFK_COMPAT 0x00000001 #define SF_READAHEAD(flags) ((flags) >> 16) #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Tue Mar 29 19:59:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ACA0AE27DF; Tue, 29 Mar 2016 19:59:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECF5B1A0D; Tue, 29 Mar 2016 19:59:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2TJxjpm037123; Tue, 29 Mar 2016 19:59:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TJxjD2037122; Tue, 29 Mar 2016 19:59:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603291959.u2TJxjD2037122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 29 Mar 2016 19:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297401 - head/sys/fs/cd9660 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 19:59:46 -0000 Author: kib Date: Tue Mar 29 19:59:44 2016 New Revision: 297401 URL: https://svnweb.freebsd.org/changeset/base/297401 Log: Do not access buffer if bread(9) or cluster_read(9) failed. On error, the functions free the buffer and set the pointer to NULL. Also remove useless call to brelse(9) on the error path. PR: 208275 Submitted by: Fabian Keil MFC after: 2 weeks Modified: head/sys/fs/cd9660/cd9660_vnops.c Modified: head/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vnops.c Tue Mar 29 19:57:11 2016 (r297400) +++ head/sys/fs/cd9660/cd9660_vnops.c Tue Mar 29 19:59:44 2016 (r297401) @@ -341,11 +341,9 @@ cd9660_read(ap) } else error = bread(vp, lbn, size, NOCRED, &bp); } - n = MIN(n, size - bp->b_resid); - if (error) { - brelse(bp); + if (error != 0) return (error); - } + n = MIN(n, size - bp->b_resid); error = uiomove(bp->b_data + on, (int)n, uio); brelse(bp); From owner-svn-src-head@freebsd.org Tue Mar 29 20:05:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C65D0AE2AC1; Tue, 29 Mar 2016 20:05:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0F83C1F47; Tue, 29 Mar 2016 20:05:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA15375; Tue, 29 Mar 2016 23:05:52 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1akztg-0005Im-P7; Tue, 29 Mar 2016 23:05:52 +0300 Subject: Re: svn commit: r297396 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Alexander Motin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201603291918.u2TJIYRp024552@repo.freebsd.org> From: Andriy Gapon Message-ID: <56FADFE8.6040203@FreeBSD.org> Date: Tue, 29 Mar 2016 23:04:56 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <201603291918.u2TJIYRp024552@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 20:05:56 -0000 On 29/03/2016 22:18, Alexander Motin wrote: > Author: mav > Date: Tue Mar 29 19:18:34 2016 > New Revision: 297396 > URL: https://svnweb.freebsd.org/changeset/base/297396 > > Log: > Modify "4958 zdb trips assert on pools with ashift >= 0xe". > > Unlike Illumos FreeBSD has concept of logical ashift, that specifies > really minimal vdev block size that can be accessed. This knowledge > allows properly pad physical I/O and correctly assert its alignment. > > This change fixes L2ARC write errors when device has logical sector > size above 512 bytes. > > MFC after: 1 month > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Mar 29 19:11:04 2016 (r297395) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Mar 29 19:18:34 2016 (r297396) > @@ -2775,10 +2775,19 @@ zio_vdev_io_start(zio_t *zio) > (void) atomic_cas_64(&spa->spa_last_io, old, new); > } > > +#ifdef illumos > align = 1ULL << vd->vdev_top->vdev_ashift; > > if (!(zio->io_flags & ZIO_FLAG_PHYSICAL) && > P2PHASE(zio->io_size, align) != 0) { > +#else > + if (zio->io_flags & ZIO_FLAG_PHYSICAL) > + align = 1ULL << vd->vdev_top->vdev_logical_ashift; Alexander, I believe that this is wrong. We must not modify any parameters of a physical zio including its size. Otherwise we are going to overwrite something that an originator of the I/O did not intend to overwrite. Here we should have a check (or just the assertion) that the zio conforms to disk characteristics. It's the code that creates physical zio-s that should be made aware of the alignment requirements. Please see my work in this direction: https://reviews.freebsd.org/D2789 (BTW, I added you as a reviewer there). > + else > + align = 1ULL << vd->vdev_top->vdev_ashift; > + > + if (P2PHASE(zio->io_size, align) != 0) { > +#endif > /* Transform logical writes to be a full physical block size. */ > uint64_t asize = P2ROUNDUP(zio->io_size, align); > char *abuf = NULL; > @@ -2794,6 +2803,7 @@ zio_vdev_io_start(zio_t *zio) > zio_subblock); > } > > +#ifdef illumos > /* > * If this is not a physical io, make sure that it is properly aligned > * before proceeding. > @@ -2809,6 +2819,10 @@ zio_vdev_io_start(zio_t *zio) > ASSERT0(P2PHASE(zio->io_offset, SPA_MINBLOCKSIZE)); > ASSERT0(P2PHASE(zio->io_size, SPA_MINBLOCKSIZE)); > } > +#else > + ASSERT0(P2PHASE(zio->io_offset, align)); > + ASSERT0(P2PHASE(zio->io_size, align)); > +#endif > > VERIFY(zio->io_type == ZIO_TYPE_READ || spa_writeable(spa)); > > -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Mar 29 20:18:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C73E4AE20A0; Tue, 29 Mar 2016 20:18:22 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lb0-x22b.google.com (mail-lb0-x22b.google.com [IPv6:2a00:1450:4010:c04::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DC81A96; Tue, 29 Mar 2016 20:18:22 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-lb0-x22b.google.com with SMTP id vo2so18439267lbb.1; Tue, 29 Mar 2016 13:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-transfer-encoding; bh=SqPmTBJYSX/Ir1udClIPl5Kf7Qo7UGKD8xY8mxjdGs0=; b=FUtyzBjkjPrAQygjO+L1gCO0pez0Qpxg5nlayF3kziPl6m1gnCbtUQ4gEh3Hsq+PIA gOde3Uden00pi4Gh5M591rO/JlqalMSWCpEaHCGlTgpUj8q+wYM5p+58Ss4YVG24ua19 mE9KjgzF5cbcIrGU2DpWHdAdscJum+RpC28dKFWtRMftzQNFFODLaPkzRAMFpN9J8qK9 J6TJUyLB8/4isjJamLZxBdY+e9ZhCnDQQ3p5jPan1cKPIvXCKq1HvqvqjT5bz+1HmOLJ j8pgCyaYUrdQvTbX+czqZN+u+LvgAIG2kSD8f1BRgfzuELVmJ90B/DDTToXoF/n+AV2g C9xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:message-id:date:from:user-agent :mime-version:to:subject:references:in-reply-to :content-transfer-encoding; bh=SqPmTBJYSX/Ir1udClIPl5Kf7Qo7UGKD8xY8mxjdGs0=; b=geYF6eTDTvkqqAcsKhfZ4uHjvUrXkl16KxbWa01y6abV1YSPARys+N66rfpY/BsEe2 GhPxIkvwqEIu097oTg+wZkgN3G3CAdU2zNMNyrGs8Bb188XEwbrbK4/JMeJyAgcRnJxN S3vjko9S2Jy3473UNZHk/oW4K1uD2EteXcdjxbiUskpZd6t4TlVDIZ/COV7iCM8y63vS Ju1lb2VETNe0bws5ffMjG5fQyrrNJc/azVgRrfhETlFL9XspdDxI4jTSZeaOATG3Qhn2 v8TLGywro19thSVaHHYK292Fzj+cV5sHwb7skMY2f8H4qh0jN0klJASDDlz97r4MKeLl sv9Q== X-Gm-Message-State: AD7BkJK9gvsZ3FR6F66k0DDweVxJs3DuYAaAHT1YC8hWA0yxoDtOKQdDo8BQIX5QRa3laA== X-Received: by 10.112.25.99 with SMTP id b3mr1998431lbg.11.1459282700624; Tue, 29 Mar 2016 13:18:20 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by smtp.googlemail.com with ESMTPSA id ai2sm54341lbc.46.2016.03.29.13.18.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 Mar 2016 13:18:20 -0700 (PDT) Sender: Alexander Motin Message-ID: <56FAE30A.2080300@FreeBSD.org> Date: Tue, 29 Mar 2016 23:18:18 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r297396 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201603291918.u2TJIYRp024552@repo.freebsd.org> <56FADFE8.6040203@FreeBSD.org> In-Reply-To: <56FADFE8.6040203@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 20:18:22 -0000 On 29.03.16 23:04, Andriy Gapon wrote: > On 29/03/2016 22:18, Alexander Motin wrote: >> Author: mav >> Date: Tue Mar 29 19:18:34 2016 >> New Revision: 297396 >> URL: https://svnweb.freebsd.org/changeset/base/297396 >> >> Log: >> Modify "4958 zdb trips assert on pools with ashift >= 0xe". >> >> Unlike Illumos FreeBSD has concept of logical ashift, that specifies >> really minimal vdev block size that can be accessed. This knowledge >> allows properly pad physical I/O and correctly assert its alignment. >> >> This change fixes L2ARC write errors when device has logical sector >> size above 512 bytes. >> >> MFC after: 1 month > > Alexander, > > I believe that this is wrong. > We must not modify any parameters of a physical zio including its size. > Otherwise we are going to overwrite something that an originator of the I/O did > not intend to overwrite. Here we should have a check (or just the assertion) > that the zio conforms to disk characteristics. It's the code that creates > physical zio-s that should be made aware of the alignment requirements. Generally I agree with your point. I also had such thoughts. Though this way is much easier and less invasive and I can not find any real failure scenario for it. I will happily revert it when better solution is ready. > Please see my work in this direction: https://reviews.freebsd.org/D2789 > (BTW, I added you as a reviewer there). Sure. I'll take a look on that. -- Alexander Motin From owner-svn-src-head@freebsd.org Tue Mar 29 23:02:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24FE2AE0CAE; Tue, 29 Mar 2016 23:02:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 0ED061FE3; Tue, 29 Mar 2016 23:02:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 074CF1C4C; Tue, 29 Mar 2016 23:02:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id A96E11E170; Tue, 29 Mar 2016 23:02:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id rTJFdaimaQGV; Tue, 29 Mar 2016 23:02:07 +0000 (UTC) Subject: Re: svn commit: r297040 - in head: contrib/bmake contrib/bmake/mk share/mk usr.bin/bmake DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com BDA8B1E167 To: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603182003.u2IK39FS069664@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <56FB096C.6030001@FreeBSD.org> Date: Tue, 29 Mar 2016 16:02:04 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <201603182003.u2IK39FS069664@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 23:02:10 -0000 On 3/18/16 1:03 PM, Simon J. Gerraty wrote: > .if defined(NO_DIRDEPS) || defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) > -# confine ourselves to the original dir > +# confine ourselves to the original dir and below. > DIRDEPS_FILTER += M${_DEP_RELDIR}* > +.elif defined(NO_DIRDEPS_BELOW) > +DIRDEPS_FILTER += M${_DEP_RELDIR} > .endif There is still dirdeps cache code right further down below this that only is skipped with NO_DIRDEPS. -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Tue Mar 29 23:33:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85299AE1407; Tue, 29 Mar 2016 23:33:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 571B51DF8; Tue, 29 Mar 2016 23:33:45 +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 u2TNXieQ004452; Tue, 29 Mar 2016 23:33:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2TNXiIj004451; Tue, 29 Mar 2016 23:33:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603292333.u2TNXiIj004451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 29 Mar 2016 23:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297402 - head/sys/dev/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 23:33:45 -0000 Author: pfg Date: Tue Mar 29 23:33:44 2016 New Revision: 297402 URL: https://svnweb.freebsd.org/changeset/base/297402 Log: Small typo. Modified: head/sys/dev/ata/ata-lowlevel.c Modified: head/sys/dev/ata/ata-lowlevel.c ============================================================================== --- head/sys/dev/ata/ata-lowlevel.c Tue Mar 29 19:59:44 2016 (r297401) +++ head/sys/dev/ata/ata-lowlevel.c Tue Mar 29 23:33:44 2016 (r297402) @@ -851,7 +851,7 @@ ata_pio_read(struct ata_request *request panic("ata_pio_read: Unsupported CAM data type %x\n", (request->ccb->ccb_h.flags & CAM_DATA_MASK)); - /* We may have extra byte already red but not stored. */ + /* We may have extra byte already read but not stored. */ if (resid) { addr[0] = buf[1]; addr++; From owner-svn-src-head@freebsd.org Tue Mar 29 23:54:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99418AE18FA; Tue, 29 Mar 2016 23:54:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x242.google.com (mail-ig0-x242.google.com [IPv6:2607:f8b0:4001:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 640211957; Tue, 29 Mar 2016 23:54:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x242.google.com with SMTP id ww10so5241361igb.2; Tue, 29 Mar 2016 16:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=JDGysSDh1aAv7lt3vvVFx2zAUqTRj+9ZyliMvsIXnMQ=; b=LZQWOiWh+426YeHmCrKzLtlH/oVmi3pMyU1TNxWkSHATIxmWMa6dftsGcjXv6YOv6v N6dG4GWbpeKK7MJAaxKF8xAwLhVpNI4+r9u9rjRDLYnxiF0VAC5p8Z61M9vMx8/jpqo1 ax/UHvMUrJk3GVPtHT8UuJ3qbFsIxxUE9oa20WGNZ0z0dsrvdwnkx8Xae0o/l5CJaKY/ GFn6Jj+eVfr5SJLhT0nhnF0Qai43f5ADyK+NIwjI9XkXTw9kIgChFI9/Id46us7YPxxS W0D2C1ImFEW1eWA9B+a6OLRPHW27WVq1aEC+3Jot5+/e8APuMMJ85yVWWUsIiIalskRj 5V3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=JDGysSDh1aAv7lt3vvVFx2zAUqTRj+9ZyliMvsIXnMQ=; b=E7yGt6e3mnLXD/L/pammtAMdJElPkVczEEwFBB7Dfs7giq1nswsLrsIWrgV5Wka1sg bVZGGNxHMI8UVEIQzFBQTXiWIx4W3y+iff5dXUvYg+Gf8sZ4vNiK1QjhISuuo0ILby73 zyb/lnnXLFOi7Q6uOskmujJkpJ2AXPRvAWz18vREl+XjmuiTwCCaAFHiREg/zBc28Lct n/Oljn7/IOZOanCkBOYJvI0saMlURISFF7+5yuiPYn6o7S+UHzO8xWL8oT7xFTNQeEPK fZfpR4mM6PtseRzgeUuTU/5CP0D+8uDK12n2NcL3t6T1Y5WnMqpda5+f0r9YBRKn1Lxr K/bw== X-Gm-Message-State: AD7BkJLczg/zvOky884b6n33g6UVWnhH3VdfwKxLcf3rAgKzn9QEUiLiVcsaTGLR/ARGJbZ+7ugnOAg47M3k3Q== X-Received: by 10.50.65.74 with SMTP id v10mr5833258igs.33.1459295654747; Tue, 29 Mar 2016 16:54:14 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.66 with HTTP; Tue, 29 Mar 2016 16:53:55 -0700 (PDT) In-Reply-To: <201603291519.u2TFJuXW051571@repo.freebsd.org> References: <201603291519.u2TFJuXW051571@repo.freebsd.org> From: Ed Maste Date: Tue, 29 Mar 2016 23:53:55 +0000 X-Google-Sender-Auth: MBSCW9CQC15vUJ4CHeRpvBFJ9Y4 Message-ID: Subject: Re: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries To: Zbigniew Bodek Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 23:54:15 -0000 On 29 March 2016 at 15:19, Zbigniew Bodek wrote: > Author: zbb > Date: Tue Mar 29 15:19:56 2016 > New Revision: 297392 > URL: https://svnweb.freebsd.org/changeset/base/297392 > > Log: > Reduce OFW PCI code duplication - involves ARM, PPC and SPARC64 My 'make tinderbox' build is now failing (powerpc LINT) with: linking kernel cpcht.o: In function `cpcht_attach': cpcht.c:(.text+0x17dc): undefined reference to `ofw_pci_attach' cpcht.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' grackle.o: In function `grackle_attach': grackle.c:(.text+0x2dc): undefined reference to `ofw_pci_attach' grackle.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' uninorthpci.o: In function `uninorth_attach': uninorthpci.c:(.text+0x68c): undefined reference to `ofw_pci_attach' uninorthpci.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' *** [kernel] Error code 1 From owner-svn-src-head@freebsd.org Wed Mar 30 00:04:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7373AAE1DDD; Wed, 30 Mar 2016 00:04:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43DE81E94; Wed, 30 Mar 2016 00:04:00 +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 u2U03xA0013734; Wed, 30 Mar 2016 00:03:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2U03xvo013733; Wed, 30 Mar 2016 00:03:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201603300003.u2U03xvo013733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 30 Mar 2016 00:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297403 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 00:04:00 -0000 Author: markj Date: Wed Mar 30 00:03:59 2016 New Revision: 297403 URL: https://svnweb.freebsd.org/changeset/base/297403 Log: Fix the lladdr copy in in6_lltable_dump_entry() after r292978. This bug caused "ndp -a" to show the wrong link layer address for neighbour cache entries. PR: 208067 Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Mar 29 23:33:44 2016 (r297402) +++ head/sys/netinet6/in6.c Wed Mar 30 00:03:59 2016 (r297403) @@ -2367,7 +2367,7 @@ in6_lltable_dump_entry(struct lltable *l sdl->sdl_alen = ifp->if_addrlen; sdl->sdl_index = ifp->if_index; sdl->sdl_type = ifp->if_type; - bcopy(&lle->ll_addr, LLADDR(sdl), ifp->if_addrlen); + bcopy(lle->ll_addr, LLADDR(sdl), ifp->if_addrlen); if (lle->la_expire != 0) ndpc.rtm.rtm_rmx.rmx_expire = lle->la_expire + lle->lle_remtime / hz + From owner-svn-src-head@freebsd.org Wed Mar 30 00:42:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F7BAAE24C7; Wed, 30 Mar 2016 00:42:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F1A21F02; Wed, 30 Mar 2016 00:42:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2U0gIoa025578; Wed, 30 Mar 2016 00:42:18 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2U0gITZ025577; Wed, 30 Mar 2016 00:42:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603300042.u2U0gITZ025577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 30 Mar 2016 00:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297404 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 00:42:19 -0000 Author: adrian Date: Wed Mar 30 00:42:18 2016 New Revision: 297404 URL: https://svnweb.freebsd.org/changeset/base/297404 Log: [net80211] Add fields to decode uAPSD fields. It turns out that madwifi actually has the basics for uAPSD implemented but it was never ported to FreeBSD. I may eventually port most of the pieces; I'll see how it goes! Obtained from: Madwifi Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Wed Mar 30 00:03:59 2016 (r297403) +++ head/sys/net80211/ieee80211.h Wed Mar 30 00:42:18 2016 (r297404) @@ -317,6 +317,27 @@ struct ieee80211_wme_param { } __packed; /* + * WME U-APSD qos info field defines + */ +#define WME_CAPINFO_UAPSD_EN 0x00000080 +#define WME_CAPINFO_UAPSD_VO 0x00000001 +#define WME_CAPINFO_UAPSD_VI 0x00000002 +#define WME_CAPINFO_UAPSD_BK 0x00000004 +#define WME_CAPINFO_UAPSD_BE 0x00000008 +#define WME_CAPINFO_UAPSD_ACFLAGS_SHIFT 0 +#define WME_CAPINFO_UAPSD_ACFLAGS_MASK 0xF +#define WME_CAPINFO_UAPSD_MAXSP_SHIFT 5 +#define WME_CAPINFO_UAPSD_MAXSP_MASK 0x3 +#define WME_CAPINFO_IE_OFFSET 8 +#define WME_UAPSD_MAXSP(_qosinfo) \ + (((_qosinfo) >> WME_CAPINFO_UAPSD_MAXSP_SHIFT) & \ + WME_CAPINFO_UAPSD_MAXSP_MASK) +#define WME_UAPSD_AC_ENABLED(_ac, _qosinfo) \ + ((1 << (3 - (_ac))) & ( \ + ((_qosinfo) >> WME_CAPINFO_UAPSD_ACFLAGS_SHIFT) & \ + WME_CAPINFO_UAPSD_ACFLAGS_MASK)) + +/* * Management Notification Frame */ struct ieee80211_mnf { From owner-svn-src-head@freebsd.org Wed Mar 30 00:44:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B817DAE25E8; Wed, 30 Mar 2016 00:44:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 939C710B6; Wed, 30 Mar 2016 00:44:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2U0iBrb025724; Wed, 30 Mar 2016 00:44:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2U0iA2p025715; Wed, 30 Mar 2016 00:44:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603300044.u2U0iA2p025715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 30 Mar 2016 00:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297405 - in head/sys: dev/ath net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 00:44:12 -0000 Author: adrian Date: Wed Mar 30 00:44:10 2016 New Revision: 297405 URL: https://svnweb.freebsd.org/changeset/base/297405 Log: [net80211] migrate the time_* macros to ieee80211_* namespace. It turns out that these will clash very annoyingly with the linux macros in the linuxkpi layer, so let the wookie^Wlinux win. The only user that I can find is ath(4), so fix it there too. Modified: head/sys/dev/ath/if_ath_lna_div.c head/sys/net80211/ieee80211_dfs.c head/sys/net80211/ieee80211_freebsd.h head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_power.c head/sys/net80211/ieee80211_scan_sta.c head/sys/net80211/ieee80211_scan_sw.c head/sys/net80211/ieee80211_sta.c Modified: head/sys/dev/ath/if_ath_lna_div.c ============================================================================== --- head/sys/dev/ath/if_ath_lna_div.c Wed Mar 30 00:42:18 2016 (r297404) +++ head/sys/dev/ath/if_ath_lna_div.c Wed Mar 30 00:44:10 2016 (r297405) @@ -766,7 +766,7 @@ ath_lna_rx_comb_scan(struct ath_softc *s /* Short scan check */ if (antcomb->scan && antcomb->alt_good) { - if (time_after(ticks, antcomb->scan_start_time + + if (ieee80211_time_after(ticks, antcomb->scan_start_time + msecs_to_jiffies(ATH_ANT_DIV_COMB_SHORT_SCAN_INTR))) short_scan = AH_TRUE; else Modified: head/sys/net80211/ieee80211_dfs.c ============================================================================== --- head/sys/net80211/ieee80211_dfs.c Wed Mar 30 00:42:18 2016 (r297404) +++ head/sys/net80211/ieee80211_dfs.c Wed Mar 30 00:44:10 2016 (r297405) @@ -245,7 +245,7 @@ dfs_timeout(void *arg) for (i = 0; i < ic->ic_nchans; i++) { c = &ic->ic_channels[i]; if (IEEE80211_IS_CHAN_RADAR(c)) { - if (time_after_eq(now, dfs->nol_event[i]+NOL_TIMEOUT)) { + if (ieee80211_time_after_eq(now, dfs->nol_event[i]+NOL_TIMEOUT)) { c->ic_state &= ~IEEE80211_CHANSTATE_RADAR; if (c->ic_state & IEEE80211_CHANSTATE_NORADAR) { /* Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Wed Mar 30 00:42:18 2016 (r297404) +++ head/sys/net80211/ieee80211_freebsd.h Wed Mar 30 00:44:10 2016 (r297405) @@ -251,10 +251,10 @@ void ieee80211_vap_destroy(struct ieee80 #define ticks_to_msecs(t) (1000*(t) / hz) #define ticks_to_secs(t) ((t) / hz) -#define time_after(a,b) ((long)(b) - (long)(a) < 0) -#define time_before(a,b) time_after(b,a) -#define time_after_eq(a,b) ((long)(a) - (long)(b) >= 0) -#define time_before_eq(a,b) time_after_eq(b,a) +#define ieee80211_time_after(a,b) ((long)(b) - (long)(a) < 0) +#define ieee80211_time_before(a,b) ieee80211_time_after(b,a) +#define ieee80211_time_after_eq(a,b) ((long)(a) - (long)(b) >= 0) +#define ieee80211_time_before_eq(a,b) ieee80211_time_after_eq(b,a) struct mbuf *ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen); Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Wed Mar 30 00:42:18 2016 (r297404) +++ head/sys/net80211/ieee80211_ht.c Wed Mar 30 00:44:10 2016 (r297405) @@ -1406,7 +1406,7 @@ ieee80211_ht_timeout(struct ieee80211com IEEE80211_LOCK_ASSERT(ic); if ((ic->ic_flags_ht & IEEE80211_FHT_NONHT_PR) && - time_after(ticks, ic->ic_lastnonht + IEEE80211_NONHT_PRESENT_AGE)) { + ieee80211_time_after(ticks, ic->ic_lastnonht + IEEE80211_NONHT_PRESENT_AGE)) { #if 0 IEEE80211_NOTE(vap, IEEE80211_MSG_11N, ni, "%s", "time out non-HT STA present on channel"); Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Wed Mar 30 00:42:18 2016 (r297404) +++ head/sys/net80211/ieee80211_node.c Wed Mar 30 00:44:10 2016 (r297405) @@ -2638,7 +2638,7 @@ ieee80211_erp_timeout(struct ieee80211co IEEE80211_LOCK_ASSERT(ic); if ((ic->ic_flags_ext & IEEE80211_FEXT_NONERP_PR) && - time_after(ticks, ic->ic_lastnonerp + IEEE80211_NONERP_PRESENT_AGE)) { + ieee80211_time_after(ticks, ic->ic_lastnonerp + IEEE80211_NONERP_PRESENT_AGE)) { #if 0 IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni, "%s", "age out non-ERP sta present on channel"); Modified: head/sys/net80211/ieee80211_power.c ============================================================================== --- head/sys/net80211/ieee80211_power.c Wed Mar 30 00:42:18 2016 (r297404) +++ head/sys/net80211/ieee80211_power.c Wed Mar 30 00:44:10 2016 (r297405) @@ -623,7 +623,7 @@ ieee80211_sta_ps_timer_check(struct ieee /* If we've done any data within our idle interval, bail */ /* XXX hard-coded to one second for now, ew! */ - if (time_after(ic->ic_lastdata + 500, ticks)) + if (ieee80211_time_after(ic->ic_lastdata + 500, ticks)) goto out; /* Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Wed Mar 30 00:42:18 2016 (r297404) +++ head/sys/net80211/ieee80211_scan_sta.c Wed Mar 30 00:44:10 2016 (r297405) @@ -1323,7 +1323,7 @@ sta_roam_check(struct ieee80211_scan_sta * XXX deauth current ap */ if (curRate < roamRate || curRssi < roamRssi) { - if (time_after(ticks, ic->ic_lastscan + vap->iv_scanvalid)) { + if (ieee80211_time_after(ticks, ic->ic_lastscan + vap->iv_scanvalid)) { /* * Scan cache contents are too old; force a scan now * if possible so we have current state to make a @@ -1333,7 +1333,7 @@ sta_roam_check(struct ieee80211_scan_sta * XXX force immediate switch on scan complete */ if (!IEEE80211_IS_CHAN_DTURBO(ic->ic_curchan) && - time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle)) + ieee80211_time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle)) ieee80211_bg_scan(vap, 0); return; } Modified: head/sys/net80211/ieee80211_scan_sw.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sw.c Wed Mar 30 00:42:18 2016 (r297404) +++ head/sys/net80211/ieee80211_scan_sw.c Wed Mar 30 00:44:10 2016 (r297405) @@ -304,7 +304,7 @@ ieee80211_swscan_check_scan(const struct } if ((ic->ic_flags & IEEE80211_F_SCAN) == 0 && (flags & IEEE80211_SCAN_FLUSH) == 0 && - time_before(ticks, ic->ic_lastscan + vap->iv_scanvalid)) { + ieee80211_time_before(ticks, ic->ic_lastscan + vap->iv_scanvalid)) { /* * We're not currently scanning and the cache is * deemed hot enough to consult. Lock out others @@ -674,7 +674,7 @@ end: if (scandone || (ss->ss_flags & IEEE80211_SCAN_GOTPICK) || (ss_priv->ss_iflags & ISCAN_ABORT) || - time_after(ticks + ss->ss_mindwell, ss_priv->ss_scanend)) { + ieee80211_time_after(ticks + ss->ss_mindwell, ss_priv->ss_scanend)) { ss_priv->ss_iflags &= ~ISCAN_RUNNING; scan_end(ss, scandone); return; @@ -686,7 +686,7 @@ end: /* * Watch for truncation due to the scan end time. */ - if (time_after(ticks + ss->ss_maxdwell, ss_priv->ss_scanend)) + if (ieee80211_time_after(ticks + ss->ss_maxdwell, ss_priv->ss_scanend)) maxdwell = ss_priv->ss_scanend - ticks; else maxdwell = ss->ss_maxdwell; @@ -807,7 +807,7 @@ scan_end(struct ieee80211_scan_state *ss if ((ss_priv->ss_iflags & ISCAN_CANCEL) == 0 && !ss->ss_ops->scan_end(ss, vap) && (ss->ss_flags & IEEE80211_SCAN_ONCE) == 0 && - time_before(ticks + ss->ss_mindwell, ss_priv->ss_scanend)) { + ieee80211_time_before(ticks + ss->ss_mindwell, ss_priv->ss_scanend)) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s: done, restart " "[ticks %u, dwell min %lu scanend %lu]\n", @@ -923,7 +923,7 @@ ieee80211_swscan_add_scan(struct ieee802 * the timer so we'll switch to the next channel. */ if ((SCAN_PRIVATE(ss)->ss_iflags & ISCAN_MINDWELL) == 0 && - time_after_eq(ticks, SCAN_PRIVATE(ss)->ss_chanmindwell)) { + ieee80211_time_after_eq(ticks, SCAN_PRIVATE(ss)->ss_chanmindwell)) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s: chan %3d%c min dwell met (%u > %lu)\n", __func__, Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Wed Mar 30 00:42:18 2016 (r297404) +++ head/sys/net80211/ieee80211_sta.c Wed Mar 30 00:44:10 2016 (r297405) @@ -1253,7 +1253,7 @@ contbgscan(struct ieee80211vap *vap) return ((ic->ic_flags_ext & IEEE80211_FEXT_BGSCAN) && (ic->ic_flags & IEEE80211_F_CSAPENDING) == 0 && vap->iv_state == IEEE80211_S_RUN && /* XXX? */ - time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle)); + ieee80211_time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle)); } /* @@ -1274,8 +1274,8 @@ startbgscan(struct ieee80211vap *vap) #ifdef IEEE80211_SUPPORT_SUPERG !IEEE80211_IS_CHAN_DTURBO(ic->ic_curchan) && #endif - time_after(ticks, ic->ic_lastscan + vap->iv_bgscanintvl) && - time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle)); + ieee80211_time_after(ticks, ic->ic_lastscan + vap->iv_bgscanintvl) && + ieee80211_time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle)); } static void From owner-svn-src-head@freebsd.org Wed Mar 30 01:08:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CE48AE2BED; Wed, 30 Mar 2016 01:08:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E121C107F; Wed, 30 Mar 2016 01:08:09 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2U189NY032610; Wed, 30 Mar 2016 01:08:09 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2U189ei032609; Wed, 30 Mar 2016 01:08:09 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603300108.u2U189ei032609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 30 Mar 2016 01:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297406 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 01:08:10 -0000 Author: np Date: Wed Mar 30 01:08:08 2016 New Revision: 297406 URL: https://svnweb.freebsd.org/changeset/base/297406 Log: Remove unnecessary dequeue_mutex (added in r294610) from the iWARP connection manager. Examining so_comp without synchronization with iw_so_event_handler is a harmless race. Submitted by: Krishnamraju Eraparaju @ Chelsio Reviewed by: Steve Wise @ Open Grid Computing Sponsored by: Chelsio Communications Modified: head/sys/ofed/drivers/infiniband/core/iwcm.c Modified: head/sys/ofed/drivers/infiniband/core/iwcm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/iwcm.c Wed Mar 30 00:44:10 2016 (r297405) +++ head/sys/ofed/drivers/infiniband/core/iwcm.c Wed Mar 30 01:08:08 2016 (r297406) @@ -79,7 +79,6 @@ struct iwcm_listen_work { static LIST_HEAD(listen_port_list); static DEFINE_MUTEX(listen_port_mutex); -static DEFINE_MUTEX(dequeue_mutex); struct listen_port_info { struct list_head list; @@ -455,7 +454,6 @@ iw_so_event_handler(struct work_struct * kfree(work); return; } - mutex_lock(&dequeue_mutex); /* Dequeue & process all new 'so' connection requests for this cmid */ while ((so = dequeue_socket(work->cm_id->so)) != NULL) { @@ -475,7 +473,6 @@ iw_so_event_handler(struct work_struct * } } err: - mutex_unlock(&dequeue_mutex); kfree(work); #endif return; @@ -487,7 +484,6 @@ iw_so_upcall(struct socket *parent_so, v struct socket *so; struct iw_cm_id *cm_id = arg; - mutex_lock(&dequeue_mutex); /* check whether iw_so_event_handler() already dequeued this 'so' */ so = TAILQ_FIRST(&parent_so->so_comp); if (!so) @@ -500,7 +496,6 @@ iw_so_upcall(struct socket *parent_so, v INIT_WORK(&work->work, iw_so_event_handler); queue_work(iwcm_wq, &work->work); - mutex_unlock(&dequeue_mutex); return SU_OK; } From owner-svn-src-head@freebsd.org Wed Mar 30 01:32:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A3D1AE2F43; Wed, 30 Mar 2016 01:32:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 475C31ACC; Wed, 30 Mar 2016 01:32:09 +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 u2U1W8iu041640; Wed, 30 Mar 2016 01:32:08 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2U1W89m041639; Wed, 30 Mar 2016 01:32:08 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603300132.u2U1W89m041639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 30 Mar 2016 01:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297407 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 01:32:09 -0000 Author: pfg Date: Wed Mar 30 01:32:08 2016 New Revision: 297407 URL: https://svnweb.freebsd.org/changeset/base/297407 Log: freopen(3): prevent uninitialized errno. The case doesn't look very likely but clean the possibility nevertheless CID: 1018720 MFC after: 1 week Modified: head/lib/libc/stdio/freopen.c Modified: head/lib/libc/stdio/freopen.c ============================================================================== --- head/lib/libc/stdio/freopen.c Wed Mar 30 01:08:08 2016 (r297406) +++ head/lib/libc/stdio/freopen.c Wed Mar 30 01:32:08 2016 (r297407) @@ -66,7 +66,8 @@ freopen(const char * __restrict file, co (void) fclose(fp); errno = sverrno; return (NULL); - } + } else + sverrno = 0; FLOCKFILE(fp); From owner-svn-src-head@freebsd.org Wed Mar 30 03:59:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69FE2AE2B52; Wed, 30 Mar 2016 03:59:15 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0136.outbound.protection.outlook.com [157.56.110.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9A8F12EE; Wed, 30 Mar 2016 03:59:13 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-juniper-net; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=r8C0tR0GwvqnScL/ezCyghpEIdYPxEr7h9qBiMaLk/I=; b=b0xjjHcckyvWoYGqp63y+5Wffk4cC7gDg7MZQxyxXsynECktaqgS1as6rYzV9PTwOzz9KQ27eFUFI3D5YTdqp4XOJ6yJr/qLDsJpgAcRz1/rrwrGBsZftED+696EkGFFPlp4zPUjht/MOOA2ApLkhfXRSOLU3TOrJP+V7cERB6k= Received: from DM2PR0501CA0013.namprd05.prod.outlook.com (10.162.29.151) by BN3PR05MB2674.namprd05.prod.outlook.com (10.166.72.26) with Microsoft SMTP Server (TLS) id 15.1.447.15; Wed, 30 Mar 2016 03:59:12 +0000 Received: from BL2FFO11OLC002.protection.gbl (2a01:111:f400:7c09::197) by DM2PR0501CA0013.outlook.office365.com (2a01:111:e400:5148::23) with Microsoft SMTP Server (TLS) id 15.1.447.15 via Frontend Transport; Wed, 30 Mar 2016 03:59:11 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=juniper.net; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BL2FFO11OLC002.mail.protection.outlook.com (10.173.161.186) with Microsoft SMTP Server (TLS) id 15.1.453.6 via Frontend Transport; Wed, 30 Mar 2016 03:59:11 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 29 Mar 2016 20:59:05 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.16.84]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u2U3x4A61768; Tue, 29 Mar 2016 20:59:04 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 272EA385508; Tue, 29 Mar 2016 20:59:04 -0700 (PDT) To: Bryan Drewery CC: , , , Subject: Re: svn commit: r297040 - in head: contrib/bmake contrib/bmake/mk share/mk usr.bin/bmake In-Reply-To: <56FB096C.6030001@FreeBSD.org> References: <201603182003.u2IK39FS069664@repo.freebsd.org> <56FB096C.6030001@FreeBSD.org> Comments: In-reply-to: Bryan Drewery message dated "Tue, 29 Mar 2016 16:02:04 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <54143.1459310344.1@kaos.jnpr.net> Content-Transfer-Encoding: quoted-printable Date: Tue, 29 Mar 2016 20:59:04 -0700 Message-ID: <54145.1459310344@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.19; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(189002)(199003)(24454002)(50226001)(23726003)(4001430100002)(76176999)(92566002)(50466002)(11100500001)(2810700001)(4326007)(1096002)(76506005)(53416004)(2906002)(86362001)(110136002)(1220700001)(107886002)(50986999)(77096005)(46406003)(81166005)(87936001)(117636001)(105596002)(450100001)(189998001)(6806005)(5008740100001)(97756001)(5003600100002)(586003)(106466001)(2950100001)(19580405001)(47776003)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR05MB2674; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC002; 1:I975BVvkHdVGz8NFJwUMixlhzSzIJDhTFzGLB9/2O0NStAxAW6NqtLhp26fr4hxIh9Vxi4YpsOrD94fG9WZTwnrtYcnkVl5JykSijaCTn+S8I0yvBtEMOiQ0V1+5l/PzfebYwa3y6AW6GnqYPqdEzaODLq5Dc9b1YurUt+daJP4NsdeS8vD8XbgSYp0kDn2gspJQ9nsmugbckfZJIv9pNN5j3FACqJAU6acZUHGl0AdPfunwSLxi0x3Iz3JsL/GrthKVcpYAcmS2TmGXeLQruHqLUwafi8fgw+8Fe96trb9/7hyZbne8ASs929BJpZbeLgZvxvNPMQ7wUVCZe7BUJSN+LoO60RbHA8Ta3LGhXw2frrXqfwDXCc0fFLFkX8BHFF7gCNmlGwCjebx4Cg7KkxY5VzyOCWfEgjBCkme8eYcp1acRYNr+M99TuS7apHgg X-MS-Office365-Filtering-Correlation-Id: 3a916551-6182-4687-3bf3-08d3584fa711 X-Microsoft-Exchange-Diagnostics: 1; BN3PR05MB2674; 2:69iLLvMAFX3wC2l15KKFxEIJHw683RtDW5p5skOe/tY0Cmrxn4RDW0n1k+7qRFrCdaTs1UZi3WRruhLFrMTCKzeC7YVjwuOesiafFNjg/zCR8REfwrA/xFpboQUWAxJLMat7gN24uHJ7Zk7yoRCcvFkWxfcSAY5IuRJpMr0F7kpG3Gzg415JE0g1nBLK/bER; 3:Mmw3s/WlpBeiCZCREkIdkbexLXeJDFgxzNPfZz8DopTzx+wAvVnLw062+UBbWX/EHEK2V4hzwSPQqj1dnbx7Gy1IuonDC4GuTeQBExIZLV8qij7KGFJBakItpUsG6upFDjX02SftVGoU/i2Wf38RQngEJfona7YWFhHMWA4X8ebmT5PTxEThp0VvcSRrSdUUr8kxOZndMLio5DFnaLJaBUHB8qgZCNZWNNcmhP3s4Xg= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR05MB2674; X-Microsoft-Exchange-Diagnostics: 1; BN3PR05MB2674; 25:HzN8boN5p4cIjVgNIci087oCNaRmdlFfT1nBxL16hBvwkh9G23Ac+oSWO0VCKQrcTpkVXro2f53o/ZzbMZhA6WnB17FhOXipBsyRF/X9FPDjk3tbG6bxG5/sP4WleGTrrASr1DnBJPyqmGIwkw6IkkNGi8SZs+pAFjOMk1QEBE1/8WpEzeuU4nj079lcmGA1q/di9YJsBX6Mh+fNj5PUS1NfCo5qiYRzm3b1itigCVaFS1+XsPZWJ+YoH2wvDJgBWvCNuYBYU7npA+Vl12iLjq8j3OXMC/3WgJ0w1UYynH7LPW23xT+tChfu4kx1JkknmDghzBcJU5Zwb7szqVnyJQMp1U4r+H8V+kD8RiYt7PfYIbnGxIMRslo/aFaKwwbr7TgncEugH/XYr7UCNYpfJ7sdrPJ24ZA05l6ImIBkhTkF/XI94M+9odArHYKeTk/W6V5o/QrTXEtcBW8z/oqmk8BCoqWnmsB7UgyeqUWhMukPGr9YFbcUHO1JRJLP1kpdASPipBBsNn6FMI6FgEMYXLv+jVOhgTdrg1jgM+ivBdPID0bDbXKbMoaF4SNFB9L7BDcxlPBO5lOTOglHa48eGCPzvK0xPhYjvA8y4Zk8d71nyorr7Xm46yaXSnRGno6hJUqMjoGqYOTInPHLekVTbUSB/hhFQFwkcdxlXRgmV0FgwMP4jgATn1apCtgBoXn+ X-Microsoft-Exchange-Diagnostics: 1; BN3PR05MB2674; 20:XAs+B+KndNUg99iJNM7Dn+nq/KU8c/WZW8GKsLsmcb9YPZEC8AEDNVTfvJLEn6U2TigV9lY5Rff8HOdJECSZYw5DRcAuad6dlXGu4aqwJ9ie+vPwRtcTLegajZD44S9iXCvspSLpLFje8m27BbC9O7W+BuneIB1FjCYvjGhb/OSdUQxKrCV1uvgvfzIs1YaMPoQGHnzB116iPr9Jtl8SAKn/xJl9HlPpnXd7mZRFCFhmhnjj5fZ7ZGJGbr30Mo0DlepahKeJsJhiPo0y5w2GRt0+gZMKsuilTEjtzVzWDGwsdzK0hGABEvnwNHFSs3SaaWieEza0Ggz2R8QKYAfckVcDucbgKXegrIPzeFUtFiXTC51mF4HEHZ0zRATofvBFImCCsnUeouVcgE1dD1ByZCgo5A4ZBak8z+1SgFf3ZQcQ08C8SxNtGopmJbY4R9EL3RwBUZyLUJvIrg21pfNe06weeotY4pCLJp1m+scueapmbI77UbfvgrT3QSDO3qp9 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(13023025)(13024025)(13015025)(8121501046)(5005006)(13018025)(10201501046)(3002001); SRVR:BN3PR05MB2674; BCL:0; PCL:0; RULEID:; SRVR:BN3PR05MB2674; X-Microsoft-Exchange-Diagnostics: 1; BN3PR05MB2674; 4:VZxOt4zP6K+c+04E9EnvsBCfIHWmVIAEoKTDP+qGcaQi6fMkRrSI9yMDmtcReHZnFMK7PZ0fgIUnmvOKzaY0WI60POjn79PcSMN5wIzdqljEDFS/OhYutFAHrdA8vAZolB9gbNsRj9QCbZ7nTBmsE17x5rhr2Vu5dqmZbXhLMDZKfHMHInTWy/arz+KdPL54EM9LVrB5d7zjPYY4JVHycdhtrAdoAl9ogS5lSfYPVGpfM16QqQYWNnOO4hz/qyGI7bjnYjlZg4TQsZftpmChdqMANqhGL9Q9BJPXaafkPSDvgq7ovxsLhOdSrMijupVClXneai1zwJBIJj+hCiP8Ns4ShWAyY5igoFVW3HIglzPPvT+kJLron0pcwJjejR5x12StZUD0T874q0AEb7VOZEdZF8zNaBX9iJvRRML9Cs3BCYrR/c63T/Vfgi/I6Y51fzkRiC9lrLRLGXjLqa9u1A== X-Forefront-PRVS: 08978A8F5C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR05MB2674; 23:OqyhL+AStJ42S0AVpF3NgLWCxBwfK1wLekY3zToW3?= =?us-ascii?Q?qLgUMsJ4EGTwZfU4eHCFiDO35q6Y3vc0TZz3FEIBVOR1Rr7+LVJyoQR/5oRi?= =?us-ascii?Q?adqh28ECx+gghOiIrylX3yl6JD7GyaVn6nEeCKEZhkHEhsPJDUXE2uGrVdBF?= =?us-ascii?Q?lNpAuRu/+Q/IyU6pewHCczMziKklzOgPb6rxPoLfLCbF4+GAy2iCcAiNEfhs?= =?us-ascii?Q?B/ah0wzj+TmrHFcAnRCX+BgUoYJ7OjFVZqvXlVUFiUjz7gHNaJ/neBdD3Pz+?= =?us-ascii?Q?2IrWKTWoFW1/i6JV5jHAZfap3zx5s01p95RovMU0jwhcIR8vHG28waIg7Xn1?= =?us-ascii?Q?QK0y9YNop8TP9n3ugMKKS7pVnq+s6SnVPvVux3xWQrGbxeC4GLqjJ98OjFNR?= =?us-ascii?Q?Qj06jkjF/sFrOhNsPizEm0778M8NfvS0dy7TYFeaFA7HIZVCwb99fPCSobcc?= =?us-ascii?Q?V9qmtOBDONruYW9lE+AQ/T+HjC1HtofNLxVwi+y/Xg27avF/LyBHdDZ81l9D?= =?us-ascii?Q?8bB+7acqPhbJoqpHhz8j2RJRUG2rM+4HARg34VyR5CC0SeMOpMXcar9vx/os?= =?us-ascii?Q?bMSKJtTvzHSaYiSkQ0nx/CT4E3X2wjah5pb8aT1J8IyE58VAbhNfbc9Ba/wd?= =?us-ascii?Q?b8PoZZDaX/0EXFypiIJOn62gbu921d/lJ2D6VeZquTsLrmHx12PJQDh9gfMN?= =?us-ascii?Q?SUc9Ddukgyc1aMKhBAdDpaq45krjljIi618tx3/ROd9G1TvvXDzbdbdUbpTc?= =?us-ascii?Q?zw+Q97UCuXxi4E97kk1uNlukaZOfdiiWTBExlefHnFUMY6t9ZfRipM+x9hNY?= =?us-ascii?Q?8M0Sxj9Pp0i4m2ePeStV4SU9uza2QsO/teWF2I69Nk/w9OPbJF8BTU4KvVSC?= =?us-ascii?Q?+a2/v9gGRRXx7xXOAIW1bFjzgVv8uKBJhmD5gn8dKAE0j5AxTqwm46rRH6Bm?= =?us-ascii?Q?ztRgWWvwCe2UEOXKVcO2LPWq5NvbXnkCH9XdZATF3Ck6x8V25FATmgcL3Tqy?= =?us-ascii?Q?zZSiQ4JM8OlN/cSfLvlC1hUx26OK++MoaGwLm1LNoIQA3DLW8PSZBoF6VRc3?= =?us-ascii?Q?P4I/FxzsEPx5piwj6jyIM/0X/UD?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR05MB2674; 5:nxri+cA6uIVOiCQIO6A7VeXnIujLXCuO9ySHsyPRznqV53+j1U8aGNhJ4GifLdNFl22d5K1OT9q5ooQ+k0jDETQF3MuXKzsNTFDA47yYhoKy6HgsOmJyirJthHahpLs9QycI+kAl1/ir5HE/6JSYKQ==; 24:oHlEe6FiiOLyC0bf5AratcNJrxr5C+2wfT+KY3oogLU/xcngbH1/L+Cz9+w/OtQ7JKORo1m3/SXqBfLEjCUl4prwFk8Rarb7TfwdNjPLlOs= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2016 03:59:11.4369 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR05MB2674 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 03:59:15 -0000 Bryan Drewery wrote: > There is still dirdeps cache code right further down below this that > only is skipped with NO_DIRDEPS. Ah yes. Index: dirdeps.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /volume/cvs/sjg/mk/dirdeps.mk,v retrieving revision 1.62 retrieving revision 1.63 diff -u -p -r1.62 -r1.63 --- dirdeps.mk 16 Mar 2016 00:11:53 -0000 1.62 +++ dirdeps.mk 30 Mar 2016 03:47:48 -0000 1.63 @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.62 2016/03/16 00:11:53 sjg Exp $ +# $Id: dirdeps.mk,v 1.63 2016/03/30 03:47:48 sjg Exp $ = # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -304,7 +304,13 @@ DEP_SKIP_DIR =3D ${SKIP_DIR} \ = NSkipDir =3D ${DEP_SKIP_DIR:${M_ListToSkip}} = -.if defined(NO_DIRDEPS) || defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) +.if defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) +NO_DIRDEPS =3D +.elif defined(WITHOUT_DIRDEPS_BELOW) +NO_DIRDEPS_BELOW =3D +.endif + +.if defined(NO_DIRDEPS) # confine ourselves to the original dir and below. DIRDEPS_FILTER +=3D M${_DEP_RELDIR}* .elif defined(NO_DIRDEPS_BELOW) @@ -370,7 +376,7 @@ MK_DIRDEPS_CACHE ?=3D no BUILD_DIRDEPS_CACHE ?=3D no BUILD_DIRDEPS ?=3D yes = -.if !defined(NO_DIRDEPS) +.if !defined(NO_DIRDEPS) && !defined(NO_DIRDEPS_BELOW) .if ${MK_DIRDEPS_CACHE} =3D=3D "yes" # this is where we will cache all our work DIRDEPS_CACHE?=3D ${_OBJDIR}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g= :S,^,.,:N.} From owner-svn-src-head@freebsd.org Wed Mar 30 06:13:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68AD3AE27D8; Wed, 30 Mar 2016 06:13:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 395F4196A; Wed, 30 Mar 2016 06:13:59 +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 u2U6DwnX026747; Wed, 30 Mar 2016 06:13:58 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2U6DwGv026746; Wed, 30 Mar 2016 06:13:58 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603300613.u2U6DwGv026746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 30 Mar 2016 06:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297408 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 06:13:59 -0000 Author: pfg Date: Wed Mar 30 06:13:58 2016 New Revision: 297408 URL: https://svnweb.freebsd.org/changeset/base/297408 Log: freopen(3): prevent uninitialized errno. Revert r297407 and redo it cleanly. Pointed out by: Jukka A. Ukkonen CID: 1018720 MFC after: 1 week Modified: head/lib/libc/stdio/freopen.c Modified: head/lib/libc/stdio/freopen.c ============================================================================== --- head/lib/libc/stdio/freopen.c Wed Mar 30 01:32:08 2016 (r297407) +++ head/lib/libc/stdio/freopen.c Wed Mar 30 06:13:58 2016 (r297408) @@ -66,8 +66,7 @@ freopen(const char * __restrict file, co (void) fclose(fp); errno = sverrno; return (NULL); - } else - sverrno = 0; + } FLOCKFILE(fp); @@ -79,6 +78,7 @@ freopen(const char * __restrict file, co * re-open the same file with a different mode. We allow this only * if the modes are compatible. */ + sverrno = 0; if (file == NULL) { /* See comment below regarding freopen() of closed files. */ if (fp->_flags == 0) { From owner-svn-src-head@freebsd.org Wed Mar 30 06:48:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E242DAE2F1A; Wed, 30 Mar 2016 06:48:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B29B4165E; Wed, 30 Mar 2016 06:48:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2U6m9VP036484; Wed, 30 Mar 2016 06:48:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2U6m926036483; Wed, 30 Mar 2016 06:48:09 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603300648.u2U6m926036483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 30 Mar 2016 06:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297409 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 06:48:11 -0000 Author: adrian Date: Wed Mar 30 06:48:09 2016 New Revision: 297409 URL: https://svnweb.freebsd.org/changeset/base/297409 Log: [bwn] fix time_before -> ieee80211_time_before() Noticed by: Jia-Shiun Li Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Wed Mar 30 06:13:58 2016 (r297408) +++ head/sys/dev/bwn/if_bwn.c Wed Mar 30 06:48:09 2016 (r297409) @@ -2612,7 +2612,7 @@ bwn_phy_g_task_15s(struct bwn_mac *mac) BWN_GETTIME(now); if (bwn_has_hwpctl(mac)) { expire = now - BWN_LO_PWRVEC_EXPIRE; - if (time_before(lo->pwr_vec_read_time, expire)) { + if (ieee80211_time_before(lo->pwr_vec_read_time, expire)) { bwn_lo_get_powervector(mac); bwn_phy_g_dc_lookup_init(mac, 0); } @@ -2621,7 +2621,7 @@ bwn_phy_g_task_15s(struct bwn_mac *mac) expire = now - BWN_LO_CALIB_EXPIRE; TAILQ_FOREACH_SAFE(cal, &lo->calib_list, list, tmp) { - if (!time_before(cal->calib_time, expire)) + if (!ieee80211_time_before(cal->calib_time, expire)) continue; if (BWN_BBATTCMP(&cal->bbatt, &pg->pg_bbatt) && BWN_RFATTCMP(&cal->rfatt, &pg->pg_rfatt)) { @@ -6149,7 +6149,7 @@ bwn_lo_save(struct bwn_mac *mac, struct BWN_PHY_WRITE(mac, BWN_PHY_CCK(0x2f), 0); nanouptime(&ts); - if (time_before(lo->txctl_measured_time, + if (ieee80211_time_before(lo->txctl_measured_time, (ts.tv_nsec / 1000000 + ts.tv_sec * 1000) - BWN_LO_TXCTL_EXPIRE)) bwn_lo_measure_txctl_values(mac); @@ -9365,7 +9365,7 @@ bwn_phy_txpower_check(struct bwn_mac *ma BWN_GETTIME(now); - if (!(flags & BWN_TXPWR_IGNORE_TIME) && time_before(now, phy->nexttime)) + if (!(flags & BWN_TXPWR_IGNORE_TIME) && ieee80211_time_before(now, phy->nexttime)) return; phy->nexttime = now + 2 * 1000; From owner-svn-src-head@freebsd.org Wed Mar 30 07:42:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D708AE2F72; Wed, 30 Mar 2016 07:42:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id DB4EB1A62; Wed, 30 Mar 2016 07:42:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id A4CE4D663B1; Wed, 30 Mar 2016 18:41:59 +1100 (AEDT) Date: Wed, 30 Mar 2016 18:41:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297408 - head/lib/libc/stdio In-Reply-To: <201603300613.u2U6DwGv026746@repo.freebsd.org> Message-ID: <20160330180123.V3090@besplex.bde.org> References: <201603300613.u2U6DwGv026746@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=7aRgpVi7GxIzNs7i03cA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 07:42:15 -0000 On Wed, 30 Mar 2016, Pedro F. Giffuni wrote: > Log: > freopen(3): prevent uninitialized errno. > > Revert r297407 and redo it cleanly. This might need a few more commits to do it correctly. > Modified: head/lib/libc/stdio/freopen.c > ============================================================================== > --- head/lib/libc/stdio/freopen.c Wed Mar 30 01:32:08 2016 (r297407) > +++ head/lib/libc/stdio/freopen.c Wed Mar 30 06:13:58 2016 (r297408) > @@ -66,8 +66,7 @@ freopen(const char * __restrict file, co > (void) fclose(fp); > errno = sverrno; > return (NULL); > - } else > - sverrno = 0; > + } This uses the one value that is clearly wrong. C Standard library functions are not permitted to set errno to 0, but that is what happens if this setting of sverrno is actually used. Most C Standard library functions are permitted to set errno to any nonzero value even if they succeed. For this particular function, errno has an unspecified value in Standard C after the function returns, but POSIX extends this and specifies some settings. This extension is permitted because, unlike for some other functions, Standard C doesn't specify anything for errno. It would not be wrong to set sverrno to errno here, of course without the style bug, but any use of the value would be dubious. > > FLOCKFILE(fp); > > @@ -79,6 +78,7 @@ freopen(const char * __restrict file, co > * re-open the same file with a different mode. We allow this only > * if the modes are compatible. > */ > + sverrno = 0; > if (file == NULL) { > /* See comment below regarding freopen() of closed files. */ > if (fp->_flags == 0) { Setting it to 0 here is equivalent to setting it above, except it doesn't have the style bug. Actually saving errno in it is not quite eqivalent to saving errno above, since there are functions that might set errno in between. It should be set above, or better not at all. You need to understand the function better to place it exactly correctly. The function only restores from sverrno after the "finish" label in the f < 0 case. I think it intends to restore the errno that was set for one of the 2 'f = _open(...)' expressions, so if it actually uses the above setting then that is a bug. A complete fix would reorganise the function to avoid "goto finish" so that it is clear to humans and coverities that the above setting is never used. Bruce From owner-svn-src-head@freebsd.org Wed Mar 30 08:55:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30534AE03DD for ; Wed, 30 Mar 2016 08:55:20 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com [IPv6:2a00:1450:4010:c04::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE29F1DB2 for ; Wed, 30 Mar 2016 08:55:19 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lb0-x22e.google.com with SMTP id bc4so27164755lbc.2 for ; Wed, 30 Mar 2016 01:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+PmXnhONAzH/eW0i4dVH5gl5oGyUWE73JgmMpc6dm50=; b=matxRCxQWWTlgA+z3k51sljrhdV5tQkIFIjpNjMgyXS40M4CC9+UyWTdFZUeicQr/E ojoW8eIpmmGLBMiDHbi4LxNKHZbQNjWKqxcMGfVc4pqlEnykw9MMOBWWU/ULKqedL7n1 CoPaANaRL+u0U6/zlz+V3ZhevVRq0nsCWloefdou/Q43oSiDNF1kQn5nkVAQ7qLVsMgd LT+HHEMC1e4YGTlteIrOdgieFJ5I9KPcJTv3x5EkO5H+JwVv6kWZrRIMHV8Nl2src7ea TPDeeBJiVwQpIziHcuXMdfo8fJX5amK/zxs6+2F6wQy09FFNw6QJVHBBy7iARiW8m8Hb F5Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+PmXnhONAzH/eW0i4dVH5gl5oGyUWE73JgmMpc6dm50=; b=Ik1YDno11LNSiIKBSyGJ2Mg/166Nu98a/Dx+3VlTnzoxm0tzfc34Z+664l/bGkwGMx 9TTl7SY773bbl6ezasJJ93PZKuHaQO/KQ4uRbQNZDoRRBgtAg3G+LhzWbHedHKjxo4/l H1lXxhUQvDh+6B+EP1nbwhtziAdbvUkPc4Ukgv+E/Is3b/XCWIXBC45ZOKRQ3r5O2FYL CAzgyY6YPKTln5j8WW32spR9Sl70TWphkk7xZieuEldxEcwYeqQqAeDhflSIO/o21zdg wc3wZGcEeK23Y02zHfmoel7gl5KpzenDKn6pz03xPDEDSj/4QdDWdIeidYwdMJnnCwig 3sUA== X-Gm-Message-State: AD7BkJKswPneQnJzkqSoDHf8LeUFhKSiHSVUi1Q3o95UC4EmFCJcoDUmFVE6HZt5ISHHS6VsaxToO5w5Vw38+Q== X-Received: by 10.112.148.162 with SMTP id tt2mr2723031lbb.38.1459328118055; Wed, 30 Mar 2016 01:55:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.77.202 with HTTP; Wed, 30 Mar 2016 01:54:58 -0700 (PDT) In-Reply-To: References: <201603291519.u2TFJuXW051571@repo.freebsd.org> From: Zbigniew Bodek Date: Wed, 30 Mar 2016 10:54:58 +0200 Message-ID: Subject: Re: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries To: Ed Maste Cc: Zbigniew Bodek , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: multipart/mixed; boundary=047d7b3440aa16932e052f404e65 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 08:55:20 -0000 --047d7b3440aa16932e052f404e65 Content-Type: text/plain; charset=UTF-8 Hello Ed, Please check out the attached patch. For powerpc we should compile-in ofwpci.c regardless of FDT option. However, it seems that LINT for powerpc does not have FDT. What do you thing about adding it (as can be seen in the attached patch)?. This would be done in a separate commit. Best regards zbb 2016-03-30 1:53 GMT+02:00 Ed Maste : > On 29 March 2016 at 15:19, Zbigniew Bodek wrote: > > Author: zbb > > Date: Tue Mar 29 15:19:56 2016 > > New Revision: 297392 > > URL: https://svnweb.freebsd.org/changeset/base/297392 > > > > Log: > > Reduce OFW PCI code duplication - involves ARM, PPC and SPARC64 > > My 'make tinderbox' build is now failing (powerpc LINT) with: > > linking kernel > cpcht.o: In function `cpcht_attach': > cpcht.c:(.text+0x17dc): undefined reference to `ofw_pci_attach' > cpcht.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' > grackle.o: In function `grackle_attach': > grackle.c:(.text+0x2dc): undefined reference to `ofw_pci_attach' > grackle.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' > uninorthpci.o: In function `uninorth_attach': > uninorthpci.c:(.text+0x68c): undefined reference to `ofw_pci_attach' > uninorthpci.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' > *** [kernel] Error code 1 > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > --047d7b3440aa16932e052f404e65 Content-Type: text/plain; charset=US-ASCII; name="ppc_lint_fix.diff" Content-Disposition: attachment; filename="ppc_lint_fix.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_imem8px40 ZGlmZiAtLWdpdCBhL3N5cy9jb25mL2ZpbGVzLnBvd2VycGMgYi9zeXMvY29uZi9maWxlcy5wb3dl cnBjCmluZGV4IGUzOTM0M2IuLmQyZThlM2IgMTAwNjQ0Ci0tLSBhL3N5cy9jb25mL2ZpbGVzLnBv d2VycGMKKysrIGIvc3lzL2NvbmYvZmlsZXMucG93ZXJwYwpAQCAtNTcsNyArNTcsNyBAQCBkZXYv b2Z3L29md19jb25zb2xlLmMJCW9wdGlvbmFsCWFpbQogZGV2L29mdy9vZndfZGlzay5jCQlvcHRp b25hbAlvZndkIGFpbQogZGV2L29mdy9vZndfaWljYnVzLmMJCW9wdGlvbmFsCWlpY2J1cyBhaW0K IGRldi9vZncvb2Z3YnVzLmMJCW9wdGlvbmFsCWFpbSB8IGZkdAotZGV2L29mdy9vZndwY2kuYwkJ b3B0aW9uYWwgCWZkdCBwY2kKK2Rldi9vZncvb2Z3cGNpLmMJCW9wdGlvbmFsIAlwY2kKIGRldi9v Zncvb2Z3X3N0YW5kYXJkLmMJCW9wdGlvbmFsCWFpbSBwb3dlcnBjCiBkZXYvb2Z3L29md19zdWJy LmMJCW9wdGlvbmFsCWFpbSBwb3dlcnBjCiBkZXYvcG93ZXJtYWNfbnZyYW0vcG93ZXJtYWNfbnZy YW0uYyBvcHRpb25hbAlwb3dlcm1hY19udnJhbSBwb3dlcm1hYwpkaWZmIC0tZ2l0IGEvc3lzL3Bv d2VycGMvY29uZi9OT1RFUyBiL3N5cy9wb3dlcnBjL2NvbmYvTk9URVMKaW5kZXggNzVlNzc0Zi4u YjAwZGVmNCAxMDA2NDQKLS0tIGEvc3lzL3Bvd2VycGMvY29uZi9OT1RFUworKysgYi9zeXMvcG93 ZXJwYy9jb25mL05PVEVTCkBAIC00Niw2ICs0Niw3IEBAIG9wdGlvbnMgCVBPV0VSTUFDCQkjTmV3 V29ybGQgQXBwbGUgUG93ZXJNYWNzCiBvcHRpb25zIAlQU0lNCQkJI0dEQiBQU0lNIHBwYyBzaW11 bGF0b3IKIG9wdGlvbnMgCU1BTUJPCQkJI0lCTSBNYW1ibyBGdWxsIFN5c3RlbSBTaW11bGF0b3IK IAorb3B0aW9ucyAJRkRUCiBvcHRpb25zIAlTQ19PRldGQgkJIyBPRlcgZnJhbWUgYnVmZmVyCiAK ICMgVGhlIGNwdWZyZXEoNCkgZHJpdmVyIHByb3ZpZGVzIHN1cHBvcnQgZm9yIENQVSBmcmVxdWVu Y3kgY29udHJvbAo= --047d7b3440aa16932e052f404e65-- From owner-svn-src-head@freebsd.org Wed Mar 30 10:05:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B979AE22EB; Wed, 30 Mar 2016 10:05:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B56F41A82; Wed, 30 Mar 2016 10:05:53 +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 u2UA5qqN098042; Wed, 30 Mar 2016 10:05:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UA5qNY098039; Wed, 30 Mar 2016 10:05:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201603301005.u2UA5qNY098039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 30 Mar 2016 10:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297416 - in head: share/man/man4 sys/dev/usb sys/dev/usb/video X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 10:05:54 -0000 Author: hselasky Date: Wed Mar 30 10:05:52 2016 New Revision: 297416 URL: https://svnweb.freebsd.org/changeset/base/297416 Log: Add new USB ID to UDL driver. Submitted by: Matthias Petermann PR: 201084 Modified: head/share/man/man4/udl.4 head/sys/dev/usb/usbdevs head/sys/dev/usb/video/udl.c Modified: head/share/man/man4/udl.4 ============================================================================== --- head/share/man/man4/udl.4 Wed Mar 30 08:42:10 2016 (r297415) +++ head/share/man/man4/udl.4 Wed Mar 30 10:05:52 2016 (r297416) @@ -62,6 +62,7 @@ The following devices should work: .It Sunweit USB to DVI .It Unitek Y-2240 USB to DVI .It VideoHome NBdock1920 +.It i-tec USB 2.0 Docking Station (USBDVIDOCK) .El .Sh SEE ALSO .Xr usb 4 Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Mar 30 08:42:10 2016 (r297415) +++ head/sys/dev/usb/usbdevs Wed Mar 30 10:05:52 2016 (r297416) @@ -1700,6 +1700,7 @@ product DISPLAYLINK UM7X0 0x401a nanovis product DISPLAYLINK LT1421 0x03e0 Lenovo ThinkVision LT1421 product DISPLAYLINK POLARIS2 0x0117 Polaris2 USB dock product DISPLAYLINK PLUGABLE 0x0377 Plugable docking station +product DISPLAYLINK ITEC 0x02e9 i-tec USB 2.0 Docking Station /* DMI products */ product DMI CFSM_RW 0xa109 CF/SM Reader/Writer Modified: head/sys/dev/usb/video/udl.c ============================================================================== --- head/sys/dev/usb/video/udl.c Wed Mar 30 08:42:10 2016 (r297415) +++ head/sys/dev/usb/video/udl.c Wed Mar 30 10:05:52 2016 (r297416) @@ -177,7 +177,8 @@ static const STRUCT_USB_HOST_ID udl_devs {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_PLUGABLE, DL160)}, {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LUM70, DL125)}, {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_POLARIS2, DLUNK)}, - {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LT1421, DLUNK)} + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LT1421, DLUNK)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_ITEC, DL165)}, }; static void From owner-svn-src-head@freebsd.org Wed Mar 30 10:10:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FDC0AE2570 for ; Wed, 30 Mar 2016 10:10:14 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9C291C9B for ; Wed, 30 Mar 2016 10:10:13 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f51.google.com with SMTP id k79so32154197lfb.2 for ; Wed, 30 Mar 2016 03:10:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=rC/cpt1whxxiQYEP0Rz63WIdXQD33f7pW4UhD6YXWPc=; b=LJPizehbaRyOrUbXuWDDyPmPSgU70kOjYvrp+HKutcYHgy1dX2QcvLSZcFzYt1rJ61 CeOru0VUPNWlI7SLTHwVdh8xHLTZdrbjkNX/xFurDqzt8Dfr0eFPXzcf+eoDcpEF4TCa X+cjKWI06lAvJ/mhbW/2OE2A+1vV3OOzOzb6V6td9wxDk+AhpuHYS1eHK9Wr+5HfeHho SCC5ODviShpW7qm2OaLUpWpuvUZt7CdFWezPheWKqPVKQYau6uWZT91M/dWIrXNgaL9a enOn8A8eroliQXfwtZCHY4yxRyBPsg8JP1YhREDI/QSl7YzMTUvdY+sr4bK2CbsoRcJX xY8A== X-Gm-Message-State: AD7BkJLdaJu204p/ffGmWAhJk+YG09daA7YqlR+KdNgYhLpJptcbo/e3apaq95ci5icpOQ== X-Received: by 10.25.17.67 with SMTP id g64mr3514920lfi.112.1459332116185; Wed, 30 Mar 2016 03:01:56 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id ke9sm473643lbc.28.2016.03.30.03.01.55 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Mar 2016 03:01:55 -0700 (PDT) Subject: Re: svn commit: r297408 - head/lib/libc/stdio To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603300613.u2U6DwGv026746@repo.freebsd.org> From: Andrey Chernov Message-ID: <56FBA412.5010301@freebsd.org> Date: Wed, 30 Mar 2016 13:01:54 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <201603300613.u2U6DwGv026746@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 10:10:14 -0000 On 30.03.2016 9:13, Pedro F. Giffuni wrote: > */ > + sverrno = 0; > if (file == NULL) { It introduces the bug of touching errno. Previous code does it right because 'goto finish;' can't happen with (f < 0) where errno is restored later. The whole errno code is complex here for reading at least. It microoptimize errno handling by removing unnecessary assignment, but it does not gain much in reality. Better change for easy reading will be to set sverrno = errno; once right at the function enter and remove it in all other places. In any case errno touching should be backed out. -- http://ache.vniz.net/ From owner-svn-src-head@freebsd.org Wed Mar 30 12:03:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67618AE2703 for ; Wed, 30 Mar 2016 12:03:13 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF6801A97 for ; Wed, 30 Mar 2016 12:03:12 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lb0-f182.google.com with SMTP id u8so30264068lbk.0 for ; Wed, 30 Mar 2016 05:03:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=KtjT179DwUJXjpmPo5zf3MfZg7wmhntasC5s/BkbSlE=; b=jvADoRS4OJtRnY/WPU7OLkiffLUee3gKNyibq1YPi03Aq0KxbxS0xLBjy5vGGh02DJ sz3x3zjlYa+g7uUohOFS7guN6SabaY3kDfXqtULDQrnneHWQ4386wMgJKhWfkYemaOXS X4YHJKfiQccevkrTOyO62VHvCYS8I/mkPM1mGPOiid55tCTzZBdLBuRBS/BoaxLnaG4m KuZzbTE5ZCOddbqnYVyG1FH89LIXF0LMpHplVGiT1hzmN8Wzn8npn2CsbB4T3rJ21kKu BvYqhxWvbTNIv8WGvy0Uq10bMYyOb0BIxljDNhSzwNNkHgGlYsCXb08mp6cpr9kD5wQy 0A6Q== X-Gm-Message-State: AD7BkJLSia3iQ2MT0LkK9ZgI1MSpYRnZNd6mI0eJxFszuBNsxBxRn7E6QdZQzrPMER6DXA== X-Received: by 10.112.62.229 with SMTP id b5mr3430937lbs.30.1459332687822; Wed, 30 Mar 2016 03:11:27 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id pi5sm473240lbb.41.2016.03.30.03.11.26 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Mar 2016 03:11:27 -0700 (PDT) Subject: Re: svn commit: r297407 - head/lib/libc/stdio To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603300132.u2U1W89m041639@repo.freebsd.org> From: Andrey Chernov Message-ID: <56FBA64E.5030403@freebsd.org> Date: Wed, 30 Mar 2016 13:11:26 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <201603300132.u2U1W89m041639@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 12:03:13 -0000 On 30.03.2016 4:32, Pedro F. Giffuni wrote: > --- head/lib/libc/stdio/freopen.c Wed Mar 30 01:08:08 2016 (r297406) > +++ head/lib/libc/stdio/freopen.c Wed Mar 30 01:32:08 2016 (r297407) > @@ -66,7 +66,8 @@ freopen(const char * __restrict file, co > (void) fclose(fp); > errno = sverrno; > return (NULL); > - } > + } else > + sverrno = 0; This one is wrong too, see my detailed reply on the next commit. -- http://ache.vniz.net/ From owner-svn-src-head@freebsd.org Wed Mar 30 13:26:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D28F4AE1F76; Wed, 30 Mar 2016 13:26:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4C94108D; Wed, 30 Mar 2016 13:26:36 +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 u2UDQZWS058065; Wed, 30 Mar 2016 13:26:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UDQZKD058064; Wed, 30 Mar 2016 13:26:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603301326.u2UDQZKD058064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 30 Mar 2016 13:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297417 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 13:26:36 -0000 Author: pfg Date: Wed Mar 30 13:26:35 2016 New Revision: 297417 URL: https://svnweb.freebsd.org/changeset/base/297417 Log: freopen(3): prevent uninitialized errno. Revert completley r297408 (and r297407): this ends up touching errno, which we are not allowed to do. Pointed out by: ache, bde Modified: head/lib/libc/stdio/freopen.c Modified: head/lib/libc/stdio/freopen.c ============================================================================== --- head/lib/libc/stdio/freopen.c Wed Mar 30 10:05:52 2016 (r297416) +++ head/lib/libc/stdio/freopen.c Wed Mar 30 13:26:35 2016 (r297417) @@ -78,7 +78,6 @@ freopen(const char * __restrict file, co * re-open the same file with a different mode. We allow this only * if the modes are compatible. */ - sverrno = 0; if (file == NULL) { /* See comment below regarding freopen() of closed files. */ if (fp->_flags == 0) { From owner-svn-src-head@freebsd.org Wed Mar 30 14:34:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B960FAE20F1; Wed, 30 Mar 2016 14:34:07 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97DCB1626; Wed, 30 Mar 2016 14:34:07 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u2UEXwPG029914 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 30 Mar 2016 07:33:59 -0700 Subject: Re: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries To: Zbigniew Bodek , Ed Maste References: <201603291519.u2TFJuXW051571@repo.freebsd.org> Cc: Zbigniew Bodek , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" From: Nathan Whitehorn Message-ID: <56FBE3D6.9050205@freebsd.org> Date: Wed, 30 Mar 2016 07:33:58 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: X-Sonic-CAuth: UmFuZG9tSVZ5rWJtdS5m/lR1N1kTBZpbZlWikkZdQ2LGP1a3jMBZ6rghUBOtM/LGLjui0SaMCm6f0ro5piFYnhNGE5aD8zWyCRxvx65RkXo= X-Sonic-ID: C;8NphcIT25RGCn5FDXdaMvg== M;CJK6cIT25RGCn5FDXdaMvg== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 14:34:07 -0000 PowerPC (and SPARC) can have real OFW without FDT support. Adding FDT to LINT is the wrong solution: rather, it should switch on fdt | aim like the rest of the Open Firmware code. -Nathan On 03/30/16 01:54, Zbigniew Bodek wrote: > Hello Ed, > > Please check out the attached patch. For powerpc we should compile-in > ofwpci.c regardless of FDT option. > However, it seems that LINT for powerpc does not have FDT. What do you > thing about adding it (as can be seen in the attached patch)?. This > would be done in a separate commit. > > Best regards > zbb > > 2016-03-30 1:53 GMT+02:00 Ed Maste >: > > On 29 March 2016 at 15:19, Zbigniew Bodek > wrote: > > Author: zbb > > Date: Tue Mar 29 15:19:56 2016 > > New Revision: 297392 > > URL: https://svnweb.freebsd.org/changeset/base/297392 > > > > Log: > > Reduce OFW PCI code duplication - involves ARM, PPC and SPARC64 > > My 'make tinderbox' build is now failing (powerpc LINT) with: > > linking kernel > cpcht.o: In function `cpcht_attach': > cpcht.c:(.text+0x17dc): undefined reference to `ofw_pci_attach' > cpcht.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' > grackle.o: In function `grackle_attach': > grackle.c:(.text+0x2dc): undefined reference to `ofw_pci_attach' > grackle.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' > uninorthpci.o: In function `uninorth_attach': > uninorthpci.c:(.text+0x68c): undefined reference to `ofw_pci_attach' > uninorthpci.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' > *** [kernel] Error code 1 > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to > "svn-src-all-unsubscribe@freebsd.org > " > > From owner-svn-src-head@freebsd.org Wed Mar 30 14:42:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D445AE247A; Wed, 30 Mar 2016 14:42:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id 156001C51; Wed, 30 Mar 2016 14:42:11 +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 u2UEgAR8080475; Wed, 30 Mar 2016 14:42:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UEg9n7080470; Wed, 30 Mar 2016 14:42:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603301442.u2UEg9n7080470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 30 Mar 2016 14:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297418 - in head/lib/libc: arm mips powerpc powerpc64 sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 14:42:11 -0000 Author: emaste Date: Wed Mar 30 14:42:09 2016 New Revision: 297418 URL: https://svnweb.freebsd.org/changeset/base/297418 Log: libc: stop exporting cerror i386 stopped exporting .cerror in r240152, and likewise for amd64 in r240178. It is not used by other libraries on any platform, so apply the same change to the remaining architectures. Reviewed by: jhibbits, jilles Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5774 Modified: head/lib/libc/arm/Symbol.map head/lib/libc/mips/Symbol.map head/lib/libc/powerpc/Symbol.map head/lib/libc/powerpc64/Symbol.map head/lib/libc/sparc64/Symbol.map Modified: head/lib/libc/arm/Symbol.map ============================================================================== --- head/lib/libc/arm/Symbol.map Wed Mar 30 13:26:35 2016 (r297417) +++ head/lib/libc/arm/Symbol.map Wed Mar 30 14:42:09 2016 (r297418) @@ -29,7 +29,6 @@ FBSD_1.0 { ntohs; vfork; brk; - cerror; /* XXX - Should this be .cerror (see sys/cerror.S)? */ sbrk; }; Modified: head/lib/libc/mips/Symbol.map ============================================================================== --- head/lib/libc/mips/Symbol.map Wed Mar 30 13:26:35 2016 (r297417) +++ head/lib/libc/mips/Symbol.map Wed Mar 30 14:42:09 2016 (r297418) @@ -28,7 +28,6 @@ FBSD_1.0 { ntohs; vfork; brk; - cerror; /* XXX - Should this be .cerror (see sys/cerror.S)? */ sbrk; }; Modified: head/lib/libc/powerpc/Symbol.map ============================================================================== --- head/lib/libc/powerpc/Symbol.map Wed Mar 30 13:26:35 2016 (r297417) +++ head/lib/libc/powerpc/Symbol.map Wed Mar 30 14:42:09 2016 (r297418) @@ -56,5 +56,4 @@ FBSDprivate_1.0 { __signalcontext; __syncicache; _end; - .cerror; }; Modified: head/lib/libc/powerpc64/Symbol.map ============================================================================== --- head/lib/libc/powerpc64/Symbol.map Wed Mar 30 13:26:35 2016 (r297417) +++ head/lib/libc/powerpc64/Symbol.map Wed Mar 30 14:42:09 2016 (r297418) @@ -52,5 +52,4 @@ FBSDprivate_1.0 { __signalcontext; __syncicache; _end; - _cerror; }; Modified: head/lib/libc/sparc64/Symbol.map ============================================================================== --- head/lib/libc/sparc64/Symbol.map Wed Mar 30 13:26:35 2016 (r297417) +++ head/lib/libc/sparc64/Symbol.map Wed Mar 30 14:42:09 2016 (r297418) @@ -82,7 +82,6 @@ FBSDprivate_1.0 { __siglongjmp; __sys_brk; _brk; - .cerror; __sys_exect; _exect; _end; From owner-svn-src-head@freebsd.org Wed Mar 30 15:55:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE853AE370F for ; Wed, 30 Mar 2016 15:55:42 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lf0-x235.google.com (mail-lf0-x235.google.com [IPv6:2a00:1450:4010:c07::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22F3010BB for ; Wed, 30 Mar 2016 15:55:42 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lf0-x235.google.com with SMTP id k79so39566789lfb.2 for ; Wed, 30 Mar 2016 08:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GkQbpZay0/dzzLZnNsUtvv5aLyVBCWfGzTJcxaLCZ3I=; b=s7vPmuyoUCYprcQn3zsuC794yqdblWU2e7sCdKLzkOG+ZFKemH77AKrv0kVgQssMLI JoMglvfj86zBbrgSxNEKZC1RpD6kNs0NeScVPyEDH/vSRovozc2VRRSwskb7SxVudGhx nuEFz60i/K1QJgwm7RtbA8P4M3kv9i9iviAciK4g5aP0VxkIA+UOVt88DJTCJFkDOv9+ /9fy/9eHIgFxo7qhfHfNvYng8aBlKBHM32Lv2LjcfAPSH5BooZE8AzjS/4SPmqw6VPhg ED8WpJrwr0T///5cOOi9DYwdTt0YWjNaGdoQk6eHWVZg7Qg3rPARBylc+dO8HI9NABqo z5VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GkQbpZay0/dzzLZnNsUtvv5aLyVBCWfGzTJcxaLCZ3I=; b=fQCREYxW9WWJeEnwYoo6sGCkK1lBp/YNc3fZYU/pn6k9fHdKqxj77t5ZfUW/uLKdqP k9XgaRDo9XP7JSZ4ZFWcEc94v2sbH0DDI3vLIK8TDLsMnQgDBp4n7/kq5STR2ZnAPdA9 K2Cq5zwexKjQmIxwRZiLX4CplLzxpqdNDZ/ttFyEKKhcyQDAuJI1q/0V+t97LUc2r/GG q/+ATU2MQcLrmHuBt6uVZDO7y2Eujj/6UtgKXsVnRZxBvDTF7QuKJi3n2m4tjD2DRynk pAJhauT1LnnIua6a272uwym4M4/rVF5tuiNk8/2Ns9zFj8qPzhxkgJI3S9wMWGDAppnC LsOA== X-Gm-Message-State: AD7BkJKhF/ROoTDQ/zgOHgfm6UFzZ0Xlv2+DpoFAfCODvJzgg2JbLUJAdHzFZo3Bi7ruFjLoWnbE5gAVTNOXcA== X-Received: by 10.25.30.206 with SMTP id e197mr4341954lfe.144.1459353340288; Wed, 30 Mar 2016 08:55:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.77.202 with HTTP; Wed, 30 Mar 2016 08:55:20 -0700 (PDT) In-Reply-To: <56FBE3D6.9050205@freebsd.org> References: <201603291519.u2TFJuXW051571@repo.freebsd.org> <56FBE3D6.9050205@freebsd.org> From: Zbigniew Bodek Date: Wed, 30 Mar 2016 17:55:20 +0200 Message-ID: Subject: Re: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries To: Nathan Whitehorn Cc: Ed Maste , Zbigniew Bodek , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: multipart/mixed; boundary=001a11401b0e734be0052f462d17 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 15:55:42 -0000 --001a11401b0e734be0052f462d17 Content-Type: text/plain; charset=UTF-8 Thank you Nathan. Please check out new patch in the attachment. Best regards zbb 2016-03-30 16:33 GMT+02:00 Nathan Whitehorn : > PowerPC (and SPARC) can have real OFW without FDT support. Adding FDT to > LINT is the wrong solution: rather, it should switch on fdt | aim like the > rest of the Open Firmware code. > -Nathan > > > On 03/30/16 01:54, Zbigniew Bodek wrote: > > Hello Ed, > > Please check out the attached patch. For powerpc we should compile-in > ofwpci.c regardless of FDT option. > However, it seems that LINT for powerpc does not have FDT. What do you > thing about adding it (as can be seen in the attached patch)?. This would > be done in a separate commit. > > Best regards > zbb > > 2016-03-30 1:53 GMT+02:00 Ed Maste : > >> On 29 March 2016 at 15:19, Zbigniew Bodek < >> zbb@freebsd.org> wrote: >> > Author: zbb >> > Date: Tue Mar 29 15:19:56 2016 >> > New Revision: 297392 >> > URL: https://svnweb.freebsd.org/changeset/base/297392 >> > >> > Log: >> > Reduce OFW PCI code duplication - involves ARM, PPC and SPARC64 >> >> My 'make tinderbox' build is now failing (powerpc LINT) with: >> >> linking kernel >> cpcht.o: In function `cpcht_attach': >> cpcht.c:(.text+0x17dc): undefined reference to `ofw_pci_attach' >> cpcht.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' >> grackle.o: In function `grackle_attach': >> grackle.c:(.text+0x2dc): undefined reference to `ofw_pci_attach' >> grackle.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' >> uninorthpci.o: In function `uninorth_attach': >> uninorthpci.c:(.text+0x68c): undefined reference to `ofw_pci_attach' >> uninorthpci.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' >> *** [kernel] Error code 1 >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to " >> svn-src-all-unsubscribe@freebsd.org" >> > > > --001a11401b0e734be0052f462d17 Content-Type: text/plain; charset=US-ASCII; name="ppc_lint_fix.diff" Content-Disposition: attachment; filename="ppc_lint_fix.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_imf1a71n0 ZGlmZiAtLWdpdCBhL3N5cy9jb25mL2ZpbGVzLnBvd2VycGMgYi9zeXMvY29uZi9maWxlcy5wb3dl cnBjCmluZGV4IGUzOTM0M2IuLjU2Nzc2ZGMgMTAwNjQ0Ci0tLSBhL3N5cy9jb25mL2ZpbGVzLnBv d2VycGMKKysrIGIvc3lzL2NvbmYvZmlsZXMucG93ZXJwYwpAQCAtNTcsNyArNTcsNyBAQCBkZXYv b2Z3L29md19jb25zb2xlLmMJCW9wdGlvbmFsCWFpbQogZGV2L29mdy9vZndfZGlzay5jCQlvcHRp b25hbAlvZndkIGFpbQogZGV2L29mdy9vZndfaWljYnVzLmMJCW9wdGlvbmFsCWlpY2J1cyBhaW0K IGRldi9vZncvb2Z3YnVzLmMJCW9wdGlvbmFsCWFpbSB8IGZkdAotZGV2L29mdy9vZndwY2kuYwkJ b3B0aW9uYWwgCWZkdCBwY2kKK2Rldi9vZncvb2Z3cGNpLmMJCW9wdGlvbmFsIAlwY2kgYWltIHwg cGNpIGZkdAogZGV2L29mdy9vZndfc3RhbmRhcmQuYwkJb3B0aW9uYWwJYWltIHBvd2VycGMKIGRl di9vZncvb2Z3X3N1YnIuYwkJb3B0aW9uYWwJYWltIHBvd2VycGMKIGRldi9wb3dlcm1hY19udnJh bS9wb3dlcm1hY19udnJhbS5jIG9wdGlvbmFsCXBvd2VybWFjX252cmFtIHBvd2VybWFjCg== --001a11401b0e734be0052f462d17-- From owner-svn-src-head@freebsd.org Wed Mar 30 16:26:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B351AE3C2E; Wed, 30 Mar 2016 16:26:01 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DB421DD0; Wed, 30 Mar 2016 16:26:01 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UGQ0VR013323; Wed, 30 Mar 2016 16:26:00 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UGQ0kv013322; Wed, 30 Mar 2016 16:26:00 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603301626.u2UGQ0kv013322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 30 Mar 2016 16:26:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297419 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 16:26:01 -0000 Author: loos Date: Wed Mar 30 16:26:00 2016 New Revision: 297419 URL: https://svnweb.freebsd.org/changeset/base/297419 Log: Bump up the read and write timeouts. The old value was too small for low speed transfers. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/ti/ti_spi.c Modified: head/sys/arm/ti/ti_spi.c ============================================================================== --- head/sys/arm/ti/ti_spi.c Wed Mar 30 14:42:09 2016 (r297418) +++ head/sys/arm/ti/ti_spi.c Wed Mar 30 16:26:00 2016 (r297419) @@ -333,7 +333,7 @@ ti_spi_fill_fifo(struct ti_spi_softc *sc timeout = 1000; while (--timeout > 0 && (TI_SPI_READ(sc, MCSPI_STAT_CH(sc->sc_cs)) & MCSPI_STAT_TXS) == 0) { - DELAY(1); + DELAY(100); } if (timeout == 0) return (-1); @@ -366,7 +366,7 @@ ti_spi_drain_fifo(struct ti_spi_softc *s timeout = 1000; while (--timeout > 0 && (TI_SPI_READ(sc, MCSPI_STAT_CH(sc->sc_cs)) & MCSPI_STAT_RXS) == 0) { - DELAY(1); + DELAY(100); } if (timeout == 0) return (-1); From owner-svn-src-head@freebsd.org Wed Mar 30 16:48:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDAB7AE31E2; Wed, 30 Mar 2016 16:48:58 +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 mx1.freebsd.org (Postfix) with ESMTPS id B7FED1DFD; Wed, 30 Mar 2016 16:48:58 +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 u2UGmvhe020279; Wed, 30 Mar 2016 16:48:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UGmvXS020278; Wed, 30 Mar 2016 16:48:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603301648.u2UGmvXS020278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 30 Mar 2016 16:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297420 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 16:48:59 -0000 Author: mav Date: Wed Mar 30 16:48:57 2016 New Revision: 297420 URL: https://svnweb.freebsd.org/changeset/base/297420 Log: Switch from using make_dev_p() to make_dev_s() to close races. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Wed Mar 30 16:26:00 2016 (r297419) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Wed Mar 30 16:48:57 2016 (r297420) @@ -589,7 +589,6 @@ zvol_create_minor(const char *name) minor_t minor = 0; char chrbuf[30], blkbuf[30]; #else - struct cdev *dev; struct g_provider *pp; struct g_geom *gp; uint64_t volsize, mode; @@ -688,18 +687,25 @@ zvol_create_minor(const char *name) bioq_init(&zv->zv_queue); mtx_init(&zv->zv_queue_mtx, "zvol", NULL, MTX_DEF); } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) { - error = make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, - &dev, &zvol_cdevsw, NULL, UID_ROOT, GID_OPERATOR, - 0640, "%s/%s", ZVOL_DRIVER, name); + struct make_dev_args args; + + make_dev_args_init(&args); + args.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_WAITOK; + args.mda_devsw = &zvol_cdevsw; + args.mda_cr = NULL; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0640; + args.mda_si_drv2 = zv; + error = make_dev_s(&args, &zv->zv_dev, + "%s/%s", ZVOL_DRIVER, name); if (error != 0) { kmem_free(zv, sizeof(*zv)); dmu_objset_disown(os, FTAG); mutex_exit(&zfsdev_state_lock); return (error); } - zv->zv_dev = dev; - dev->si_iosize_max = MAXPHYS; - dev->si_drv2 = zv; + zv->zv_dev->si_iosize_max = MAXPHYS; } LIST_INSERT_HEAD(&all_zvols, zv, zv_links); #endif /* illumos */ @@ -2965,18 +2971,24 @@ zvol_rename_minor(zvol_state_t *zv, cons g_error_provider(pp, 0); g_topology_unlock(); } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) { + struct make_dev_args args; + dev = zv->zv_dev; ASSERT(dev != NULL); zv->zv_dev = NULL; destroy_dev(dev); - if (make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, - &dev, &zvol_cdevsw, NULL, UID_ROOT, GID_OPERATOR, - 0640, "%s/%s", ZVOL_DRIVER, newname) == 0) { - zv->zv_dev = dev; - dev->si_iosize_max = MAXPHYS; - dev->si_drv2 = zv; - } + make_dev_args_init(&args); + args.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_WAITOK; + args.mda_devsw = &zvol_cdevsw; + args.mda_cr = NULL; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0640; + args.mda_si_drv2 = zv; + if (make_dev_s(&args, &zv->zv_dev, + "%s/%s", ZVOL_DRIVER, newname) == 0) + zv->zv_dev->si_iosize_max = MAXPHYS; } strlcpy(zv->zv_name, newname, sizeof(zv->zv_name)); } @@ -3023,16 +3035,10 @@ zvol_rename_minors(const char *oldname, static int zvol_d_open(struct cdev *dev, int flags, int fmt, struct thread *td) { - zvol_state_t *zv; + zvol_state_t *zv = dev->si_drv2; int err = 0; mutex_enter(&zfsdev_state_lock); - zv = dev->si_drv2; - if (zv == NULL) { - mutex_exit(&zfsdev_state_lock); - return(ENXIO); /* zvol_create_minor() not done yet */ - } - if (zv->zv_total_opens == 0) err = zvol_first_open(zv); if (err) { @@ -3070,16 +3076,9 @@ out: static int zvol_d_close(struct cdev *dev, int flags, int fmt, struct thread *td) { - zvol_state_t *zv; - int err = 0; + zvol_state_t *zv = dev->si_drv2; mutex_enter(&zfsdev_state_lock); - zv = dev->si_drv2; - if (zv == NULL) { - mutex_exit(&zfsdev_state_lock); - return(ENXIO); - } - if (zv->zv_flags & ZVOL_EXCL) { ASSERT(zv->zv_total_opens == 1); zv->zv_flags &= ~ZVOL_EXCL; From owner-svn-src-head@freebsd.org Wed Mar 30 16:54:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA9B5AE3334; Wed, 30 Mar 2016 16:54:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id 777401207; Wed, 30 Mar 2016 16:54:19 +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 u2UGsIlo023261; Wed, 30 Mar 2016 16:54:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UGsIIm023260; Wed, 30 Mar 2016 16:54:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603301654.u2UGsIIm023260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 30 Mar 2016 16:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297421 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 16:54:19 -0000 Author: mav Date: Wed Mar 30 16:54:18 2016 New Revision: 297421 URL: https://svnweb.freebsd.org/changeset/base/297421 Log: Plug open count leak on zvol rename. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Wed Mar 30 16:48:57 2016 (r297420) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Wed Mar 30 16:54:18 2016 (r297421) @@ -2977,6 +2977,11 @@ zvol_rename_minor(zvol_state_t *zv, cons ASSERT(dev != NULL); zv->zv_dev = NULL; destroy_dev(dev); + if (zv->zv_total_opens > 0) { + zv->zv_flags &= ~ZVOL_EXCL; + zv->zv_total_opens = 0; + zvol_last_close(zv); + } make_dev_args_init(&args); args.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_WAITOK; From owner-svn-src-head@freebsd.org Wed Mar 30 16:57:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EFA5AE339D; Wed, 30 Mar 2016 16:57:30 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2182F13C1; Wed, 30 Mar 2016 16:57:30 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UGvT6d023426; Wed, 30 Mar 2016 16:57:29 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UGvTAE023423; Wed, 30 Mar 2016 16:57:29 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201603301657.u2UGvTAE023423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 30 Mar 2016 16:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297422 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 16:57:30 -0000 Author: jamie Date: Wed Mar 30 16:57:28 2016 New Revision: 297422 URL: https://svnweb.freebsd.org/changeset/base/297422 Log: Add osd_reserve() and osd_set_reserved(), which allow M_WAITOK allocation of an OSD array, Modified: head/share/man/man9/osd.9 head/sys/kern/kern_osd.c head/sys/sys/osd.h Modified: head/share/man/man9/osd.9 ============================================================================== --- head/share/man/man9/osd.9 Wed Mar 30 16:54:18 2016 (r297421) +++ head/share/man/man9/osd.9 Wed Mar 30 16:57:28 2016 (r297422) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 5, 2011 +.Dd March 30, 2016 .Dt OSD 9 .Os .Sh NAME @@ -33,6 +33,9 @@ .Nm osd_register , .Nm osd_deregister , .Nm osd_set , +.Nm osd_reserve , +.Nm osd_set_reserved , +.Nm osd_free_reserved , .Nm osd_get , .Nm osd_del , .Nm osd_call , @@ -63,6 +66,22 @@ .Fa "void *value" .Fc .Ft void * +.Fo osd_reserve +.Fa "u_int slot" +.Fc +.Ft int +.Fo osd_set_reserved +.Fa "u_int type" +.Fa "struct osd *osd" +.Fa "u_int slot" +.Fa "void *rsv" +.Fa "void *value" +.Fc +.Ft void +.Fo osd_free_reserved +.Fa "void *rsv" +.Fc +.Ft void * .Fo osd_get .Fa "u_int type" .Fa "struct osd *osd" @@ -198,6 +217,15 @@ argument points to a data object to asso .Fa osd . .Pp The +.Fn osd_set_reserved +function does the same as +.Fn osd_set , +but with an extra argument +.Fa rsv +that is internal-use memory previously allocated via +.Fn osd_reserve . +.Pp +The .Fn osd_get function returns the data pointer associated with a kernel data structure's .Vt struct osd @@ -324,6 +352,24 @@ will proceed without any .Xr realloc 9 calls. .Pp +It is possible for +.Fn osd_set +to fail to allocate this array. To ensure that such allocation succeeds, +.Fn osd_reserve +may be called (in a non-blocking context), and it will pre-allocate the +memory via +.Xr malloc 9 +with M_WAITOK. +Then this pre-allocated memory is passed to +.Fn osd_set_reserved , +which will use it if necessary or otherwise discard it. +The memory may also be explicitly discarded by calling +.Fn osd_free_reserved . +As this method always allocates memory whether or not it is ultimately needed, +it should be used only rarely, such as in the unlikely event that +.Fn osd_set +fails. +.Pp The .Nm API is geared towards slot identifiers storing pointers to the same underlying @@ -359,15 +405,27 @@ the kernel including most fast paths. returns the slot identifier for the newly registered data type. .Pp .Fn osd_set -returns zero on success or ENOMEM if the specified type/slot identifier pair +and +.Fn osd_set_reserved +return zero on success or ENOMEM if the specified type/slot identifier pair triggered an internal .Xr realloc 9 -which failed. +which failed +.Fn ( osd_set_reserved +will always succeed when +.Fa rsv +is non-NULL). .Pp .Fn osd_get returns the data pointer for the specified type/slot identifier pair, or NULL if the slot has not been initialised yet. .Pp +.Fn osd_reserve +returns a pointer suitable for passing to +.Fn osd_set_reserved +or +.Fn osd_free_reserved . +.Pp .Fn osd_call returns zero if no method is run or the method for each slot runs successfully. If a method for a slot returns non-zero, Modified: head/sys/kern/kern_osd.c ============================================================================== --- head/sys/kern/kern_osd.c Wed Mar 30 16:54:18 2016 (r297421) +++ head/sys/kern/kern_osd.c Wed Mar 30 16:57:28 2016 (r297422) @@ -54,7 +54,7 @@ struct osd_master { struct sx osd_module_lock; struct rmlock osd_object_lock; struct mtx osd_list_lock; - LIST_HEAD(, osd) osd_list; /* (m) */ + LIST_HEAD(, osd) osd_list; /* (l) */ osd_destructor_t *osd_destructors; /* (o) */ osd_method_t *osd_methods; /* (m) */ u_int osd_ntslots; /* (m) */ @@ -198,6 +198,24 @@ osd_deregister(u_int type, u_int slot) int osd_set(u_int type, struct osd *osd, u_int slot, void *value) { + + return (osd_set_reserved(type, osd, slot, NULL, value)); +} + +void * +osd_reserve(u_int slot) +{ + + KASSERT(slot > 0, ("Invalid slot.")); + + OSD_DEBUG("Reserving slot array (slot=%u).", slot); + return (malloc(sizeof(void *) * slot, M_OSD, M_WAITOK | M_ZERO)); +} + +int +osd_set_reserved(u_int type, struct osd *osd, u_int slot, void *rsv, + void *value) +{ struct rm_priotracker tracker; KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); @@ -206,36 +224,34 @@ osd_set(u_int type, struct osd *osd, u_i rm_rlock(&osdm[type].osd_object_lock, &tracker); if (slot > osd->osd_nslots) { + void *newptr; + if (value == NULL) { OSD_DEBUG( "Not allocating null slot (type=%u, slot=%u).", type, slot); rm_runlock(&osdm[type].osd_object_lock, &tracker); + if (rsv) + osd_free_reserved(rsv); return (0); - } else if (osd->osd_nslots == 0) { + } + + /* + * Too few slots allocated here, so we need to extend or create + * the array. + */ + if (rsv) { /* - * First OSD for this object, so we need to allocate - * space and put it onto the list. + * Use the reserve passed in (assumed to be + * the right size). */ - osd->osd_slots = malloc(sizeof(void *) * slot, M_OSD, - M_NOWAIT | M_ZERO); - if (osd->osd_slots == NULL) { - rm_runlock(&osdm[type].osd_object_lock, - &tracker); - return (ENOMEM); + newptr = rsv; + if (osd->osd_nslots != 0) { + memcpy(newptr, osd->osd_slots, + sizeof(void *) * osd->osd_nslots); + free(osd->osd_slots, M_OSD); } - osd->osd_nslots = slot; - mtx_lock(&osdm[type].osd_list_lock); - LIST_INSERT_HEAD(&osdm[type].osd_list, osd, osd_next); - mtx_unlock(&osdm[type].osd_list_lock); - OSD_DEBUG("Setting first slot (type=%u).", type); } else { - void *newptr; - - /* - * Too few slots allocated here, needs to extend - * the array. - */ newptr = realloc(osd->osd_slots, sizeof(void *) * slot, M_OSD, M_NOWAIT | M_ZERO); if (newptr == NULL) { @@ -243,11 +259,22 @@ osd_set(u_int type, struct osd *osd, u_i &tracker); return (ENOMEM); } - osd->osd_slots = newptr; - osd->osd_nslots = slot; - OSD_DEBUG("Growing slots array (type=%u).", type); } - } + if (osd->osd_nslots == 0) { + /* + * First OSD for this object, so we need to put it + * onto the list. + */ + mtx_lock(&osdm[type].osd_list_lock); + LIST_INSERT_HEAD(&osdm[type].osd_list, osd, osd_next); + mtx_unlock(&osdm[type].osd_list_lock); + OSD_DEBUG("Setting first slot (type=%u).", type); + } else + OSD_DEBUG("Growing slots array (type=%u).", type); + osd->osd_slots = newptr; + osd->osd_nslots = slot; + } else if (rsv) + osd_free_reserved(rsv); OSD_DEBUG("Setting slot value (type=%u, slot=%u, value=%p).", type, slot, value); osd->osd_slots[slot - 1] = value; @@ -255,6 +282,14 @@ osd_set(u_int type, struct osd *osd, u_i return (0); } +void +osd_free_reserved(void *rsv) +{ + + OSD_DEBUG("Discarding reserved slot array."); + free(rsv, M_OSD); +} + void * osd_get(u_int type, struct osd *osd, u_int slot) { Modified: head/sys/sys/osd.h ============================================================================== --- head/sys/sys/osd.h Wed Mar 30 16:54:18 2016 (r297421) +++ head/sys/sys/osd.h Wed Mar 30 16:57:28 2016 (r297422) @@ -59,6 +59,10 @@ int osd_register(u_int type, osd_destruc void osd_deregister(u_int type, u_int slot); int osd_set(u_int type, struct osd *osd, u_int slot, void *value); +void *osd_reserve(u_int slot); +int osd_set_reserved(u_int type, struct osd *osd, u_int slot, void *rsv, + void *value); +void osd_free_reserved(void *rsv); void *osd_get(u_int type, struct osd *osd, u_int slot); void osd_del(u_int type, struct osd *osd, u_int slot); int osd_call(u_int type, u_int method, void *obj, void *data); @@ -71,6 +75,8 @@ void osd_exit(u_int type, struct osd *os osd_deregister(OSD_THREAD, (slot)) #define osd_thread_set(td, slot, value) \ osd_set(OSD_THREAD, &(td)->td_osd, (slot), (value)) +#define osd_thread_set_reserved(td, slot, rsv, value) \ + osd_set_reserved(OSD_THREAD, &(td)->td_osd, (slot), (rsv), (value)) #define osd_thread_get(td, slot) \ osd_get(OSD_THREAD, &(td)->td_osd, (slot)) #define osd_thread_del(td, slot) do { \ @@ -88,6 +94,8 @@ void osd_exit(u_int type, struct osd *os osd_deregister(OSD_JAIL, (slot)) #define osd_jail_set(pr, slot, value) \ osd_set(OSD_JAIL, &(pr)->pr_osd, (slot), (value)) +#define osd_jail_set_reserved(pr, slot, rsv, value) \ + osd_set_reserved(OSD_JAIL, &(pr)->pr_osd, (slot), (rsv), (value)) #define osd_jail_get(pr, slot) \ osd_get(OSD_JAIL, &(pr)->pr_osd, (slot)) #define osd_jail_del(pr, slot) \ From owner-svn-src-head@freebsd.org Wed Mar 30 17:00:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9676CAE3472; Wed, 30 Mar 2016 17:00:34 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66028164D; Wed, 30 Mar 2016 17:00:34 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UH0Xkf023611; Wed, 30 Mar 2016 17:00:33 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UH0XiC023610; Wed, 30 Mar 2016 17:00:33 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603301700.u2UH0XiC023610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 30 Mar 2016 17:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297423 - head/sys/dev/flash X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 17:00:34 -0000 Author: loos Date: Wed Mar 30 17:00:33 2016 New Revision: 297423 URL: https://svnweb.freebsd.org/changeset/base/297423 Log: Add basic FDT support for the mx25l SPI flash. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Wed Mar 30 16:57:28 2016 (r297422) +++ head/sys/dev/flash/mx25l.c Wed Mar 30 17:00:33 2016 (r297423) @@ -26,6 +26,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -40,6 +42,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + #include #include "spibus_if.h" @@ -360,7 +368,15 @@ mx25l_read(device_t dev, off_t offset, c static int mx25l_probe(device_t dev) { + +#ifdef FDT + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "st,m25p")) + return (ENXIO); +#endif device_set_desc(dev, "M25Pxx Flash Family"); + return (0); } From owner-svn-src-head@freebsd.org Wed Mar 30 17:05:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52751AE364B; Wed, 30 Mar 2016 17:05:05 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F3591ACB; Wed, 30 Mar 2016 17:05:05 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UH54Xl026398; Wed, 30 Mar 2016 17:05:04 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UH54a6026397; Wed, 30 Mar 2016 17:05:04 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201603301705.u2UH54a6026397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 30 Mar 2016 17:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297424 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 17:05:05 -0000 Author: jamie Date: Wed Mar 30 17:05:04 2016 New Revision: 297424 URL: https://svnweb.freebsd.org/changeset/base/297424 Log: Use osd_reserve / osd_jail_set_reserved, which is known to succeed. Also don't work around nonexistent osd_register failure. Modified: head/sys/compat/linux/linux_mib.c Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Wed Mar 30 17:00:33 2016 (r297423) +++ head/sys/compat/linux/linux_mib.c Wed Mar 30 17:05:04 2016 (r297424) @@ -168,9 +168,6 @@ linux_find_prison(struct prison *spr, st struct prison *pr; struct linux_prison *lpr; - if (!linux_osd_jail_slot) - /* In case osd_register failed. */ - spr = &prison0; for (pr = spr;; pr = pr->pr_parent) { mtx_lock(&pr->pr_mtx); lpr = (pr == &prison0) @@ -189,15 +186,14 @@ linux_find_prison(struct prison *spr, st * Ensure a prison has its own Linux info. If lprp is non-null, point it to * the Linux info and lock the prison. */ -static int +static void linux_alloc_prison(struct prison *pr, struct linux_prison **lprp) { struct prison *ppr; struct linux_prison *lpr, *nlpr; - int error; + void *rsv; /* If this prison already has Linux info, return that. */ - error = 0; lpr = linux_find_prison(pr, &ppr); if (ppr == pr) goto done; @@ -207,29 +203,24 @@ linux_alloc_prison(struct prison *pr, st */ mtx_unlock(&ppr->pr_mtx); nlpr = malloc(sizeof(struct linux_prison), M_PRISON, M_WAITOK); + rsv = osd_reserve(linux_osd_jail_slot); lpr = linux_find_prison(pr, &ppr); if (ppr == pr) { free(nlpr, M_PRISON); + osd_free_reserved(rsv); goto done; } /* Inherit the initial values from the ancestor. */ mtx_lock(&pr->pr_mtx); - error = osd_jail_set(pr, linux_osd_jail_slot, nlpr); - if (error == 0) { - bcopy(lpr, nlpr, sizeof(*lpr)); - lpr = nlpr; - } else { - free(nlpr, M_PRISON); - lpr = NULL; - } + (void)osd_jail_set_reserved(pr, linux_osd_jail_slot, rsv, nlpr); + bcopy(lpr, nlpr, sizeof(*lpr)); + lpr = nlpr; mtx_unlock(&ppr->pr_mtx); done: if (lprp != NULL) *lprp = lpr; else mtx_unlock(&pr->pr_mtx); - - return (error); } /* @@ -249,7 +240,8 @@ linux_prison_create(void *obj, void *dat * Inherit a prison's initial values from its parent * (different from JAIL_SYS_INHERIT which also inherits changes). */ - return (linux_alloc_prison(pr, NULL)); + linux_alloc_prison(pr, NULL); + return (0); } static int @@ -345,11 +337,7 @@ linux_prison_set(void *obj, void *data) * "linux=new" or "linux.*": * the prison gets its own Linux info. */ - error = linux_alloc_prison(pr, &lpr); - if (error) { - mtx_unlock(&pr->pr_mtx); - return (error); - } + linux_alloc_prison(pr, &lpr); if (osrelease) { error = linux_map_osrel(osrelease, &lpr->pr_osrel); if (error) { @@ -449,21 +437,18 @@ linux_osd_jail_register(void) linux_osd_jail_slot = osd_jail_register(linux_prison_destructor, methods); - if (linux_osd_jail_slot > 0) { - /* Copy the system linux info to any current prisons. */ - sx_xlock(&allprison_lock); - TAILQ_FOREACH(pr, &allprison, pr_list) - (void)linux_alloc_prison(pr, NULL); - sx_xunlock(&allprison_lock); - } + /* Copy the system linux info to any current prisons. */ + sx_slock(&allprison_lock); + TAILQ_FOREACH(pr, &allprison, pr_list) + linux_alloc_prison(pr, NULL); + sx_sunlock(&allprison_lock); } void linux_osd_jail_deregister(void) { - if (linux_osd_jail_slot) - osd_jail_deregister(linux_osd_jail_slot); + osd_jail_deregister(linux_osd_jail_slot); } void From owner-svn-src-head@freebsd.org Wed Mar 30 17:18:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D70BAE37D4; Wed, 30 Mar 2016 17:18:50 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AFF81FD5; Wed, 30 Mar 2016 17:18:50 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UHInoW029503; Wed, 30 Mar 2016 17:18:49 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UHInHP029502; Wed, 30 Mar 2016 17:18:49 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603301718.u2UHInHP029502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 30 Mar 2016 17:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297425 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 17:18:50 -0000 Author: loos Date: Wed Mar 30 17:18:49 2016 New Revision: 297425 URL: https://svnweb.freebsd.org/changeset/base/297425 Log: Use the AM33XX_IOPAD() MACRO which is easier to read (uses the same offset of TRM). While here remove i2c2_pins, it is already defined in am335x-bone-common.dtsi. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/beaglebone-black.dts Wed Mar 30 17:05:04 2016 (r297424) +++ head/sys/boot/fdt/dts/arm/beaglebone-black.dts Wed Mar 30 17:18:49 2016 (r297425) @@ -33,15 +33,8 @@ &am33xx_pinmux { i2c1_pins: pinmux_i2c1_pins { pinctrl-single,pins = < - 0x158 (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_d1.i2c1_sda */ - 0x15c (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_cs0.i2c1_scl */ - >; - }; - - i2c2_pins: pinmux_i2c2_pins { - pinctrl-single,pins = < - 0x178 (PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_ctsn.i2c2_sda */ - 0x17c (PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_rtsn.i2c2_scl */ + AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_d1.i2c1_sda */ + AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_cs0.i2c1_scl */ >; }; }; From owner-svn-src-head@freebsd.org Wed Mar 30 17:22:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A591CAE3944; Wed, 30 Mar 2016 17:22:37 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83C0E1389; Wed, 30 Mar 2016 17:22:37 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u2UHMTlN001446 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 30 Mar 2016 10:22:29 -0700 Subject: Re: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries To: Zbigniew Bodek References: <201603291519.u2TFJuXW051571@repo.freebsd.org> <56FBE3D6.9050205@freebsd.org> Cc: Ed Maste , Zbigniew Bodek , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" From: Nathan Whitehorn Message-ID: <56FC0B55.1040805@freebsd.org> Date: Wed, 30 Mar 2016 10:22:29 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: X-Sonic-CAuth: UmFuZG9tSVbJFkhhFqb4v+rd+mzIDOCLuLP7YcxjOcKbO7UqG0wTnJego1qCRRc2T1W5Rvl/lILCBqISnxYuWcBTjBANLHqJviV5/k7f3oY= X-Sonic-ID: C;vsO4+pv25RGYVcgVZbXa/Q== M;/Lb6+pv25RGYVcgVZbXa/Q== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 17:22:37 -0000 I think it should be pci aim | fdt, just like the previous line when the files lived in sys/powerpc. To conf, that evaluates as pci && (aim || fdt). -Nathan On 03/30/16 08:55, Zbigniew Bodek wrote: > > Thank you Nathan. Please check out new patch in the attachment. > > Best regards > zbb > > 2016-03-30 16:33 GMT+02:00 Nathan Whitehorn >: > > PowerPC (and SPARC) can have real OFW without FDT support. Adding > FDT to LINT is the wrong solution: rather, it should switch on fdt > | aim like the rest of the Open Firmware code. > -Nathan > > > On 03/30/16 01:54, Zbigniew Bodek wrote: >> Hello Ed, >> >> Please check out the attached patch. For powerpc we should >> compile-in ofwpci.c regardless of FDT option. >> However, it seems that LINT for powerpc does not have FDT. What >> do you thing about adding it (as can be seen in the attached >> patch)?. This would be done in a separate commit. >> >> Best regards >> zbb >> >> 2016-03-30 1:53 GMT+02:00 Ed Maste > >: >> >> On 29 March 2016 at 15:19, Zbigniew Bodek > > wrote: >> > Author: zbb >> > Date: Tue Mar 29 15:19:56 2016 >> > New Revision: 297392 >> > URL: https://svnweb.freebsd.org/changeset/base/297392 >> > >> > Log: >> > Reduce OFW PCI code duplication - involves ARM, PPC and >> SPARC64 >> >> My 'make tinderbox' build is now failing (powerpc LINT) with: >> >> linking kernel >> cpcht.o: In function `cpcht_attach': >> cpcht.c:(.text+0x17dc): undefined reference to `ofw_pci_attach' >> cpcht.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' >> grackle.o: In function `grackle_attach': >> grackle.c:(.text+0x2dc): undefined reference to `ofw_pci_attach' >> grackle.o:(.data.rel+0x0): undefined reference to >> `ofw_pci_driver' >> uninorthpci.o: In function `uninorth_attach': >> uninorthpci.c:(.text+0x68c): undefined reference to >> `ofw_pci_attach' >> uninorthpci.o:(.data.rel+0x0): undefined reference to >> `ofw_pci_driver' >> *** [kernel] Error code 1 >> _______________________________________________ >> svn-src-all@freebsd.org >> mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to >> "svn-src-all-unsubscribe@freebsd.org >> " >> >> > > From owner-svn-src-head@freebsd.org Wed Mar 30 17:32:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36015AE3B2E; Wed, 30 Mar 2016 17:32:16 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0306B1981; Wed, 30 Mar 2016 17:32:15 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UHWFrJ035399; Wed, 30 Mar 2016 17:32:15 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UHWFqO035397; Wed, 30 Mar 2016 17:32:15 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603301732.u2UHWFqO035397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 30 Mar 2016 17:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297426 - in head/sys: arm/conf boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 17:32:16 -0000 Author: loos Date: Wed Mar 30 17:32:14 2016 New Revision: 297426 URL: https://svnweb.freebsd.org/changeset/base/297426 Log: Enable SPI1 on Beaglebone Black. SPI1 was chosen because SPI0 shares the gpio pins with I2C1. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/conf/BEAGLEBONE head/sys/boot/fdt/dts/arm/beaglebone-black.dts Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Wed Mar 30 17:18:49 2016 (r297425) +++ head/sys/arm/conf/BEAGLEBONE Wed Mar 30 17:32:14 2016 (r297426) @@ -87,6 +87,10 @@ device gpio device gpioled device gpiobacklight +# SPI +device ti_spi +device spibus + # ADC support device ti_adc Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/beaglebone-black.dts Wed Mar 30 17:18:49 2016 (r297425) +++ head/sys/boot/fdt/dts/arm/beaglebone-black.dts Wed Mar 30 17:32:14 2016 (r297426) @@ -37,6 +37,16 @@ AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_cs0.i2c1_scl */ >; }; + + spi1_pins: pinmux_spi1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x964, PIN_INPUT_PULLUP | MUX_MODE2) /* eCAP0_in_PWM0_out.spi1_cs1 */ + AM33XX_IOPAD(0x990, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcasp0_aclkx.spi1_sclk */ + AM33XX_IOPAD(0x994, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcasp0_fsx.spi1_d0 - miso */ + AM33XX_IOPAD(0x998, PIN_INPUT_PULLUP | MUX_MODE3) /* mcasp0_axr0.spi1_d1 - mosi */ + AM33XX_IOPAD(0x99c, PIN_INPUT_PULLUP | MUX_MODE3) /* mcasp0_ahclkr.spi1_cs0 */ + >; + }; }; &i2c0 { @@ -65,6 +75,13 @@ status = "okay"; }; +&spi1 { + pinctrl-names = "default"; + pinctrl-0 = <&spi1_pins>; + + status = "okay"; +}; + &lcdc { hdmi = <&tda998x>; }; From owner-svn-src-head@freebsd.org Wed Mar 30 18:39:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71952AE39F1; Wed, 30 Mar 2016 18:39:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 427B51CF8; Wed, 30 Mar 2016 18:39:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UIdfJ8054863; Wed, 30 Mar 2016 18:39:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UIdf8N054862; Wed, 30 Mar 2016 18:39:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603301839.u2UIdf8N054862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 30 Mar 2016 18:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297427 - head/targets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 18:39:42 -0000 Author: bdrewery Date: Wed Mar 30 18:39:41 2016 New Revision: 297427 URL: https://svnweb.freebsd.org/changeset/base/297427 Log: show-valid-targets: Show host targets and also order all of the targets. Sponsored by: EMC / Isilon Storage Division Modified: head/targets/Makefile.xtras Modified: head/targets/Makefile.xtras ============================================================================== --- head/targets/Makefile.xtras Wed Mar 30 17:32:14 2016 (r297426) +++ head/targets/Makefile.xtras Wed Mar 30 18:39:41 2016 (r297427) @@ -37,10 +37,19 @@ BUILD_TARGETS != cd ${_here} && \ find . \( -name Makefile.depend -o -name ${.MAKE.DEPENDFILE:T} \) | \ sed 's,/Makefile.*,,;s,^./,,' | sort -u +BUILD_TARGETS_HOST != cd ${_here} && \ + find . \( -name Makefile.depend.host -o -name ${.MAKE.DEPENDFILE:T}.host \) | \ + sed 's,/Makefile.*,,;s,^./,,' | sort -u + show-valid-targets: +.if !empty(BUILD_TARGETS_HOST) + @echo "Build targets for host (leave out the ${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):" + @echo "${BUILD_TARGETS_HOST:O:ts\n}" + @echo +.endif @echo "Build targets for ${MACHINE} (leave out the ${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):" - @echo "${BUILD_TARGETS:ts\n}" - @echo; echo "Other targets:"; echo "${OTHER_TARGETS:ts\n}" + @echo "${BUILD_TARGETS:O:ts\n}" + @echo; echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}" .endif help: show-help From owner-svn-src-head@freebsd.org Wed Mar 30 18:40:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66BF0AE3A3E; Wed, 30 Mar 2016 18:40:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DE8B1E4C; Wed, 30 Mar 2016 18:40:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UIe9nV054943; Wed, 30 Mar 2016 18:40:09 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UIe9Yr054942; Wed, 30 Mar 2016 18:40:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603301840.u2UIe9Yr054942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 30 Mar 2016 18:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297428 - head/targets/pseudo/hosttools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 18:40:10 -0000 Author: bdrewery Date: Wed Mar 30 18:40:09 2016 New Revision: 297428 URL: https://svnweb.freebsd.org/changeset/base/297428 Log: Move hosttools to Makefile.depend.host so it shows under host targets in show-valid-targets. Sponsored by: EMC / Isilon Storage Division Added: head/targets/pseudo/hosttools/Makefile.depend.host - copied, changed from r297427, head/targets/pseudo/hosttools/Makefile.depend Deleted: head/targets/pseudo/hosttools/Makefile.depend Copied and modified: head/targets/pseudo/hosttools/Makefile.depend.host (from r297427, head/targets/pseudo/hosttools/Makefile.depend) ============================================================================== --- head/targets/pseudo/hosttools/Makefile.depend Wed Mar 30 18:39:41 2016 (r297427, copy source) +++ head/targets/pseudo/hosttools/Makefile.depend.host Wed Mar 30 18:40:09 2016 (r297428) @@ -6,29 +6,31 @@ .include .endif +# These are all .host dependencies + DIRDEPS = \ - lib/clang/include.host \ - lib/libc++.host \ - lib/libcxxrt.host \ - share/doc/llvm/clang.host \ - usr.bin/clang/clang-tblgen.host \ - usr.bin/clang/clang.host \ - usr.bin/clang/llvm-tblgen.host \ - usr.bin/lex/lib.host \ - usr.bin/localedef.host \ - usr.bin/mkcsmapper_static.host \ - usr.bin/mkesdb_static.host \ - usr.bin/mkuzip.host \ - usr.bin/yacc.host \ - usr.bin/xinstall.host \ - usr.bin/xlint/xlint.host \ - usr.sbin/config.host \ + lib/clang/include \ + lib/libc++ \ + lib/libcxxrt \ + share/doc/llvm/clang \ + usr.bin/clang/clang-tblgen \ + usr.bin/clang/clang \ + usr.bin/clang/llvm-tblgen \ + usr.bin/lex/lib \ + usr.bin/localedef \ + usr.bin/mkcsmapper_static \ + usr.bin/mkesdb_static \ + usr.bin/mkuzip \ + usr.bin/yacc \ + usr.bin/xinstall \ + usr.bin/xlint/xlint \ + usr.sbin/config \ .if ${MK_KERBEROS} != "no" DIRDEPS+= \ - kerberos5/tools/asn1_compile.host \ - kerberos5/tools/make-roken.host \ - usr.bin/compile_et.host \ + kerberos5/tools/asn1_compile \ + kerberos5/tools/make-roken \ + usr.bin/compile_et \ .endif From owner-svn-src-head@freebsd.org Wed Mar 30 18:53:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14019AE3CCF; Wed, 30 Mar 2016 18:53:17 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E61D716B7; Wed, 30 Mar 2016 18:53:15 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 5db310f7; Wed, 30 Mar 2016 20:53:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=aqAraxnyJa7q4zj79rcNQkC8y9s=; b=lVu2akxKejOsYz6ay8xX7IDO/KZV XNeUx9Q0y2xDu0CPYYavky8FS0bcVwCuukcsX9RH5D9kv9Uu+woIw749xxQhsoNJ 18jyBqfgqyA9hjWSN4ns2sKIVBhDSciu1FCjLP4Yu6ebM62qfqUxU1yaxQoUrkTo ovLYpc0KyrEAV+I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=tRNSOvY8q58dEXKVww6PlWepa4/ySTNIVE/LF5srIa02UgcA1Qh+wEgg 8aSAOq7ym4DLAJD5oU5wQQoFea6udreXsNvXFL8MNsn7Pzky6a3qPJg5RNgvoGjM SaYL3rQNACMgbNyyLmPCJ+8TOw0HQHL05Z1mS40wjLyIWDsiPI0= Received: from knuckles.blih.net (ip-54.net-82-216-203.roubaix.rev.numericable.fr [82.216.203.54]) by mail.blih.net (OpenSMTPD) with ESMTPSA id d0969995 TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Wed, 30 Mar 2016 20:53:06 +0200 (CEST) Date: Wed, 30 Mar 2016 20:53:05 +0200 From: Emmanuel Vadot To: Luiz Otavio O Souza Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297426 - in head/sys: arm/conf boot/fdt/dts/arm Message-Id: <20160330205305.ebea13d8492d5727910a22fc@bidouilliste.com> In-Reply-To: <201603301732.u2UHWFqO035397@repo.freebsd.org> References: <201603301732.u2UHWFqO035397@repo.freebsd.org> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 18:53:17 -0000 Hi Luiz, Why setting the pins to SPI mode here ? This should be done in your own board dts file if you need it (unless there is some spi chip on the BBB that I don't know of). This reduce the number of GPIOs available on the headers. Thanks, On Wed, 30 Mar 2016 17:32:15 +0000 (UTC) Luiz Otavio O Souza wrote: > Author: loos > Date: Wed Mar 30 17:32:14 2016 > New Revision: 297426 > URL: https://svnweb.freebsd.org/changeset/base/297426 > > Log: > Enable SPI1 on Beaglebone Black. > > SPI1 was chosen because SPI0 shares the gpio pins with I2C1. > > Sponsored by: Rubicon Communications (Netgate) > > Modified: > head/sys/arm/conf/BEAGLEBONE > head/sys/boot/fdt/dts/arm/beaglebone-black.dts > > Modified: head/sys/arm/conf/BEAGLEBONE > ============================================================================== > --- head/sys/arm/conf/BEAGLEBONE Wed Mar 30 17:18:49 2016 (r297425) > +++ head/sys/arm/conf/BEAGLEBONE Wed Mar 30 17:32:14 2016 (r297426) > @@ -87,6 +87,10 @@ device gpio > device gpioled > device gpiobacklight > > +# SPI > +device ti_spi > +device spibus > + > # ADC support > device ti_adc > > > Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts > ============================================================================== > --- head/sys/boot/fdt/dts/arm/beaglebone-black.dts Wed Mar 30 17:18:49 2016 (r297425) > +++ head/sys/boot/fdt/dts/arm/beaglebone-black.dts Wed Mar 30 17:32:14 2016 (r297426) > @@ -37,6 +37,16 @@ > AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_cs0.i2c1_scl */ > >; > }; > + > + spi1_pins: pinmux_spi1_pins { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x964, PIN_INPUT_PULLUP | MUX_MODE2) /* eCAP0_in_PWM0_out.spi1_cs1 */ > + AM33XX_IOPAD(0x990, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcasp0_aclkx.spi1_sclk */ > + AM33XX_IOPAD(0x994, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcasp0_fsx.spi1_d0 - miso */ > + AM33XX_IOPAD(0x998, PIN_INPUT_PULLUP | MUX_MODE3) /* mcasp0_axr0.spi1_d1 - mosi */ > + AM33XX_IOPAD(0x99c, PIN_INPUT_PULLUP | MUX_MODE3) /* mcasp0_ahclkr.spi1_cs0 */ > + >; > + }; > }; > > &i2c0 { > @@ -65,6 +75,13 @@ > status = "okay"; > }; > > +&spi1 { > + pinctrl-names = "default"; > + pinctrl-0 = <&spi1_pins>; > + > + status = "okay"; > +}; > + > &lcdc { > hdmi = <&tda998x>; > }; > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Wed Mar 30 18:55:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1079AE3D35; Wed, 30 Mar 2016 18:55:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C4C018A8; Wed, 30 Mar 2016 18:55:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UItwOv060714; Wed, 30 Mar 2016 18:55:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UItwRF060713; Wed, 30 Mar 2016 18:55:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603301855.u2UItwRF060713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 30 Mar 2016 18:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297430 - head/targets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 18:55:59 -0000 Author: bdrewery Date: Wed Mar 30 18:55:58 2016 New Revision: 297430 URL: https://svnweb.freebsd.org/changeset/base/297430 Log: show-valid-targets: Organize all targets by the all_machine_list. Sponsored by: EMC / Isilon Storage Division Modified: head/targets/Makefile.xtras Modified: head/targets/Makefile.xtras ============================================================================== --- head/targets/Makefile.xtras Wed Mar 30 18:45:18 2016 (r297429) +++ head/targets/Makefile.xtras Wed Mar 30 18:55:58 2016 (r297430) @@ -33,23 +33,27 @@ OTHER_TARGETS = \ destroy-host \ destroy-stage \ -BUILD_TARGETS != cd ${_here} && \ +BUILD_TARGETS_${MACHINE:tu} != cd ${_here} && \ find . \( -name Makefile.depend -o -name ${.MAKE.DEPENDFILE:T} \) | \ sed 's,/Makefile.*,,;s,^./,,' | sort -u -BUILD_TARGETS_HOST != cd ${_here} && \ - find . \( -name Makefile.depend.host -o -name ${.MAKE.DEPENDFILE:T}.host \) | \ +.for _machine in ${all_machine_list} +_targets_${_machine} != cd ${_here} && \ + find . \( -name Makefile.depend.${_machine} -o \ + -name ${.MAKE.DEPENDFILE:T}.${_machine} \) | \ sed 's,/Makefile.*,,;s,^./,,' | sort -u +BUILD_TARGETS_${_machine:tu} += ${_targets_${_machine}} +.endfor show-valid-targets: -.if !empty(BUILD_TARGETS_HOST) - @echo "Build targets for host (leave out the ${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):" - @echo "${BUILD_TARGETS_HOST:O:ts\n}" +.for _machine in ${all_machine_list:O} +.if !empty(BUILD_TARGETS_${_machine:tu}) + @echo "Build targets for ${_machine} (leave out the ${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):" + @echo "${BUILD_TARGETS_${_machine:tu}:O:ts\n}" @echo .endif - @echo "Build targets for ${MACHINE} (leave out the ${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):" - @echo "${BUILD_TARGETS:O:ts\n}" - @echo; echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}" +.endfor + @echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}" .endif help: show-help From owner-svn-src-head@freebsd.org Wed Mar 30 21:31:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1B9EAE30AC; Wed, 30 Mar 2016 21:31:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86CA712C8; Wed, 30 Mar 2016 21:31:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2ULVYoE009041; Wed, 30 Mar 2016 21:31:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2ULVYA8009040; Wed, 30 Mar 2016 21:31:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603302131.u2ULVYA8009040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 30 Mar 2016 21:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297431 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 21:31:35 -0000 Author: bdrewery Date: Wed Mar 30 21:31:34 2016 New Revision: 297431 URL: https://svnweb.freebsd.org/changeset/base/297431 Log: Remove redundant code imported into dirdeps.mk in r290956. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.dirdeps.mk Modified: head/share/mk/local.dirdeps.mk ============================================================================== --- head/share/mk/local.dirdeps.mk Wed Mar 30 18:55:58 2016 (r297430) +++ head/share/mk/local.dirdeps.mk Wed Mar 30 21:31:34 2016 (r297431) @@ -9,15 +9,6 @@ # DEP_MACHINE is set before we get here, this may not be. DEP_RELDIR ?= ${RELDIR} -.if ${.TARGETS:Uall:M*/*} && empty(DIRDEPS) -# This little trick let's us do -# -# mk -f dirdeps.mk some/dir.i386,bsd -# -DIRDEPS := ${.TARGETS:M*/*} -${.TARGETS:Nall}: all -.endif - # making universe is special .if defined(UNIVERSE_GUARD) # these should be done by now From owner-svn-src-head@freebsd.org Wed Mar 30 22:26:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8823DAE3CA7; Wed, 30 Mar 2016 22:26:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5543B1AE3; Wed, 30 Mar 2016 22:26:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UMQExV024896; Wed, 30 Mar 2016 22:26:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UMQE2P024895; Wed, 30 Mar 2016 22:26:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603302226.u2UMQE2P024895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 30 Mar 2016 22:26:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297433 - head/targets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 22:26:15 -0000 Author: bdrewery Date: Wed Mar 30 22:26:14 2016 New Revision: 297433 URL: https://svnweb.freebsd.org/changeset/base/297433 Log: show-valid-targets: Indent each target 2 spaces. Sponsored by: EMC / Isilon Storage Division Modified: head/targets/Makefile.xtras Modified: head/targets/Makefile.xtras ============================================================================== --- head/targets/Makefile.xtras Wed Mar 30 22:12:07 2016 (r297432) +++ head/targets/Makefile.xtras Wed Mar 30 22:26:14 2016 (r297433) @@ -49,11 +49,11 @@ show-valid-targets: .for _machine in ${all_machine_list:O} .if !empty(BUILD_TARGETS_${_machine:tu}) @echo "Build targets for ${_machine} (leave out the ${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):" - @echo "${BUILD_TARGETS_${_machine:tu}:O:ts\n}" + @echo -e "${BUILD_TARGETS_${_machine:tu}:O:ts\n}" | sed -e 's,^, ,' @echo .endif .endfor - @echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}" + @echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}" | sed -e 's,^, ,' .endif help: show-help From owner-svn-src-head@freebsd.org Wed Mar 30 23:50:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E24D9AE3EE4; Wed, 30 Mar 2016 23:50:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3F5C1152; Wed, 30 Mar 2016 23:50:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UNoT9f048893; Wed, 30 Mar 2016 23:50:29 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UNoTV1048892; Wed, 30 Mar 2016 23:50:29 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603302350.u2UNoTV1048892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 30 Mar 2016 23:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297435 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 23:50:31 -0000 Author: bdrewery Date: Wed Mar 30 23:50:29 2016 New Revision: 297435 URL: https://svnweb.freebsd.org/changeset/base/297435 Log: Fix the external GCC build after r297271 by setting -L /usr/lib. GCC does add /usr/lib to the library search path but it comes after /usr/local/lib which can find ports libraries such as libedit.so. The bad path comes in as /usr/local/lib/gcc/x86_64-portbld-freebsd11.0/5.3.0/../../../ which corresponds to /lib. This partially reverts r297271. Pointyhat to: bdrewery Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Mar 30 23:50:23 2016 (r297434) +++ head/Makefile.inc1 Wed Mar 30 23:50:29 2016 (r297435) @@ -421,8 +421,8 @@ TARGET_ABI= gnueabi .endif .endif .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc -# GCC requires -isystem when using a cross-compiler. -XCFLAGS+= -isystem ${WORLDTMP}/usr/include +# GCC requires -isystem and -L when using a cross-compiler. +XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib # Force using libc++ for external GCC. XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ -L${WORLDTMP}/../lib/libc++ From owner-svn-src-head@freebsd.org Wed Mar 30 23:50:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43A7DAE3EDE; Wed, 30 Mar 2016 23:50:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EC54114E; Wed, 30 Mar 2016 23:50:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UNoQvg048847; Wed, 30 Mar 2016 23:50:26 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UNoNur048822; Wed, 30 Mar 2016 23:50:23 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603302350.u2UNoNur048822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 30 Mar 2016 23:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297434 - in head: . gnu/lib/csu kerberos5 release/picobsd/build secure share/man/man5 share/man/man7 share/mk sys/conf sys/modules/pflog sys/modules/pfsync sys/modules/wtap tools tools... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 23:50:27 -0000 Author: bdrewery Date: Wed Mar 30 23:50:23 2016 New Revision: 297434 URL: https://svnweb.freebsd.org/changeset/base/297434 Log: Remove the old depend (mkdep) code and make FAST_DEPEND the one true way. Reviewed by: emaste, hselasky (partial), brooks (brief) Discussed on: arch@ Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5742 Deleted: head/tools/build/options/WITHOUT_FAST_DEPEND head/tools/build/options/WITH_FAST_DEPEND Modified: head/Makefile head/Makefile.inc1 head/Makefile.libcompat head/UPDATING head/gnu/lib/csu/Makefile head/kerberos5/Makefile head/release/picobsd/build/Makefile.conf head/secure/Makefile head/share/man/man5/make.conf.5 head/share/man/man7/build.7 head/share/mk/bsd.clang-analyze.mk head/share/mk/bsd.dep.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.opts.mk head/share/mk/bsd.prog.mk head/share/mk/local.meta.sys.mk head/sys/conf/kern.opts.mk head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk head/sys/modules/pflog/Makefile head/sys/modules/pfsync/Makefile head/sys/modules/wtap/Makefile head/tools/tinder.sh head/usr.sbin/ndiscvt/ndisgen.sh Modified: head/Makefile ============================================================================== --- head/Makefile Wed Mar 30 22:26:14 2016 (r297433) +++ head/Makefile Wed Mar 30 23:50:23 2016 (r297434) @@ -124,7 +124,7 @@ TGTS= all all-man buildenv buildenvvars installworld kernel-toolchain libraries lint maninstall \ obj objlink rerelease showconfig tags toolchain update \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ - _build-tools _cross-tools _includes _libraries _depend \ + _build-tools _cross-tools _includes _libraries \ build32 distribute32 install32 build32 distribute32 install32 \ builddtb xdev xdev-build xdev-install \ xdev-links native-xtools installconfig \ Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Mar 30 22:26:14 2016 (r297433) +++ head/Makefile.inc1 Wed Mar 30 23:50:23 2016 (r297434) @@ -7,10 +7,9 @@ # -DDB_FROM_SRC use the user/group databases in src/etc instead of # the system database when installing. # -DNO_SHARE do not go into share subdir -# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ} +# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,OBJ} # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel -# -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel # -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel # -DNO_PORTSUPDATE do not update ports in ${MAKE} update # -DNO_ROOT install without using root privilege @@ -145,16 +144,6 @@ CLEANDIR= clean cleandepend CLEANDIR= cleandir .endif -# FAST_DEPEND can skip depend tree-walks. -.if ${MK_FAST_DEPEND} == "yes" -NO_DEPEND= t -NO_KERNELDEPEND=t -.endif -# Ensure shell checks later have a value. -.if defined(NO_DEPEND) -NO_DEPEND= t -.endif - LOCAL_TOOL_DIRS?= PACKAGEDIR?= ${DESTDIR}/${DISTDIR} @@ -406,7 +395,6 @@ X${BINUTIL}?= ${${BINUTIL}} .endif .endfor CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCFLAGS} ${XCXXFLAGS}" \ - DEPFLAGS="${DEPFLAGS}" \ CPP="${XCPP} ${XCFLAGS}" \ AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ OBJDUMP=${XOBJDUMP} OBJCOPY="${XOBJCOPY}" \ @@ -438,10 +426,6 @@ XCFLAGS+= -isystem ${WORLDTMP}/usr/inclu # Force using libc++ for external GCC. XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ -L${WORLDTMP}/../lib/libc++ -# XXX: DEPFLAGS is a workaround for not properly passing CXXFLAGS to sub-makes -# due to CXX="${XCXX} ${XCXXFLAGS}". bsd.dep.mk does use CXXFLAGS when -# building C++ files so this can come out if passing CXXFLAGS down is fixed. -DEPFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 .else TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 @@ -635,16 +619,10 @@ _libraries: ${_+_}cd ${.CURDIR}; \ ${WMAKE} -DNO_FSCHG MK_HTML=no -DNO_LINT MK_MAN=no \ MK_PROFILE=no MK_TESTS=no MK_TESTS_SUPPORT=${MK_TESTS} libraries -_depend: - @echo - @echo "--------------------------------------------------------------" - @echo ">>> stage 4.3: make dependencies" - @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${WMAKE} depend everything: @echo @echo "--------------------------------------------------------------" - @echo ">>> stage 4.4: building everything" + @echo ">>> stage 4.3: building everything" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; _PARALLEL_SUBDIR_OK=1 ${WMAKE} all @@ -655,9 +633,6 @@ WMAKE_TGTS+= _bootstrap-tools .endif WMAKE_TGTS+= _cleanobj _obj _build-tools _cross-tools WMAKE_TGTS+= _includes _libraries -.if !defined(NO_DEPEND) -WMAKE_TGTS+= _depend -.endif WMAKE_TGTS+= everything .if defined(LIBCOMPAT) && empty(SUBDIR_OVERRIDE) WMAKE_TGTS+= build${libcompat} @@ -700,7 +675,7 @@ buildenv: .PHONY @cd ${BUILDENV_DIR} && env ${WMAKEENV} BUILDENV=1 ${BUILDENV_SHELL} \ || true -TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild${libcompat}} +TOOLCHAIN_TGTS= ${WMAKE_TGTS:Neverything:Nbuild${libcompat}} toolchain: ${TOOLCHAIN_TGTS} kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries} @@ -997,7 +972,6 @@ distrib-dirs distribution: .MAKE .PHONY .if defined(KERNFAST) NO_KERNELCLEAN= t NO_KERNELCONFIG= t -NO_KERNELDEPEND= t NO_KERNELOBJ= t # Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah .if !defined(KERNCONF) && ${KERNFAST} != "1" @@ -1079,16 +1053,9 @@ buildkernel: .MAKE .PHONY @echo ">>> stage 2.3: build tools" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; ${KTMAKE} kernel-tools -.if !defined(NO_KERNELDEPEND) - @echo - @echo "--------------------------------------------------------------" - @echo ">>> stage 3.1: making dependencies" - @echo "--------------------------------------------------------------" - ${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ -.endif @echo @echo "--------------------------------------------------------------" - @echo ">>> stage 3.2: building everything" + @echo ">>> stage 3.1: building everything" @echo "--------------------------------------------------------------" ${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ @echo "--------------------------------------------------------------" @@ -1287,11 +1254,10 @@ legacy: false .endif .for _tool in tools/build ${_elftoolchain_libs} - ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \ + ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ - if [ -z "${NO_DEPEND}" ]; then ${MAKE} DIRPRFX=${_tool}/ depend; fi; \ ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install .endfor @@ -1447,10 +1413,9 @@ bootstrap-tools: .PHONY ${_vtfontcvt} \ usr.bin/localedef ${_bt}-${_tool}: .PHONY .MAKE - ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ + ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ - if [ -z "${NO_DEPEND}" ]; then ${MAKE} DIRPRFX=${_tool}/ depend; fi; \ ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install @@ -1496,10 +1461,9 @@ build-tools: build-tools_${_tool} .for _tool in \ ${_gcc_tools} build-tools_${_tool}: .PHONY - ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ + ${_+_}@${ECHODIR} "===> ${_tool} (obj,all)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ - if [ -z "${NO_DEPEND}" ]; then ${MAKE} DIRPRFX=${_tool}/ depend; fi; \ ${MAKE} DIRPRFX=${_tool}/ all build-tools: build-tools_${_tool} .endfor @@ -1580,10 +1544,9 @@ cross-tools: .MAKE .PHONY ${_btxld} \ ${_crunchide} \ ${_usb_tools} - ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ + ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ - if [ -z "${NO_DEPEND}" ]; then ${MAKE} DIRPRFX=${_tool}/ depend; fi; \ ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install .endfor @@ -1612,10 +1575,9 @@ NXBMAKE= ${NXBENV} ${MAKE} \ native-xtools: .PHONY .if ${MK_GCC_BOOTSTRAP} != "no" mkdir -p ${OBJTREE}/gperf_for_gcc/usr/bin - ${_+_}@${ECHODIR} "===> ${_gperf} (obj,depend,all,install)"; \ + ${_+_}@${ECHODIR} "===> ${_gperf} (obj,all,install)"; \ cd ${.CURDIR}/${_gperf}; \ ${NXBMAKE} DIRPRFX=${_gperf}/ obj; \ - if [ -z "${NO_DEPEND}" ]; then ${NXBMAKE} DIRPRFX=${_gperf}/ depend; fi; \ ${NXBMAKE} DIRPRFX=${_gperf}/ all; \ ${NXBMAKE} DIRPRFX=${_gperf}/ DESTDIR=${OBJTREE}/gperf_for_gcc install .endif @@ -1687,10 +1649,9 @@ native-xtools: .PHONY usr.bin/xz \ usr.bin/yacc \ usr.sbin/chown - ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ + ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${NXBMAKE} DIRPRFX=${_tool}/ obj; \ - if [ -z "${NO_DEPEND}" ]; then ${NXBMAKE} DIRPRFX=${_tool}/ depend; fi; \ ${NXBMAKE} DIRPRFX=${_tool}/ all; \ ${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${NXBDESTDIR} install .endfor @@ -1926,10 +1887,9 @@ gnu/lib/libdialog__L: lib/msun__L lib/nc .for _lib in ${_prereq_libs} ${_lib}__PL: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) - ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ + ${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \ cd ${.CURDIR}/${_lib}; \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \ - if [ -z "${NO_DEPEND}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; fi; \ ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ DIRPRFX=${_lib}/ all; \ ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ @@ -1940,10 +1900,9 @@ ${_lib}__PL: .PHONY .MAKE .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} ${_lib}__L: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) - ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ + ${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \ cd ${.CURDIR}/${_lib}; \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \ - if [ -z "${NO_DEPEND}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; fi; \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all; \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ install .endif @@ -1953,10 +1912,9 @@ ${_lib}__L: .PHONY .MAKE # static PAM library, and dynamic PAM library before dynamic PAM # modules. lib/libpam__L: .PHONY .MAKE - ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ + ${_+_}@${ECHODIR} "===> lib/libpam (obj,all,install)"; \ cd ${.CURDIR}/lib/libpam; \ ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj; \ - if [ -z "${NO_DEPEND}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ depend; fi; \ ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \ -D_NO_LIBPAM_SO_YET all; \ ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \ @@ -2251,10 +2209,9 @@ _xb-bootstrap-tools: .PHONY .for _tool in \ ${_clang_tblgen} \ ${_gperf} - ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ + ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \ - if [ -z "${NO_DEPEND}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ depend; fi; \ ${CDMAKE} DIRPRFX=${_tool}/ all; \ ${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install .endfor @@ -2271,10 +2228,9 @@ _xb-cross-tools: .PHONY ${_clang_libs} \ ${_clang} \ ${_cc} - ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ + ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,all)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \ - if [ -z "${NO_DEPEND}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ depend; fi; \ ${CDMAKE} DIRPRFX=${_tool}/ all .endfor Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Wed Mar 30 22:26:14 2016 (r297433) +++ head/Makefile.libcompat Wed Mar 30 23:50:23 2016 (r297434) @@ -148,7 +148,7 @@ build${libcompat}: .PHONY ${_+_}cd ${.CURDIR}; \ ${LIBCOMPATWMAKE} -f Makefile.inc1 -DNO_FSCHG libraries .if ${libcompat} == "32" -.for _t in obj depend all +.for _t in obj all ${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIBCOMPATWMAKE} \ -DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t} ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIBCOMPATWMAKE} \ Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Mar 30 22:26:14 2016 (r297433) +++ head/UPDATING Wed Mar 30 23:50:23 2016 (r297434) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160330: + The FAST_DEPEND build option has been removed and its functionality is + now the one true way. The old mkdep(1) style of 'make depend' has + been removed. See 20160311 for further details. + 20160317: Resource range types have grown from unsigned long to uintmax_t. All drivers, and anything using libdevinfo, need to be recompiled. Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Wed Mar 30 22:26:14 2016 (r297433) +++ head/gnu/lib/csu/Makefile Wed Mar 30 23:50:23 2016 (r297434) @@ -22,7 +22,6 @@ CFLAGS+= -fno-inline-functions -fno-exce CFLAGS+= -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. \ -I${CCDIR}/cc_tools CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG} -MKDEP= -DCRT_BEGIN .if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI Modified: head/kerberos5/Makefile ============================================================================== --- head/kerberos5/Makefile Wed Mar 30 22:26:14 2016 (r297433) +++ head/kerberos5/Makefile Wed Mar 30 23:50:23 2016 (r297434) @@ -14,7 +14,6 @@ kerberize: cd ${.CURDIR}/../${entry}; \ ${MAKE} cleandir; \ ${MAKE} obj; \ - ${MAKE} depend; \ ${MAKE} all; \ ${MAKE} install .endfor @@ -25,7 +24,6 @@ dekerberize: cd ${.CURDIR}/../${entry}; \ ${MAKE} MK_KERBEROS=no cleandir; \ ${MAKE} MK_KERBEROS=no obj; \ - ${MAKE} MK_KERBEROS=no depend; \ ${MAKE} MK_KERBEROS=no all; \ ${MAKE} MK_KERBEROS=no install .endfor Modified: head/release/picobsd/build/Makefile.conf ============================================================================== --- head/release/picobsd/build/Makefile.conf Wed Mar 30 22:26:14 2016 (r297433) +++ head/release/picobsd/build/Makefile.conf Wed Mar 30 23:50:23 2016 (r297434) @@ -43,8 +43,7 @@ do_a_make_in_the_kernel_directory_anyway (cd ${COMPILE}; ${BINMAKE} KERNEL=kernel ${MODULES} ) ${COMPILE}: ${CONF}/${CONFFILE} - (cd ${CONF}; ${CONFIG} -d ${COMPILE} ${CONFFILE}; \ - cd ${COMPILE}; ${BINMAKE} KERNEL=kernel ${MODULES} depend ) + cd ${CONF}; ${CONFIG} -d ${COMPILE} ${CONFFILE} ${CONF}/${CONFFILE}: ${KERNCONF} # -mkdir -p ${CONF} # XXX not needed yet. Modified: head/secure/Makefile ============================================================================== --- head/secure/Makefile Wed Mar 30 22:26:14 2016 (r297433) +++ head/secure/Makefile Wed Mar 30 23:50:23 2016 (r297434) @@ -24,7 +24,6 @@ secure: .MAKE .PHONY cd ${.CURDIR}/../${entry}; \ ${MAKE} cleandir; \ ${MAKE} obj; \ - ${MAKE} depend; \ ${MAKE} all; \ ${MAKE} install .endfor @@ -35,7 +34,6 @@ insecure: .MAKE .PHONY cd ${.CURDIR}/../${entry}; \ ${MAKE} MK_CRYPT=no cleandir; \ ${MAKE} MK_CRYPT=no obj; \ - ${MAKE} MK_CRYPT=no depend; \ ${MAKE} MK_CRYPT=no all; \ ${MAKE} MK_CRYPT=no install .endfor Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Wed Mar 30 22:26:14 2016 (r297433) +++ head/share/man/man5/make.conf.5 Wed Mar 30 23:50:23 2016 (r297434) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 24, 2016 +.Dd March 29, 2016 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -294,12 +294,6 @@ Set this to skip running .Xr config 8 during .Dq Li "${MAKE} buildkernel" . -.It Va NO_KERNELDEPEND -.Pq Vt bool -Set this to skip running -.Dq Li "${MAKE} depend" -during -.Dq Li "${MAKE} buildkernel" . .It Va NO_KERNELOBJ .Pq Vt bool Set this to skip running Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Wed Mar 30 22:26:14 2016 (r297433) +++ head/share/man/man7/build.7 Wed Mar 30 23:50:23 2016 (r297434) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 26, 2016 +.Dd March 29, 2016 .Dt BUILD 7 .Os .Sh NAME @@ -122,11 +122,13 @@ test suite on installed world. .It Cm clean Remove any files created during the build process. .It Cm cleandepend -Remove the file -.Pa ${.OBJDIR}/${DEPENDFILE} -generated by a prior +Remove the +.Pa ${.OBJDIR}/${DEPENDFILE}* +files generated by prior +.Dq Li "make" +and .Dq Li "make depend" -step. +steps. .It Cm cleandir Remove the canonical object directory if it exists, or perform actions equivalent to @@ -146,6 +148,8 @@ and the second one will clean up .It Cm depend Generate a list of build dependencies in file .Pa ${.OBJDIR}/${DEPENDFILE} . +Per-object dependencies are generated at build time and stored in +.Pa ${.OBJDIR}/${DEPENDFILE}.${OBJ} . .It Cm install Install the results of the build to the appropriate location in the installation directory hierarchy specified in variable @@ -412,7 +416,6 @@ If set, the build target defaults to setting .Va NO_KERNELCLEAN , .Va NO_KERNELCONFIG , -.Va NO_KERNELDEPEND and .Va NO_KERNELOBJ . When set to a value other than @@ -527,7 +530,7 @@ using the .Fl D option of .Xr make 1 : -.Bl -tag -width ".Va -DNO_KERNELDEPEND" +.Bl -tag -width ".Va -DNO_KERNELCONFIG" .It Va NO_CLEANDIR If set, the build targets that clean parts of the object tree use the equivalent of @@ -565,12 +568,6 @@ If set, the build process does not run as part of the .Cm buildkernel target. -.It Va NO_KERNELDEPEND -If set, the build process does not run -.Dq make depend -as part of the -.Cm buildkernel -target. .It Va NO_KERNELOBJ If set, the build process does not run .Dq make obj Modified: head/share/mk/bsd.clang-analyze.mk ============================================================================== --- head/share/mk/bsd.clang-analyze.mk Wed Mar 30 22:26:14 2016 (r297433) +++ head/share/mk/bsd.clang-analyze.mk Wed Mar 30 23:50:23 2016 (r297434) @@ -83,10 +83,7 @@ ${__obj}: ${OBJS_DEPEND_GUESS} ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .endfor -.if ${MK_FAST_DEPEND} == "yes" -beforeanalyze: depend -.endif -beforeanalyze: .PHONY +beforeanalyze: depend .PHONY .if !defined(_RECURSING_PROGS) && !empty(CLANG_ANALYZE_SRCS) && \ ${CLANG_ANALYZE_OUTPUT} != "text" mkdir -p ${CLANG_ANALYZE_OUTPUT_DIR} Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Mar 30 22:26:14 2016 (r297433) +++ head/share/mk/bsd.dep.mk Wed Mar 30 23:50:23 2016 (r297434) @@ -20,10 +20,6 @@ # # HTAGSFLAGS Options for htags(1) [not set] # -# MKDEP Options for ${MKDEPCMD} [not set] -# -# MKDEPCMD Makefile dependency list program [mkdep] -# # SRCS List of source files (c, c++, assembler) # # DPSRCS List of source files which are needed for generating @@ -54,13 +50,6 @@ CTAGSFLAGS?= GTAGSFLAGS?= -o HTAGSFLAGS?= -_MKDEPCC:= ${CC:N${CCACHE_BIN}} -# XXX: DEPFLAGS can come out once Makefile.inc1 properly passes down -# CXXFLAGS. -.if !empty(DEPFLAGS) -_MKDEPCC+= ${DEPFLAGS} -.endif -MKDEPCMD?= CC='${_MKDEPCC}' mkdep .if ${MK_DIRDEPS_BUILD} == "no" .MAKE.DEPENDFILE= ${DEPENDFILE} .endif @@ -95,9 +84,6 @@ CLEANFILES?= .for _S in ${SRCS:N*.[dhly]} OBJS_DEPEND_GUESS.${_S:R}.o= ${_S} -.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) -${_S:R}.o: ${OBJS_DEPEND_GUESS.${_S:R}.o} -.endif .endfor # Lexical analyzers @@ -106,9 +92,6 @@ ${_S:R}.o: ${OBJS_DEPEND_GUESS.${_S:R}.o ${_LC}: ${_LSRC} ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC} OBJS_DEPEND_GUESS.${_LC:R}.o= ${_LC} -.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) -${_LC:R}.o: ${OBJS_DEPEND_GUESS.${_LC:R}.o} -.endif SRCS:= ${SRCS:S/${_LSRC}/${_LC}/} CLEANFILES+= ${_LC} .endfor @@ -138,9 +121,6 @@ ${_YC}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} .endif OBJS_DEPEND_GUESS.${_YC:R}.o= ${_YC} -.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) -${_YC:R}.o: ${OBJS_DEPEND_GUESS.${_YC:R}.o} -.endif .endfor .endfor @@ -175,7 +155,6 @@ ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$/ .if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon) _meta_filemon= 1 .endif -.if ${MK_FAST_DEPEND} == "yes" .if ${MAKE_VERSION} < 20160220 DEPEND_MP?= -MP .endif @@ -210,7 +189,6 @@ CFLAGS+= ${DEPEND_CFLAGS} .endfor .endif # !defined(_SKIP_READ_DEPEND) .endif # !defined(_meta_filemon) -.endif # ${MK_FAST_DEPEND} == "yes" .endif # defined(SRCS) .if ${MK_DIRDEPS_BUILD} == "yes" @@ -230,7 +208,6 @@ afterdepend: beforedepend # Guess some dependencies for when no ${DEPENDFILE}.OBJ is generated yet. # For meta+filemon the .meta file is checked for since it is the dependency # file used. -.if ${MK_FAST_DEPEND} == "yes" .for __obj in ${DEPENDOBJS:O:u} .if (defined(_meta_filemon) && !exists(${.OBJDIR}/${__obj}.meta)) || \ (!defined(_meta_filemon) && !exists(${.OBJDIR}/${DEPENDFILE}.${__obj})) @@ -245,7 +222,6 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .if ${MK_DIRDEPS_BUILD} == "no" || ${.MAKE.LEVEL} > 0 beforebuild: depend .endif -.endif # ${MK_FAST_DEPEND} == "yes" .if !target(depend) .if defined(SRCS) @@ -254,41 +230,14 @@ depend: beforedepend ${DEPENDFILE} after # Tell bmake not to look for generated files via .PATH .NOPATH: ${DEPENDFILE} ${DEPENDFILES_OBJS} -.if ${MK_FAST_DEPEND} == "no" -# Capture -include from CFLAGS. -# This could be simpler with bmake :tW but needs to support fmake for MFC. -_CFLAGS_INCLUDES= ${CFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} -_CXXFLAGS_INCLUDES= ${CXXFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} - -# Different types of sources are compiled with slightly different flags. -# Split up the sources, and filter out headers and non-applicable flags. -MKDEP_CFLAGS= ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} \ - ${CFLAGS:M-ansi} ${_CFLAGS_INCLUDES} -MKDEP_CXXFLAGS= ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} \ - ${CXXFLAGS:M-std=*} ${CXXFLAGS:M-ansi} ${CXXFLAGS:M-stdlib=*} \ - ${_CXXFLAGS_INCLUDES} -.endif # ${MK_FAST_DEPEND} == "no" - DPSRCS+= ${SRCS} -# FAST_DEPEND will only generate a .depend if _EXTRADEPEND is used but -# the target is created to allow 'make depend' to generate files. +# A .depend file will only be generated if there are commands in +# beforedepend/_EXTRADEPEND/afterdepend. The target is kept +# to allow 'make depend' to generate files. ${DEPENDFILE}: ${DPSRCS} .if exists(${.OBJDIR}/${DEPENDFILE}) rm -f ${DEPENDFILE} .endif -.if ${MK_FAST_DEPEND} == "no" -.if !empty(DPSRCS:M*.[cS]) - ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ - ${MKDEP_CFLAGS} ${.ALLSRC:M*.[cS]} -.endif -.if !empty(DPSRCS:M*.cc) || !empty(DPSRCS:M*.C) || !empty(DPSRCS:M*.cpp) || \ - !empty(DPSRCS:M*.cxx) - ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ - ${MKDEP_CXXFLAGS} \ - ${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cpp} ${.ALLSRC:M*.cxx} -.else -.endif -.endif # ${MK_FAST_DEPEND} == "no" .if target(_EXTRADEPEND) _EXTRADEPEND: .USE ${DEPENDFILE}: _EXTRADEPEND Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed Mar 30 22:26:14 2016 (r297433) +++ head/share/mk/bsd.lib.mk Wed Mar 30 23:50:23 2016 (r297434) @@ -289,12 +289,6 @@ all: all-man .endif _EXTRADEPEND: -.if ${MK_FAST_DEPEND} == "no" - @TMP=_depend$$$$; \ - sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.So:/' < ${DEPENDFILE} \ - > $$TMP; \ - mv $$TMP ${DEPENDFILE} -.endif .if !defined(NO_EXTRADEPEND) && defined(SHLIB_NAME) .if defined(DPADD) && !empty(DPADD) echo ${SHLIB_NAME_FULL}: ${DPADD} >> ${DEPENDFILE} @@ -414,23 +408,6 @@ OBJS_DEPEND_GUESS.${_S:R}.So= ${_S} .endif .include - -.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) -.if defined(LIB) && !empty(LIB) -${OBJS} ${STATICOBJS} ${POBJS}: ${OBJS_DEPEND_GUESS} -.for _S in ${SRCS:N*.[hly]} -${_S:R}.po: ${OBJS_DEPEND_GUESS.${_S:R}.po} -.endfor -.endif -.if defined(SHLIB_NAME) || \ - defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) -${SOBJS}: ${OBJS_DEPEND_GUESS} -.for _S in ${SRCS:N*.[hly]} -${_S:R}.So: ${OBJS_DEPEND_GUESS.${_S:R}.So} -.endfor -.endif -.endif - .include .include .include Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Wed Mar 30 22:26:14 2016 (r297433) +++ head/share/mk/bsd.opts.mk Wed Mar 30 23:50:23 2016 (r297434) @@ -52,7 +52,6 @@ __DEFAULT_YES_OPTIONS = \ ASSERT_DEBUG \ DEBUG_FILES \ DOCCOMPRESS \ - FAST_DEPEND \ INCLUDES \ INSTALLLIB \ KERBEROS \ @@ -79,12 +78,6 @@ __DEFAULT_DEPENDENT_OPTIONS = \ STAGING_PROG/STAGING \ -# Enable FAST_DEPEND by default for the meta build. -.if !empty(.MAKE.MODE:Mmeta) -__DEFAULT_YES_OPTIONS+= FAST_DEPEND -__DEFAULT_NO_OPTIONS:= ${__DEFAULT_NO_OPTIONS:NFAST_DEPEND} -.endif - .include # Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed Mar 30 22:26:14 2016 (r297433) +++ head/share/mk/bsd.prog.mk Wed Mar 30 23:50:23 2016 (r297434) @@ -283,13 +283,6 @@ OBJS_DEPEND_GUESS+= ${SRCS:M*.h} .endif .include - -.if defined(PROG) -.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) -${OBJS}: ${OBJS_DEPEND_GUESS} -.endif -.endif - .include .include .include Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Wed Mar 30 22:26:14 2016 (r297433) +++ head/share/mk/local.meta.sys.mk Wed Mar 30 23:50:23 2016 (r297434) @@ -6,7 +6,6 @@ # we need this until there is an alternative MK_INSTALL_AS_USER= yes -MK_FAST_DEPEND= yes _default_makeobjdir=$${.CURDIR:S,^$${SRCTOP},$${OBJTOP},} Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Wed Mar 30 22:26:14 2016 (r297433) +++ head/sys/conf/kern.opts.mk Wed Mar 30 23:50:23 2016 (r297434) @@ -30,7 +30,6 @@ __DEFAULT_YES_OPTIONS = \ CDDL \ CRYPT \ CUSE \ - FAST_DEPEND \ FORMAT_EXTENSIONS \ INET \ INET6 \ @@ -49,12 +48,6 @@ __DEFAULT_NO_OPTIONS = \ NAND \ OFED -# Enable FAST_DEPEND by default for the meta build. -.if !empty(.MAKE.MODE:Unormal:Mmeta) -__DEFAULT_YES_OPTIONS+= FAST_DEPEND -__DEFAULT_NO_OPTIONS:= ${__DEFAULT_NO_OPTIONS:NFAST_DEPEND} -.endif - # Some options are totally broken on some architectures. We disable # them. If you need to enable them on an experimental basis, you # must change this code. Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Mar 30 22:26:14 2016 (r297433) +++ head/sys/conf/kern.post.mk Wed Mar 30 23:50:23 2016 (r297434) @@ -145,10 +145,6 @@ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o OBJS_DEPEND_GUESS+= assym.s vnode_if.h ${BEFORE_DEPEND:M*.h} \ ${MFILES:T:S/.m$/.h/} -.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/.depend) -${SYSTEM_OBJS}: ${OBJS_DEPEND_GUESS} -.endif - LNFILES= ${CFILES:T:S/.c$/.ln/} .for mfile in ${MFILES} @@ -189,23 +185,6 @@ genassym.o: $S/$M/$M/genassym.c ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h -# Normal files first -CFILES_NORMAL= ${CFILES:N*/cddl/*:N*fs/nfsclient/nfs_clkdtrace*:N*/compat/linuxkpi/common/*:N*/ofed/*:N*/dev/mlx5/*} -SFILES_NORMAL= ${SFILES:N*/cddl/*} - -# We have "special" -I include paths for zfs/dtrace files in 'depend'. -CFILES_CDDL= ${CFILES:M*/cddl/*} -SFILES_CDDL= ${SFILES:M*/cddl/*} - -# We have "special" -I include paths for LinuxKPI. -CFILES_LINUXKPI=${CFILES:M*/compat/linuxkpi/common/*} - -# We have "special" -I include paths for OFED. -CFILES_OFED=${CFILES:M*/ofed/*} - -# We have "special" -I include paths for MLX5. -CFILES_MLX5=${CFILES:M*/dev/mlx5/*} - # Skip reading .depend when not needed to speed up tree-walks # and simple lookups. .if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \ @@ -216,9 +195,6 @@ _SKIP_READ_DEPEND= 1 .endif kernel-depend: .depend -# The argument list can be very long, so use make -V and xargs to -# pass it to mkdep. -_MKDEPCC:= ${CC:N${CCACHE_BIN}} SRCS= assym.s vnode_if.h ${BEFORE_DEPEND} ${CFILES} \ ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \ ${MFILES:T:S/.m$/.h/} @@ -228,7 +204,6 @@ DEPENDFILES= .depend .depend.* .if !empty(.MAKE.MODE:Unormal:Mmeta) && empty(.MAKE.MODE:Unormal:Mnofilemon) _meta_filemon= 1 .endif -.if ${MK_FAST_DEPEND} == "yes" DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/.depend./} .if ${MAKE_VERSION} < 20160220 @@ -261,12 +236,10 @@ CFLAGS+= ${DEPEND_CFLAGS} # all dependencies are correctly added or accounted for. This is mostly to # ensure downstream uses of kernel-depend are handled. beforebuild: kernel-depend -.endif # ${MK_FAST_DEPEND} == "yes" # Guess some dependencies for when no ${DEPENDFILE}.OBJ is generated yet. # For meta+filemon the .meta file is checked for since it is the dependency # file used. -.if ${MK_FAST_DEPEND} == "yes" .for __obj in ${DEPENDOBJS:O:u} .if (defined(_meta_filemon) && !exists(${.OBJDIR}/${__obj}.meta)) || \ (!defined(_meta_filemon) && !exists(${.OBJDIR}/.depend.${__obj})) @@ -276,32 +249,10 @@ ${__obj}: ${OBJS_DEPEND_GUESS} ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .endif .endfor -.endif .NOPATH: .depend ${DEPENDFILES_OBJS} .depend: .PRECIOUS ${SRCS} -.if ${MK_FAST_DEPEND} == "no" - rm -f ${.TARGET}.tmp -# C files - ${MAKE} -V CFILES_NORMAL -V SYSTEM_CFILES -V GEN_CFILES | \ - CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${CFLAGS} - ${MAKE} -V CFILES_CDDL | \ - CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_CFLAGS} \ - ${FBT_CFLAGS} ${DTRACE_CFLAGS} - ${MAKE} -V CFILES_LINUXKPI | \ - CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp \ - ${CFLAGS} ${LINUXKPI_INCLUDES} - ${MAKE} -V CFILES_OFED -V CFILES_MLX5 | \ - CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp \ - ${CFLAGS} ${OFEDINCLUDES} -# Assembly files - ${MAKE} -V SFILES_NORMAL | \ - CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ASM_CFLAGS} - ${MAKE} -V SFILES_CDDL | \ - CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_ASM_CFLAGS} - mv ${.TARGET}.tmp ${.TARGET} -.endif _ILINKS= machine .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Wed Mar 30 22:26:14 2016 (r297433) +++ head/sys/conf/kern.pre.mk Wed Mar 30 23:50:23 2016 (r297434) @@ -64,29 +64,6 @@ NOSTDINC= -nostdinc INCLUDES= ${NOSTDINC} ${INCLMAGIC} -I. -I$S -.if ${MK_FAST_DEPEND} == "no" && (make(depend) || make(kernel-depend)) - -# This hack lets us use the ipfilter code without spamming a new -# include path into contrib'ed source files. -INCLUDES+= -I$S/contrib/ipfilter - -# ... and the same for ath -INCLUDES+= -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal - -# ... and the same for the NgATM stuff -INCLUDES+= -I$S/contrib/ngatm - -# ... and the same for vchiq -INCLUDES+= -I$S/contrib/vchiq - -# ... and the same for twa -INCLUDES+= -I$S/dev/twa - -# ... and the same for cxgb and cxgbe -INCLUDES+= -I$S/dev/cxgb -I$S/dev/cxgbe - -.endif - CFLAGS= ${COPTFLAGS} ${DEBUG} CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100 Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed Mar 30 22:26:14 2016 (r297433) +++ head/sys/conf/kmod.mk Wed Mar 30 23:50:23 2016 (r297434) @@ -458,11 +458,6 @@ cleanilinks: OBJS_DEPEND_GUESS+= ${SRCS:M*.h} .include - -.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) -${OBJS}: ${OBJS_DEPEND_GUESS} -.endif - .include .include .include "kern.mk" Modified: head/sys/modules/pflog/Makefile ============================================================================== --- head/sys/modules/pflog/Makefile Wed Mar 30 22:26:14 2016 (r297433) +++ head/sys/modules/pflog/Makefile Wed Mar 30 23:50:23 2016 (r297434) @@ -7,14 +7,11 @@ SRCS= if_pflog.c \ opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h SRCS+= bus_if.h device_if.h -.if defined(KERNBUILDDIR) -MKDEP+= -include ${KERNBUILDDIR}/opt_global.h -.else +.if !defined(KERNBUILDDIR) .if defined(VIMAGE) opt_global.h: echo "#define VIMAGE 1" >> ${.TARGET} CFLAGS+= -include opt_global.h -MKDEP+= -include opt_global.h .endif .endif Modified: head/sys/modules/pfsync/Makefile ============================================================================== --- head/sys/modules/pfsync/Makefile Wed Mar 30 22:26:14 2016 (r297433) +++ head/sys/modules/pfsync/Makefile Wed Mar 30 23:50:23 2016 (r297434) @@ -7,14 +7,11 @@ SRCS= if_pfsync.c \ opt_pf.h opt_inet.h opt_inet6.h SRCS+= bus_if.h device_if.h -.if defined(KERNBUILDDIR) -MKDEP+= -include ${KERNBUILDDIR}/opt_global.h -.else +.if !defined(KERNBUILDDIR) .if defined(VIMAGE) opt_global.h: echo "#define VIMAGE 1" >> ${.TARGET} CFLAGS+= -include opt_global.h -MKDEP+= -include opt_global.h .endif .endif Modified: head/sys/modules/wtap/Makefile ============================================================================== --- head/sys/modules/wtap/Makefile Wed Mar 30 22:26:14 2016 (r297433) +++ head/sys/modules/wtap/Makefile Wed Mar 30 23:50:23 2016 (r297434) @@ -16,11 +16,8 @@ SRCS += visibility.c SRCS += opt_global.h -.if defined(KERNBUILDDIR) -MKDEP= -include ${KERNBUILDDIR}/opt_global.h -.else +.if !defined(KERNBUILDDIR) CFLAGS+= -include opt_global.h -MKDEP= -include opt_global.h opt_global.h: echo "#define VIMAGE 1" > ${.TARGET} Modified: head/tools/tinder.sh ============================================================================== --- head/tools/tinder.sh Wed Mar 30 22:26:14 2016 (r297433) +++ head/tools/tinder.sh Wed Mar 30 23:50:23 2016 (r297434) @@ -58,4 +58,4 @@ for i in "$@"; do ;; esac done -make tinderbox UNIVERSE_TARGET="_cleanobj _obj _depend everything" $MAKE_ARGS SUBDIR_OVERRIDE="$SUBDIR" +make tinderbox UNIVERSE_TARGET="_cleanobj _obj everything" $MAKE_ARGS SUBDIR_OVERRIDE="$SUBDIR" Modified: head/usr.sbin/ndiscvt/ndisgen.sh ============================================================================== --- head/usr.sbin/ndiscvt/ndisgen.sh Wed Mar 30 22:26:14 2016 (r297433) +++ head/usr.sbin/ndiscvt/ndisgen.sh Wed Mar 30 23:50:23 2016 (r297434) @@ -432,11 +432,6 @@ fi echo -n " Building kernel module... " echo "" > bus_if.h echo "" > device_if.h -if ! ${MAKE} -f ${MAKEFILE} depend > /dev/null; then - echo "build failed. Exiting." - echo "" - exit -fi if ! ${MAKE} -f ${MAKEFILE} all > /dev/null; then echo "build failed. Exiting." echo "" From owner-svn-src-head@freebsd.org Wed Mar 30 23:53:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42B02AE308E; Wed, 30 Mar 2016 23:53:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 150A61707; Wed, 30 Mar 2016 23:53:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UNrCwu051706; Wed, 30 Mar 2016 23:53:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UNrCVe051705; Wed, 30 Mar 2016 23:53:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603302353.u2UNrCVe051705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 30 Mar 2016 23:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297436 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 23:53:13 -0000 Author: bdrewery Date: Wed Mar 30 23:53:12 2016 New Revision: 297436 URL: https://svnweb.freebsd.org/changeset/base/297436 Log: Remove FAST_DEPEND reference missed in r297434. Modified: head/tools/build/options/WITH_CCACHE_BUILD Modified: head/tools/build/options/WITH_CCACHE_BUILD ============================================================================== --- head/tools/build/options/WITH_CCACHE_BUILD Wed Mar 30 23:50:29 2016 (r297435) +++ head/tools/build/options/WITH_CCACHE_BUILD Wed Mar 30 23:53:12 2016 (r297436) @@ -24,9 +24,6 @@ when using an external compiler. The .Sy CCACHE_CPP2 option is used for Clang but not GCC. -ccache works best when combined with the -.Sy WITH_FAST_DEPEND -option. .Pp Sharing a cache between multiple work directories requires using a layout similar to From owner-svn-src-head@freebsd.org Wed Mar 30 23:56:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 443BAAE320C; Wed, 30 Mar 2016 23:56:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0B321A7C; Wed, 30 Mar 2016 23:56:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2UNuiDU051873; Wed, 30 Mar 2016 23:56:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2UNuiGR051872; Wed, 30 Mar 2016 23:56:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603302356.u2UNuiGR051872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 30 Mar 2016 23:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297437 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 23:56:45 -0000 Author: bdrewery Date: Wed Mar 30 23:56:43 2016 New Revision: 297437 URL: https://svnweb.freebsd.org/changeset/base/297437 Log: Regenerate Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Mar 30 23:53:12 2016 (r297436) +++ head/share/man/man5/src.conf.5 Wed Mar 30 23:56:43 2016 (r297437) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd March 11, 2016 +.Dd March 30, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -248,7 +248,7 @@ Set to not build Capsicum support into s .\" from FreeBSD: head/tools/build/options/WITHOUT_CASPER 258838 2013-12-02 08:21:28Z pjd Set to not build Casper program and related libraries. .It Va WITH_CCACHE_BUILD -.\" from FreeBSD: head/tools/build/options/WITH_CCACHE_BUILD 290526 2015-11-08 00:50:18Z bdrewery +.\" from FreeBSD: head/tools/build/options/WITH_CCACHE_BUILD 297436 2016-03-30 23:53:12Z bdrewery Set to use .Xr ccache 1 for the build. @@ -274,9 +274,6 @@ when using an external compiler. The .Sy CCACHE_CPP2 option is used for Clang but not GCC. -ccache works best when combined with the -.Sy WITH_FAST_DEPEND -option. .Pp Sharing a cache between multiple work directories requires using a layout similar to @@ -517,8 +514,6 @@ When set, it also enforces the following .Pp .Bl -item -compact .It -.Va WITH_FAST_DEPEND -.It .Va WITH_INSTALL_AS_USER .El .Pp @@ -618,12 +613,6 @@ An alternate bootstrap tool chain must b .\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru Set to avoid installing examples to .Pa /usr/share/examples/ . -.It Va WITHOUT_FAST_DEPEND -.\" from FreeBSD: head/tools/build/options/WITHOUT_FAST_DEPEND 296669 2016-03-11 17:00:42Z bdrewery -Set to use the historical -.Xr mkdep 1 -for the "make depend" phase of the build. -This option is deprecated and will be removed soon. .It Va WITHOUT_FDT .\" from FreeBSD: head/tools/build/options/WITHOUT_FDT 221539 2011-05-06 19:10:27Z ru Set to not build Flattened Device Tree support as part of the base system. @@ -1459,6 +1448,8 @@ When set, it also enforces the following .Va WITHOUT_GDB .It .Va WITHOUT_INCLUDES +.It +.Va WITHOUT_LLDB .El .It Va WITHOUT_UNBOUND .\" from FreeBSD: head/tools/build/options/WITHOUT_UNBOUND 255597 2013-09-15 14:51:23Z des From owner-svn-src-head@freebsd.org Thu Mar 31 00:26:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD285AE3B2F; Thu, 31 Mar 2016 00:26:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81D811601; Thu, 31 Mar 2016 00:26:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2V0QeVq060824; Thu, 31 Mar 2016 00:26:40 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2V0Qe3N060823; Thu, 31 Mar 2016 00:26:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603310026.u2V0Qe3N060823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 31 Mar 2016 00:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297438 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 00:26:41 -0000 Author: bdrewery Date: Thu Mar 31 00:26:40 2016 New Revision: 297438 URL: https://svnweb.freebsd.org/changeset/base/297438 Log: DIRDEPS_BUILD: Don't reset OBJROOT in sub-makes. MAKEOBJDIRPREFIX is set to blank and exported from MAKELEVEL0 along with OBJROOT exported. In sub-makes OBJROOT is recalculated with an empty MAKEOBJDIRPREFIX though. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.meta.sys.mk Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Wed Mar 30 23:56:43 2016 (r297437) +++ head/share/mk/local.meta.sys.mk Thu Mar 31 00:26:40 2016 (r297438) @@ -10,7 +10,7 @@ MK_INSTALL_AS_USER= yes _default_makeobjdir=$${.CURDIR:S,^$${SRCTOP},$${OBJTOP},} .if empty(OBJROOT) || ${.MAKE.LEVEL} == 0 -.if defined(MAKEOBJDIRPREFIX) +.if defined(MAKEOBJDIRPREFIX) && !empty(MAKEOBJDIRPREFIX) # put things approximately where they want OBJROOT:=${MAKEOBJDIRPREFIX}${SRCTOP}/ MAKEOBJDIRPREFIX= From owner-svn-src-head@freebsd.org Thu Mar 31 00:53:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41E74AE106D; Thu, 31 Mar 2016 00:53:25 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1384011FD; Thu, 31 Mar 2016 00:53:25 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2V0rORe069599; Thu, 31 Mar 2016 00:53:24 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2V0rO0F069597; Thu, 31 Mar 2016 00:53:24 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201603310053.u2V0rO0F069597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 31 Mar 2016 00:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297439 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 00:53:25 -0000 Author: gnn Date: Thu Mar 31 00:53:23 2016 New Revision: 297439 URL: https://svnweb.freebsd.org/changeset/base/297439 Log: Unbreak the RSS/PCBGROUp build. Modified: head/sys/netinet/in_pcbgroup.c head/sys/netinet6/in6_pcbgroup.c Modified: head/sys/netinet/in_pcbgroup.c ============================================================================== --- head/sys/netinet/in_pcbgroup.c Thu Mar 31 00:26:40 2016 (r297438) +++ head/sys/netinet/in_pcbgroup.c Thu Mar 31 00:53:23 2016 (r297439) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/netinet6/in6_pcbgroup.c ============================================================================== --- head/sys/netinet6/in6_pcbgroup.c Thu Mar 31 00:26:40 2016 (r297438) +++ head/sys/netinet6/in6_pcbgroup.c Thu Mar 31 00:53:23 2016 (r297439) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include From owner-svn-src-head@freebsd.org Thu Mar 31 02:01:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50CD2AE24EF; Thu, 31 Mar 2016 02:01:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CBAB1C53; Thu, 31 Mar 2016 02:01:12 +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 u2V21BYm087631; Thu, 31 Mar 2016 02:01:11 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2V21Bue087630; Thu, 31 Mar 2016 02:01:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603310201.u2V21Bue087630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 31 Mar 2016 02:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297441 - head/sbin/restore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 02:01:12 -0000 Author: pfg Date: Thu Mar 31 02:01:11 2016 New Revision: 297441 URL: https://svnweb.freebsd.org/changeset/base/297441 Log: restore(8): fix use of uninitialized value. Prevent uninitialized use of scalar newvol when jumping to gethdr. CID: 1006491 Modified: head/sbin/restore/tape.c Modified: head/sbin/restore/tape.c ============================================================================== --- head/sbin/restore/tape.c Thu Mar 31 01:36:50 2016 (r297440) +++ head/sbin/restore/tape.c Thu Mar 31 02:01:11 2016 (r297441) @@ -340,6 +340,7 @@ getvol(long nextvol) } if (volno == 1) return; + newvol = 0; goto gethdr; } again: From owner-svn-src-head@freebsd.org Thu Mar 31 03:04:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C75AAAE373B; Thu, 31 Mar 2016 03:04:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9944F1A1F; Thu, 31 Mar 2016 03:04:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2V34QSH008902; Thu, 31 Mar 2016 03:04:26 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2V34QSU008901; Thu, 31 Mar 2016 03:04:26 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603310304.u2V34QSU008901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 31 Mar 2016 03:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297442 - head/targets/pseudo/hosttools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 03:04:27 -0000 Author: bdrewery Date: Thu Mar 31 03:04:26 2016 New Revision: 297442 URL: https://svnweb.freebsd.org/changeset/base/297442 Log: hosttools: Trim unneeded directories. These should only be build tools that are in various Makefile.depend as host dependencies. Anything toolchain related is handled by toolchain and bootstrap-tools currently. Sponsored by: EMC / Isilon Storage Division Modified: head/targets/pseudo/hosttools/Makefile.depend.host Modified: head/targets/pseudo/hosttools/Makefile.depend.host ============================================================================== --- head/targets/pseudo/hosttools/Makefile.depend.host Thu Mar 31 02:01:11 2016 (r297441) +++ head/targets/pseudo/hosttools/Makefile.depend.host Thu Mar 31 03:04:26 2016 (r297442) @@ -9,21 +9,14 @@ # These are all .host dependencies DIRDEPS = \ - lib/clang/include \ - lib/libc++ \ - lib/libcxxrt \ - share/doc/llvm/clang \ usr.bin/clang/clang-tblgen \ - usr.bin/clang/clang \ usr.bin/clang/llvm-tblgen \ - usr.bin/lex/lib \ usr.bin/localedef \ usr.bin/mkcsmapper_static \ usr.bin/mkesdb_static \ - usr.bin/mkuzip \ - usr.bin/yacc \ usr.bin/xinstall \ usr.bin/xlint/xlint \ + usr.bin/yacc \ usr.sbin/config \ .if ${MK_KERBEROS} != "no" From owner-svn-src-head@freebsd.org Thu Mar 31 04:57:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51EC1AE4429; Thu, 31 Mar 2016 04:57:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E70B1644; Thu, 31 Mar 2016 04:57:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2V4vdmE041344; Thu, 31 Mar 2016 04:57:39 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2V4vddK041341; Thu, 31 Mar 2016 04:57:39 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603310457.u2V4vddK041341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 31 Mar 2016 04:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297443 - in head/sys: dev/nctgpio modules modules/nctgpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 04:57:40 -0000 Author: adrian Date: Thu Mar 31 04:57:38 2016 New Revision: 297443 URL: https://svnweb.freebsd.org/changeset/base/297443 Log: Add support for the Nuvoton NCT5104D. Make it compile only for i386/amd64 for now as it's been tested there. It's quite possible it'll show up elsewhere and we can enable it for other architectures later. Tested: * PC Engines APU1C4 Submitted by: Daniel Wyatt Reviewed by: adrian, loos Differential Revision: https://reviews.freebsd.org/D5389 Added: head/sys/dev/nctgpio/ head/sys/dev/nctgpio/nctgpio.c (contents, props changed) head/sys/modules/nctgpio/ head/sys/modules/nctgpio/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Added: head/sys/dev/nctgpio/nctgpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nctgpio/nctgpio.c Thu Mar 31 04:57:38 2016 (r297443) @@ -0,0 +1,802 @@ +/*- + * Copyright (c) 2016 Daniel Wyatt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +/* + * Nuvoton GPIO driver. + * + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include + +#include "gpio_if.h" + +/* + * Global configuration registers (CR). + */ +#define NCT_CR_LDN 0x07 /* Logical Device Number */ +#define NCT_CR_CHIP_ID 0x20 /* Chip ID */ +#define NCT_CR_CHIP_ID_H 0x20 /* Chip ID (high byte) */ +#define NCT_CR_CHIP_ID_L 0x21 /* Chip ID (low byte) */ +#define NCT_CR_OPT_1 0x26 /* Global Options (1) */ + +/* Logical Device Numbers. */ +#define NCT_LDN_GPIO 0x07 +#define NCT_LDN_GPIO_CFG 0x08 +#define NCT_LDN_GPIO_MODE 0x0f + +/* Logical Device 7 */ +#define NCT_LD7_GPIO_ENABLE 0x30 +#define NCT_LD7_GPIO0_IOR 0xe0 +#define NCT_LD7_GPIO0_DAT 0xe1 +#define NCT_LD7_GPIO0_INV 0xe2 +#define NCT_LD7_GPIO0_DST 0xe3 +#define NCT_LD7_GPIO1_IOR 0xe4 +#define NCT_LD7_GPIO1_DAT 0xe5 +#define NCT_LD7_GPIO1_INV 0xe6 +#define NCT_LD7_GPIO1_DST 0xe7 + +/* Logical Device F */ +#define NCT_LDF_GPIO0_OUTCFG 0xe0 +#define NCT_LDF_GPIO1_OUTCFG 0xe1 + +#define NCT_EXTFUNC_ENTER 0x87 +#define NCT_EXTFUNC_EXIT 0xaa + +#define NCT_MAX_PIN 15 +#define NCT_IS_VALID_PIN(_p) ((_p) >= 0 && (_p) <= NCT_MAX_PIN) + +#define NCT_PIN_BIT(_p) (1 << ((_p) % 8)) + +#define NCT_GPIO_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ + GPIO_PIN_OPENDRAIN | GPIO_PIN_PUSHPULL | \ + GPIO_PIN_INVIN | GPIO_PIN_INVOUT) + +struct nct_softc { + device_t dev; + device_t busdev; + struct mtx mtx; + struct resource *portres; + int rid; + struct gpio_pin pins[NCT_MAX_PIN]; +}; + +#define GPIO_LOCK_INIT(_sc) mtx_init(&(_sc)->mtx, \ + device_get_nameunit(dev), NULL, MTX_DEF) +#define GPIO_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->mtx) +#define GPIO_LOCK(_sc) mtx_lock(&(_sc)->mtx) +#define GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) +#define GPIO_ASSERT_LOCKED(_sc) mtx_assert(&(_sc)->mtx, MA_OWNED) +#define GPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&(_sc)->mtx, MA_NOTOWNED) + +#define NCT_BARRIER_WRITE(_sc) \ + bus_barrier((_sc)->portres, 0, 2, BUS_SPACE_BARRIER_WRITE) + +#define NCT_BARRIER_READ_WRITE(_sc) \ + bus_barrier((_sc)->portres, 0, 2, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE) + +static void ext_cfg_enter(struct nct_softc *); +static void ext_cfg_exit(struct nct_softc *); + +/* + * Potential Extended Function Enable Register addresses. + * Same address as EFIR. + */ +uint8_t probe_addrs[] = {0x2e, 0x4e}; + +struct nuvoton_vendor_device_id { + uint16_t chip_id; + const char * descr; +} nct_devs[] = { + { + .chip_id = 0x1061, + .descr = "Nuvoton NCT5104D", + }, + { + .chip_id = 0xc452, + .descr = "Nuvoton NCT5104D (PC-Engines APU)", + }, +}; + +static void +write_cfg_reg_1(struct nct_softc *sc, uint8_t reg, uint8_t value) +{ + GPIO_ASSERT_LOCKED(sc); + bus_write_1(sc->portres, 0, reg); + NCT_BARRIER_WRITE(sc); + bus_write_1(sc->portres, 1, value); + NCT_BARRIER_WRITE(sc); +} + +static uint8_t +read_cfg_reg_1(struct nct_softc *sc, uint8_t reg) +{ + uint8_t value; + + GPIO_ASSERT_LOCKED(sc); + bus_write_1(sc->portres, 0, reg); + NCT_BARRIER_READ_WRITE(sc); + value = bus_read_1(sc->portres, 1); + NCT_BARRIER_READ_WRITE(sc); + + return (value); +} + +static uint16_t +read_cfg_reg_2(struct nct_softc *sc, uint8_t reg) +{ + uint16_t value; + + value = read_cfg_reg_1(sc, reg) << 8; + value |= read_cfg_reg_1(sc, reg + 1); + + return (value); +} + +/* + * Enable extended function mode. + * + */ +static void +ext_cfg_enter(struct nct_softc *sc) +{ + GPIO_ASSERT_LOCKED(sc); + bus_write_1(sc->portres, 0, NCT_EXTFUNC_ENTER); + NCT_BARRIER_WRITE(sc); + bus_write_1(sc->portres, 0, NCT_EXTFUNC_ENTER); + NCT_BARRIER_WRITE(sc); +} + +/* + * Disable extended function mode. + * + */ +static void +ext_cfg_exit(struct nct_softc *sc) +{ + GPIO_ASSERT_LOCKED(sc); + bus_write_1(sc->portres, 0, NCT_EXTFUNC_EXIT); + NCT_BARRIER_WRITE(sc); +} + +/* + * Select a Logical Device. + */ +static void +select_ldn(struct nct_softc *sc, uint8_t ldn) +{ + write_cfg_reg_1(sc, NCT_CR_LDN, ldn); +} + +/* + * Get the GPIO Input/Output register address + * for a pin. + */ +static uint8_t +nct_ior_addr(uint32_t pin_num) +{ + uint8_t addr; + + addr = NCT_LD7_GPIO0_IOR; + if (pin_num > 7) + addr = NCT_LD7_GPIO1_IOR; + + return (addr); +} + +/* + * Get the GPIO Data register address for a pin. + */ +static uint8_t +nct_dat_addr(uint32_t pin_num) +{ + uint8_t addr; + + addr = NCT_LD7_GPIO0_DAT; + if (pin_num > 7) + addr = NCT_LD7_GPIO1_DAT; + + return (addr); +} + +/* + * Get the GPIO Inversion register address + * for a pin. + */ +static uint8_t +nct_inv_addr(uint32_t pin_num) +{ + uint8_t addr; + + addr = NCT_LD7_GPIO0_INV; + if (pin_num > 7) + addr = NCT_LD7_GPIO1_INV; + + return (addr); +} + +/* + * Get the GPIO Output Configuration/Mode + * register address for a pin. + */ +static uint8_t +nct_outcfg_addr(uint32_t pin_num) +{ + uint8_t addr; + + addr = NCT_LDF_GPIO0_OUTCFG; + if (pin_num > 7) + addr = NCT_LDF_GPIO1_OUTCFG; + + return (addr); +} + +/* + * Set a pin to output mode. + */ +static void +nct_set_pin_is_output(struct nct_softc *sc, uint32_t pin_num) +{ + uint8_t reg; + uint8_t ior; + + reg = nct_ior_addr(pin_num); + select_ldn(sc, NCT_LDN_GPIO); + ior = read_cfg_reg_1(sc, reg); + ior &= ~(NCT_PIN_BIT(pin_num)); + write_cfg_reg_1(sc, reg, ior); +} + +/* + * Set a pin to input mode. + */ +static void +nct_set_pin_is_input(struct nct_softc *sc, uint32_t pin_num) +{ + uint8_t reg; + uint8_t ior; + + reg = nct_ior_addr(pin_num); + select_ldn(sc, NCT_LDN_GPIO); + ior = read_cfg_reg_1(sc, reg); + ior |= NCT_PIN_BIT(pin_num); + write_cfg_reg_1(sc, reg, ior); +} + +/* + * Check whether a pin is configured as an input. + */ +static bool +nct_pin_is_input(struct nct_softc *sc, uint32_t pin_num) +{ + uint8_t reg; + uint8_t ior; + + reg = nct_ior_addr(pin_num); + select_ldn(sc, NCT_LDN_GPIO); + ior = read_cfg_reg_1(sc, reg); + + return (ior & NCT_PIN_BIT(pin_num)); +} + +/* + * Write a value to an output pin. + */ +static void +nct_write_pin(struct nct_softc *sc, uint32_t pin_num, uint8_t data) +{ + uint8_t reg; + uint8_t value; + + reg = nct_dat_addr(pin_num); + select_ldn(sc, NCT_LDN_GPIO); + value = read_cfg_reg_1(sc, reg); + if (data) + value |= NCT_PIN_BIT(pin_num); + else + value &= ~(NCT_PIN_BIT(pin_num)); + + write_cfg_reg_1(sc, reg, value); +} + +static bool +nct_read_pin(struct nct_softc *sc, uint32_t pin_num) +{ + uint8_t reg; + + reg = nct_dat_addr(pin_num); + select_ldn(sc, NCT_LDN_GPIO); + + return (read_cfg_reg_1(sc, reg) & NCT_PIN_BIT(pin_num)); +} + +static void +nct_set_pin_is_inverted(struct nct_softc *sc, uint32_t pin_num) +{ + uint8_t reg; + uint8_t inv; + + reg = nct_inv_addr(pin_num); + select_ldn(sc, NCT_LDN_GPIO); + inv = read_cfg_reg_1(sc, reg); + inv |= (NCT_PIN_BIT(pin_num)); + write_cfg_reg_1(sc, reg, inv); +} + +static void +nct_set_pin_not_inverted(struct nct_softc *sc, uint32_t pin_num) +{ + uint8_t reg; + uint8_t inv; + + reg = nct_inv_addr(pin_num); + select_ldn(sc, NCT_LDN_GPIO); + inv = read_cfg_reg_1(sc, reg); + inv &= ~(NCT_PIN_BIT(pin_num)); + write_cfg_reg_1(sc, reg, inv); +} + +static bool +nct_pin_is_inverted(struct nct_softc *sc, uint32_t pin_num) +{ + uint8_t reg; + uint8_t inv; + + reg = nct_inv_addr(pin_num); + select_ldn(sc, NCT_LDN_GPIO); + inv = read_cfg_reg_1(sc, reg); + + return (inv & NCT_PIN_BIT(pin_num)); +} + +static void +nct_set_pin_opendrain(struct nct_softc *sc, uint32_t pin_num) +{ + uint8_t reg; + uint8_t outcfg; + + reg = nct_outcfg_addr(pin_num); + select_ldn(sc, NCT_LDN_GPIO_MODE); + outcfg = read_cfg_reg_1(sc, reg); + outcfg |= (NCT_PIN_BIT(pin_num)); + write_cfg_reg_1(sc, reg, outcfg); +} + +static void +nct_set_pin_pushpull(struct nct_softc *sc, uint32_t pin_num) +{ + uint8_t reg; + uint8_t outcfg; + + reg = nct_outcfg_addr(pin_num); + select_ldn(sc, NCT_LDN_GPIO_MODE); + outcfg = read_cfg_reg_1(sc, reg); + outcfg &= ~(NCT_PIN_BIT(pin_num)); + write_cfg_reg_1(sc, reg, outcfg); +} + +static bool +nct_pin_is_opendrain(struct nct_softc *sc, uint32_t pin_num) +{ + uint8_t reg; + uint8_t outcfg; + + reg = nct_outcfg_addr(pin_num); + select_ldn(sc, NCT_LDN_GPIO_MODE); + outcfg = read_cfg_reg_1(sc, reg); + + return (outcfg & NCT_PIN_BIT(pin_num)); +} + +static void +nct_identify(driver_t *driver, device_t parent) +{ + if (device_find_child(parent, driver->name, 0) != NULL) + return; + + BUS_ADD_CHILD(parent, 0, driver->name, 0); +} + +static int +nct_probe(device_t dev) +{ + int i, j; + int rc; + struct nct_softc *sc; + uint16_t chipid; + + /* Make sure we do not claim some ISA PNP device. */ + if (isa_get_logicalid(dev) != 0) + return (ENXIO); + + sc = device_get_softc(dev); + + for (i = 0; i < sizeof(probe_addrs) / sizeof(*probe_addrs); i++) { + sc->rid = 0; + sc->portres = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->rid, + probe_addrs[i], probe_addrs[i] + 1, 2, RF_ACTIVE); + if (sc->portres == NULL) + continue; + + GPIO_LOCK_INIT(sc); + + GPIO_ASSERT_UNLOCKED(sc); + GPIO_LOCK(sc); + ext_cfg_enter(sc); + chipid = read_cfg_reg_2(sc, NCT_CR_CHIP_ID); + ext_cfg_exit(sc); + GPIO_UNLOCK(sc); + + GPIO_LOCK_DESTROY(sc); + + bus_release_resource(dev, SYS_RES_IOPORT, sc->rid, sc->portres); + bus_delete_resource(dev, SYS_RES_IOPORT, sc->rid); + + for (j = 0; j < sizeof(nct_devs) / sizeof(*nct_devs); j++) { + if (chipid == nct_devs[j].chip_id) { + rc = bus_set_resource(dev, SYS_RES_IOPORT, 0, probe_addrs[i], 2); + if (rc != 0) { + device_printf(dev, "bus_set_resource failed for address 0x%02X\n", probe_addrs[i]); + continue; + } + device_set_desc(dev, nct_devs[j].descr); + return (BUS_PROBE_DEFAULT); + } + } + } + return (ENXIO); +} + +static int +nct_attach(device_t dev) +{ + struct nct_softc *sc; + int i; + + sc = device_get_softc(dev); + + sc->rid = 0; + sc->portres = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->rid, + 0ul, ~0ul, 2, RF_ACTIVE); + if (sc->portres == NULL) { + device_printf(dev, "cannot allocate ioport\n"); + return (ENXIO); + } + + GPIO_LOCK_INIT(sc); + + GPIO_ASSERT_UNLOCKED(sc); + GPIO_LOCK(sc); + ext_cfg_enter(sc); + select_ldn(sc, NCT_LDN_GPIO); + /* Enable gpio0 and gpio1. */ + write_cfg_reg_1(sc, NCT_LD7_GPIO_ENABLE, + read_cfg_reg_1(sc, NCT_LD7_GPIO_ENABLE) | 0x03); + + for (i = 0; i <= NCT_MAX_PIN; i++) { + struct gpio_pin *pin; + + pin = &sc->pins[i]; + pin->gp_pin = i; + pin->gp_caps = NCT_GPIO_CAPS; + pin->gp_flags = 0; + + snprintf(pin->gp_name, GPIOMAXNAME, "GPIO%02u", i); + pin->gp_name[GPIOMAXNAME - 1] = '\0'; + + if (nct_pin_is_input(sc, i)) + pin->gp_flags |= GPIO_PIN_INPUT; + else + pin->gp_flags |= GPIO_PIN_OUTPUT; + + if (nct_pin_is_opendrain(sc, i)) + pin->gp_flags |= GPIO_PIN_OPENDRAIN; + else + pin->gp_flags |= GPIO_PIN_PUSHPULL; + + if (nct_pin_is_inverted(sc, i)) + pin->gp_flags |= (GPIO_PIN_INVIN | GPIO_PIN_INVOUT); + } + GPIO_UNLOCK(sc); + + sc->busdev = gpiobus_attach_bus(dev); + if (sc->busdev == NULL) { + GPIO_ASSERT_UNLOCKED(sc); + GPIO_LOCK(sc); + ext_cfg_exit(sc); + GPIO_UNLOCK(sc); + bus_release_resource(dev, SYS_RES_IOPORT, sc->rid, sc->portres); + GPIO_LOCK_DESTROY(sc); + + return (ENXIO); + } + + return (0); +} + +static int +nct_detach(device_t dev) +{ + struct nct_softc *sc; + + sc = device_get_softc(dev); + gpiobus_detach_bus(dev); + + GPIO_ASSERT_UNLOCKED(sc); + GPIO_LOCK(sc); + ext_cfg_exit(sc); + GPIO_UNLOCK(sc); + + /* Cleanup resources. */ + bus_release_resource(dev, SYS_RES_IOPORT, sc->rid, sc->portres); + + GPIO_LOCK_DESTROY(sc); + + return (0); +} + +static device_t +nct_gpio_get_bus(device_t dev) +{ + struct nct_softc *sc; + + sc = device_get_softc(dev); + + return (sc->busdev); +} + +static int +nct_gpio_pin_max(device_t dev, int *npins) +{ + *npins = NCT_MAX_PIN; + + return (0); +} + +static int +nct_gpio_pin_set(device_t dev, uint32_t pin_num, uint32_t pin_value) +{ + struct nct_softc *sc; + + if (!NCT_IS_VALID_PIN(pin_num)) + return (EINVAL); + + sc = device_get_softc(dev); + GPIO_ASSERT_UNLOCKED(sc); + GPIO_LOCK(sc); + nct_write_pin(sc, pin_num, pin_value); + GPIO_UNLOCK(sc); + + return (0); +} + +static int +nct_gpio_pin_get(device_t dev, uint32_t pin_num, uint32_t *pin_value) +{ + struct nct_softc *sc; + + if (!NCT_IS_VALID_PIN(pin_num)) + return (EINVAL); + + sc = device_get_softc(dev); + GPIO_ASSERT_UNLOCKED(sc); + GPIO_LOCK(sc); + *pin_value = nct_read_pin(sc, pin_num); + GPIO_UNLOCK(sc); + + return (0); +} + +static int +nct_gpio_pin_toggle(device_t dev, uint32_t pin_num) +{ + struct nct_softc *sc; + + if (!NCT_IS_VALID_PIN(pin_num)) + return (EINVAL); + + sc = device_get_softc(dev); + GPIO_ASSERT_UNLOCKED(sc); + GPIO_LOCK(sc); + if (nct_read_pin(sc, pin_num)) + nct_write_pin(sc, pin_num, 0); + else + nct_write_pin(sc, pin_num, 1); + + GPIO_UNLOCK(sc); + + return (0); +} + +static int +nct_gpio_pin_getcaps(device_t dev, uint32_t pin_num, uint32_t *caps) +{ + struct nct_softc *sc; + + if (!NCT_IS_VALID_PIN(pin_num)) + return (EINVAL); + + sc = device_get_softc(dev); + GPIO_ASSERT_UNLOCKED(sc); + GPIO_LOCK(sc); + *caps = sc->pins[pin_num].gp_caps; + GPIO_UNLOCK(sc); + + return (0); +} + +static int +nct_gpio_pin_getflags(device_t dev, uint32_t pin_num, uint32_t *flags) +{ + struct nct_softc *sc; + + if (!NCT_IS_VALID_PIN(pin_num)) + return (EINVAL); + + sc = device_get_softc(dev); + GPIO_ASSERT_UNLOCKED(sc); + GPIO_LOCK(sc); + *flags = sc->pins[pin_num].gp_flags; + GPIO_UNLOCK(sc); + + return (0); +} + +static int +nct_gpio_pin_getname(device_t dev, uint32_t pin_num, char *name) +{ + struct nct_softc *sc; + + if (!NCT_IS_VALID_PIN(pin_num)) + return (EINVAL); + + sc = device_get_softc(dev); + GPIO_ASSERT_UNLOCKED(sc); + GPIO_LOCK(sc); + memcpy(name, sc->pins[pin_num].gp_name, GPIOMAXNAME); + GPIO_UNLOCK(sc); + + return (0); +} + +static int +nct_gpio_pin_setflags(device_t dev, uint32_t pin_num, uint32_t flags) +{ + struct nct_softc *sc; + struct gpio_pin *pin; + + if (!NCT_IS_VALID_PIN(pin_num)) + return (EINVAL); + + sc = device_get_softc(dev); + pin = &sc->pins[pin_num]; + if ((flags & pin->gp_caps) != flags) + return (EINVAL); + + GPIO_ASSERT_UNLOCKED(sc); + GPIO_LOCK(sc); + if (flags & (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)) { + if ((flags & (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)) == + (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)) { + GPIO_UNLOCK(sc); + return (EINVAL); + } + + if (flags & GPIO_PIN_INPUT) + nct_set_pin_is_input(sc, pin_num); + else + nct_set_pin_is_output(sc, pin_num); + } + + if (flags & (GPIO_PIN_OPENDRAIN | GPIO_PIN_PUSHPULL)) { + if (flags & GPIO_PIN_INPUT) { + GPIO_UNLOCK(sc); + return (EINVAL); + } + + if ((flags & (GPIO_PIN_OPENDRAIN | GPIO_PIN_PUSHPULL)) == + (GPIO_PIN_OPENDRAIN | GPIO_PIN_PUSHPULL)) { + GPIO_UNLOCK(sc); + return (EINVAL); + } + + if (flags & GPIO_PIN_OPENDRAIN) + nct_set_pin_opendrain(sc, pin_num); + else + nct_set_pin_pushpull(sc, pin_num); + } + + if (flags & (GPIO_PIN_INVIN | GPIO_PIN_INVOUT)) { + if ((flags & (GPIO_PIN_INVIN | GPIO_PIN_INVOUT)) != + (GPIO_PIN_INVIN | GPIO_PIN_INVOUT)) { + GPIO_UNLOCK(sc); + return (EINVAL); + } + + if (flags & GPIO_PIN_INVIN) + nct_set_pin_is_inverted(sc, pin_num); + else + nct_set_pin_not_inverted(sc, pin_num); + } + + pin->gp_flags = flags; + GPIO_UNLOCK(sc); + + return (0); +} + +static device_method_t nct_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, nct_identify), + DEVMETHOD(device_probe, nct_probe), + DEVMETHOD(device_attach, nct_attach), + DEVMETHOD(device_detach, nct_detach), + + /* GPIO */ + DEVMETHOD(gpio_get_bus, nct_gpio_get_bus), + DEVMETHOD(gpio_pin_max, nct_gpio_pin_max), + DEVMETHOD(gpio_pin_get, nct_gpio_pin_get), + DEVMETHOD(gpio_pin_set, nct_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, nct_gpio_pin_toggle), + DEVMETHOD(gpio_pin_getname, nct_gpio_pin_getname), + DEVMETHOD(gpio_pin_getcaps, nct_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_getflags, nct_gpio_pin_getflags), + DEVMETHOD(gpio_pin_setflags, nct_gpio_pin_setflags), + + DEVMETHOD_END +}; + +static driver_t nct_isa_driver = { + "gpio", + nct_methods, + sizeof(struct nct_softc) +}; + +static devclass_t nct_devclass; + +DRIVER_MODULE(nctgpio, isa, nct_isa_driver, nct_devclass, NULL, NULL); +MODULE_DEPEND(nctgpio, gpiobus, 1, 1, 1); Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Mar 31 03:04:26 2016 (r297442) +++ head/sys/modules/Makefile Thu Mar 31 04:57:38 2016 (r297443) @@ -250,6 +250,7 @@ SUBDIR= \ ${_nandfs} \ ${_nandsim} \ ${_ncr} \ + ${_nctgpio} \ ${_ncv} \ ${_ndis} \ netfpga10g \ @@ -558,6 +559,7 @@ _ixv= ixv _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux +_nctgpio= nctgpio _ndis= ndis _pccard= pccard .if ${MK_OFED} != "no" || defined(ALL_MODULES) Added: head/sys/modules/nctgpio/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/nctgpio/Makefile Thu Mar 31 04:57:38 2016 (r297443) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/nctgpio +KMOD= nctgpio +SRCS= nctgpio.c +SRCS+= device_if.h bus_if.h isa_if.h gpio_if.h opt_platform.h + +.include From owner-svn-src-head@freebsd.org Thu Mar 31 06:19:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD4D6AE23BA; Thu, 31 Mar 2016 06:19:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE4B319AE; Thu, 31 Mar 2016 06:19: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 u2V6JFKs065573; Thu, 31 Mar 2016 06:19:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2V6JFSk065572; Thu, 31 Mar 2016 06:19:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201603310619.u2V6JFSk065572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 31 Mar 2016 06:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297444 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 06:19:17 -0000 Author: hselasky Date: Thu Mar 31 06:19:15 2016 New Revision: 297444 URL: https://svnweb.freebsd.org/changeset/base/297444 Log: Fix bugs in currently unused bit searching loop. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Thu Mar 31 04:57:38 2016 (r297443) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Thu Mar 31 06:19:15 2016 (r297444) @@ -147,11 +147,11 @@ find_last_bit(unsigned long *addr, unsig if (mask) return (bit + __flsl(mask)); } - while (--pos) { + while (pos--) { addr--; bit -= BITS_PER_LONG; if (*addr) - return (bit + __flsl(mask)); + return (bit + __flsl(*addr)); } return (size); } From owner-svn-src-head@freebsd.org Thu Mar 31 08:18:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49838AE3EE9 for ; Thu, 31 Mar 2016 08:18:53 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lf0-x235.google.com (mail-lf0-x235.google.com [IPv6:2a00:1450:4010:c07::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF1371BBB for ; Thu, 31 Mar 2016 08:18:52 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lf0-x235.google.com with SMTP id k79so53967996lfb.2 for ; Thu, 31 Mar 2016 01:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9eLfngmNh181yFN33QfzOHX9SXj6u6pTIGZTuOxTCmw=; b=2JUo3RSrt34WhDLqVejqxENwFZNKUPK+j5PoGs4sveoVf3KBEumRtRJF5b3P6QDUIY bJ7X/JearHadY9j5kdRUTI/LCDUdOUA+LJKWty7eOxYNfjmmSLQPOiOcXz0uVJv1W9lh fYxWCudG+BtmkRovq4qEQoWY4/sGc3cULV3ylYUTguSpRJL2crGtTnxhq/ejezw0Uw4k YNakUXmCksXLPmCE/c2WZ+xOxRpREAzs3XrhDtoGSIgMjMp1V/4BqrOOC9oaRM78Q7wV oAHfC9C5dyCqnna/xhRlG7rqPvLE4W/Uk4dQ0xFeLZn9MHeuE0Ov517csOVjxqfpmz73 fAjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9eLfngmNh181yFN33QfzOHX9SXj6u6pTIGZTuOxTCmw=; b=E1PH04uB4r2BivJPsjTYkRx1PrSTQuNbz7Jp9LDHDxpg+4bc2gWPFdz2D8u9DS9zut q64gnlHZihjMgW44ewmUmDm2PoAfqJqDYDY45KlU228Cs7c6A+zI4eYyFvmx2kSVzkA4 3eCI9AQZ0ANDL0zqZZARb+ggovcXXvsIJ/md7C3jtpkQo5pmYw43/QjEpNrhiwHDX5Rr BBlwZCTYEgvdwD6sOjPqwpvRRjH7ApbFav1KKbWib+OLrlrbizSMc2az2Xq+8HIy5v8g Q/ilBwxKvXO/vgp5AiJpLFUoV8knSWvwFcLYOWLGoRHvjgBMhvqdQmVwlBcypT90AgQ0 NZpQ== X-Gm-Message-State: AD7BkJITyRtvBuaQEGNLZsjTgweQ8H2yYFpLQErnBoKFgYbaWlOLdfDYP6FtQwMd2bbxGyblJOeukKSe2q9GTg== X-Received: by 10.25.41.140 with SMTP id p134mr6245253lfp.15.1459412330941; Thu, 31 Mar 2016 01:18:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.77.202 with HTTP; Thu, 31 Mar 2016 01:18:31 -0700 (PDT) In-Reply-To: <56FC0B55.1040805@freebsd.org> References: <201603291519.u2TFJuXW051571@repo.freebsd.org> <56FBE3D6.9050205@freebsd.org> <56FC0B55.1040805@freebsd.org> From: Zbigniew Bodek Date: Thu, 31 Mar 2016 10:18:31 +0200 Message-ID: Subject: Re: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries To: Nathan Whitehorn Cc: Ed Maste , Zbigniew Bodek , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 08:18:53 -0000 Are you sure? I don't see an example of what you are writing about. Instead I can see several other examples such as: dev/usb/controller/ehci_fsl.c optional ehci mpc85xx | ehci qoriq_dpaa dev/iicbus/adm1030.c optional powermac windtunnel | adm1030 powermac etc. Why would they do that if they could simply type: ehci mpc85xx | qoriq_dpaa? Best regards zbb 2016-03-30 19:22 GMT+02:00 Nathan Whitehorn : > I think it should be pci aim | fdt, just like the previous line when the > files lived in sys/powerpc. To conf, that evaluates as pci && (aim || fdt). > -Nathan > > > On 03/30/16 08:55, Zbigniew Bodek wrote: > > > Thank you Nathan. Please check out new patch in the attachment. > > Best regards > zbb > > 2016-03-30 16:33 GMT+02:00 Nathan Whitehorn : > >> PowerPC (and SPARC) can have real OFW without FDT support. Adding FDT to >> LINT is the wrong solution: rather, it should switch on fdt | aim like the >> rest of the Open Firmware code. >> -Nathan >> >> >> On 03/30/16 01:54, Zbigniew Bodek wrote: >> >> Hello Ed, >> >> Please check out the attached patch. For powerpc we should compile-in >> ofwpci.c regardless of FDT option. >> However, it seems that LINT for powerpc does not have FDT. What do you >> thing about adding it (as can be seen in the attached patch)?. This would >> be done in a separate commit. >> >> Best regards >> zbb >> >> 2016-03-30 1:53 GMT+02:00 Ed Maste < >> emaste@freebsd.org>: >> >>> On 29 March 2016 at 15:19, Zbigniew Bodek < >>> zbb@freebsd.org> wrote: >>> > Author: zbb >>> > Date: Tue Mar 29 15:19:56 2016 >>> > New Revision: 297392 >>> > URL: https://svnweb.freebsd.org/changeset/base/297392 >>> > >>> > Log: >>> > Reduce OFW PCI code duplication - involves ARM, PPC and SPARC64 >>> >>> My 'make tinderbox' build is now failing (powerpc LINT) with: >>> >>> linking kernel >>> cpcht.o: In function `cpcht_attach': >>> cpcht.c:(.text+0x17dc): undefined reference to `ofw_pci_attach' >>> cpcht.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' >>> grackle.o: In function `grackle_attach': >>> grackle.c:(.text+0x2dc): undefined reference to `ofw_pci_attach' >>> grackle.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' >>> uninorthpci.o: In function `uninorth_attach': >>> uninorthpci.c:(.text+0x68c): undefined reference to `ofw_pci_attach' >>> uninorthpci.o:(.data.rel+0x0): undefined reference to `ofw_pci_driver' >>> *** [kernel] Error code 1 >>> _______________________________________________ >>> svn-src-all@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/svn-src-all >>> To unsubscribe, send any mail to " >>> svn-src-all-unsubscribe@freebsd.org" >>> >> >> >> > > From owner-svn-src-head@freebsd.org Thu Mar 31 11:07:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1A0EAE4A19; Thu, 31 Mar 2016 11:07:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7751D98; Thu, 31 Mar 2016 11:07:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VB7OQn052562; Thu, 31 Mar 2016 11:07:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VB7OWn052556; Thu, 31 Mar 2016 11:07:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201603311107.u2VB7OWn052556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 31 Mar 2016 11:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297446 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 11:07:26 -0000 Author: andrew Date: Thu Mar 31 11:07:24 2016 New Revision: 297446 URL: https://svnweb.freebsd.org/changeset/base/297446 Log: Add support for 4 level pagetables. The userland address space has been increased to 256TiB. The kernel address space can also be increased to be the same size, but this will be performed in a later change. To help work with an extra level of page tables two new functions have been added, one to file the lowest level table entry, and one to find the block/page level. Both of these find the entry for a given pmap and virtual address. This has been tested with a combination of buildworld, stress2 tests, and by using sort to consume a large amount of memory by sorting /dev/zero. No new issues are known to be present from this change. Reviewed by: kib Obtained from: ABT Systems Ltd Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5720 Modified: head/sys/arm64/arm64/genassym.c head/sys/arm64/arm64/locore.S head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/minidump_machdep.c head/sys/arm64/arm64/pmap.c head/sys/arm64/arm64/swtch.S head/sys/arm64/arm64/vm_machdep.c head/sys/arm64/include/machdep.h head/sys/arm64/include/pcb.h head/sys/arm64/include/pmap.h head/sys/arm64/include/pte.h head/sys/arm64/include/vmparam.h Modified: head/sys/arm64/arm64/genassym.c ============================================================================== --- head/sys/arm64/arm64/genassym.c Thu Mar 31 09:55:21 2016 (r297445) +++ head/sys/arm64/arm64/genassym.c Thu Mar 31 11:07:24 2016 (r297446) @@ -52,7 +52,7 @@ ASSYM(PCB_SIZE, roundup2(sizeof(struct p ASSYM(PCB_SINGLE_STEP_SHIFT, PCB_SINGLE_STEP_SHIFT); ASSYM(PCB_REGS, offsetof(struct pcb, pcb_x)); ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp)); -ASSYM(PCB_L1ADDR, offsetof(struct pcb, pcb_l1addr)); +ASSYM(PCB_L0ADDR, offsetof(struct pcb, pcb_l0addr)); ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Thu Mar 31 09:55:21 2016 (r297445) +++ head/sys/arm64/arm64/locore.S Thu Mar 31 11:07:24 2016 (r297446) @@ -35,7 +35,7 @@ #include #include -#define VIRT_BITS 39 +#define VIRT_BITS 48 .globl kernbase .set kernbase, KERNBASE @@ -89,7 +89,8 @@ _start: /* * At this point: * x27 = TTBR0 table - * x26 = TTBR1 table + * x26 = Kernel L1 table + * x24 = TTBR1 table */ /* Enable the mmu */ @@ -100,16 +101,6 @@ _start: br x15 virtdone: - /* - * Now that we are in virtual address space, - * we don't need the identity mapping in TTBR0 and - * can set the TCR to a more useful value. - */ - ldr x2, tcr - mrs x3, id_aa64mmfr0_el1 - bfi x2, x3, #32, #3 - msr tcr_el1, x2 - /* Set up the stack */ adr x25, initstack_end mov sp, x25 @@ -128,6 +119,7 @@ virtdone: /* Make the page table base a virtual address */ sub x26, x26, x29 + sub x24, x24, x29 sub sp, sp, #(64 * 4) mov x0, sp @@ -139,6 +131,7 @@ virtdone: str x26, [x0, 8] /* kern_l1pt */ str x29, [x0, 16] /* kern_delta */ str x25, [x0, 24] /* kern_stack */ + str x24, [x0, 32] /* kern_l0pt */ /* trace back starts here */ mov fp, #0 @@ -175,7 +168,7 @@ ENTRY(mpentry) msr contextidr_el1, x1 /* Load the kernel page table */ - adr x26, pagetable_l1_ttbr1 + adr x24, pagetable_l0_ttbr1 /* Load the identity page table */ adr x27, pagetable_l0_ttbr0 @@ -187,16 +180,6 @@ ENTRY(mpentry) br x15 mp_virtdone: - /* - * Now that we are in virtual address space, - * we don't need the identity mapping in TTBR0 and - * can set the TCR to a more useful value. - */ - ldr x2, tcr - mrs x3, id_aa64mmfr0_el1 - bfi x2, x3, #32, #3 - msr tcr_el1, x2 - ldr x4, =secondary_stacks mov x5, #(PAGE_SIZE * KSTACK_PAGES) mul x5, x0, x5 @@ -388,11 +371,18 @@ create_pagetables: mov x6, x26 bl link_l1_pagetable + /* Move to the l0 table */ + add x24, x26, #PAGE_SIZE + + /* Link the l0 -> l1 table */ + mov x9, x6 + mov x6, x24 + bl link_l0_pagetable /* * Build the TTBR0 maps. */ - add x27, x26, #PAGE_SIZE + add x27, x24, #PAGE_SIZE mov x6, x27 /* The initial page table */ #if defined(SOCDEV_PA) && defined(SOCDEV_VA) @@ -440,7 +430,7 @@ link_l0_pagetable: */ /* Find the table index */ lsr x11, x8, #L0_SHIFT - and x11, x11, #Ln_ADDR_MASK + and x11, x11, #L0_ADDR_MASK /* Build the L0 block entry */ mov x12, #L0_TABLE @@ -582,7 +572,7 @@ start_mmu: /* Load ttbr0 and ttbr1 */ msr ttbr0_el1, x27 - msr ttbr1_el1, x26 + msr ttbr1_el1, x24 isb /* Clear the Monitor Debug System control register */ @@ -596,11 +586,8 @@ start_mmu: /* * Setup TCR according to PARange bits from ID_AA64MMFR0_EL1. - * Some machines have physical memory mapped >512GiB, which can not - * be identity-mapped using the default 39 VA bits. Thus, use - * 48 VA bits for now and switch back to 39 after the VA jump. */ - ldr x2, tcr_early + ldr x2, tcr mrs x3, id_aa64mmfr0_el1 bfi x2, x3, #32, #3 msr tcr_el1, x2 @@ -623,9 +610,6 @@ mair: tcr: .quad (TCR_TxSZ(64 - VIRT_BITS) | TCR_ASID_16 | TCR_TG1_4K | \ TCR_CACHE_ATTRS | TCR_SMP_ATTRS) -tcr_early: - .quad (TCR_T1SZ(64 - VIRT_BITS) | TCR_T0SZ(64 - 48) | \ - TCR_ASID_16 | TCR_TG1_4K | TCR_CACHE_ATTRS | TCR_SMP_ATTRS) sctlr_set: /* Bits to set */ .quad (SCTLR_UCI | SCTLR_nTWE | SCTLR_nTWI | SCTLR_UCT | SCTLR_DZE | \ @@ -651,6 +635,8 @@ pagetable: .space PAGE_SIZE pagetable_l1_ttbr1: .space PAGE_SIZE +pagetable_l0_ttbr1: + .space PAGE_SIZE pagetable_l1_ttbr0: .space PAGE_SIZE pagetable_l0_ttbr0: Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Thu Mar 31 09:55:21 2016 (r297445) +++ head/sys/arm64/arm64/machdep.c Thu Mar 31 11:07:24 2016 (r297446) @@ -896,8 +896,8 @@ initarm(struct arm64_bootparams *abp) cache_setup(); /* Bootstrap enough of pmap to enter the kernel proper */ - pmap_bootstrap(abp->kern_l1pt, KERNBASE - abp->kern_delta, - lastaddr - KERNBASE); + pmap_bootstrap(abp->kern_l0pt, abp->kern_l1pt, + KERNBASE - abp->kern_delta, lastaddr - KERNBASE); arm_devmap_bootstrap(0, NULL); Modified: head/sys/arm64/arm64/minidump_machdep.c ============================================================================== --- head/sys/arm64/arm64/minidump_machdep.c Thu Mar 31 09:55:21 2016 (r297445) +++ head/sys/arm64/arm64/minidump_machdep.c Thu Mar 31 11:07:24 2016 (r297446) @@ -218,7 +218,7 @@ blk_write(struct dumperinfo *di, char *p int minidumpsys(struct dumperinfo *di) { - pd_entry_t *l1, *l2; + pd_entry_t *l0, *l1, *l2; pt_entry_t *l3; uint32_t pmapsize; vm_offset_t va; @@ -236,7 +236,7 @@ minidumpsys(struct dumperinfo *di) pmapsize = 0; for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += L2_SIZE) { pmapsize += PAGE_SIZE; - if (!pmap_get_tables(pmap_kernel(), va, &l1, &l2, &l3)) + if (!pmap_get_tables(pmap_kernel(), va, &l0, &l1, &l2, &l3)) continue; /* We should always be using the l2 table for kvm */ @@ -335,7 +335,7 @@ minidumpsys(struct dumperinfo *di) /* Dump kernel page directory pages */ bzero(&tmpbuffer, sizeof(tmpbuffer)); for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += L2_SIZE) { - if (!pmap_get_tables(pmap_kernel(), va, &l1, &l2, &l3)) { + if (!pmap_get_tables(pmap_kernel(), va, &l0, &l1, &l2, &l3)) { /* We always write a page, even if it is zero */ error = blk_write(di, (char *)&tmpbuffer, 0, PAGE_SIZE); if (error) Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Mar 31 09:55:21 2016 (r297445) +++ head/sys/arm64/arm64/pmap.c Thu Mar 31 11:07:24 2016 (r297446) @@ -11,7 +11,7 @@ * All rights reserved. * Copyright (c) 2014 Andrew Turner * All rights reserved. - * Copyright (c) 2014 The FreeBSD Foundation + * Copyright (c) 2014-2016 The FreeBSD Foundation * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -142,9 +142,14 @@ __FBSDID("$FreeBSD$"); #include #include -#define NPDEPG (PAGE_SIZE/(sizeof (pd_entry_t))) -#define NUPDE (NPDEPG * NPDEPG) -#define NUSERPGTBLS (NUPDE + NPDEPG) +#define NL0PG (PAGE_SIZE/(sizeof (pd_entry_t))) +#define NL1PG (PAGE_SIZE/(sizeof (pd_entry_t))) +#define NL2PG (PAGE_SIZE/(sizeof (pd_entry_t))) +#define NL3PG (PAGE_SIZE/(sizeof (pt_entry_t))) + +#define NUL0E L0_ENTRIES +#define NUL1E (NUL0E * NL1PG) +#define NUL2E (NUL1E * NL2PG) #if !defined(DIAGNOSTIC) #ifdef __GNUC_GNU_INLINE__ @@ -273,15 +278,37 @@ pagezero(void *p) bzero(p, PAGE_SIZE); } +#define pmap_l0_index(va) (((va) >> L0_SHIFT) & L0_ADDR_MASK) #define pmap_l1_index(va) (((va) >> L1_SHIFT) & Ln_ADDR_MASK) #define pmap_l2_index(va) (((va) >> L2_SHIFT) & Ln_ADDR_MASK) #define pmap_l3_index(va) (((va) >> L3_SHIFT) & Ln_ADDR_MASK) static __inline pd_entry_t * +pmap_l0(pmap_t pmap, vm_offset_t va) +{ + + return (&pmap->pm_l0[pmap_l0_index(va)]); +} + +static __inline pd_entry_t * +pmap_l0_to_l1(pd_entry_t *l0, vm_offset_t va) +{ + pd_entry_t *l1; + + l1 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l0) & ~ATTR_MASK); + return (&l1[pmap_l1_index(va)]); +} + +static __inline pd_entry_t * pmap_l1(pmap_t pmap, vm_offset_t va) { + pd_entry_t *l0; + + l0 = pmap_l0(pmap, va); + if ((pmap_load(l0) & ATTR_DESCR_MASK) != L0_TABLE) + return (NULL); - return (&pmap->pm_l1[pmap_l1_index(va)]); + return (pmap_l0_to_l1(l0, va)); } static __inline pd_entry_t * @@ -314,28 +341,103 @@ pmap_l2_to_l3(pd_entry_t *l2, vm_offset_ return (&l3[pmap_l3_index(va)]); } +/* + * Returns the lowest valid pde for a given virtual address. + * The next level may or may not point to a valid page or block. + */ +static __inline pd_entry_t * +pmap_pde(pmap_t pmap, vm_offset_t va, int *level) +{ + pd_entry_t *l0, *l1, *l2, desc; + + l0 = pmap_l0(pmap, va); + desc = pmap_load(l0) & ATTR_DESCR_MASK; + if (desc != L0_TABLE) { + *level = -1; + return (NULL); + } + + l1 = pmap_l0_to_l1(l0, va); + desc = pmap_load(l1) & ATTR_DESCR_MASK; + if (desc != L1_TABLE) { + *level = 0; + return (l0); + } + + l2 = pmap_l1_to_l2(l1, va); + desc = pmap_load(l2) & ATTR_DESCR_MASK; + if (desc != L2_TABLE) { + *level = 1; + return (l1); + } + + *level = 2; + return (l2); +} + +/* + * Returns the lowest valid pte block or table entry for a given virtual + * address. If there are no valid entries return NULL and set the level to + * the first invalid level. + */ static __inline pt_entry_t * -pmap_l3(pmap_t pmap, vm_offset_t va) +pmap_pte(pmap_t pmap, vm_offset_t va, int *level) { - pd_entry_t *l2; + pd_entry_t *l1, *l2, desc; + pt_entry_t *l3; - l2 = pmap_l2(pmap, va); - if (l2 == NULL || (pmap_load(l2) & ATTR_DESCR_MASK) != L2_TABLE) + l1 = pmap_l1(pmap, va); + if (l1 == NULL) { + *level = 0; return (NULL); + } + desc = pmap_load(l1) & ATTR_DESCR_MASK; + if (desc == L1_BLOCK) { + *level = 1; + return (l1); + } - return (pmap_l2_to_l3(l2, va)); + if (desc != L1_TABLE) { + *level = 1; + return (NULL); + } + + l2 = pmap_l1_to_l2(l1, va); + desc = pmap_load(l2) & ATTR_DESCR_MASK; + if (desc == L2_BLOCK) { + *level = 2; + return (l2); + } + + if (desc != L2_TABLE) { + *level = 2; + return (NULL); + } + + *level = 3; + l3 = pmap_l2_to_l3(l2, va); + if ((pmap_load(l3) & ATTR_DESCR_MASK) != L3_PAGE) + return (NULL); + + return (l3); } bool -pmap_get_tables(pmap_t pmap, vm_offset_t va, pd_entry_t **l1, pd_entry_t **l2, - pt_entry_t **l3) +pmap_get_tables(pmap_t pmap, vm_offset_t va, pd_entry_t **l0, pd_entry_t **l1, + pd_entry_t **l2, pt_entry_t **l3) { - pd_entry_t *l1p, *l2p; + pd_entry_t *l0p, *l1p, *l2p; + + if (pmap->pm_l0 == NULL) + return (false); + + l0p = pmap_l0(pmap, va); + *l0 = l0p; - if (pmap->pm_l1 == NULL) + if ((pmap_load(l0p) & ATTR_DESCR_MASK) != L0_TABLE) return (false); - l1p = pmap_l1(pmap, va); + l1p = pmap_l0_to_l1(l0p, va); *l1 = l1p; if ((pmap_load(l1p) & ATTR_DESCR_MASK) == L1_BLOCK) { @@ -544,7 +646,8 @@ pmap_bootstrap_l3(vm_offset_t l1pt, vm_o * Bootstrap the system enough to run with virtual memory. */ void -pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) +pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_paddr_t kernstart, + vm_size_t kernlen) { u_int l1_slot, l2_slot, avail_slot, map_slot, used_map_slot; uint64_t kern_delta; @@ -562,7 +665,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_padd printf("%lx\n", (KERNBASE >> L1_SHIFT) & Ln_ADDR_MASK); /* Set this early so we can use the pagetable walking functions */ - kernel_pmap_store.pm_l1 = (pd_entry_t *)l1pt; + kernel_pmap_store.pm_l0 = (pd_entry_t *)l0pt; PMAP_LOCK_INIT(kernel_pmap); /* @@ -805,30 +908,40 @@ pmap_invalidate_all(pmap_t pmap) vm_paddr_t pmap_extract(pmap_t pmap, vm_offset_t va) { - pd_entry_t *l2p, l2; - pt_entry_t *l3p, l3; + pt_entry_t *pte, tpte; vm_paddr_t pa; + int lvl; pa = 0; PMAP_LOCK(pmap); /* - * Start with the l2 tabel. We are unable to allocate - * pages in the l1 table. + * Find the block or page map for this virtual address. pmap_pte + * will return either a valid block/page entry, or NULL. */ - l2p = pmap_l2(pmap, va); - if (l2p != NULL) { - l2 = pmap_load(l2p); - if ((l2 & ATTR_DESCR_MASK) == L2_TABLE) { - l3p = pmap_l2_to_l3(l2p, va); - if (l3p != NULL) { - l3 = pmap_load(l3p); - - if ((l3 & ATTR_DESCR_MASK) == L3_PAGE) - pa = (l3 & ~ATTR_MASK) | - (va & L3_OFFSET); - } - } else if ((l2 & ATTR_DESCR_MASK) == L2_BLOCK) - pa = (l2 & ~ATTR_MASK) | (va & L2_OFFSET); + pte = pmap_pte(pmap, va, &lvl); + if (pte != NULL) { + tpte = pmap_load(pte); + pa = tpte & ~ATTR_MASK; + switch(lvl) { + case 1: + KASSERT((tpte & ATTR_DESCR_MASK) == L1_BLOCK, + ("pmap_extract: Invalid L1 pte found: %lx", + tpte & ATTR_DESCR_MASK)); + pa |= (va & L1_OFFSET); + break; + case 2: + KASSERT((tpte & ATTR_DESCR_MASK) == L2_BLOCK, + ("pmap_extract: Invalid L2 pte found: %lx", + tpte & ATTR_DESCR_MASK)); + pa |= (va & L2_OFFSET); + break; + case 3: + KASSERT((tpte & ATTR_DESCR_MASK) == L3_PAGE, + ("pmap_extract: Invalid L3 pte found: %lx", + tpte & ATTR_DESCR_MASK)); + pa |= (va & L3_OFFSET); + break; + } } PMAP_UNLOCK(pmap); return (pa); @@ -844,21 +957,31 @@ pmap_extract(pmap_t pmap, vm_offset_t va vm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) { - pt_entry_t *l3p, l3; + pt_entry_t *pte, tpte; vm_paddr_t pa; vm_page_t m; + int lvl; pa = 0; m = NULL; PMAP_LOCK(pmap); retry: - l3p = pmap_l3(pmap, va); - if (l3p != NULL && (l3 = pmap_load(l3p)) != 0) { - if (((l3 & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) || + pte = pmap_pte(pmap, va, &lvl); + if (pte != NULL) { + tpte = pmap_load(pte); + + KASSERT(lvl > 0 && lvl <= 3, + ("pmap_extract_and_hold: Invalid level %d", lvl)); + CTASSERT(L1_BLOCK == L2_BLOCK); + KASSERT((lvl == 3 && (tpte & ATTR_DESCR_MASK) == L3_PAGE) || + (lvl < 3 && (tpte & ATTR_DESCR_MASK) == L1_BLOCK), + ("pmap_extract_and_hold: Invalid pte at L%d: %lx", lvl, + tpte & ATTR_DESCR_MASK)); + if (((tpte & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) || ((prot & VM_PROT_WRITE) == 0)) { - if (vm_page_pa_tryrelock(pmap, l3 & ~ATTR_MASK, &pa)) + if (vm_page_pa_tryrelock(pmap, tpte & ~ATTR_MASK, &pa)) goto retry; - m = PHYS_TO_VM_PAGE(l3 & ~ATTR_MASK); + m = PHYS_TO_VM_PAGE(tpte & ~ATTR_MASK); vm_page_hold(m); } } @@ -870,25 +993,39 @@ retry: vm_paddr_t pmap_kextract(vm_offset_t va) { - pd_entry_t *l2p, l2; - pt_entry_t *l3; + pt_entry_t *pte, tpte; vm_paddr_t pa; + int lvl; if (va >= DMAP_MIN_ADDRESS && va < DMAP_MAX_ADDRESS) { pa = DMAP_TO_PHYS(va); } else { - l2p = pmap_l2(kernel_pmap, va); - if (l2p == NULL) - panic("pmap_kextract: No l2"); - l2 = pmap_load(l2p); - if ((l2 & ATTR_DESCR_MASK) == L2_BLOCK) - return ((l2 & ~ATTR_MASK) | - (va & L2_OFFSET)); - - l3 = pmap_l2_to_l3(l2p, va); - if (l3 == NULL) - panic("pmap_kextract: No l3..."); - pa = (pmap_load(l3) & ~ATTR_MASK) | (va & PAGE_MASK); + pa = 0; + pte = pmap_pte(kernel_pmap, va, &lvl); + if (pte != NULL) { + tpte = pmap_load(pte); + pa = tpte & ~ATTR_MASK; + switch(lvl) { + case 1: + KASSERT((tpte & ATTR_DESCR_MASK) == L1_BLOCK, + ("pmap_kextract: Invalid L1 pte found: %lx", + tpte & ATTR_DESCR_MASK)); + pa |= (va & L1_OFFSET); + break; + case 2: + KASSERT((tpte & ATTR_DESCR_MASK) == L2_BLOCK, + ("pmap_kextract: Invalid L2 pte found: %lx", + tpte & ATTR_DESCR_MASK)); + pa |= (va & L2_OFFSET); + break; + case 3: + KASSERT((tpte & ATTR_DESCR_MASK) == L3_PAGE, + ("pmap_kextract: Invalid L3 pte found: %lx", + tpte & ATTR_DESCR_MASK)); + pa |= (va & L3_OFFSET); + break; + } + } } return (pa); } @@ -900,8 +1037,10 @@ pmap_kextract(vm_offset_t va) void pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm_paddr_t pa) { - pt_entry_t *l3; + pd_entry_t *pde; + pt_entry_t *pte; vm_offset_t va; + int lvl; KASSERT((pa & L3_OFFSET) == 0, ("pmap_kenter_device: Invalid physical address")); @@ -912,11 +1051,16 @@ pmap_kenter_device(vm_offset_t sva, vm_s va = sva; while (size != 0) { - l3 = pmap_l3(kernel_pmap, va); - KASSERT(l3 != NULL, ("Invalid page table, va: 0x%lx", va)); - pmap_load_store(l3, (pa & ~L3_OFFSET) | ATTR_DEFAULT | + pde = pmap_pde(kernel_pmap, va, &lvl); + KASSERT(pde != NULL, + ("pmap_kenter_device: Invalid page entry, va: 0x%lx", va)); + KASSERT(lvl == 2, + ("pmap_kenter_device: Invalid level %d", lvl)); + + pte = pmap_l2_to_l3(pde, va); + pmap_load_store(pte, (pa & ~L3_OFFSET) | ATTR_DEFAULT | ATTR_IDX(DEVICE_MEMORY) | L3_PAGE); - PTE_SYNC(l3); + PTE_SYNC(pte); va += PAGE_SIZE; pa += PAGE_SIZE; @@ -927,28 +1071,30 @@ pmap_kenter_device(vm_offset_t sva, vm_s /* * Remove a page from the kernel pagetables. - * Note: not SMP coherent. */ PMAP_INLINE void pmap_kremove(vm_offset_t va) { - pt_entry_t *l3; + pt_entry_t *pte; + int lvl; - l3 = pmap_l3(kernel_pmap, va); - KASSERT(l3 != NULL, ("pmap_kremove: Invalid address")); + pte = pmap_pte(kernel_pmap, va, &lvl); + KASSERT(pte != NULL, ("pmap_kremove: Invalid address")); + KASSERT(lvl == 3, ("pmap_kremove: Invalid pte level %d", lvl)); - if (pmap_l3_valid_cacheable(pmap_load(l3))) + if (pmap_l3_valid_cacheable(pmap_load(pte))) cpu_dcache_wb_range(va, L3_SIZE); - pmap_load_clear(l3); - PTE_SYNC(l3); + pmap_load_clear(pte); + PTE_SYNC(pte); pmap_invalidate_page(kernel_pmap, va); } void pmap_kremove_device(vm_offset_t sva, vm_size_t size) { - pt_entry_t *l3; + pt_entry_t *pte; vm_offset_t va; + int lvl; KASSERT((sva & L3_OFFSET) == 0, ("pmap_kremove_device: Invalid virtual address")); @@ -957,10 +1103,12 @@ pmap_kremove_device(vm_offset_t sva, vm_ va = sva; while (size != 0) { - l3 = pmap_l3(kernel_pmap, va); - KASSERT(l3 != NULL, ("Invalid page table, va: 0x%lx", va)); - pmap_load_clear(l3); - PTE_SYNC(l3); + pte = pmap_pte(kernel_pmap, va, &lvl); + KASSERT(pte != NULL, ("Invalid page table, va: 0x%lx", va)); + KASSERT(lvl == 3, + ("Invalid device pagetable level: %d != 3", lvl)); + pmap_load_clear(pte); + PTE_SYNC(pte); va += PAGE_SIZE; size -= PAGE_SIZE; @@ -999,19 +1147,26 @@ pmap_map(vm_offset_t *virt, vm_paddr_t s void pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) { - pt_entry_t *l3, pa; + pd_entry_t *pde; + pt_entry_t *pte, pa; vm_offset_t va; vm_page_t m; - int i; + int i, lvl; va = sva; for (i = 0; i < count; i++) { + pde = pmap_pde(kernel_pmap, va, &lvl); + KASSERT(pde != NULL, + ("pmap_qenter: Invalid page entry, va: 0x%lx", va)); + KASSERT(lvl == 2, + ("pmap_qenter: Invalid level %d", lvl)); + m = ma[i]; pa = VM_PAGE_TO_PHYS(m) | ATTR_DEFAULT | ATTR_AP(ATTR_AP_RW) | ATTR_IDX(m->md.pv_memattr) | L3_PAGE; - l3 = pmap_l3(kernel_pmap, va); - pmap_load_store(l3, pa); - PTE_SYNC(l3); + pte = pmap_l2_to_l3(pde, va); + pmap_load_store(pte, pa); + PTE_SYNC(pte); va += L3_SIZE; } @@ -1021,25 +1176,27 @@ pmap_qenter(vm_offset_t sva, vm_page_t * /* * This routine tears out page mappings from the * kernel -- it is meant only for temporary mappings. - * Note: SMP coherent. Uses a ranged shootdown IPI. */ void pmap_qremove(vm_offset_t sva, int count) { - pt_entry_t *l3; + pt_entry_t *pte; vm_offset_t va; + int lvl; KASSERT(sva >= VM_MIN_KERNEL_ADDRESS, ("usermode va %lx", sva)); va = sva; while (count-- > 0) { - l3 = pmap_l3(kernel_pmap, va); - KASSERT(l3 != NULL, ("pmap_kremove: Invalid address")); - - if (pmap_l3_valid_cacheable(pmap_load(l3))) - cpu_dcache_wb_range(va, L3_SIZE); - pmap_load_clear(l3); - PTE_SYNC(l3); + pte = pmap_pte(kernel_pmap, va, &lvl); + KASSERT(lvl == 3, + ("Invalid device pagetable level: %d != 3", lvl)); + if (pte != NULL) { + if (pmap_l3_valid_cacheable(pmap_load(pte))) + cpu_dcache_wb_range(va, L3_SIZE); + pmap_load_clear(pte); + PTE_SYNC(pte); + } va += PAGE_SIZE; } @@ -1104,26 +1261,47 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t /* * unmap the page table page */ - if (m->pindex >= NUPDE) { - /* PD page */ + if (m->pindex >= (NUL2E + NUL1E)) { + /* l1 page */ + pd_entry_t *l0; + + l0 = pmap_l0(pmap, va); + pmap_load_clear(l0); + PTE_SYNC(l0); + } else if (m->pindex >= NUL2E) { + /* l2 page */ pd_entry_t *l1; + l1 = pmap_l1(pmap, va); pmap_load_clear(l1); PTE_SYNC(l1); } else { - /* PTE page */ + /* l3 page */ pd_entry_t *l2; + l2 = pmap_l2(pmap, va); pmap_load_clear(l2); PTE_SYNC(l2); } pmap_resident_count_dec(pmap, 1); - if (m->pindex < NUPDE) { - /* We just released a PT, unhold the matching PD */ - vm_page_t pdpg; + if (m->pindex < NUL2E) { + /* We just released an l3, unhold the matching l2 */ + pd_entry_t *l1, tl1; + vm_page_t l2pg; - pdpg = PHYS_TO_VM_PAGE(*pmap_l1(pmap, va) & ~ATTR_MASK); - pmap_unwire_l3(pmap, va, pdpg, free); + l1 = pmap_l1(pmap, va); + tl1 = pmap_load(l1); + l2pg = PHYS_TO_VM_PAGE(tl1 & ~ATTR_MASK); + pmap_unwire_l3(pmap, va, l2pg, free); + } else if (m->pindex < (NUL2E + NUL1E)) { + /* We just released an l2, unhold the matching l1 */ + pd_entry_t *l0, tl0; + vm_page_t l1pg; + + l0 = pmap_l0(pmap, va); + tl0 = pmap_load(l0); + l1pg = PHYS_TO_VM_PAGE(tl0 & ~ATTR_MASK); + pmap_unwire_l3(pmap, va, l1pg, free); } pmap_invalidate_page(pmap, va); @@ -1164,27 +1342,27 @@ pmap_pinit0(pmap_t pmap) PMAP_LOCK_INIT(pmap); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); - pmap->pm_l1 = kernel_pmap->pm_l1; + pmap->pm_l0 = kernel_pmap->pm_l0; } int pmap_pinit(pmap_t pmap) { - vm_paddr_t l1phys; - vm_page_t l1pt; + vm_paddr_t l0phys; + vm_page_t l0pt; /* - * allocate the l1 page + * allocate the l0 page */ - while ((l1pt = vm_page_alloc(NULL, 0xdeadbeef, VM_ALLOC_NORMAL | + while ((l0pt = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) VM_WAIT; - l1phys = VM_PAGE_TO_PHYS(l1pt); - pmap->pm_l1 = (pd_entry_t *)PHYS_TO_DMAP(l1phys); + l0phys = VM_PAGE_TO_PHYS(l0pt); + pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(l0phys); - if ((l1pt->flags & PG_ZERO) == 0) - pagezero(pmap->pm_l1); + if ((l0pt->flags & PG_ZERO) == 0) + pagezero(pmap->pm_l0); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); @@ -1205,7 +1383,7 @@ pmap_pinit(pmap_t pmap) static vm_page_t _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) { - vm_page_t m, /*pdppg, */pdpg; + vm_page_t m, l1pg, l2pg; PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -1237,33 +1415,84 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t * it isn't already there. */ - if (ptepindex >= NUPDE) { - pd_entry_t *l1; - vm_pindex_t l1index; + if (ptepindex >= (NUL2E + NUL1E)) { + pd_entry_t *l0; + vm_pindex_t l0index; + + l0index = ptepindex - (NUL2E + NUL1E); + l0 = &pmap->pm_l0[l0index]; + pmap_load_store(l0, VM_PAGE_TO_PHYS(m) | L0_TABLE); + PTE_SYNC(l0); + } else if (ptepindex >= NUL2E) { + vm_pindex_t l0index, l1index; + pd_entry_t *l0, *l1; + pd_entry_t tl0; + + l1index = ptepindex - NUL2E; + l0index = l1index >> L0_ENTRIES_SHIFT; + + l0 = &pmap->pm_l0[l0index]; + tl0 = pmap_load(l0); + if (tl0 == 0) { + /* recurse for allocating page dir */ + if (_pmap_alloc_l3(pmap, NUL2E + NUL1E + l0index, + lockp) == NULL) { + --m->wire_count; + /* XXX: release mem barrier? */ + atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_free_zero(m); + return (NULL); + } + } else { + l1pg = PHYS_TO_VM_PAGE(tl0 & ~ATTR_MASK); + l1pg->wire_count++; + } - l1index = ptepindex - NUPDE; - l1 = &pmap->pm_l1[l1index]; + l1 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l0) & ~ATTR_MASK); + l1 = &l1[ptepindex & Ln_ADDR_MASK]; pmap_load_store(l1, VM_PAGE_TO_PHYS(m) | L1_TABLE); PTE_SYNC(l1); - } else { - vm_pindex_t l1index; - pd_entry_t *l1, *l2; - - l1index = ptepindex >> (L1_SHIFT - L2_SHIFT); - l1 = &pmap->pm_l1[l1index]; - if (pmap_load(l1) == 0) { + vm_pindex_t l0index, l1index; + pd_entry_t *l0, *l1, *l2; + pd_entry_t tl0, tl1; + + l1index = ptepindex >> Ln_ENTRIES_SHIFT; + l0index = l1index >> L0_ENTRIES_SHIFT; + + l0 = &pmap->pm_l0[l0index]; + tl0 = pmap_load(l0); + if (tl0 == 0) { /* recurse for allocating page dir */ - if (_pmap_alloc_l3(pmap, NUPDE + l1index, + if (_pmap_alloc_l3(pmap, NUL2E + l1index, lockp) == NULL) { --m->wire_count; atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); return (NULL); } + tl0 = pmap_load(l0); + l1 = (pd_entry_t *)PHYS_TO_DMAP(tl0 & ~ATTR_MASK); + l1 = &l1[l1index & Ln_ADDR_MASK]; } else { - pdpg = PHYS_TO_VM_PAGE(pmap_load(l1) & ~ATTR_MASK); - pdpg->wire_count++; + l1 = (pd_entry_t *)PHYS_TO_DMAP(tl0 & ~ATTR_MASK); + l1 = &l1[l1index & Ln_ADDR_MASK]; + tl1 = pmap_load(l1); + if (tl1 == 0) { + /* recurse for allocating page dir */ + if (_pmap_alloc_l3(pmap, NUL2E + l1index, + lockp) == NULL) { + --m->wire_count; + /* XXX: release mem barrier? */ + atomic_subtract_int( + &vm_cnt.v_wire_count, 1); + vm_page_free_zero(m); + return (NULL); + } + } else { + l2pg = PHYS_TO_VM_PAGE(tl1 & ~ATTR_MASK); + l2pg->wire_count++; + } } l2 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l1) & ~ATTR_MASK); @@ -1281,8 +1510,9 @@ static vm_page_t pmap_alloc_l3(pmap_t pmap, vm_offset_t va, struct rwlock **lockp) { vm_pindex_t ptepindex; - pd_entry_t *l2; + pd_entry_t *pde, tpde; vm_page_t m; + int lvl; /* * Calculate pagetable page index @@ -1292,24 +1522,29 @@ retry: /* * Get the page directory entry */ - l2 = pmap_l2(pmap, va); + pde = pmap_pde(pmap, va, &lvl); /* - * If the page table page is mapped, we just increment the - * hold count, and activate it. + * If the page table page is mapped, we just increment the hold count, + * and activate it. If we get a level 2 pde it will point to a level 3 + * table. */ - if (l2 != NULL && pmap_load(l2) != 0) { - m = PHYS_TO_VM_PAGE(pmap_load(l2) & ~ATTR_MASK); - m->wire_count++; - } else { - /* - * Here if the pte page isn't mapped, or if it has been - * deallocated. - */ - m = _pmap_alloc_l3(pmap, ptepindex, lockp); - if (m == NULL && lockp != NULL) - goto retry; + if (lvl == 2) { + tpde = pmap_load(pde); + if (tpde != 0) { + m = PHYS_TO_VM_PAGE(tpde & ~ATTR_MASK); + m->wire_count++; + return (m); + } } + + /* + * Here if the pte page isn't mapped, or if it has been deallocated. + */ + m = _pmap_alloc_l3(pmap, ptepindex, lockp); + if (m == NULL && lockp != NULL) + goto retry; + return (m); } @@ -1332,7 +1567,7 @@ pmap_release(pmap_t pmap) ("pmap_release: pmap resident count %ld != 0", pmap->pm_stats.resident_count)); - m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l1)); + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l0)); m->wire_count--; atomic_subtract_int(&vm_cnt.v_wire_count, 1); @@ -1369,7 +1604,7 @@ pmap_growkernel(vm_offset_t addr) { vm_paddr_t paddr; vm_page_t nkpg; - pd_entry_t *l1, *l2; + pd_entry_t *l0, *l1, *l2; mtx_assert(&kernel_map->system_mtx, MA_OWNED); @@ -1377,7 +1612,11 @@ pmap_growkernel(vm_offset_t addr) if (addr - 1 >= kernel_map->max_offset) addr = kernel_map->max_offset; while (kernel_vm_end < addr) { - l1 = pmap_l1(kernel_pmap, kernel_vm_end); + l0 = pmap_l0(kernel_pmap, kernel_vm_end); + KASSERT(pmap_load(l0) != 0, + ("pmap_growkernel: No level 0 kernel entry")); + + l1 = pmap_l0_to_l1(l0, kernel_vm_end); if (pmap_load(l1) == 0) { /* We need a new PDP entry */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Mar 31 11:18:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11678AE4DFD; Thu, 31 Mar 2016 11:18:54 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA2E51329; Thu, 31 Mar 2016 11:18:53 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VBIqdA055659; Thu, 31 Mar 2016 11:18:52 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VBIq3x055657; Thu, 31 Mar 2016 11:18:52 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201603311118.u2VBIq3x055657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 31 Mar 2016 11:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297447 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 11:18:54 -0000 Author: zbb Date: Thu Mar 31 11:18:52 2016 New Revision: 297447 URL: https://svnweb.freebsd.org/changeset/base/297447 Log: Disable MSI-x for AHCI on Alpine plattform Changes introduced to AHCI code adding support for MSI-x caused interrupt storm on Alpine boards. This is unintended behaviour so added quirk to omit this functionality. Reviewed by: mav Submitted by: Marcin Mazurek Obtained from: Semihalf Sponsored by: Annapurna Labs Differential Revision: https://reviews.freebsd.org/D4301 Modified: head/sys/dev/ahci/ahci.h head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Thu Mar 31 11:07:24 2016 (r297446) +++ head/sys/dev/ahci/ahci.h Thu Mar 31 11:18:52 2016 (r297447) @@ -597,6 +597,7 @@ enum ahci_err_type { #define AHCI_Q_1MSI 0x00020000 #define AHCI_Q_FORCE_PI 0x00040000 #define AHCI_Q_RESTORE_CAP 0x00080000 +#define AHCI_Q_NOMSIX 0x00100000 #define AHCI_Q_BIT_STRING \ "\020" \ @@ -619,7 +620,8 @@ enum ahci_err_type { "\021ABAR0" \ "\0221MSI" \ "\023FORCE_PI" \ - "\024RESTORE_CAP" + "\024RESTORE_CAP" \ + "\025NOMSIX" int ahci_attach(device_t dev); int ahci_detach(device_t dev); Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Thu Mar 31 11:07:24 2016 (r297446) +++ head/sys/dev/ahci/ahci_pci.c Thu Mar 31 11:18:52 2016 (r297447) @@ -293,7 +293,7 @@ static const struct { {0x11851039, 0x00, "SiS 968", 0}, {0x01861039, 0x00, "SiS 968", 0}, {0xa01c177d, 0x00, "ThunderX", AHCI_Q_ABAR0|AHCI_Q_1MSI}, - {0x00311c36, 0x00, "Annapurna", AHCI_Q_FORCE_PI|AHCI_Q_RESTORE_CAP}, + {0x00311c36, 0x00, "Annapurna", AHCI_Q_FORCE_PI|AHCI_Q_RESTORE_CAP|AHCI_Q_NOMSIX}, {0x00000000, 0x00, NULL, 0} }; @@ -437,6 +437,9 @@ ahci_pci_attach(device_t dev) &ctlr->r_rid, RF_ACTIVE))) return ENXIO; + if (ctlr->quirks & AHCI_Q_NOMSIX) + msix_count = 0; + /* Read MSI-x BAR IDs if supported */ if (msix_count > 0) { error = ahci_pci_read_msix_bars(dev, &table_bar, &pba_bar); From owner-svn-src-head@freebsd.org Thu Mar 31 12:10:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9CE2AE20F0; Thu, 31 Mar 2016 12:10:18 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 976421A73; Thu, 31 Mar 2016 12:10:18 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VCAHKn070585; Thu, 31 Mar 2016 12:10:17 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VCAHrI070584; Thu, 31 Mar 2016 12:10:17 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201603311210.u2VCAHrI070584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 31 Mar 2016 12:10:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297448 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 12:10:18 -0000 Author: zbb Date: Thu Mar 31 12:10:17 2016 New Revision: 297448 URL: https://svnweb.freebsd.org/changeset/base/297448 Log: Fix typo in the VNIC's PF function name Should be add_vf not addr_vf. Modified: head/sys/dev/vnic/nic_main.c Modified: head/sys/dev/vnic/nic_main.c ============================================================================== --- head/sys/dev/vnic/nic_main.c Thu Mar 31 11:18:52 2016 (r297447) +++ head/sys/dev/vnic/nic_main.c Thu Mar 31 12:10:17 2016 (r297448) @@ -119,7 +119,7 @@ static int nicpf_detach(device_t); #ifdef PCI_IOV static int nicpf_iov_init(device_t, uint16_t, const nvlist_t *); static void nicpf_iov_uninit(device_t); -static int nicpf_iov_addr_vf(device_t, uint16_t, const nvlist_t *); +static int nicpf_iov_add_vf(device_t, uint16_t, const nvlist_t *); #endif static device_method_t nicpf_methods[] = { @@ -131,7 +131,7 @@ static device_method_t nicpf_methods[] = #ifdef PCI_IOV DEVMETHOD(pci_iov_init, nicpf_iov_init), DEVMETHOD(pci_iov_uninit, nicpf_iov_uninit), - DEVMETHOD(pci_iov_add_vf, nicpf_iov_addr_vf), + DEVMETHOD(pci_iov_add_vf, nicpf_iov_add_vf), #endif DEVMETHOD_END, }; @@ -294,7 +294,7 @@ nicpf_iov_uninit(device_t dev) } static int -nicpf_iov_addr_vf(device_t dev, uint16_t vfnum, const nvlist_t *params) +nicpf_iov_add_vf(device_t dev, uint16_t vfnum, const nvlist_t *params) { const void *mac; struct nicpf *nic; From owner-svn-src-head@freebsd.org Thu Mar 31 12:13:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 196CEAE22EF; Thu, 31 Mar 2016 12:13:03 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD3201E56; Thu, 31 Mar 2016 12:13:02 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VCD2DR073316; Thu, 31 Mar 2016 12:13:02 GMT (envelope-from fanf@FreeBSD.org) Received: (from fanf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VCD2hq073315; Thu, 31 Mar 2016 12:13:02 GMT (envelope-from fanf@FreeBSD.org) Message-Id: <201603311213.u2VCD2hq073315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fanf set sender to fanf@FreeBSD.org using -f From: Tony Finch Date: Thu, 31 Mar 2016 12:13:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297449 - head/usr.bin/whois X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 12:13:03 -0000 Author: fanf Date: Thu Mar 31 12:13:01 2016 New Revision: 297449 URL: https://svnweb.freebsd.org/changeset/base/297449 Log: Fix whois queries for ARIN AS numbers. The ARIN whois server likes AS number queries to be in the form "a 8075" rather than "as7085". Modified: head/usr.bin/whois/whois.c Modified: head/usr.bin/whois/whois.c ============================================================================== --- head/usr.bin/whois/whois.c Thu Mar 31 12:10:17 2016 (r297448) +++ head/usr.bin/whois/whois.c Thu Mar 31 12:13:01 2016 (r297449) @@ -431,9 +431,13 @@ done: else if ((flags & WHOIS_SPAM_ME) || strchr(query, ' ') != NULL) fprintf(fp, "%s\r\n", query); - else if (strcasecmp(hostname, ANICHOST) == 0) - fprintf(fp, "+ %s\r\n", query); - else if (strcasecmp(hostres->ai_canonname, VNICHOST) == 0) + else if (strcasecmp(hostname, ANICHOST) == 0) { + if (strncasecmp(query, "AS", 2) == 0 && + strspn(query+2, "0123456789") == strlen(query+2)) + fprintf(fp, "+ a %s\r\n", query+2); + else + fprintf(fp, "+ %s\r\n", query); + } else if (strcasecmp(hostres->ai_canonname, VNICHOST) == 0) fprintf(fp, "domain %s\r\n", query); else fprintf(fp, "%s\r\n", query); From owner-svn-src-head@freebsd.org Thu Mar 31 13:10:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21F01AE2FCC; Thu, 31 Mar 2016 13:10:31 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E127C19F0; Thu, 31 Mar 2016 13:10:30 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VDAUl4089148; Thu, 31 Mar 2016 13:10:30 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VDAT81089145; Thu, 31 Mar 2016 13:10:29 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201603311310.u2VDAT81089145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 31 Mar 2016 13:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297450 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 13:10:31 -0000 Author: zbb Date: Thu Mar 31 13:10:29 2016 New Revision: 297450 URL: https://svnweb.freebsd.org/changeset/base/297450 Log: Improve TX path of the VNIC driver - Avoid memory leak when nicvf_tx_mbuf_locked() fails - Introduce nicvf_xmit_locked() routine that uses drbr_peek(), drbr_advance() or drbr_putback() for a specific ifnet. This gives more clear and efficient design as well as prevents from dropping mbufs that where not sent due to temporary lack of descriptors. - Add missing ETHER_BPF_MTAP() hook Pointed out by: yongari Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5534 Modified: head/sys/dev/vnic/nicvf_main.c head/sys/dev/vnic/nicvf_queues.c head/sys/dev/vnic/nicvf_queues.h Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Thu Mar 31 12:13:01 2016 (r297449) +++ head/sys/dev/vnic/nicvf_main.c Thu Mar 31 13:10:29 2016 (r297450) @@ -661,8 +661,8 @@ nicvf_if_transmit(struct ifnet *ifp, str sq = &qs->sq[qidx]; - if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING) { + if (((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) || !nic->link_up) { err = drbr_enqueue(ifp, sq->br, mbuf); return (err); } @@ -679,17 +679,16 @@ nicvf_if_transmit(struct ifnet *ifp, str } } + err = drbr_enqueue(ifp, sq->br, mbuf); + if (err != 0) + return (err); + if (NICVF_TX_TRYLOCK(sq) != 0) { - err = nicvf_tx_mbuf_locked(sq, mbuf); + err = nicvf_xmit_locked(sq); NICVF_TX_UNLOCK(sq); return (err); - } else { - err = drbr_enqueue(ifp, sq->br, mbuf); - if (err != 0) - return (err); - + } else taskqueue_enqueue(sq->snd_taskq, &sq->snd_task); - } return (0); } Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Thu Mar 31 12:13:01 2016 (r297449) +++ head/sys/dev/vnic/nicvf_queues.c Thu Mar 31 13:10:29 2016 (r297450) @@ -60,11 +60,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include +#include +#include #include #include @@ -105,6 +106,8 @@ static void nicvf_cmp_queue_config(struc boolean_t); static void nicvf_sq_free_used_descs(struct nicvf *, struct snd_queue *, int); +static int nicvf_tx_mbuf_locked(struct snd_queue *, struct mbuf **); + static void nicvf_rbdr_task(void *, int); static void nicvf_rbdr_task_nowait(void *, int); @@ -739,6 +742,7 @@ nicvf_cq_intr_handler(struct nicvf *nic, int cqe_count, cqe_head; struct queue_set *qs = nic->qs; struct cmp_queue *cq = &qs->cq[cq_idx]; + struct snd_queue *sq = &qs->sq[cq_idx]; struct rcv_queue *rq; struct cqe_rx_t *cq_desc; struct lro_ctrl *lro; @@ -818,6 +822,7 @@ done: ((if_getdrvflags(nic->ifp) & IFF_DRV_RUNNING) != 0)) { /* Reenable TXQ if its stopped earlier due to SQ full */ if_setdrvflagbits(nic->ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); + taskqueue_enqueue(sq->snd_taskq, &sq->snd_task); } out: /* @@ -991,25 +996,62 @@ nicvf_free_cmp_queue(struct nicvf *nic, memset(cq->mtx_name, 0, sizeof(cq->mtx_name)); } -static void -nicvf_snd_task(void *arg, int pending) +int +nicvf_xmit_locked(struct snd_queue *sq) { - struct snd_queue *sq = (struct snd_queue *)arg; - struct mbuf *mbuf; + struct nicvf *nic; + struct ifnet *ifp; + struct mbuf *next; + int err; - NICVF_TX_LOCK(sq); - while (1) { - mbuf = drbr_dequeue(NULL, sq->br); - if (mbuf == NULL) - break; + NICVF_TX_LOCK_ASSERT(sq); + + nic = sq->nic; + ifp = nic->ifp; + err = 0; + + while ((next = drbr_peek(ifp, sq->br)) != NULL) { + err = nicvf_tx_mbuf_locked(sq, &next); + if (err != 0) { + if (next == NULL) + drbr_advance(ifp, sq->br); + else + drbr_putback(ifp, sq->br, next); - if (nicvf_tx_mbuf_locked(sq, mbuf) != 0) { - /* XXX ARM64TODO: Increase Tx drop counter */ - m_freem(mbuf); break; } + drbr_advance(ifp, sq->br); + /* Send a copy of the frame to the BPF listener */ + ETHER_BPF_MTAP(ifp, next); } + return (err); +} + +static void +nicvf_snd_task(void *arg, int pending) +{ + struct snd_queue *sq = (struct snd_queue *)arg; + struct nicvf *nic; + struct ifnet *ifp; + int err; + + nic = sq->nic; + ifp = nic->ifp; + + /* + * Skip sending anything if the driver is not running, + * SQ full or link is down. + */ + if (((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) || !nic->link_up) + return; + + NICVF_TX_LOCK(sq); + err = nicvf_xmit_locked(sq); NICVF_TX_UNLOCK(sq); + /* Try again */ + if (err != 0) + taskqueue_enqueue(sq->snd_taskq, &sq->snd_task); } /* Initialize transmit queue */ @@ -1862,8 +1904,8 @@ static inline void nicvf_sq_add_gather_s } /* Put an mbuf to a SQ for packet transfer. */ -int -nicvf_tx_mbuf_locked(struct snd_queue *sq, struct mbuf *mbuf) +static int +nicvf_tx_mbuf_locked(struct snd_queue *sq, struct mbuf **mbufp) { bus_dma_segment_t segs[256]; struct nicvf *nic; @@ -1881,15 +1923,17 @@ nicvf_tx_mbuf_locked(struct snd_queue *s snd_buff = &sq->snd_buff[sq->tail]; err = bus_dmamap_load_mbuf_sg(sq->snd_buff_dmat, snd_buff->dmap, - mbuf, segs, &nsegs, BUS_DMA_NOWAIT); - if (err != 0) { + *mbufp, segs, &nsegs, BUS_DMA_NOWAIT); + if (__predict_false(err != 0)) { /* ARM64TODO: Add mbuf defragmenting if we lack maps */ + m_freem(*mbufp); + *mbufp = NULL; return (err); } /* Set how many subdescriptors is required */ nic = sq->nic; - if (mbuf->m_pkthdr.tso_segsz != 0 && nic->hw_tso) + if ((*mbufp)->m_pkthdr.tso_segsz != 0 && nic->hw_tso) subdesc_cnt = MIN_SQ_DESC_PER_PKT_XMIT; else subdesc_cnt = MIN_SQ_DESC_PER_PKT_XMIT + nsegs - 1; @@ -1903,10 +1947,15 @@ nicvf_tx_mbuf_locked(struct snd_queue *s qentry = nicvf_get_sq_desc(sq, subdesc_cnt); /* Add SQ header subdesc */ - err = nicvf_sq_add_hdr_subdesc(sq, qentry, subdesc_cnt - 1, mbuf, - mbuf->m_pkthdr.len); + err = nicvf_sq_add_hdr_subdesc(sq, qentry, subdesc_cnt - 1, *mbufp, + (*mbufp)->m_pkthdr.len); if (err != 0) { + nicvf_put_sq_desc(sq, subdesc_cnt); bus_dmamap_unload(sq->snd_buff_dmat, snd_buff->dmap); + if (err == ENOBUFS) { + m_freem(*mbufp); + *mbufp = NULL; + } return (err); } Modified: head/sys/dev/vnic/nicvf_queues.h ============================================================================== --- head/sys/dev/vnic/nicvf_queues.h Thu Mar 31 12:13:01 2016 (r297449) +++ head/sys/dev/vnic/nicvf_queues.h Thu Mar 31 13:10:29 2016 (r297450) @@ -388,7 +388,7 @@ void nicvf_disable_intr(struct nicvf *, void nicvf_clear_intr(struct nicvf *, int, int); int nicvf_is_intr_enabled(struct nicvf *, int, int); -int nicvf_tx_mbuf_locked(struct snd_queue *, struct mbuf *); +int nicvf_xmit_locked(struct snd_queue *sq); /* Register access APIs */ void nicvf_reg_write(struct nicvf *, uint64_t, uint64_t); From owner-svn-src-head@freebsd.org Thu Mar 31 13:13:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40C89AE411D; Thu, 31 Mar 2016 13:13:40 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF2891E40; Thu, 31 Mar 2016 13:13:39 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VDDdbc091889; Thu, 31 Mar 2016 13:13:39 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VDDdIF091888; Thu, 31 Mar 2016 13:13:39 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201603311313.u2VDDdIF091888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 31 Mar 2016 13:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297451 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 13:13:40 -0000 Author: zbb Date: Thu Mar 31 13:13:38 2016 New Revision: 297451 URL: https://svnweb.freebsd.org/changeset/base/297451 Log: Fix MAC address configuration for VNIC The FDT description is as follows: - phy-handle, reg, qlm-mode, mac-address are under nodes in bgx0/1 node - phy nodes (pointed by phy-handle) are under MDIO even though they may not be connected through to MDIO. In those nodes they do not contain MAC address or etc. This commit changes parsing of the FDT nodes for BGX so that it can obtain correct MAC address for a given PHY. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5781 Modified: head/sys/dev/vnic/thunder_bgx_fdt.c Modified: head/sys/dev/vnic/thunder_bgx_fdt.c ============================================================================== --- head/sys/dev/vnic/thunder_bgx_fdt.c Thu Mar 31 13:10:29 2016 (r297450) +++ head/sys/dev/vnic/thunder_bgx_fdt.c Thu Mar 31 13:13:38 2016 (r297451) @@ -285,18 +285,9 @@ bgx_fdt_init_phy(struct bgx *bgx) continue; } - if (OF_getencprop(child, "phy-handle", &phy, - sizeof(phy)) <= 0) { - if (bootverbose) { - device_printf(bgx->dev, - "No phy-handle in PHY node. Skipping...\n"); - } - continue; - } /* Acquire PHY address */ - phy = OF_node_from_xref(phy); - if (OF_getencprop(phy, "reg", &bgx->lmac[lmac].phyaddr, + if (OF_getencprop(child, "reg", &bgx->lmac[lmac].phyaddr, sizeof(bgx->lmac[lmac].phyaddr)) <= 0) { if (bootverbose) { device_printf(bgx->dev, @@ -305,6 +296,15 @@ bgx_fdt_init_phy(struct bgx *bgx) bgx->lmac[lmac].phyaddr = MII_PHY_ANY; } + if (OF_getencprop(child, "phy-handle", &phy, + sizeof(phy)) <= 0) { + if (bootverbose) { + device_printf(bgx->dev, + "No phy-handle in PHY node. Skipping...\n"); + } + continue; + } + phy = OF_instance_to_package(phy); /* * Get PHY interface (MDIO bus) device. * Driver must be already attached. @@ -321,7 +321,7 @@ bgx_fdt_init_phy(struct bgx *bgx) } /* Get mac address from FDT */ - bgx_fdt_get_macaddr(phy, bgx->lmac[lmac].mac); + bgx_fdt_get_macaddr(child, bgx->lmac[lmac].mac); bgx->lmac[lmac].lmacid = lmac; lmac++; From owner-svn-src-head@freebsd.org Thu Mar 31 13:20:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08388AE4274; Thu, 31 Mar 2016 13:20:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA3BC1103; Thu, 31 Mar 2016 13:20:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VDK3PF092296; Thu, 31 Mar 2016 13:20:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VDK27X092294; Thu, 31 Mar 2016 13:20:02 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603311320.u2VDK27X092294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 31 Mar 2016 13:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297452 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 13:20:04 -0000 Author: trasz Date: Thu Mar 31 13:20:02 2016 New Revision: 297452 URL: https://svnweb.freebsd.org/changeset/base/297452 Log: Remove NULL checks after M_WAITOK allocations, which - by definition - can never return NULL. Reviewed by: arybchik@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5773 Modified: head/sys/dev/sfxge/sfxge_mcdi.c head/sys/dev/sfxge/sfxge_nvram.c Modified: head/sys/dev/sfxge/sfxge_mcdi.c ============================================================================== --- head/sys/dev/sfxge/sfxge_mcdi.c Thu Mar 31 13:13:38 2016 (r297451) +++ head/sys/dev/sfxge/sfxge_mcdi.c Thu Mar 31 13:20:02 2016 (r297452) @@ -250,10 +250,6 @@ sfxge_mcdi_ioctl(struct sfxge_softc *sc, } mcdibuf = malloc(SFXGE_MCDI_MAX_PAYLOAD, M_TEMP, M_WAITOK | M_ZERO); - if (mcdibuf == NULL) { - rc = ENOMEM; - goto fail4; - } if ((rc = copyin(ip->u.mcdi.payload, mcdibuf, ip->u.mcdi.len)) != 0) { goto fail5; } @@ -292,7 +288,6 @@ sfxge_mcdi_ioctl(struct sfxge_softc *sc, fail6: fail5: free(mcdibuf, M_TEMP); -fail4: fail3: fail2: fail1: Modified: head/sys/dev/sfxge/sfxge_nvram.c ============================================================================== --- head/sys/dev/sfxge/sfxge_nvram.c Thu Mar 31 13:13:38 2016 (r297451) +++ head/sys/dev/sfxge/sfxge_nvram.c Thu Mar 31 13:20:02 2016 (r297452) @@ -75,10 +75,6 @@ sfxge_nvram_rw(struct sfxge_softc *sc, s goto fail1; buf = malloc(chunk_size, M_TEMP, M_WAITOK); - if (buf == NULL) { - rc = ENOMEM; - goto fail2; - } off = 0; while (total_size) { @@ -108,7 +104,6 @@ sfxge_nvram_rw(struct sfxge_softc *sc, s fail3: free(buf, M_TEMP); -fail2: efx_nvram_rw_finish(enp, type); fail1: return (rc); From owner-svn-src-head@freebsd.org Thu Mar 31 13:23:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8D43AE4382; Thu, 31 Mar 2016 13:23:44 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DF9F151A; Thu, 31 Mar 2016 13:23:44 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VDNh7b095133; Thu, 31 Mar 2016 13:23:43 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VDNhrp095132; Thu, 31 Mar 2016 13:23:43 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201603311323.u2VDNhrp095132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 31 Mar 2016 13:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297453 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 13:23:44 -0000 Author: zbb Date: Thu Mar 31 13:23:43 2016 New Revision: 297453 URL: https://svnweb.freebsd.org/changeset/base/297453 Log: Don't omit m_dup() for non-writeable mbufs that need checksum calculation If the driver is not active or link is down the packet could remain non-writeable. This commit makes all mbufs enqueued to the driver's ring buffer to have correct attributes. Pointed out by: wma Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5800 Modified: head/sys/dev/vnic/nicvf_main.c Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Thu Mar 31 13:20:02 2016 (r297452) +++ head/sys/dev/vnic/nicvf_main.c Thu Mar 31 13:23:43 2016 (r297453) @@ -661,12 +661,6 @@ nicvf_if_transmit(struct ifnet *ifp, str sq = &qs->sq[qidx]; - if (((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING) || !nic->link_up) { - err = drbr_enqueue(ifp, sq->br, mbuf); - return (err); - } - if (mbuf->m_next != NULL && (mbuf->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP)) != 0) { @@ -680,8 +674,15 @@ nicvf_if_transmit(struct ifnet *ifp, str } err = drbr_enqueue(ifp, sq->br, mbuf); - if (err != 0) + if (((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) || !nic->link_up || (err != 0)) { + /* + * Try to enqueue packet to the ring buffer. + * If the driver is not active, link down or enqueue operation + * failed, return with the appropriate error code. + */ return (err); + } if (NICVF_TX_TRYLOCK(sq) != 0) { err = nicvf_xmit_locked(sq); From owner-svn-src-head@freebsd.org Thu Mar 31 14:48:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 000CFAE4617; Thu, 31 Mar 2016 14:48:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C519F107D; Thu, 31 Mar 2016 14:48:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VEmHDW021067; Thu, 31 Mar 2016 14:48:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VEmH2q021066; Thu, 31 Mar 2016 14:48:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603311448.u2VEmH2q021066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 31 Mar 2016 14:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297454 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 14:48:19 -0000 Author: bdrewery Date: Thu Mar 31 14:48:17 2016 New Revision: 297454 URL: https://svnweb.freebsd.org/changeset/base/297454 Log: Define OBJTOP earlier if possible for use in targets. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.sys.mk Modified: head/share/mk/local.sys.mk ============================================================================== --- head/share/mk/local.sys.mk Thu Mar 31 13:23:43 2016 (r297453) +++ head/share/mk/local.sys.mk Thu Mar 31 14:48:17 2016 (r297454) @@ -23,6 +23,10 @@ MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFIL .endif .endif +.if !empty(.OBJDIR) +OBJTOP?= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP} +.endif + .include "src.sys.mk" .if ${.MAKE.MODE:Mmeta*} != "" From owner-svn-src-head@freebsd.org Thu Mar 31 15:16:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EBC1AE4DF8; Thu, 31 Mar 2016 15:16:24 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06F9912CE; Thu, 31 Mar 2016 15:16:23 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VFGNij030969; Thu, 31 Mar 2016 15:16:23 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VFGMXI030965; Thu, 31 Mar 2016 15:16:22 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201603311516.u2VFGMXI030965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Thu, 31 Mar 2016 15:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297455 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 15:16:24 -0000 Author: brueffer Date: Thu Mar 31 15:16:22 2016 New Revision: 297455 URL: https://svnweb.freebsd.org/changeset/base/297455 Log: Fix minor problems caught by mandoc -Tlint. Modified: head/share/man/man4/capsicum.4 head/share/man/man4/cfi.4 head/share/man/man4/lagg.4 head/share/man/man4/uart.4 Modified: head/share/man/man4/capsicum.4 ============================================================================== --- head/share/man/man4/capsicum.4 Thu Mar 31 14:48:17 2016 (r297454) +++ head/share/man/man4/capsicum.4 Thu Mar 31 15:16:22 2016 (r297455) @@ -105,7 +105,7 @@ associated with file descriptors; descri .Xr write 2 , .Xr cap_rights_get 3 , .Xr casper 3 , -.Xr procdesc 4 , +.Xr procdesc 4 .Sh HISTORY .Nm first appeared in Modified: head/share/man/man4/cfi.4 ============================================================================== --- head/share/man/man4/cfi.4 Thu Mar 31 14:48:17 2016 (r297454) +++ head/share/man/man4/cfi.4 Thu Mar 31 15:16:22 2016 (r297455) @@ -50,8 +50,8 @@ In .Pp In DTS file: .Cd flash@74000000 { -.Cd " compatible =" Qo cfi-flash Qc ; -.Cd " reg = <0x74000000 0x4000000>;" +.Cd " compatible =" Qo cfi-flash Qc ; +.Cd " reg = <0x74000000 0x4000000>;" .Cd }; .Sh DESCRIPTION The @@ -72,7 +72,6 @@ Additional support for write-once bits t devices to read-only can be enabled by the .Cd CFI_ARMEDANDDANGEROUS kernel option. -.El .Sh SEE ALSO .Xr led 4 .Sh HISTORY Modified: head/share/man/man4/lagg.4 ============================================================================== --- head/share/man/man4/lagg.4 Thu Mar 31 14:48:17 2016 (r297454) +++ head/share/man/man4/lagg.4 Thu Mar 31 15:16:22 2016 (r297455) @@ -166,7 +166,7 @@ Gigabit Ethernet interfaces: 192.168.1.1 netmask 255.255.255.0 .Ed .Pp -Create a link aggregation using ROUNDROBIN with two +Create a link aggregation using ROUNDROBIN with two .Xr bge 4 Gigabit Ethernet interfaces and set the limit of 500 packets per interface: Modified: head/share/man/man4/uart.4 ============================================================================== --- head/share/man/man4/uart.4 Thu Mar 31 14:48:17 2016 (r297454) +++ head/share/man/man4/uart.4 Thu Mar 31 15:16:22 2016 (r297455) @@ -188,7 +188,7 @@ Capture pulses on the CTS line. Capture pulses on the DCD line. .El .Pp -The following values may be ORed with the capture mode to configure +The following values may be ORed with the capture mode to configure capture processing options: .Bl -tag -compact -offset "mmmm" -width "mmmm" .It 0x10 From owner-svn-src-head@freebsd.org Thu Mar 31 16:10:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7472AE3A10; Thu, 31 Mar 2016 16:10:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B707F1736; Thu, 31 Mar 2016 16:10:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VG9xt3052153; Thu, 31 Mar 2016 16:09:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VG9xcX052151; Thu, 31 Mar 2016 16:09:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603311609.u2VG9xcX052151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 31 Mar 2016 16:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297456 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 16:10:01 -0000 Author: bdrewery Date: Thu Mar 31 16:09:59 2016 New Revision: 297456 URL: https://svnweb.freebsd.org/changeset/base/297456 Log: We don't support DPLIBS. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.README head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Thu Mar 31 15:16:22 2016 (r297455) +++ head/share/mk/bsd.README Thu Mar 31 16:09:59 2016 (r297456) @@ -315,7 +315,7 @@ PROGS_CXX PROG and PROGS_CXX in one Make SRCS.bar= bar_src.c The supported variables are BINDIR BINGRP BINMODE BINOWN - CFLAGS CXXFLAGS DPADD DPLIBS DPSRCS LDADD + CFLAGS CXXFLAGS DPADD DPSRCS LDADD LDFLAGS LIBADD MAN MLINKS PROGNAME SRCS. PROGNAME The name that the above program will be installed as, if Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Thu Mar 31 15:16:22 2016 (r297455) +++ head/share/mk/bsd.progs.mk Thu Mar 31 16:09:59 2016 (r297456) @@ -24,7 +24,7 @@ PROGS += ${PROGS_CXX} # just one of many PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ PROGNAME SRCS WARNS -PROG_VARS += CFLAGS CXXFLAGS DPADD DPLIBS LDADD LIBADD LINKS \ +PROG_VARS += CFLAGS CXXFLAGS DPADD LDADD LIBADD LINKS \ LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} .if empty(${PROG_OVERRIDE_VARS:M$v}) From owner-svn-src-head@freebsd.org Thu Mar 31 16:44:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19AE6AE4432; Thu, 31 Mar 2016 16:44:34 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C395116D3; Thu, 31 Mar 2016 16:44:33 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VGiW6F063880; Thu, 31 Mar 2016 16:44:32 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VGiWum063879; Thu, 31 Mar 2016 16:44:32 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201603311644.u2VGiWum063879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 31 Mar 2016 16:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297457 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 16:44:34 -0000 Author: zbb Date: Thu Mar 31 16:44:32 2016 New Revision: 297457 URL: https://svnweb.freebsd.org/changeset/base/297457 Log: Fix number of the enabled VFs in VNIC nic->num_vf_en is set based on the number of the enabled LMACs. This number should not be overwritten later by any routine. Instead it should fail PCI_IOV_ADD_VF() so that available VFs with the corresponding LMACs will attach whereas other, disabled VFs will fail with the proper error code. Error signaling (due to improper number of VFs requested) is also moved from PCI_IOV_INIT() to PCI_IOV_ADD_VF(). This will be reworked when multiple queue sets are enabled but for now this is the correct behavior of the driver. Obtained from: Semihalf Sponsored by: Cavium Modified: head/sys/dev/vnic/nic_main.c Modified: head/sys/dev/vnic/nic_main.c ============================================================================== --- head/sys/dev/vnic/nic_main.c Thu Mar 31 16:09:59 2016 (r297456) +++ head/sys/dev/vnic/nic_main.c Thu Mar 31 16:44:32 2016 (r297457) @@ -269,18 +269,9 @@ nicpf_iov_init(device_t dev, uint16_t nu nic = device_get_softc(dev); - nic->num_vf_en = 0; if (num_vfs == 0) return (ENXIO); - if (num_vfs > MAX_NUM_VFS_SUPPORTED) - return (EINVAL); - /* - * Just set variables here. - * The number of VFs will be written to configuration - * space later in PCI_ADD_VF(). - */ - nic->num_vf_en = num_vfs; nic->flags |= NIC_SRIOV_ENABLED; return (0); @@ -306,6 +297,9 @@ nicpf_iov_add_vf(device_t dev, uint16_t if ((nic->flags & NIC_SRIOV_ENABLED) == 0) return (ENXIO); + if (vfnum > (nic->num_vf_en - 1)) + return (EINVAL); + if (nvlist_exists_binary(params, "mac-addr") != 0) { mac = nvlist_get_binary(params, "mac-addr", &size); bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vfnum]); @@ -1094,11 +1088,8 @@ static int nic_sriov_init(device_t dev, } /* Fix-up the number of enabled VFs */ total_vf_cnt = pci_read_config(dev, iov_pos + PCIR_SRIOV_TOTAL_VFS, 2); - if (total_vf_cnt < nic->num_vf_en) - nic->num_vf_en = total_vf_cnt; - if (total_vf_cnt == 0) - return (0); + return (ENXIO); /* Attach SR-IOV */ pf_schema = pci_iov_schema_alloc_node(); @@ -1116,7 +1107,6 @@ static int nic_sriov_init(device_t dev, device_printf(dev, "Failed to initialize SR-IOV (error=%d)\n", err); - nic->num_vf_en = 0; return (err); } #endif From owner-svn-src-head@freebsd.org Thu Mar 31 17:00:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24EDEAE49D0; Thu, 31 Mar 2016 17:00:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB7C21EE9; Thu, 31 Mar 2016 17:00:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VH0muF069187; Thu, 31 Mar 2016 17:00:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VH0m8p069186; Thu, 31 Mar 2016 17:00:48 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603311700.u2VH0m8p069186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 31 Mar 2016 17:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297458 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 17:00:49 -0000 Author: trasz Date: Thu Mar 31 17:00:47 2016 New Revision: 297458 URL: https://svnweb.freebsd.org/changeset/base/297458 Log: Fix overflows, making it impossible to add negative amounts using rctl(8). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_rctl.c Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Thu Mar 31 16:44:32 2016 (r297457) +++ head/sys/kern/kern_rctl.c Thu Mar 31 17:00:47 2016 (r297458) @@ -642,6 +642,9 @@ str2int64(const char *str, int64_t *valu if ((size_t)(end - str) != strlen(str)) return (EINVAL); + if (*value < 0) + return (ERANGE); + return (0); } @@ -1008,8 +1011,13 @@ rctl_string_to_rule(char *rulestr, struc error = str2int64(amountstr, &rule->rr_amount); if (error != 0) goto out; - if (RACCT_IS_IN_MILLIONS(rule->rr_resource)) + if (RACCT_IS_IN_MILLIONS(rule->rr_resource)) { + if (rule->rr_amount > INT64_MAX / 1000000) { + error = ERANGE; + goto out; + } rule->rr_amount *= 1000000; + } } if (perstr == NULL || perstr[0] == '\0') From owner-svn-src-head@freebsd.org Thu Mar 31 17:11:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ABA6AE4D2C; Thu, 31 Mar 2016 17:11:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 478581658; Thu, 31 Mar 2016 17:11:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VHBw8v072906; Thu, 31 Mar 2016 17:11:58 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VHBwFq072903; Thu, 31 Mar 2016 17:11:58 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603311711.u2VHBwFq072903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 31 Mar 2016 17:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297459 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 17:11:59 -0000 Author: np Date: Thu Mar 31 17:11:58 2016 New Revision: 297459 URL: https://svnweb.freebsd.org/changeset/base/297459 Log: Add wait_event_interruptible_timeout to linuxkpi. Submitted by: Krishnamraju Eraparaju @ Chelsio Reviewed by: hselasky@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D5776 Modified: head/sys/compat/linuxkpi/common/include/linux/jiffies.h head/sys/compat/linuxkpi/common/include/linux/wait.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/jiffies.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/jiffies.h Thu Mar 31 17:00:47 2016 (r297458) +++ head/sys/compat/linuxkpi/common/include/linux/jiffies.h Thu Mar 31 17:11:58 2016 (r297459) @@ -95,4 +95,14 @@ get_jiffies_64(void) return ((u64)(unsigned)ticks); } +static inline int +linux_timer_jiffies_until(unsigned long expires) +{ + int delta = expires - jiffies; + /* guard against already expired values */ + if (delta < 1) + delta = 1; + return (delta); +} + #endif /* _LINUX_JIFFIES_H_ */ Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/wait.h Thu Mar 31 17:00:47 2016 (r297458) +++ head/sys/compat/linuxkpi/common/include/linux/wait.h Thu Mar 31 17:11:58 2016 (r297459) @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -113,6 +114,52 @@ do { \ -_error; \ }) +#define wait_event_interruptible_timeout(q, cond, timeout) \ +({ \ + void *c = &(q).wchan; \ + long end = jiffies + timeout; \ + int __ret = 0; \ + int __rc = 0; \ + \ + if (!(cond)) { \ + for (; __rc == 0;) { \ + sleepq_lock(c); \ + if (cond) { \ + sleepq_release(c); \ + __ret = 1; \ + break; \ + } \ + sleepq_add(c, NULL, "completion", \ + SLEEPQ_SLEEP | SLEEPQ_INTERRUPTIBLE, 0); \ + sleepq_set_timeout(c, linux_timer_jiffies_until(end));\ + __rc = sleepq_timedwait_sig (c, 0); \ + if (__rc != 0) { \ + /* check for timeout or signal. \ + * 0 if the condition evaluated to false\ + * after the timeout elapsed, 1 if the \ + * condition evaluated to true after the\ + * timeout elapsed. \ + */ \ + if (__rc == EWOULDBLOCK) \ + __ret = (cond); \ + else \ + __ret = -ERESTARTSYS; \ + } \ + \ + } \ + } else { \ + /* return remaining jiffies (at least 1) if the \ + * condition evaluated to true before the timeout \ + * elapsed. \ + */ \ + __ret = (end - jiffies); \ + if( __ret < 1 ) \ + __ret = 1; \ + } \ + __ret; \ +}) + + static inline int waitqueue_active(wait_queue_head_t *q) { Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Mar 31 17:00:47 2016 (r297458) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Mar 31 17:11:58 2016 (r297459) @@ -894,16 +894,6 @@ kasprintf(gfp_t gfp, const char *fmt, .. return (p); } -static int -linux_timer_jiffies_until(unsigned long expires) -{ - int delta = expires - jiffies; - /* guard against already expired values */ - if (delta < 1) - delta = 1; - return (delta); -} - static void linux_timer_callback_wrapper(void *context) { From owner-svn-src-head@freebsd.org Thu Mar 31 17:15:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7196AE4DD2; Thu, 31 Mar 2016 17:15:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A1E618BF; Thu, 31 Mar 2016 17:15:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VHF311073067; Thu, 31 Mar 2016 17:15:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VHF3Ve073066; Thu, 31 Mar 2016 17:15:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603311715.u2VHF3Ve073066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 31 Mar 2016 17:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297460 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 17:15:04 -0000 Author: trasz Date: Thu Mar 31 17:15:03 2016 New Revision: 297460 URL: https://svnweb.freebsd.org/changeset/base/297460 Log: Improve comments. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/racct.h Modified: head/sys/sys/racct.h ============================================================================== --- head/sys/sys/racct.h Thu Mar 31 17:11:58 2016 (r297459) +++ head/sys/sys/racct.h Thu Mar 31 17:15:03 2016 (r297460) @@ -98,7 +98,7 @@ extern int racct_enable; /* * Resource usage can drop, as opposed to only grow. When the process - * terminates, its resource usage is freed from the respective + * terminates, its resource usage is subtracted from the respective * per-credential racct containers. */ #define RACCT_IS_RECLAIMABLE(X) (racct_types[X] & RACCT_RECLAIMABLE) @@ -126,8 +126,7 @@ extern int racct_enable; * When a process terminates, its resource usage is not automatically * subtracted from per-credential racct containers. Instead, the resource * usage of per-credential racct containers decays in time. - * Resource usage can olso drop for such resource. - * So far, the only such resource is RACCT_PCTCPU. + * Resource usage can also drop for such resource. */ #define RACCT_IS_DECAYING(X) (racct_types[X] & RACCT_DECAYING) From owner-svn-src-head@freebsd.org Thu Mar 31 17:27:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BDC1AE3111; Thu, 31 Mar 2016 17:27:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DD971F66; Thu, 31 Mar 2016 17:27:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VHR175076211; Thu, 31 Mar 2016 17:27:01 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VHR1MU076209; Thu, 31 Mar 2016 17:27:01 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603311727.u2VHR1MU076209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 31 Mar 2016 17:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297461 - in head: lib/libc libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 17:27:02 -0000 Author: bdrewery Date: Thu Mar 31 17:27:01 2016 New Revision: 297461 URL: https://svnweb.freebsd.org/changeset/base/297461 Log: WITHOUT_TOOLCHAIN: Fix build of rtld. MK_TOOLCHAIN==no disables building and installing of pic archives. c_pic.a is still needed for rtld though so force it to build in lib/libc and link directly to the objdir version of it for rtld. Somehow this has been broken since r148725. Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/Makefile head/libexec/rtld-elf/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Thu Mar 31 17:15:03 2016 (r297460) +++ head/lib/libc/Makefile Thu Mar 31 17:27:01 2016 (r297461) @@ -5,6 +5,9 @@ SHLIBDIR?= /lib .include +# Force building of libc_pic.a +MK_TOOLCHAIN= yes + LIBC_SRCTOP?= ${.CURDIR} # Pick the current architecture directory for libc. In general, this is Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Thu Mar 31 17:15:03 2016 (r297460) +++ head/libexec/rtld-elf/Makefile Thu Mar 31 17:27:01 2016 (r297461) @@ -45,6 +45,9 @@ CFLAGS+= -fvisibility=hidden .endif LDFLAGS+= -shared -Wl,-Bsymbolic LIBADD= c_pic +.if ${MK_TOOLCHAIN} == "no" +LDFLAGS+= -L${LIBCDIR} +.endif .if ${MACHINE_CPUARCH} == "arm" # Some of the required math functions (div & mod) are implemented in From owner-svn-src-head@freebsd.org Thu Mar 31 17:27:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 110E7AE313A; Thu, 31 Mar 2016 17:27:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D259210D6; Thu, 31 Mar 2016 17:27:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VHRE4J076262; Thu, 31 Mar 2016 17:27:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VHREKr076261; Thu, 31 Mar 2016 17:27:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603311727.u2VHREKr076261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 31 Mar 2016 17:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297462 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 17:27:16 -0000 Author: bdrewery Date: Thu Mar 31 17:27:14 2016 New Revision: 297462 URL: https://svnweb.freebsd.org/changeset/base/297462 Log: LIB32+WITHOUT_TOOLCHAIN: Fix build by staging includes. This is the same fix as r297281 for the normal build. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Thu Mar 31 17:27:01 2016 (r297461) +++ head/Makefile.libcompat Thu Mar 31 17:27:14 2016 (r297462) @@ -134,7 +134,8 @@ build${libcompat}: .PHONY ln -sf ${.CURDIR}/sys ${WORLDTMP} .for _t in obj includes .for _dir in ${_LC_INCDIRS} - ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATWMAKE} DIRPRFX=${_dir}/ ${_t} + ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATWMAKE} MK_INCLUDES=yes \ + DIRPRFX=${_dir}/ ${_t} .endfor .endfor .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic From owner-svn-src-head@freebsd.org Thu Mar 31 17:27:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22C2EAE3165; Thu, 31 Mar 2016 17:27:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E399910F8; Thu, 31 Mar 2016 17:27:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VHRIlu076310; Thu, 31 Mar 2016 17:27:18 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VHRInC076309; Thu, 31 Mar 2016 17:27:18 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603311727.u2VHRInC076309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 31 Mar 2016 17:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297463 - head/lib/libc/tests/ssp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 17:27:19 -0000 Author: bdrewery Date: Thu Mar 31 17:27:17 2016 New Revision: 297463 URL: https://svnweb.freebsd.org/changeset/base/297463 Log: WITHOUT_TOOLCHAIN: Skip building of h_raw. -fsanitize does not seem to work when a --sysroot is specified and there is no /usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.ubsan_standalone-*.a. Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/ssp/Makefile Modified: head/lib/libc/tests/ssp/Makefile ============================================================================== --- head/lib/libc/tests/ssp/Makefile Thu Mar 31 17:27:14 2016 (r297462) +++ head/lib/libc/tests/ssp/Makefile Thu Mar 31 17:27:17 2016 (r297463) @@ -32,7 +32,7 @@ PROGS+= h_memset # # sanitizer is not tested or supported for ARM right now. sbruno .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -.if ${COMPILER_TYPE} == "clang" +.if ${COMPILER_TYPE} == "clang" && ${MK_TOOLCHAIN} == "yes" .if ${COMPILER_VERSION} < 30500 || 30700 <= ${COMPILER_VERSION} PROGS+= h_raw .endif From owner-svn-src-head@freebsd.org Thu Mar 31 17:27:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 863EBAE31CA; Thu, 31 Mar 2016 17:27:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 493571394; Thu, 31 Mar 2016 17:27:31 +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 u2VHRURU076361; Thu, 31 Mar 2016 17:27:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VHRULV076360; Thu, 31 Mar 2016 17:27:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201603311727.u2VHRULV076360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 31 Mar 2016 17:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297464 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 17:27:31 -0000 Author: jhb Date: Thu Mar 31 17:27:30 2016 New Revision: 297464 URL: https://svnweb.freebsd.org/changeset/base/297464 Log: Tidy up the unmapped I/O code in qphysio. - Move some blocks around to reduce the number of 'if (unmap)' checks. - Use 'pbuf == NULL' instead of 'unmap'. - Use nitems. - Pull an assignment out of an if expression. Reviewed by: kib Sponsored by: Chelsio Communications Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Thu Mar 31 17:27:17 2016 (r297463) +++ head/sys/kern/vfs_aio.c Thu Mar 31 17:27:30 2016 (r297464) @@ -1173,7 +1173,7 @@ aio_qphysio(struct proc *p, struct kaioc struct cdevsw *csw; struct cdev *dev; struct kaioinfo *ki; - int error, ref, unmap, poff; + int error, ref, poff; vm_prot_t prot; cb = &job->uaiocb; @@ -1206,12 +1206,13 @@ aio_qphysio(struct proc *p, struct kaioc ki = p->p_aioinfo; poff = (vm_offset_t)cb->aio_buf & PAGE_MASK; - unmap = ((dev->si_flags & SI_UNMAPPED) && unmapped_buf_allowed); - if (unmap) { + if ((dev->si_flags & SI_UNMAPPED) && unmapped_buf_allowed) { if (cb->aio_nbytes > MAXPHYS) { error = -1; goto unref; } + + pbuf = NULL; } else { if (cb->aio_nbytes > MAXPHYS - poff) { error = -1; @@ -1221,18 +1222,14 @@ aio_qphysio(struct proc *p, struct kaioc error = -1; goto unref; } - } - job->bp = bp = g_alloc_bio(); - if (!unmap) { + job->pbuf = pbuf = (struct buf *)getpbuf(NULL); BUF_KERNPROC(pbuf); - } else - pbuf = NULL; - - AIO_LOCK(ki); - if (!unmap) + AIO_LOCK(ki); ki->kaio_buffer_count++; - AIO_UNLOCK(ki); + AIO_UNLOCK(ki); + } + job->bp = bp = g_alloc_bio(); bp->bio_length = cb->aio_nbytes; bp->bio_bcount = cb->aio_nbytes; @@ -1246,17 +1243,18 @@ aio_qphysio(struct proc *p, struct kaioc prot = VM_PROT_READ; if (cb->aio_lio_opcode == LIO_READ) prot |= VM_PROT_WRITE; /* Less backwards than it looks */ - if ((job->npages = vm_fault_quick_hold_pages( - &curproc->p_vmspace->vm_map, + job->npages = vm_fault_quick_hold_pages(&curproc->p_vmspace->vm_map, (vm_offset_t)bp->bio_data, bp->bio_length, prot, job->pages, - sizeof(job->pages)/sizeof(job->pages[0]))) < 0) { + nitems(job->pages)); + if (job->npages < 0) { error = EFAULT; goto doerror; } - if (!unmap) { + if (pbuf != NULL) { pmap_qenter((vm_offset_t)pbuf->b_data, job->pages, job->npages); bp->bio_data = pbuf->b_data + poff; + atomic_add_int(&num_buf_aio, 1); } else { bp->bio_ma = job->pages; bp->bio_ma_n = job->npages; @@ -1265,20 +1263,16 @@ aio_qphysio(struct proc *p, struct kaioc bp->bio_flags |= BIO_UNMAPPED; } - if (!unmap) - atomic_add_int(&num_buf_aio, 1); - /* Perform transfer. */ csw->d_strategy(bp); dev_relthread(dev, ref); return (0); doerror: - AIO_LOCK(ki); - if (!unmap) + if (pbuf != NULL) { + AIO_LOCK(ki); ki->kaio_buffer_count--; - AIO_UNLOCK(ki); - if (pbuf) { + AIO_UNLOCK(ki); relpbuf(pbuf, NULL); job->pbuf = NULL; } From owner-svn-src-head@freebsd.org Thu Mar 31 17:32:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA0ECAE3413; Thu, 31 Mar 2016 17:32:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A02CC185D; Thu, 31 Mar 2016 17:32:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VHWS17079174; Thu, 31 Mar 2016 17:32:28 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VHWSQg079173; Thu, 31 Mar 2016 17:32:28 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603311732.u2VHWSQg079173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 31 Mar 2016 17:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297465 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 17:32:30 -0000 Author: trasz Date: Thu Mar 31 17:32:28 2016 New Revision: 297465 URL: https://svnweb.freebsd.org/changeset/base/297465 Log: Refactor; no functional changes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_rctl.c Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Thu Mar 31 17:27:30 2016 (r297464) +++ head/sys/kern/kern_rctl.c Thu Mar 31 17:32:28 2016 (r297465) @@ -219,43 +219,43 @@ rctl_resource_name(int resource) panic("rctl_resource_name: unknown resource %d", resource); } -/* - * Return the amount of resource that can be allocated by 'p' before - * hitting 'rule'. - */ -static int64_t -rctl_available_resource(const struct proc *p, const struct rctl_rule *rule) +static struct racct * +rctl_proc_rule_to_racct(const struct proc *p, const struct rctl_rule *rule) { - int resource; - int64_t available = INT64_MAX; struct ucred *cred = p->p_ucred; ASSERT_RACCT_ENABLED(); rw_assert(&rctl_lock, RA_LOCKED); - resource = rule->rr_resource; switch (rule->rr_per) { case RCTL_SUBJECT_TYPE_PROCESS: - available = rule->rr_amount - - p->p_racct->r_resources[resource]; - break; + return (p->p_racct); case RCTL_SUBJECT_TYPE_USER: - available = rule->rr_amount - - cred->cr_ruidinfo->ui_racct->r_resources[resource]; - break; + return (cred->cr_ruidinfo->ui_racct); case RCTL_SUBJECT_TYPE_LOGINCLASS: - available = rule->rr_amount - - cred->cr_loginclass->lc_racct->r_resources[resource]; - break; + return (cred->cr_loginclass->lc_racct); case RCTL_SUBJECT_TYPE_JAIL: - available = rule->rr_amount - - cred->cr_prison->pr_prison_racct->prr_racct-> - r_resources[resource]; - break; + return (cred->cr_prison->pr_prison_racct->prr_racct); default: - panic("rctl_compute_available: unknown per %d", - rule->rr_per); + panic("%s: unknown per %d", __func__, rule->rr_per); } +} + +/* + * Return the amount of resource that can be allocated by 'p' before + * hitting 'rule'. + */ +static int64_t +rctl_available_resource(const struct proc *p, const struct rctl_rule *rule) +{ + int64_t available; + const struct racct *racct; + + ASSERT_RACCT_ENABLED(); + rw_assert(&rctl_lock, RA_LOCKED); + + racct = rctl_proc_rule_to_racct(p, rule); + available = rule->rr_amount - racct->r_resources[rule->rr_resource]; return (available); } From owner-svn-src-head@freebsd.org Thu Mar 31 18:10:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B40F4AD6475; Thu, 31 Mar 2016 18:10:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 722F01E99; Thu, 31 Mar 2016 18:10:30 +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 u2VIAT8f089199; Thu, 31 Mar 2016 18:10:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VIATsi089196; Thu, 31 Mar 2016 18:10:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201603311810.u2VIATsi089196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 31 Mar 2016 18:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297466 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 18:10:30 -0000 Author: jhb Date: Thu Mar 31 18:10:29 2016 New Revision: 297466 URL: https://svnweb.freebsd.org/changeset/base/297466 Log: Rework handling of thread sleeps before timers are working. Previously, calls to *sleep() and cv_*wait*() immediately returned during early boot. Instead, permit threads that request a sleep without a timeout to sleep as wakeup() works during early boot. Sleeps with timeouts are harder to emulate without working timers, so just punt and panic explicitly if any thread tries to use those before timers are working. Any threads that depend on timeouts should either wait until SI_SUB_KICK_SCHEDULER to start or they should use DELAY() until timers are available. Until APs are started earlier this should be a no-op as other kthreads shouldn't get a chance to start running until after timers are working regardless of when they were created. Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D5724 Modified: head/sys/kern/kern_condvar.c head/sys/kern/kern_synch.c head/sys/kern/subr_sleepqueue.c Modified: head/sys/kern/kern_condvar.c ============================================================================== --- head/sys/kern/kern_condvar.c Thu Mar 31 17:32:28 2016 (r297465) +++ head/sys/kern/kern_condvar.c Thu Mar 31 18:10:29 2016 (r297466) @@ -122,15 +122,8 @@ _cv_wait(struct cv *cvp, struct lock_obj "Waiting on \"%s\"", cvp->cv_description); class = LOCK_CLASS(lock); - if (cold || SCHEDULER_STOPPED()) { - /* - * During autoconfiguration, just give interrupts - * a chance, then just return. Don't run any other - * thread or panic below, in case this is the idle - * process and already asleep. - */ + if (SCHEDULER_STOPPED()) return; - } sleepq_lock(cvp); @@ -183,13 +176,7 @@ _cv_wait_unlock(struct cv *cvp, struct l ("cv_wait_unlock cannot be used with Giant")); class = LOCK_CLASS(lock); - if (cold || SCHEDULER_STOPPED()) { - /* - * During autoconfiguration, just give interrupts - * a chance, then just return. Don't run any other - * thread or panic below, in case this is the idle - * process and already asleep. - */ + if (SCHEDULER_STOPPED()) { class->lc_unlock(lock); return; } @@ -240,15 +227,8 @@ _cv_wait_sig(struct cv *cvp, struct lock "Waiting on \"%s\"", cvp->cv_description); class = LOCK_CLASS(lock); - if (cold || SCHEDULER_STOPPED()) { - /* - * After a panic, or during autoconfiguration, just give - * interrupts a chance, then just return; don't run any other - * procs or panic below, in case this is the idle process and - * already asleep. - */ + if (SCHEDULER_STOPPED()) return (0); - } sleepq_lock(cvp); @@ -307,15 +287,8 @@ _cv_timedwait_sbt(struct cv *cvp, struct "Waiting on \"%s\"", cvp->cv_description); class = LOCK_CLASS(lock); - if (cold || SCHEDULER_STOPPED()) { - /* - * After a panic, or during autoconfiguration, just give - * interrupts a chance, then just return; don't run any other - * thread or panic below, in case this is the idle process and - * already asleep. - */ - return 0; - } + if (SCHEDULER_STOPPED()) + return (0); sleepq_lock(cvp); @@ -376,15 +349,8 @@ _cv_timedwait_sig_sbt(struct cv *cvp, st "Waiting on \"%s\"", cvp->cv_description); class = LOCK_CLASS(lock); - if (cold || SCHEDULER_STOPPED()) { - /* - * After a panic, or during autoconfiguration, just give - * interrupts a chance, then just return; don't run any other - * thread or panic below, in case this is the idle process and - * already asleep. - */ - return 0; - } + if (SCHEDULER_STOPPED()) + return (0); sleepq_lock(cvp); Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Thu Mar 31 17:32:28 2016 (r297465) +++ head/sys/kern/kern_synch.c Thu Mar 31 18:10:29 2016 (r297466) @@ -162,15 +162,7 @@ _sleep(void *ident, struct lock_object * else class = NULL; - if (cold || SCHEDULER_STOPPED()) { - /* - * During autoconfiguration, just return; - * don't run any other threads or panic below, - * in case this is the idle thread and already asleep. - * XXX: this used to do "s = splhigh(); splx(safepri); - * splx(s);" to give interrupts a chance, but there is - * no way to give interrupts a chance now. - */ + if (SCHEDULER_STOPPED()) { if (lock != NULL && priority & PDROP) class->lc_unlock(lock); return (0); @@ -264,17 +256,8 @@ msleep_spin_sbt(void *ident, struct mtx KASSERT(p != NULL, ("msleep1")); KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep")); - if (cold || SCHEDULER_STOPPED()) { - /* - * During autoconfiguration, just return; - * don't run any other threads or panic below, - * in case this is the idle thread and already asleep. - * XXX: this used to do "s = splhigh(); splx(safepri); - * splx(s);" to give interrupts a chance, but there is - * no way to give interrupts a chance now. - */ + if (SCHEDULER_STOPPED()) return (0); - } sleepq_lock(ident); CTR5(KTR_PROC, "msleep_spin: thread %ld (pid %ld, %s) on %s (%p)", Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Thu Mar 31 17:32:28 2016 (r297465) +++ head/sys/kern/subr_sleepqueue.c Thu Mar 31 18:10:29 2016 (r297466) @@ -385,6 +385,8 @@ sleepq_set_timeout_sbt(void *wchan, sbin MPASS(TD_ON_SLEEPQ(td)); MPASS(td->td_sleepqueue == NULL); MPASS(wchan != NULL); + if (cold) + panic("timed sleep before timers are working"); callout_reset_sbt_on(&td->td_slpcallout, sbt, pr, sleepq_timeout, td, PCPU_GET(cpuid), flags | C_DIRECT_EXEC); } From owner-svn-src-head@freebsd.org Thu Mar 31 18:36:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7B8AAD6E84; Thu, 31 Mar 2016 18:36:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C335C1E7E; Thu, 31 Mar 2016 18:36:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VIaout098516; Thu, 31 Mar 2016 18:36:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VIaogp098514; Thu, 31 Mar 2016 18:36:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201603311836.u2VIaogp098514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 31 Mar 2016 18:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297467 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 18:36:52 -0000 Author: jhb Date: Thu Mar 31 18:36:50 2016 New Revision: 297467 URL: https://svnweb.freebsd.org/changeset/base/297467 Log: Remove #ifdef's from various structures used in the cxgbe/cxl driver. This provides a constant ABI and layout for these structures (especially struct adapter) avoiding some foot shooting. Discussed with: np Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/offload.h Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Mar 31 18:10:29 2016 (r297466) +++ head/sys/dev/cxgbe/adapter.h Thu Mar 31 18:36:50 2016 (r297467) @@ -246,12 +246,10 @@ struct vi_info { int rsrv_noflowq; /* Reserve queue 0 for non-flowid packets */ int nrxq; /* # of rx queues */ int first_rxq; /* index of first rx queue */ -#ifdef TCP_OFFLOAD int nofldtxq; /* # of offload tx queues */ int first_ofld_txq; /* index of first offload tx queue */ int nofldrxq; /* # of offload rx queues */ int first_ofld_rxq; /* index of first offload rx queue */ -#endif int tmr_idx; int pktc_idx; int qsize_rxq; @@ -311,9 +309,7 @@ struct cluster_layout { struct cluster_metadata { u_int refcount; -#ifdef INVARIANTS struct fl_sdesc *sd; /* For debug only. Could easily be stale */ -#endif }; struct fl_sdesc { @@ -571,7 +567,6 @@ iq_to_rxq(struct sge_iq *iq) } -#ifdef TCP_OFFLOAD /* ofld_rxq: SGE ingress queue + SGE free list + miscellaneous items */ struct sge_ofld_rxq { struct sge_iq iq; /* MUST be first */ @@ -584,7 +579,6 @@ iq_to_ofld_rxq(struct sge_iq *iq) return (__containerof(iq, struct sge_ofld_rxq, iq)); } -#endif struct wrqe { STAILQ_ENTRY(wrqe) link; @@ -636,7 +630,6 @@ struct sge_wrq { } __aligned(CACHE_LINE_SIZE); -#ifdef DEV_NETMAP struct sge_nm_rxq { struct vi_info *vi; @@ -691,19 +684,14 @@ struct sge_nm_txq { bus_addr_t ba; int iqidx; } __aligned(CACHE_LINE_SIZE); -#endif struct sge { int nrxq; /* total # of Ethernet rx queues */ int ntxq; /* total # of Ethernet tx tx queues */ -#ifdef TCP_OFFLOAD int nofldrxq; /* total # of TOE rx queues */ int nofldtxq; /* total # of TOE tx queues */ -#endif -#ifdef DEV_NETMAP int nnmrxq; /* total # of netmap rx queues */ int nnmtxq; /* total # of netmap tx queues */ -#endif int niq; /* total # of ingress queues */ int neq; /* total # of egress queues */ @@ -712,14 +700,10 @@ struct sge { struct sge_wrq *ctrlq; /* Control queues */ struct sge_txq *txq; /* NIC tx queues */ struct sge_rxq *rxq; /* NIC rx queues */ -#ifdef TCP_OFFLOAD struct sge_wrq *ofld_txq; /* TOE tx queues */ struct sge_ofld_rxq *ofld_rxq; /* TOE rx queues */ -#endif -#ifdef DEV_NETMAP struct sge_nm_txq *nm_txq; /* netmap tx queues */ struct sge_nm_rxq *nm_rxq; /* netmap rx queues */ -#endif uint16_t iq_start; int eq_start; @@ -778,20 +762,16 @@ struct adapter { struct port_info *port[MAX_NPORTS]; uint8_t chan_map[MAX_NCHAN]; -#ifdef TCP_OFFLOAD void *tom_softc; /* (struct tom_data *) */ struct tom_tunables tt; void *iwarp_softc; /* (struct c4iw_dev *) */ void *iscsi_ulp_softc; /* (struct cxgbei_data *) */ -#endif struct l2t_data *l2t; /* L2 table */ struct tid_info tids; uint16_t doorbells; -#ifdef TCP_OFFLOAD int offload_map; /* ports with IFCAP_TOE enabled */ int active_ulds; /* ULDs activated on this adapter */ -#endif int flags; int debug_flags; @@ -840,11 +820,9 @@ struct adapter { fw_msg_handler_t fw_msg_handler[7]; /* NUM_FW6_TYPES */ cpl_handler_t cpl_handler[0xef]; /* NUM_CPL_CMDS */ -#ifdef INVARIANTS const char *last_op; const void *last_op_thr; int last_op_flags; -#endif int sc_do_rxcopy; }; Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Thu Mar 31 18:10:29 2016 (r297466) +++ head/sys/dev/cxgbe/offload.h Thu Mar 31 18:36:50 2016 (r297467) @@ -125,7 +125,6 @@ struct t4_virt_res { struct t4_range l2t; }; -#ifdef TCP_OFFLOAD enum { ULD_TOM = 0, ULD_IWARP, @@ -152,6 +151,7 @@ struct tom_tunables { int tx_align; }; +#ifdef TCP_OFFLOAD int t4_register_uld(struct uld_info *); int t4_unregister_uld(struct uld_info *); int t4_activate_uld(struct adapter *, int); From owner-svn-src-head@freebsd.org Thu Mar 31 18:50:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E898CAE435A; Thu, 31 Mar 2016 18:50:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4F29188C; Thu, 31 Mar 2016 18:50:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VIo757001985; Thu, 31 Mar 2016 18:50:07 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VIo69v001979; Thu, 31 Mar 2016 18:50:06 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201603311850.u2VIo69v001979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 31 Mar 2016 18:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297468 - in head/sys: compat/cloudabi compat/cloudabi64 contrib/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 18:50:08 -0000 Author: ed Date: Thu Mar 31 18:50:06 2016 New Revision: 297468 URL: https://svnweb.freebsd.org/changeset/base/297468 Log: Sync in the latest CloudABI system call definitions. Some time ago I made a change to merge together the memory scope definitions used by mmap (MAP_{PRIVATE,SHARED}) and lock objects (PTHREAD_PROCESS_{PRIVATE,SHARED}). Though that sounded pretty smart back then, it's backfiring. In the case of mmap it's used with other flags in a bitmask, but for locking it's an enumeration. As our plan is to automatically generate bindings for other languages, that looks a bit sloppy. Change all of the locking functions to use separate flags instead. Obtained from: https://github.com/NuxiNL/cloudabi Modified: head/sys/compat/cloudabi/cloudabi_futex.c head/sys/compat/cloudabi/cloudabi_util.h head/sys/compat/cloudabi64/cloudabi64_systrace_args.c head/sys/contrib/cloudabi/cloudabi64_types.h head/sys/contrib/cloudabi/cloudabi_types_common.h head/sys/contrib/cloudabi/syscalls.master Modified: head/sys/compat/cloudabi/cloudabi_futex.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_futex.c Thu Mar 31 18:36:50 2016 (r297467) +++ head/sys/compat/cloudabi/cloudabi_futex.c Thu Mar 31 18:50:06 2016 (r297468) @@ -212,16 +212,16 @@ static int futex_user_cmpxchg(uint32_t * static int futex_address_create(struct futex_address *fa, struct thread *td, - const void *object, cloudabi_mflags_t scope) + const void *object, cloudabi_scope_t scope) { KASSERT(td == curthread, ("Can only create umtx keys for the current thread")); switch (scope) { - case CLOUDABI_MAP_PRIVATE: + case CLOUDABI_SCOPE_PRIVATE: return (umtx_key_get(object, TYPE_FUTEX, THREAD_SHARE, &fa->fa_key)); - case CLOUDABI_MAP_SHARED: + case CLOUDABI_SCOPE_SHARED: return (umtx_key_get(object, TYPE_FUTEX, AUTO_SHARE, &fa->fa_key)); default: @@ -259,7 +259,7 @@ futex_condvar_assert(const struct futex_ static int futex_condvar_lookup(struct thread *td, const cloudabi_condvar_t *address, - cloudabi_mflags_t scope, struct futex_condvar **fcret) + cloudabi_scope_t scope, struct futex_condvar **fcret) { struct futex_address fa_condvar; struct futex_condvar *fc; @@ -286,8 +286,8 @@ futex_condvar_lookup(struct thread *td, static int futex_condvar_lookup_or_create(struct thread *td, - const cloudabi_condvar_t *condvar, cloudabi_mflags_t condvar_scope, - const cloudabi_lock_t *lock, cloudabi_mflags_t lock_scope, + const cloudabi_condvar_t *condvar, cloudabi_scope_t condvar_scope, + const cloudabi_lock_t *lock, cloudabi_scope_t lock_scope, struct futex_condvar **fcret) { struct futex_address fa_condvar, fa_lock; @@ -385,7 +385,7 @@ futex_lock_assert(const struct futex_loc static int futex_lock_lookup(struct thread *td, const cloudabi_lock_t *address, - cloudabi_mflags_t scope, struct futex_lock **flret) + cloudabi_scope_t scope, struct futex_lock **flret) { struct futex_address fa; int error; @@ -974,8 +974,8 @@ futex_user_cmpxchg(uint32_t *obj, uint32 int cloudabi_futex_condvar_wait(struct thread *td, cloudabi_condvar_t *condvar, - cloudabi_mflags_t condvar_scope, cloudabi_lock_t *lock, - cloudabi_mflags_t lock_scope, cloudabi_clockid_t clock_id, + cloudabi_scope_t condvar_scope, cloudabi_lock_t *lock, + cloudabi_scope_t lock_scope, cloudabi_clockid_t clock_id, cloudabi_timestamp_t timeout, cloudabi_timestamp_t precision) { struct futex_condvar *fc; @@ -1047,7 +1047,7 @@ cloudabi_futex_condvar_wait(struct threa int cloudabi_futex_lock_rdlock(struct thread *td, cloudabi_lock_t *lock, - cloudabi_mflags_t scope, cloudabi_clockid_t clock_id, + cloudabi_scope_t scope, cloudabi_clockid_t clock_id, cloudabi_timestamp_t timeout, cloudabi_timestamp_t precision) { struct futex_lock *fl; @@ -1066,7 +1066,7 @@ cloudabi_futex_lock_rdlock(struct thread int cloudabi_futex_lock_wrlock(struct thread *td, cloudabi_lock_t *lock, - cloudabi_mflags_t scope, cloudabi_clockid_t clock_id, + cloudabi_scope_t scope, cloudabi_clockid_t clock_id, cloudabi_timestamp_t timeout, cloudabi_timestamp_t precision) { struct futex_lock *fl; Modified: head/sys/compat/cloudabi/cloudabi_util.h ============================================================================== --- head/sys/compat/cloudabi/cloudabi_util.h Thu Mar 31 18:36:50 2016 (r297467) +++ head/sys/compat/cloudabi/cloudabi_util.h Thu Mar 31 18:50:06 2016 (r297468) @@ -67,13 +67,13 @@ int cloudabi_convert_timespec(const stru * sleep on a lock or condition variable. */ int cloudabi_futex_condvar_wait(struct thread *, cloudabi_condvar_t *, - cloudabi_mflags_t, cloudabi_lock_t *, cloudabi_mflags_t, cloudabi_clockid_t, + cloudabi_scope_t, cloudabi_lock_t *, cloudabi_scope_t, cloudabi_clockid_t, cloudabi_timestamp_t, cloudabi_timestamp_t); int cloudabi_futex_lock_rdlock(struct thread *, cloudabi_lock_t *, - cloudabi_mflags_t, cloudabi_clockid_t, cloudabi_timestamp_t, + cloudabi_scope_t, cloudabi_clockid_t, cloudabi_timestamp_t, cloudabi_timestamp_t); int cloudabi_futex_lock_wrlock(struct thread *, cloudabi_lock_t *, - cloudabi_mflags_t, cloudabi_clockid_t, cloudabi_timestamp_t, + cloudabi_scope_t, cloudabi_clockid_t, cloudabi_timestamp_t, cloudabi_timestamp_t); #endif Modified: head/sys/compat/cloudabi64/cloudabi64_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Thu Mar 31 18:36:50 2016 (r297467) +++ head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Thu Mar 31 18:50:06 2016 (r297468) @@ -30,7 +30,7 @@ systrace_args(int sysnum, void *params, case 2: { struct cloudabi_sys_condvar_signal_args *p = params; uarg[0] = (intptr_t) p->condvar; /* cloudabi_condvar_t * */ - iarg[1] = p->scope; /* cloudabi_mflags_t */ + iarg[1] = p->scope; /* cloudabi_scope_t */ iarg[2] = p->nwaiters; /* cloudabi_nthreads_t */ *n_args = 3; break; @@ -297,7 +297,7 @@ systrace_args(int sysnum, void *params, case 31: { struct cloudabi_sys_lock_unlock_args *p = params; uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ - iarg[1] = p->scope; /* cloudabi_mflags_t */ + iarg[1] = p->scope; /* cloudabi_scope_t */ *n_args = 2; break; } @@ -493,7 +493,7 @@ systrace_args(int sysnum, void *params, case 54: { struct cloudabi_sys_thread_exit_args *p = params; uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ - iarg[1] = p->scope; /* cloudabi_mflags_t */ + iarg[1] = p->scope; /* cloudabi_scope_t */ *n_args = 2; break; } @@ -561,7 +561,7 @@ systrace_entry_setargdesc(int sysnum, in p = "cloudabi_condvar_t *"; break; case 1: - p = "cloudabi_mflags_t"; + p = "cloudabi_scope_t"; break; case 2: p = "cloudabi_nthreads_t"; @@ -1043,7 +1043,7 @@ systrace_entry_setargdesc(int sysnum, in p = "cloudabi_lock_t *"; break; case 1: - p = "cloudabi_mflags_t"; + p = "cloudabi_scope_t"; break; default: break; @@ -1377,7 +1377,7 @@ systrace_entry_setargdesc(int sysnum, in p = "cloudabi_lock_t *"; break; case 1: - p = "cloudabi_mflags_t"; + p = "cloudabi_scope_t"; break; default: break; Modified: head/sys/contrib/cloudabi/cloudabi64_types.h ============================================================================== --- head/sys/contrib/cloudabi/cloudabi64_types.h Thu Mar 31 18:36:50 2016 (r297467) +++ head/sys/contrib/cloudabi/cloudabi64_types.h Thu Mar 31 18:50:06 2016 (r297468) @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Nuxi, https://nuxi.nl/ +// Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions @@ -20,8 +20,9 @@ // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. - +// // This file is automatically generated. Do not edit. +// // Source: https://github.com/NuxiNL/cloudabi #ifndef CLOUDABI64_TYPES_H @@ -101,6 +102,8 @@ _Static_assert(offsetof(cloudabi64_iovec _Static_assert(sizeof(cloudabi64_iovec_t) == 16, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_iovec_t) == 8, "Incorrect layout"); +typedef void cloudabi64_processentry_t(uint64_t auxv); + typedef struct { _Alignas(8) uint64_t ri_data; _Alignas(8) uint64_t ri_datalen; @@ -153,8 +156,8 @@ typedef struct { struct { _Alignas(8) uint64_t condvar; _Alignas(8) uint64_t lock; - _Alignas(1) cloudabi_mflags_t condvar_scope; - _Alignas(1) cloudabi_mflags_t lock_scope; + _Alignas(1) cloudabi_scope_t condvar_scope; + _Alignas(1) cloudabi_scope_t lock_scope; } condvar; struct { _Alignas(4) cloudabi_fd_t fd; @@ -162,7 +165,7 @@ typedef struct { } fd_readwrite; struct { _Alignas(8) uint64_t lock; - _Alignas(1) cloudabi_mflags_t lock_scope; + _Alignas(1) cloudabi_scope_t lock_scope; } lock; struct { _Alignas(4) cloudabi_fd_t fd; Modified: head/sys/contrib/cloudabi/cloudabi_types_common.h ============================================================================== --- head/sys/contrib/cloudabi/cloudabi_types_common.h Thu Mar 31 18:36:50 2016 (r297467) +++ head/sys/contrib/cloudabi/cloudabi_types_common.h Thu Mar 31 18:50:06 2016 (r297468) @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Nuxi, https://nuxi.nl/ +// Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions @@ -20,8 +20,9 @@ // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. - +// // This file is automatically generated. Do not edit. +// // Source: https://github.com/NuxiNL/cloudabi #ifndef CLOUDABI_TYPES_COMMON_H @@ -47,6 +48,7 @@ typedef uint8_t cloudabi_advice_t; typedef uint32_t cloudabi_auxtype_t; #define CLOUDABI_AT_ARGDATA 256 #define CLOUDABI_AT_ARGDATALEN 257 +#define CLOUDABI_AT_BASE 7 #define CLOUDABI_AT_CANARY 258 #define CLOUDABI_AT_CANARYLEN 259 #define CLOUDABI_AT_NCPUS 260 @@ -298,6 +300,10 @@ typedef uint8_t cloudabi_sa_family_t; #define CLOUDABI_AF_INET6 2 #define CLOUDABI_AF_UNIX 3 +typedef uint8_t cloudabi_scope_t; +#define CLOUDABI_SCOPE_PRIVATE 4 +#define CLOUDABI_SCOPE_SHARED 8 + typedef uint8_t cloudabi_sdflags_t; #define CLOUDABI_SHUT_RD 0x01 #define CLOUDABI_SHUT_WR 0x02 Modified: head/sys/contrib/cloudabi/syscalls.master ============================================================================== --- head/sys/contrib/cloudabi/syscalls.master Thu Mar 31 18:36:50 2016 (r297467) +++ head/sys/contrib/cloudabi/syscalls.master Thu Mar 31 18:50:06 2016 (r297468) @@ -1,6 +1,6 @@ $FreeBSD$ -; Copyright (c) 2016 Nuxi, https://nuxi.nl/ +; Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions @@ -22,8 +22,9 @@ ; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ; SUCH DAMAGE. - +; ; This file is automatically generated. Do not edit. +; ; Source: https://github.com/NuxiNL/cloudabi #include @@ -44,7 +45,7 @@ 2 AUE_NULL STD { void cloudabi_sys_condvar_signal( \ cloudabi_condvar_t *condvar, \ - cloudabi_mflags_t scope, \ + cloudabi_scope_t scope, \ cloudabi_nthreads_t nwaiters); } 3 AUE_NULL STD { void cloudabi_sys_fd_close( \ @@ -196,7 +197,7 @@ 31 AUE_NULL STD { void cloudabi_sys_lock_unlock( \ cloudabi_lock_t *lock, \ - cloudabi_mflags_t scope); } + cloudabi_scope_t scope); } 32 AUE_NULL STD { void cloudabi_sys_mem_advise( \ void *addr, \ @@ -301,7 +302,7 @@ 54 AUE_NULL STD { void cloudabi_sys_thread_exit( \ cloudabi_lock_t *lock, \ - cloudabi_mflags_t scope); } + cloudabi_scope_t scope); } 55 AUE_NULL STD { void cloudabi_sys_thread_tcb_set( \ void *tcb); } From owner-svn-src-head@freebsd.org Thu Mar 31 18:50:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16CB4AE43DD; Thu, 31 Mar 2016 18:50:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E66341B91; Thu, 31 Mar 2016 18:50:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VIor7U002056; Thu, 31 Mar 2016 18:50:53 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VIoqSq002051; Thu, 31 Mar 2016 18:50:52 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201603311850.u2VIoqSq002051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 31 Mar 2016 18:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297469 - head/sys/compat/cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 18:50:54 -0000 Author: ed Date: Thu Mar 31 18:50:52 2016 New Revision: 297469 URL: https://svnweb.freebsd.org/changeset/base/297469 Log: Regenerate system call table after r297468. Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_syscall.h head/sys/compat/cloudabi64/cloudabi64_syscalls.c head/sys/compat/cloudabi64/cloudabi64_sysent.c Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h Thu Mar 31 18:50:06 2016 (r297468) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h Thu Mar 31 18:50:52 2016 (r297469) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297252 2016-03-24 21:48:41Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed */ #ifndef _CLOUDABI64_SYSPROTO_H_ @@ -43,7 +43,7 @@ struct cloudabi_sys_clock_time_get_args }; struct cloudabi_sys_condvar_signal_args { char condvar_l_[PADL_(cloudabi_condvar_t *)]; cloudabi_condvar_t * condvar; char condvar_r_[PADR_(cloudabi_condvar_t *)]; - char scope_l_[PADL_(cloudabi_mflags_t)]; cloudabi_mflags_t scope; char scope_r_[PADR_(cloudabi_mflags_t)]; + char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; char nwaiters_l_[PADL_(cloudabi_nthreads_t)]; cloudabi_nthreads_t nwaiters; char nwaiters_r_[PADR_(cloudabi_nthreads_t)]; }; struct cloudabi_sys_fd_close_args { @@ -194,7 +194,7 @@ struct cloudabi_sys_file_unlink_args { }; struct cloudabi_sys_lock_unlock_args { char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)]; - char scope_l_[PADL_(cloudabi_mflags_t)]; cloudabi_mflags_t scope; char scope_r_[PADR_(cloudabi_mflags_t)]; + char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; }; struct cloudabi_sys_mem_advise_args { char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; @@ -300,7 +300,7 @@ struct cloudabi64_sys_thread_create_args }; struct cloudabi_sys_thread_exit_args { char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)]; - char scope_l_[PADL_(cloudabi_mflags_t)]; cloudabi_mflags_t scope; char scope_r_[PADR_(cloudabi_mflags_t)]; + char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; }; struct cloudabi_sys_thread_tcb_set_args { char tcb_l_[PADL_(void *)]; void * tcb; char tcb_r_[PADR_(void *)]; Modified: head/sys/compat/cloudabi64/cloudabi64_syscall.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscall.h Thu Mar 31 18:50:06 2016 (r297468) +++ head/sys/compat/cloudabi64/cloudabi64_syscall.h Thu Mar 31 18:50:52 2016 (r297469) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297252 2016-03-24 21:48:41Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed */ #define CLOUDABI64_SYS_cloudabi_sys_clock_res_get 0 Modified: head/sys/compat/cloudabi64/cloudabi64_syscalls.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscalls.c Thu Mar 31 18:50:06 2016 (r297468) +++ head/sys/compat/cloudabi64/cloudabi64_syscalls.c Thu Mar 31 18:50:52 2016 (r297469) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297252 2016-03-24 21:48:41Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed */ const char *cloudabi64_syscallnames[] = { Modified: head/sys/compat/cloudabi64/cloudabi64_sysent.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sysent.c Thu Mar 31 18:50:06 2016 (r297468) +++ head/sys/compat/cloudabi64/cloudabi64_sysent.c Thu Mar 31 18:50:52 2016 (r297469) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297252 2016-03-24 21:48:41Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed */ #include From owner-svn-src-head@freebsd.org Thu Mar 31 18:52:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E015DAE4554; Thu, 31 Mar 2016 18:52:01 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 977FE1DCB; Thu, 31 Mar 2016 18:52:01 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VIq0ct004281; Thu, 31 Mar 2016 18:52:00 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VIq0Xh004278; Thu, 31 Mar 2016 18:52:00 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201603311852.u2VIq0Xh004278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 31 Mar 2016 18:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297470 - in head/sys: amd64/cloudabi64 arm64/cloudabi64 compat/cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 18:52:02 -0000 Author: ed Date: Thu Mar 31 18:52:00 2016 New Revision: 297470 URL: https://svnweb.freebsd.org/changeset/base/297470 Log: Make Position Independent Executables work for CloudABI. - Set BI_CAN_EXEC_DYN, so we can execute ET_DYN ELF files in addition to regular ET_EXECs. - Provide an AT_BASE entry in the auxiliary vector, so the executable knows at which address it got loaded and can apply relocations. Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c head/sys/arm64/cloudabi64/cloudabi64_sysvec.c head/sys/compat/cloudabi64/cloudabi64_module.c Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Thu Mar 31 18:50:52 2016 (r297469) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Thu Mar 31 18:52:00 2016 (r297470) @@ -156,5 +156,6 @@ Elf64_Brandinfo cloudabi64_brand = { .brand = ELFOSABI_CLOUDABI, .machine = EM_X86_64, .sysvec = &cloudabi64_elf_sysvec, + .flags = BI_CAN_EXEC_DYN, .compat_3_brand = "CloudABI", }; Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Thu Mar 31 18:50:52 2016 (r297469) +++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Thu Mar 31 18:52:00 2016 (r297470) @@ -157,5 +157,6 @@ Elf64_Brandinfo cloudabi64_brand = { .brand = ELFOSABI_CLOUDABI, .machine = EM_AARCH64, .sysvec = &cloudabi64_elf_sysvec, + .flags = BI_CAN_EXEC_DYN, .compat_3_brand = "CloudABI", }; Modified: head/sys/compat/cloudabi64/cloudabi64_module.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_module.c Thu Mar 31 18:50:52 2016 (r297469) +++ head/sys/compat/cloudabi64/cloudabi64_module.c Thu Mar 31 18:52:00 2016 (r297470) @@ -99,6 +99,7 @@ cloudabi64_fixup(register_t **stack_base #define PTR(type, ptr) { .a_type = (type), .a_ptr = (uintptr_t)(ptr) } PTR(CLOUDABI_AT_ARGDATA, argdata), VAL(CLOUDABI_AT_ARGDATALEN, argdatalen), + VAL(CLOUDABI_AT_BASE, args->base), PTR(CLOUDABI_AT_CANARY, canary), VAL(CLOUDABI_AT_CANARYLEN, sizeof(canarybuf)), VAL(CLOUDABI_AT_NCPUS, mp_ncpus), From owner-svn-src-head@freebsd.org Thu Mar 31 18:53:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B263EAE45FB; Thu, 31 Mar 2016 18:53:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B8BC1FF5; Thu, 31 Mar 2016 18:53:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VIrD0R005098; Thu, 31 Mar 2016 18:53:13 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VIrDYj005097; Thu, 31 Mar 2016 18:53:13 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603311853.u2VIrDYj005097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 31 Mar 2016 18:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297471 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 18:53:14 -0000 Author: bz Date: Thu Mar 31 18:53:13 2016 New Revision: 297471 URL: https://svnweb.freebsd.org/changeset/base/297471 Log: Catch up with some more fields. I needed the bpf one lately. Sponsored by: The FreeBSD Foundation Modified: head/sys/net/if_debug.c Modified: head/sys/net/if_debug.c ============================================================================== --- head/sys/net/if_debug.c Thu Mar 31 18:52:00 2016 (r297470) +++ head/sys/net/if_debug.c Thu Mar 31 18:53:13 2016 (r297471) @@ -67,6 +67,8 @@ if_show_ifnet(struct ifnet *ifp) IF_DB_PRINTF("%p", if_l2com); IF_DB_PRINTF("%p", if_vnet); IF_DB_PRINTF("%p", if_home_vnet); + IF_DB_PRINTF("%p", if_vlantrunk); + IF_DB_PRINTF("%p", if_bpf); IF_DB_PRINTF("%p", if_addr); IF_DB_PRINTF("%p", if_llsoftc); IF_DB_PRINTF("%p", if_label); From owner-svn-src-head@freebsd.org Thu Mar 31 19:07:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52ABDAE4A8E; Thu, 31 Mar 2016 19:07:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 221A219CF; Thu, 31 Mar 2016 19:07:04 +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 u2VJ73hV008648; Thu, 31 Mar 2016 19:07:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VJ73DR008647; Thu, 31 Mar 2016 19:07:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603311907.u2VJ73DR008647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 31 Mar 2016 19:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297472 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 19:07:04 -0000 Author: pfg Date: Thu Mar 31 19:07:03 2016 New Revision: 297472 URL: https://svnweb.freebsd.org/changeset/base/297472 Log: pci_emul_dior(): fix uninitialized scalar variable. Prevent from returning an unitialized value in case the ior size is unknown. CID: 1194319 Reviewed by: grehan Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Thu Mar 31 18:53:13 2016 (r297471) +++ head/usr.sbin/bhyve/pci_emul.c Thu Mar 31 19:07:03 2016 (r297472) @@ -2054,6 +2054,7 @@ pci_emul_dior(struct vmctx *ctx, int vcp return (0); } + value = 0; if (size == 1) { value = sc->ioregs[offset]; } else if (size == 2) { From owner-svn-src-head@freebsd.org Thu Mar 31 21:15:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50C43AE35A9; Thu, 31 Mar 2016 21:15:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 215C91336; Thu, 31 Mar 2016 21:15:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VLF0oU050202; Thu, 31 Mar 2016 21:15:00 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VLF0ph050201; Thu, 31 Mar 2016 21:15:00 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201603312115.u2VLF0ph050201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 31 Mar 2016 21:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297473 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 21:15:01 -0000 Author: glebius Date: Thu Mar 31 21:15:00 2016 New Revision: 297473 URL: https://svnweb.freebsd.org/changeset/base/297473 Log: Fix an error in r292373. Use proper count to update "pages in" counter. Noticed by: pfg via Coverity Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Mar 31 19:07:03 2016 (r297472) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Mar 31 21:15:00 2016 (r297473) @@ -5773,7 +5773,7 @@ zfs_getpages(struct vnode *vp, vm_page_t off_t startoff, endoff; int i, error; vm_pindex_t reqstart, reqend; - int lsize, reqsize, size; + int lsize, size; object = m[0]->object; error = 0; @@ -5797,7 +5797,7 @@ zfs_getpages(struct vnode *vp, vm_page_t } PCPU_INC(cnt.v_vnodein); - PCPU_ADD(cnt.v_vnodepgsin, reqsize); + PCPU_ADD(cnt.v_vnodepgsin, count); lsize = PAGE_SIZE; if (IDX_TO_OFF(mlast->pindex) + lsize > object->un_pager.vnp.vnp_size) From owner-svn-src-head@freebsd.org Thu Mar 31 21:25:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02837AE39E5; Thu, 31 Mar 2016 21:25:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C57361A1A; Thu, 31 Mar 2016 21:25:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VLPeH4053192; Thu, 31 Mar 2016 21:25:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VLPeGD053191; Thu, 31 Mar 2016 21:25:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201603312125.u2VLPeGD053191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 31 Mar 2016 21:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297474 - head/tests/sys/aio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 21:25:42 -0000 Author: jhb Date: Thu Mar 31 21:25:40 2016 New Revision: 297474 URL: https://svnweb.freebsd.org/changeset/base/297474 Log: Correct error messages in recently added test. The large read test uses an empty file created via mkstemp() rather than /dev/null as character devices are subject to two different clamping sysctls. However, I forgot to update some of the error messages after changing to mkstemp() that were still referring to /dev/null. Modified: head/tests/sys/aio/aio_test.c Modified: head/tests/sys/aio/aio_test.c ============================================================================== --- head/tests/sys/aio/aio_test.c Thu Mar 31 21:15:00 2016 (r297473) +++ head/tests/sys/aio/aio_test.c Thu Mar 31 21:25:40 2016 (r297474) @@ -696,7 +696,7 @@ ATF_TC_BODY(aio_large_read_test, tc) if (nread == -1) atf_tc_fail("aio_waitcomplete() failed: %s", strerror(errno)); if (nread != 0) - atf_tc_fail("aio_read() from /dev/null returned data: %zd", + atf_tc_fail("aio_read() from empty file returned data: %zd", nread); memset(&cb, 0, sizeof(cb)); @@ -716,9 +716,7 @@ ATF_TC_BODY(aio_large_read_test, tc) goto finished; atf_tc_fail("aio_waitcomplete() failed: %s", strerror(errno)); } - atf_tc_fail( - "aio_read() of too large read size from /dev/null returned: %zd", - nread); + atf_tc_fail("aio_read() of too large read size returned: %zd", nread); finished: close(fd); From owner-svn-src-head@freebsd.org Thu Mar 31 23:55:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75A0FAE4EBC; Thu, 31 Mar 2016 23:55:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 480C612D1; Thu, 31 Mar 2016 23:55:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VNtJIC097575; Thu, 31 Mar 2016 23:55:19 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VNtJ5T097574; Thu, 31 Mar 2016 23:55:19 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201603312355.u2VNtJ5T097574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 31 Mar 2016 23:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297475 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 23:55:20 -0000 Author: brooks Date: Thu Mar 31 23:55:19 2016 New Revision: 297475 URL: https://svnweb.freebsd.org/changeset/base/297475 Log: Document KTRFAC_FAULT and KTRFAC_FAULTEND. Obtained from: CheriBSD (9d70f563f1b033e6a9b51eaf3b145a8cbbc6617c) MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/lib/libc/sys/ktrace.2 Modified: head/lib/libc/sys/ktrace.2 ============================================================================== --- head/lib/libc/sys/ktrace.2 Thu Mar 31 21:25:40 2016 (r297474) +++ head/lib/libc/sys/ktrace.2 Thu Mar 31 23:55:19 2016 (r297475) @@ -28,7 +28,7 @@ .\" @(#)ktrace.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 10, 2011 +.Dd March 31, 2016 .Dt KTRACE 2 .Os .Sh NAME @@ -94,6 +94,8 @@ generate much output). .It KTRFAC_PROCCTOR Ta "Trace process construction." .It KTRFAC_PROCDTOR Ta "Trace process destruction." .It KTRFAC_CAPFAIL Ta "Trace capability failures." +.It KTRFAC_FAULT Ta "Trace page faults." +.It KTRFAC_FAULTEND Ta "Trace the end of page faults." .It KTRFAC_INHERIT Ta "Inherit tracing to future children." .El .Pp From owner-svn-src-head@freebsd.org Thu Mar 31 23:57:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F038AE5112; Thu, 31 Mar 2016 23:57:04 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40390149A; Thu, 31 Mar 2016 23:57:04 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VNv30m097674; Thu, 31 Mar 2016 23:57:03 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VNv3ld097673; Thu, 31 Mar 2016 23:57:03 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201603312357.u2VNv3ld097673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 31 Mar 2016 23:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297476 - head/usr.bin/ktrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 23:57:04 -0000 Author: brooks Date: Thu Mar 31 23:57:03 2016 New Revision: 297476 URL: https://svnweb.freebsd.org/changeset/base/297476 Log: Add a cross reference to ktrace(2). Obtained from: CheriBSD (9cb420d6b7f04c1b7d2006180b80932e5d3fe50e) MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/usr.bin/ktrace/ktrace.1 Modified: head/usr.bin/ktrace/ktrace.1 ============================================================================== --- head/usr.bin/ktrace/ktrace.1 Thu Mar 31 23:55:19 2016 (r297475) +++ head/usr.bin/ktrace/ktrace.1 Thu Mar 31 23:57:03 2016 (r297476) @@ -28,7 +28,7 @@ .\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd August 26, 2014 +.Dd March 31, 2016 .Dt KTRACE 1 .Os .Sh NAME @@ -175,7 +175,8 @@ on process 67 # disable tracing of all user-owned processes .Dl $ ktrace -C .Sh SEE ALSO -.Xr kdump 1 +.Xr kdump 1 , +.Xr ktrace 2 .Sh HISTORY The .Nm From owner-svn-src-head@freebsd.org Fri Apr 1 00:05:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFEE2AE5493; Fri, 1 Apr 2016 00:05:18 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA8811B84; Fri, 1 Apr 2016 00:05:18 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u3105Afg006078 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 31 Mar 2016 17:05:11 -0700 Subject: Re: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries To: Zbigniew Bodek References: <201603291519.u2TFJuXW051571@repo.freebsd.org> <56FBE3D6.9050205@freebsd.org> <56FC0B55.1040805@freebsd.org> Cc: Ed Maste , Zbigniew Bodek , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" From: Nathan Whitehorn Message-ID: <56FDBB36.5000302@freebsd.org> Date: Thu, 31 Mar 2016 17:05:10 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYXP6NtfAuc//olIOixtrcS2PUgqPgD2VdBt0d9nMO7tyrlvjcPzbxP7Z8f1zbXLoxL/+aH+9rONoK6ukg909kZuj5woWSs7tg= X-Sonic-ID: C;Dv6XZp335RGOXMgVZbXa/Q== M;sqXTZp335RGOXMgVZbXa/Q== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 00:05:18 -0000 I seem to be wrong. In any event, we don't have any non-device-tree platforms on PowerPC anymore, so you can just make it be "pci". -Nathan On 03/31/16 01:18, Zbigniew Bodek wrote: > > Are you sure? I don't see an example of what you are writing about. > Instead I can see several other examples such as: > > dev/usb/controller/ehci_fsl.coptionalehci mpc85xx | ehci qoriq_dpaa > dev/iicbus/adm1030.coptionalpowermac windtunnel | adm1030 powermac > etc. > > Why would they do that if they could simply type: ehci mpc85xx | > qoriq_dpaa? > > Best regards > zbb > > 2016-03-30 19:22 GMT+02:00 Nathan Whitehorn >: > > I think it should be pci aim | fdt, just like the previous line > when the files lived in sys/powerpc. To conf, that evaluates as > pci && (aim || fdt). > -Nathan > > > On 03/30/16 08:55, Zbigniew Bodek wrote: >> >> Thank you Nathan. Please check out new patch in the attachment. >> >> Best regards >> zbb >> >> 2016-03-30 16:33 GMT+02:00 Nathan Whitehorn >> >: >> >> PowerPC (and SPARC) can have real OFW without FDT support. >> Adding FDT to LINT is the wrong solution: rather, it should >> switch on fdt | aim like the rest of the Open Firmware code. >> -Nathan >> >> >> On 03/30/16 01:54, Zbigniew Bodek wrote: >>> Hello Ed, >>> >>> Please check out the attached patch. For powerpc we should >>> compile-in ofwpci.c regardless of FDT option. >>> However, it seems that LINT for powerpc does not have FDT. >>> What do you thing about adding it (as can be seen in the >>> attached patch)?. This would be done in a separate commit. >>> >>> Best regards >>> zbb >>> >>> 2016-03-30 1:53 GMT+02:00 Ed Maste >> >: >>> >>> On 29 March 2016 at 15:19, Zbigniew Bodek >>> > wrote: >>> > Author: zbb >>> > Date: Tue Mar 29 15:19:56 2016 >>> > New Revision: 297392 >>> > URL: https://svnweb.freebsd.org/changeset/base/297392 >>> > >>> > Log: >>> > Reduce OFW PCI code duplication - involves ARM, PPC >>> and SPARC64 >>> >>> My 'make tinderbox' build is now failing (powerpc LINT) >>> with: >>> >>> linking kernel >>> cpcht.o: In function `cpcht_attach': >>> cpcht.c:(.text+0x17dc): undefined reference to >>> `ofw_pci_attach' >>> cpcht.o:(.data.rel+0x0): undefined reference to >>> `ofw_pci_driver' >>> grackle.o: In function `grackle_attach': >>> grackle.c:(.text+0x2dc): undefined reference to >>> `ofw_pci_attach' >>> grackle.o:(.data.rel+0x0): undefined reference to >>> `ofw_pci_driver' >>> uninorthpci.o: In function `uninorth_attach': >>> uninorthpci.c:(.text+0x68c): undefined reference to >>> `ofw_pci_attach' >>> uninorthpci.o:(.data.rel+0x0): undefined reference to >>> `ofw_pci_driver' >>> *** [kernel] Error code 1 >>> _______________________________________________ >>> svn-src-all@freebsd.org >>> mailing list >>> https://lists.freebsd.org/mailman/listinfo/svn-src-all >>> To unsubscribe, send any mail to >>> "svn-src-all-unsubscribe@freebsd.org >>> " >>> >>> >> >> > > From owner-svn-src-head@freebsd.org Fri Apr 1 01:35:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40415AE4B65; Fri, 1 Apr 2016 01:35:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E03B1B9C; Fri, 1 Apr 2016 01:35:52 +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 u311ZqVU027563; Fri, 1 Apr 2016 01:35:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u311ZqFd027562; Fri, 1 Apr 2016 01:35:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604010135.u311ZqFd027562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 1 Apr 2016 01:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297477 - head/usr.sbin/mtest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 01:35:53 -0000 Author: pfg Date: Fri Apr 1 01:35:52 2016 New Revision: 297477 URL: https://svnweb.freebsd.org/changeset/base/297477 Log: mtest: Prevent access to uninitialized value. case 'g' makes use of value n, which is initialized for case 'b' and passe through to case 'g'. If case 'g' is called directly value 'n' is not initialized. Avoid the issue by initializing n before entering the switch. CID: 1006375 Reviewed by: bms Modified: head/usr.sbin/mtest/mtest.c Modified: head/usr.sbin/mtest/mtest.c ============================================================================== --- head/usr.sbin/mtest/mtest.c Thu Mar 31 23:57:03 2016 (r297476) +++ head/usr.sbin/mtest/mtest.c Fri Apr 1 01:35:52 2016 (r297477) @@ -396,6 +396,7 @@ process_cmd(char *cmd, int s, int s6, FI while (isblank(*++line)) ; /* Skip whitespace. */ + n = 0; switch (*cmd) { case '?': usage(); @@ -611,7 +612,6 @@ process_cmd(char *cmd, int s, int s6, FI } /* First determine our current filter mode. */ - n = 0; if (getsourcefilter(af2sock(af, s, s6), ifindex, &su.sa, su.sa.sa_len, &fmode, &n, NULL) != 0) { warn("getsourcefilter"); From owner-svn-src-head@freebsd.org Fri Apr 1 03:21:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52EDDAE47B1; Fri, 1 Apr 2016 03:21:02 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 233A01ABC; Fri, 1 Apr 2016 03:21:02 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u313L1ng059227; Fri, 1 Apr 2016 03:21:01 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u313L1bP059226; Fri, 1 Apr 2016 03:21:01 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201604010321.u313L1bP059226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 1 Apr 2016 03:21:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297479 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 03:21:02 -0000 Author: kevlo Date: Fri Apr 1 03:21:01 2016 New Revision: 297479 URL: https://svnweb.freebsd.org/changeset/base/297479 Log: Update comment: Linux does set a randomized generation number of an inode on ext2/3/4. While here use arc4random() instead of random(). Reviewed by: pfg MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_alloc.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Fri Apr 1 01:39:44 2016 (r297478) +++ head/sys/fs/ext2fs/ext2_alloc.c Fri Apr 1 03:21:01 2016 (r297479) @@ -406,10 +406,8 @@ ext2_valloc(struct vnode *pvp, int mode, /* * Set up a new generation number for this inode. - * XXX check if this makes sense in ext2 */ - if (ip->i_gen == 0 || ++ip->i_gen == 0) - ip->i_gen = random() / 2 + 1; + ip->i_gen = arc4random(); vfs_timestamp(&ts); ip->i_birthtime = ts.tv_sec; From owner-svn-src-head@freebsd.org Fri Apr 1 06:12:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8560CAE515C; Fri, 1 Apr 2016 06:12:55 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DC861BE5; Fri, 1 Apr 2016 06:12:55 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id p65so11689283wmp.1; Thu, 31 Mar 2016 23:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=47Se7gChBb3mBwZ7mB5csPiaXH25VJLgJQ4feOm9dr0=; b=qlPfm0NA82uUm7WCUjdp/p1KBXCmOUkEniPQupREpTDYDBRuQ0cq3g7iRne4w/8RYF HH6SrXWcSN18v742XsSZVTU1aQPbVq26ZAsGjHP5aA/62obDRFbUufsa6zaC0LgeQZti kwSzoP8SiHRB31M+LyMfAxhe3LCBUa6xFiZDKKlAbhDTY9AmTPEBdG/vKWy4OVocdarZ xMZanljVmfC9WYfSyoQRBVvuyUZ+760P4Bt79ylFoaX0E/BuBdAnnyuHWIrGIfCfehio WE+a4A3jso0hUe8mDr/YNoOG3Y9pen+aE+wkcAF9NlBWLvdbPTGr3gSfRz+W+oMSEPY9 pfMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:subject:message-id :mime-version:content-disposition:user-agent; bh=47Se7gChBb3mBwZ7mB5csPiaXH25VJLgJQ4feOm9dr0=; b=LajVxvxj1FSHG0Dg+RVQwHSrVj8PngJ0qdprz6Usui4aAKnG4+9A2go99phXpsGNuN La2GbWsViUC4pvYL6GOo1Y0usI4feK/YHWxnZvz0Oo9a9R91J4j+r2WFi7683g1X8KjS NQyvWocmjepg9g3rsEXJKiwaBCHWZg5JOMD6+biwF45yJR3zYbMbndQeiekowIhuw2Mz 7uqnZ3M2tqU5GqYlb9KYDncJ/47fjzhBY53r4cid+FgxYkK7Sr8eH7G4KEm6vLrMhc7s oQWCiOQaeHHo9JIgNpvJz3QGvjaJOnMlCbMZ1WZN/J/VDpyjHhw6KbQdfnGb4x5YhB91 EsAg== X-Gm-Message-State: AD7BkJL2kjbJem6JSP51q5IBD9Fk4VApD0/HgOnDk7Hf1m/T8rxBmTNX+YyA/OH7pUoveA== X-Received: by 10.194.22.97 with SMTP id c1mr19331191wjf.19.1459491173644; Thu, 31 Mar 2016 23:12:53 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id t7sm12375896wjf.39.2016.03.31.23.12.52 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 31 Mar 2016 23:12:53 -0700 (PDT) Sender: Mateusz Guzik Date: Fri, 1 Apr 2016 08:12:50 +0200 From: Mateusz Guzik To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297481 - head/sys/kern Message-ID: <20160401061250.GA24248@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 06:12:55 -0000 Author: mjg Date: Wed Apr 1 08:10:00 2016 New Revision: 280963 URL: https://svnweb.freebsd.org/changeset/base/297481 Log: Increase responsiveness under load by being more aggressive with priority changes. MFC after: 1 week Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c =================================================================== --- sys/kern/sched_ule.c (revision 297480) +++ sys/kern/sched_ule.c (working copy) @@ -1696,15 +1696,10 @@ } ts = td->td_sched; THREAD_LOCK_ASSERT(td, MA_OWNED); - if (td->td_priority == prio) - return; /* - * If the priority has been elevated due to priority - * propagation, we may have to move ourselves to a new - * queue. This could be optimized to not re-add in some - * cases. + * DOES THIS WORK LOL */ - if (TD_ON_RUNQ(td) && prio < td->td_priority) { + if (TD_ON_RUNQ(td) && prio != td->td_priority) { sched_rem(td); td->td_priority = prio; sched_add(td, SRQ_BORROWING); From owner-svn-src-head@freebsd.org Fri Apr 1 06:17:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92571AE5A18; Fri, 1 Apr 2016 06:17:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 580271D42; Fri, 1 Apr 2016 06:17:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u316HvZo013560; Fri, 1 Apr 2016 06:17:57 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u316HvJU013559; Fri, 1 Apr 2016 06:17:57 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604010617.u316HvJU013559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 1 Apr 2016 06:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297481 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 06:17:58 -0000 Author: sephe Date: Fri Apr 1 06:17:57 2016 New Revision: 297481 URL: https://svnweb.freebsd.org/changeset/base/297481 Log: hyperv: Register Hyper-V timer early enough for TSC freq calibration The i8254 simulation in Hyper-V is kinda broken and is not available in Generation 2 Hyper-V VMs, so Hyper-V timer must be registered early enough so that it can be used to do the TSC freq calibration. This fixes the notorious warning like this: calcru: runtime went backwards from 50 usec to 25 usec for pid 0 (kernel) Submitted by: Dexuan Cui Reviewed by: kib, sephe Tested by: kib, sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5778 Modified: head/sys/dev/hyperv/vmbus/hv_hv.c Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Fri Apr 1 03:46:16 2016 (r297480) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Fri Apr 1 06:17:57 2016 (r297481) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -207,8 +208,6 @@ hv_vmbus_init(void) hv_vmbus_g_context.hypercall_page = virt_addr; - tc_init(&hv_timecounter); /* register virtual timecount */ - hv_et_init(); return (0); @@ -437,3 +436,14 @@ void hv_vmbus_synic_cleanup(void *arg) wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); } +static void +hv_tc_init(void) +{ + if (vm_guest != VM_GUEST_HV) + return; + + /* register virtual timecounter */ + tc_init(&hv_timecounter); +} + +SYSINIT(hv_tc_init, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hv_tc_init, NULL); From owner-svn-src-head@freebsd.org Fri Apr 1 06:50:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC58AE618E; Fri, 1 Apr 2016 06:50:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id F22381CD4; Fri, 1 Apr 2016 06:50:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA06193; Fri, 01 Apr 2016 09:50:25 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1alsuX-0001fd-2v; Fri, 01 Apr 2016 09:50:25 +0300 Subject: Re: svn commit: r297481 - head/sys/kern To: Mateusz Guzik , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <20160401061250.GA24248@dft-labs.eu> From: Andriy Gapon Message-ID: <56FE19F8.10905@FreeBSD.org> Date: Fri, 1 Apr 2016 09:49:28 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <20160401061250.GA24248@dft-labs.eu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 06:50:34 -0000 On 01/04/2016 09:12, Mateusz Guzik wrote: > Author: mjg > Date: Wed Apr 1 08:10:00 2016 > New Revision: 280963 > URL: https://svnweb.freebsd.org/changeset/base/297481 > > Log: > Increase responsiveness under load by being more aggressive with > priority changes. > > MFC after: 1 week > > Modified: > head/sys/kern/sched_ule.c > > Modified: head/sys/kern/sched_ule.c > =================================================================== > --- sys/kern/sched_ule.c (revision 297480) > +++ sys/kern/sched_ule.c (working copy) > @@ -1696,15 +1696,10 @@ > } > ts = td->td_sched; > THREAD_LOCK_ASSERT(td, MA_OWNED); > - if (td->td_priority == prio) > - return; > /* > - * If the priority has been elevated due to priority > - * propagation, we may have to move ourselves to a new > - * queue. This could be optimized to not re-add in some > - * cases. > + * DOES THIS WORK LOL It does! Nice one! > */ > - if (TD_ON_RUNQ(td) && prio < td->td_priority) { > + if (TD_ON_RUNQ(td) && prio != td->td_priority) { > sched_rem(td); > td->td_priority = prio; > sched_add(td, SRQ_BORROWING); > -- Andriy Gapon From owner-svn-src-head@freebsd.org Fri Apr 1 06:28:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C09ABAE9DB6; Fri, 1 Apr 2016 06:28:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8469F1201; Fri, 1 Apr 2016 06:28:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u316SZPL016558; Fri, 1 Apr 2016 06:28:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u316SYxi016541; Fri, 1 Apr 2016 06:28:34 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604010628.u316SYxi016541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 1 Apr 2016 06:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297482 - in head/sys: dev/cxgb dev/cxgbe dev/e1000 dev/hyperv/netvsc dev/ixgbe dev/ixl dev/mlx5/mlx5_en dev/mxge dev/oce dev/qlxgb dev/qlxge dev/vnic dev/vxge dev/xen/netfront netinet ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 06:28:36 -0000 Author: sephe Date: Fri Apr 1 06:28:33 2016 New Revision: 297482 URL: https://svnweb.freebsd.org/changeset/base/297482 Log: tcp/lro: Use tcp_lro_flush_all in device drivers to avoid code duplication And factor out tcp_lro_rx_done, which deduplicates the same logic with netinet/tcp_lro.c Reviewed by: gallatin (1st version), hps, zbb, np, Dexuan Cui Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5725 Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/e1000/if_igb.c head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/ixgbe/ix_txrx.c head/sys/dev/ixl/ixl_txrx.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c head/sys/dev/mxge/if_mxge.c head/sys/dev/oce/oce_if.c head/sys/dev/qlxgb/qla_isr.c head/sys/dev/qlxge/qls_isr.c head/sys/dev/vnic/nicvf_queues.c head/sys/dev/vxge/vxge.c head/sys/dev/xen/netfront/netfront.c head/sys/netinet/tcp_lro.c head/sys/ofed/drivers/net/mlx4/en_rx.c Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/cxgb/cxgb_sge.c Fri Apr 1 06:28:33 2016 (r297482) @@ -2976,11 +2976,7 @@ process_responses(adapter_t *adap, struc #if defined(INET6) || defined(INET) /* Flush LRO */ - while (!SLIST_EMPTY(&lro_ctrl->lro_active)) { - struct lro_entry *queued = SLIST_FIRST(&lro_ctrl->lro_active); - SLIST_REMOVE_HEAD(&lro_ctrl->lro_active, next); - tcp_lro_flush(lro_ctrl, queued); - } + tcp_lro_flush_all(lro_ctrl); #endif if (sleeping) Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/cxgbe/t4_sge.c Fri Apr 1 06:28:33 2016 (r297482) @@ -1397,13 +1397,8 @@ process_iql: #if defined(INET) || defined(INET6) if (iq->flags & IQ_LRO_ENABLED) { struct lro_ctrl *lro = &rxq->lro; - struct lro_entry *l; - while (!SLIST_EMPTY(&lro->lro_active)) { - l = SLIST_FIRST(&lro->lro_active); - SLIST_REMOVE_HEAD(&lro->lro_active, next); - tcp_lro_flush(lro, l); - } + tcp_lro_flush_all(lro); } #endif Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/e1000/if_igb.c Fri Apr 1 06:28:33 2016 (r297482) @@ -4974,7 +4974,6 @@ igb_rxeof(struct igb_queue *que, int cou struct rx_ring *rxr = que->rxr; struct ifnet *ifp = adapter->ifp; struct lro_ctrl *lro = &rxr->lro; - struct lro_entry *queued; int i, processed = 0, rxdone = 0; u32 ptype, staterr = 0; union e1000_adv_rx_desc *cur; @@ -5202,10 +5201,7 @@ next_desc: /* * Flush any outstanding LRO work */ - while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&lro->lro_active, next); - tcp_lro_flush(lro, queued); - } + tcp_lro_flush_all(lro); if (done != NULL) *done += rxdone; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Apr 1 06:28:33 2016 (r297482) @@ -778,13 +778,8 @@ netvsc_channel_rollup(struct hv_vmbus_ch struct hn_tx_ring *txr = chan->hv_chan_txr; #if defined(INET) || defined(INET6) struct hn_rx_ring *rxr = chan->hv_chan_rxr; - struct lro_ctrl *lro = &rxr->hn_lro; - struct lro_entry *queued; - while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&lro->lro_active, next); - tcp_lro_flush(lro, queued); - } + tcp_lro_flush_all(&rxr->hn_lro); #endif /* Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/ixgbe/ix_txrx.c Fri Apr 1 06:28:33 2016 (r297482) @@ -1753,7 +1753,6 @@ ixgbe_rxeof(struct ix_queue *que) struct rx_ring *rxr = que->rxr; struct ifnet *ifp = adapter->ifp; struct lro_ctrl *lro = &rxr->lro; - struct lro_entry *queued; int i, nextp, processed = 0; u32 staterr = 0; u32 count = adapter->rx_process_limit; @@ -2003,10 +2002,7 @@ next_desc: /* * Flush any outstanding LRO work */ - while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&lro->lro_active, next); - tcp_lro_flush(lro, queued); - } + tcp_lro_flush_all(lro); IXGBE_RX_UNLOCK(rxr); Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/ixl/ixl_txrx.c Fri Apr 1 06:28:33 2016 (r297482) @@ -1511,7 +1511,6 @@ ixl_rxeof(struct ixl_queue *que, int cou struct ifnet *ifp = vsi->ifp; #if defined(INET6) || defined(INET) struct lro_ctrl *lro = &rxr->lro; - struct lro_entry *queued; #endif int i, nextp, processed = 0; union i40e_rx_desc *cur; @@ -1735,10 +1734,7 @@ next_desc: /* * Flush any outstanding LRO work */ - while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&lro->lro_active, next); - tcp_lro_flush(lro, queued); - } + tcp_lro_flush_all(lro); #endif IXL_RX_UNLOCK(rxr); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Fri Apr 1 06:28:33 2016 (r297482) @@ -322,9 +322,6 @@ mlx5e_decompress_cqes(struct mlx5e_cq *c static int mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget) { -#ifndef HAVE_TURBO_LRO - struct lro_entry *queued; -#endif int i; for (i = 0; i < budget; i++) { @@ -399,10 +396,7 @@ wq_ll_pop: /* ensure cq space is freed before enabling more cqes */ wmb(); #ifndef HAVE_TURBO_LRO - while ((queued = SLIST_FIRST(&rq->lro.lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&rq->lro.lro_active, next); - tcp_lro_flush(&rq->lro, queued); - } + tcp_lro_flush_all(&rq->lro); #endif return (i); } Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/mxge/if_mxge.c Fri Apr 1 06:28:33 2016 (r297482) @@ -2819,11 +2819,7 @@ mxge_clean_rx_done(struct mxge_slice_sta break; } #if defined(INET) || defined (INET6) - while (!SLIST_EMPTY(&ss->lc.lro_active)) { - struct lro_entry *lro = SLIST_FIRST(&ss->lc.lro_active); - SLIST_REMOVE_HEAD(&ss->lc.lro_active, next); - tcp_lro_flush(&ss->lc, lro); - } + tcp_lro_flush_all(&ss->lc); #endif } Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/oce/oce_if.c Fri Apr 1 06:28:33 2016 (r297482) @@ -1497,16 +1497,12 @@ static void oce_rx_flush_lro(struct oce_rq *rq) { struct lro_ctrl *lro = &rq->lro; - struct lro_entry *queued; POCE_SOFTC sc = (POCE_SOFTC) rq->parent; if (!IF_LRO_ENABLED(sc)) return; - while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&lro->lro_active, next); - tcp_lro_flush(lro, queued); - } + tcp_lro_flush_all(lro); rq->lro_pkts_queued = 0; return; Modified: head/sys/dev/qlxgb/qla_isr.c ============================================================================== --- head/sys/dev/qlxgb/qla_isr.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/qlxgb/qla_isr.c Fri Apr 1 06:28:33 2016 (r297482) @@ -267,7 +267,6 @@ qla_rcv_isr(qla_host_t *ha, uint32_t sds uint32_t comp_idx, desc_count; q80_stat_desc_t *sdesc; struct lro_ctrl *lro; - struct lro_entry *queued; uint32_t ret = 0; dev = ha->pci_dev; @@ -324,11 +323,7 @@ qla_rcv_isr(qla_host_t *ha, uint32_t sds } } - while((!SLIST_EMPTY(&lro->lro_active))) { - queued = SLIST_FIRST(&lro->lro_active); - SLIST_REMOVE_HEAD(&lro->lro_active, next); - tcp_lro_flush(lro, queued); - } + tcp_lro_flush_all(lro); if (hw->sds[sds_idx].sdsr_next != comp_idx) { QL_UPDATE_SDS_CONSUMER_INDEX(ha, sds_idx, comp_idx); Modified: head/sys/dev/qlxge/qls_isr.c ============================================================================== --- head/sys/dev/qlxge/qls_isr.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/qlxge/qls_isr.c Fri Apr 1 06:28:33 2016 (r297482) @@ -232,7 +232,6 @@ qls_cq_isr(qla_host_t *ha, uint32_t cq_i uint32_t i, cq_comp_idx; int ret = 0, tx_comp_done = 0; struct lro_ctrl *lro; - struct lro_entry *queued; cq_b = ha->rx_ring[cq_idx].cq_base_vaddr; lro = &ha->rx_ring[cq_idx].lro; @@ -287,11 +286,7 @@ qls_cq_isr(qla_host_t *ha, uint32_t cq_i } } - while((!SLIST_EMPTY(&lro->lro_active))) { - queued = SLIST_FIRST(&lro->lro_active); - SLIST_REMOVE_HEAD(&lro->lro_active, next); - tcp_lro_flush(lro, queued); - } + tcp_lro_flush_all(lro); ha->rx_ring[cq_idx].cq_next = cq_comp_idx; Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/vnic/nicvf_queues.c Fri Apr 1 06:28:33 2016 (r297482) @@ -746,7 +746,6 @@ nicvf_cq_intr_handler(struct nicvf *nic, struct rcv_queue *rq; struct cqe_rx_t *cq_desc; struct lro_ctrl *lro; - struct lro_entry *queued; int rq_idx; int cmp_err; @@ -831,10 +830,7 @@ out: rq_idx = cq_idx; rq = &nic->qs->rq[rq_idx]; lro = &rq->lro; - while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&lro->lro_active, next); - tcp_lro_flush(lro, queued); - } + tcp_lro_flush_all(lro); NICVF_CMP_UNLOCK(cq); Modified: head/sys/dev/vxge/vxge.c ============================================================================== --- head/sys/dev/vxge/vxge.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/vxge/vxge.c Fri Apr 1 06:28:33 2016 (r297482) @@ -996,7 +996,6 @@ vxge_rx_compl(vxge_hal_vpath_h vpath_han vxge_vpath_t *vpath = (vxge_vpath_t *) userdata; vxge_dev_t *vdev = vpath->vdev; - struct lro_entry *queued = NULL; struct lro_ctrl *lro = &vpath->lro; /* get the interface pointer */ @@ -1083,12 +1082,8 @@ vxge_rx_compl(vxge_hal_vpath_h vpath_han &dtr_priv, &t_code) == VXGE_HAL_OK); /* Flush any outstanding LRO work */ - if (vpath->lro_enable && vpath->lro.lro_cnt) { - while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&lro->lro_active, next); - tcp_lro_flush(lro, queued); - } - } + if (vpath->lro_enable && vpath->lro.lro_cnt) + tcp_lro_flush_all(lro); return (status); } Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/dev/xen/netfront/netfront.c Fri Apr 1 06:28:33 2016 (r297482) @@ -1202,7 +1202,6 @@ xn_rxeof(struct netfront_rxq *rxq) struct netfront_info *np = rxq->info; #if (defined(INET) || defined(INET6)) struct lro_ctrl *lro = &rxq->lro; - struct lro_entry *queued; #endif struct netfront_rx_info rinfo; struct netif_rx_response *rx = &rinfo.rx; @@ -1296,11 +1295,7 @@ xn_rxeof(struct netfront_rxq *rxq) /* * Flush any outstanding LRO work */ - while (!SLIST_EMPTY(&lro->lro_active)) { - queued = SLIST_FIRST(&lro->lro_active); - SLIST_REMOVE_HEAD(&lro->lro_active, next); - tcp_lro_flush(lro, queued); - } + tcp_lro_flush_all(lro); #endif xn_alloc_rx_buffers(rxq); Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/netinet/tcp_lro.c Fri Apr 1 06:28:33 2016 (r297482) @@ -67,6 +67,8 @@ static MALLOC_DEFINE(M_LRO, "LRO", "LRO #define TCP_LRO_INVALID_CSUM 0x0000 #endif +static void tcp_lro_rx_done(struct lro_ctrl *lc); + int tcp_lro_init(struct lro_ctrl *lc) { @@ -226,6 +228,17 @@ tcp_lro_rx_csum_fixup(struct lro_entry * } #endif +static void +tcp_lro_rx_done(struct lro_ctrl *lc) +{ + struct lro_entry *le; + + while ((le = SLIST_FIRST(&lc->lro_active)) != NULL) { + SLIST_REMOVE_HEAD(&lc->lro_active, next); + tcp_lro_flush(lc, le); + } +} + void tcp_lro_flush_inactive(struct lro_ctrl *lc, const struct timeval *timeout) { @@ -362,13 +375,12 @@ done: void tcp_lro_flush_all(struct lro_ctrl *lc) { - struct lro_entry *le; uint32_t hashtype; uint32_t flowid; unsigned x; /* check if no mbufs to flush */ - if (__predict_false(lc->lro_mbuf_count == 0)) + if (lc->lro_mbuf_count == 0) goto done; /* sort all mbufs according to stream */ @@ -390,10 +402,7 @@ tcp_lro_flush_all(struct lro_ctrl *lc) hashtype = M_HASHTYPE_GET(mb); /* flush active streams */ - while ((le = SLIST_FIRST(&lc->lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&lc->lro_active, next); - tcp_lro_flush(lc, le); - } + tcp_lro_rx_done(lc); } #ifdef TCP_LRO_RESET_SEQUENCE /* reset sequence number */ @@ -409,10 +418,8 @@ tcp_lro_flush_all(struct lro_ctrl *lc) } done: /* flush active streams */ - while ((le = SLIST_FIRST(&lc->lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&lc->lro_active, next); - tcp_lro_flush(lc, le); - } + tcp_lro_rx_done(lc); + lc->lro_mbuf_count = 0; } Modified: head/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_rx.c Fri Apr 1 06:17:57 2016 (r297481) +++ head/sys/ofed/drivers/net/mlx4/en_rx.c Fri Apr 1 06:28:33 2016 (r297482) @@ -561,9 +561,6 @@ int mlx4_en_process_rx_cq(struct net_dev struct mbuf *mb; struct mlx4_cq *mcq = &cq->mcq; struct mlx4_cqe *buf = cq->buf; -#ifdef INET - struct lro_entry *queued; -#endif int index; unsigned int length; int polled = 0; @@ -669,10 +666,7 @@ next: /* Flush all pending IP reassembly sessions */ out: #ifdef INET - while ((queued = SLIST_FIRST(&ring->lro.lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&ring->lro.lro_active, next); - tcp_lro_flush(&ring->lro, queued); - } + tcp_lro_flush_all(&ring->lro); #endif AVG_PERF_COUNTER(priv->pstats.rx_coal_avg, polled); mcq->cons_index = cons_index; From owner-svn-src-head@freebsd.org Fri Apr 1 06:43:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 900C2AE5440; Fri, 1 Apr 2016 06:43:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BBD01A68; Fri, 1 Apr 2016 06:43:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u316h5UC022359; Fri, 1 Apr 2016 06:43:05 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u316h5he022356; Fri, 1 Apr 2016 06:43:05 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604010643.u316h5he022356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 1 Apr 2016 06:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297483 - in head/sys: compat/linuxkpi/common/include/linux netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 06:43:06 -0000 Author: sephe Date: Fri Apr 1 06:43:05 2016 New Revision: 297483 URL: https://svnweb.freebsd.org/changeset/base/297483 Log: tcp/lro: Change SLIST to LIST, so that removing an entry is O(1) This is kinda critical to the performance when the CPU is slow and network bandwidth is high, e.g. in the hypervisor. Reviewed by: rrs, gallatin, Dexuan Cui Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5765 Modified: head/sys/compat/linuxkpi/common/include/linux/list.h head/sys/netinet/tcp_lro.c head/sys/netinet/tcp_lro.h Modified: head/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/list.h Fri Apr 1 06:28:33 2016 (r297482) +++ head/sys/compat/linuxkpi/common/include/linux/list.h Fri Apr 1 06:43:05 2016 (r297483) @@ -61,6 +61,7 @@ #include #include #include +#include #include #include Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Fri Apr 1 06:28:33 2016 (r297482) +++ head/sys/netinet/tcp_lro.c Fri Apr 1 06:43:05 2016 (r297483) @@ -93,8 +93,8 @@ tcp_lro_init_args(struct lro_ctrl *lc, s lc->lro_ackcnt_lim = TCP_LRO_ACKCNT_MAX; lc->lro_length_lim = TCP_LRO_LENGTH_MAX; lc->ifp = ifp; - SLIST_INIT(&lc->lro_free); - SLIST_INIT(&lc->lro_active); + LIST_INIT(&lc->lro_free); + LIST_INIT(&lc->lro_active); /* compute size to allocate */ size = (lro_mbufs * sizeof(struct mbuf *)) + @@ -113,7 +113,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, s /* setup linked list */ for (i = 0; i != lro_entries; i++) - SLIST_INSERT_HEAD(&lc->lro_free, le + i, next); + LIST_INSERT_HEAD(&lc->lro_free, le + i, next); return (0); } @@ -125,11 +125,11 @@ tcp_lro_free(struct lro_ctrl *lc) unsigned x; /* reset LRO free list */ - SLIST_INIT(&lc->lro_free); + LIST_INIT(&lc->lro_free); /* free active mbufs, if any */ - while ((le = SLIST_FIRST(&lc->lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&lc->lro_active, next); + while ((le = LIST_FIRST(&lc->lro_active)) != NULL) { + LIST_REMOVE(le, next); m_freem(le->m_head); } @@ -233,8 +233,8 @@ tcp_lro_rx_done(struct lro_ctrl *lc) { struct lro_entry *le; - while ((le = SLIST_FIRST(&lc->lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&lc->lro_active, next); + while ((le = LIST_FIRST(&lc->lro_active)) != NULL) { + LIST_REMOVE(le, next); tcp_lro_flush(lc, le); } } @@ -245,14 +245,14 @@ tcp_lro_flush_inactive(struct lro_ctrl * struct lro_entry *le, *le_tmp; struct timeval tv; - if (SLIST_EMPTY(&lc->lro_active)) + if (LIST_EMPTY(&lc->lro_active)) return; getmicrotime(&tv); timevalsub(&tv, timeout); - SLIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { + LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { if (timevalcmp(&tv, &le->mtime, >=)) { - SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); + LIST_REMOVE(le, next); tcp_lro_flush(lc, le); } } @@ -348,7 +348,7 @@ tcp_lro_flush(struct lro_ctrl *lc, struc lc->lro_queued += le->append_cnt + 1; lc->lro_flushed++; bzero(le, sizeof(*le)); - SLIST_INSERT_HEAD(&lc->lro_free, le, next); + LIST_INSERT_HEAD(&lc->lro_free, le, next); } static int @@ -593,7 +593,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m seq = ntohl(th->th_seq); /* Try to find a matching previous segment. */ - SLIST_FOREACH(le, &lc->lro_active, next) { + LIST_FOREACH(le, &lc->lro_active, next) { if (le->eh_type != eh_type) continue; if (le->source_port != th->th_sport || @@ -620,7 +620,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m /* Flush now if appending will result in overflow. */ if (le->p_len > (lc->lro_length_lim - tcp_data_len)) { - SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); + LIST_REMOVE(le, next); tcp_lro_flush(lc, le); break; } @@ -629,7 +629,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m if (__predict_false(seq != le->next_seq || (tcp_data_len == 0 && le->ack_seq == th->th_ack))) { /* Out of order packet or duplicate ACK. */ - SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); + LIST_REMOVE(le, next); tcp_lro_flush(lc, le); return (TCP_LRO_CANNOT); } @@ -662,8 +662,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m * be further delayed. */ if (le->append_cnt >= lc->lro_ackcnt_lim) { - SLIST_REMOVE(&lc->lro_active, le, lro_entry, - next); + LIST_REMOVE(le, next); tcp_lro_flush(lc, le); } return (0); @@ -687,7 +686,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m * overflow, pro-actively flush now. */ if (le->p_len > (lc->lro_length_lim - lc->ifp->if_mtu)) { - SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); + LIST_REMOVE(le, next); tcp_lro_flush(lc, le); } else getmicrotime(&le->mtime); @@ -696,13 +695,13 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m } /* Try to find an empty slot. */ - if (SLIST_EMPTY(&lc->lro_free)) + if (LIST_EMPTY(&lc->lro_free)) return (TCP_LRO_NO_ENTRIES); /* Start a new segment chain. */ - le = SLIST_FIRST(&lc->lro_free); - SLIST_REMOVE_HEAD(&lc->lro_free, next); - SLIST_INSERT_HEAD(&lc->lro_active, le, next); + le = LIST_FIRST(&lc->lro_free); + LIST_REMOVE(le, next); + LIST_INSERT_HEAD(&lc->lro_active, le, next); getmicrotime(&le->mtime); /* Start filling in details. */ Modified: head/sys/netinet/tcp_lro.h ============================================================================== --- head/sys/netinet/tcp_lro.h Fri Apr 1 06:28:33 2016 (r297482) +++ head/sys/netinet/tcp_lro.h Fri Apr 1 06:43:05 2016 (r297483) @@ -41,9 +41,8 @@ #define TCP_LRO_SEQUENCE(mb) \ (mb)->m_pkthdr.PH_loc.thirtytwo[0] -struct lro_entry -{ - SLIST_ENTRY(lro_entry) next; +struct lro_entry { + LIST_ENTRY(lro_entry) next; struct mbuf *m_head; struct mbuf *m_tail; union { @@ -72,7 +71,7 @@ struct lro_entry uint16_t timestamp; /* flag, not a TCP hdr field. */ struct timeval mtime; }; -SLIST_HEAD(lro_head, lro_entry); +LIST_HEAD(lro_head, lro_entry); #define le_ip4 leip.ip4 #define le_ip6 leip.ip6 From owner-svn-src-head@freebsd.org Fri Apr 1 08:47:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55715AE39E0; Fri, 1 Apr 2016 08:47:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22EFC1B12; Fri, 1 Apr 2016 08:47:24 +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 u318lNfb057877; Fri, 1 Apr 2016 08:47:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u318lNQb057876; Fri, 1 Apr 2016 08:47:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604010847.u318lNQb057876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 1 Apr 2016 08:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297484 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 08:47:24 -0000 Author: kib Date: Fri Apr 1 08:47:23 2016 New Revision: 297484 URL: https://svnweb.freebsd.org/changeset/base/297484 Log: Style(9), use tabs for the #define LOOPS line. Print unsigned values with %u. Make code slightly more compact by inlining loop limit. Noted by: bde Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Fri Apr 1 06:43:05 2016 (r297483) +++ head/sys/x86/x86/local_apic.c Fri Apr 1 08:47:23 2016 (r297484) @@ -511,7 +511,7 @@ native_lapic_init(vm_paddr_t addr) } #ifdef SMP -#define LOOPS 1000000 +#define LOOPS 1000000 /* * Calibrate the busy loop waiting for IPI ack in xAPIC mode. * lapic_ipi_wait_mult contains the number of iterations which @@ -535,7 +535,7 @@ native_lapic_init(vm_paddr_t addr) r2 = r * 1000000; lapic_ipi_wait_mult = r1 >= r2 ? r1 / r2 : 1; if (bootverbose) { - printf("LAPIC: ipi_wait() us multiplier %jd (r %jd tsc %jd)\n", + printf("LAPIC: ipi_wait() us multiplier %ju (r %ju tsc %ju)\n", (uintmax_t)lapic_ipi_wait_mult, (uintmax_t)r, (uintmax_t)tsc_freq); } @@ -1762,14 +1762,13 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_O static int native_lapic_ipi_wait(int delay) { - uint64_t i, counter; + uint64_t rx; /* LAPIC_ICR.APIC_DELSTAT_MASK is undefined in x2APIC mode */ if (x2apic_mode) return (1); - counter = lapic_ipi_wait_mult * delay; - for (i = 0; delay == -1 || i < counter; i++) { + for (rx = 0; delay == -1 || rx < lapic_ipi_wait_mult * delay; rx++) { if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == APIC_DELSTAT_IDLE) return (1); From owner-svn-src-head@freebsd.org Fri Apr 1 09:07:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0324AEB43B; Fri, 1 Apr 2016 09:07:19 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82966176E; Fri, 1 Apr 2016 09:07:19 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3197I6I063942; Fri, 1 Apr 2016 09:07:18 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3197I9c063941; Fri, 1 Apr 2016 09:07:18 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201604010907.u3197I9c063941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 1 Apr 2016 09:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297486 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 09:07:19 -0000 Author: zbb Date: Fri Apr 1 09:07:18 2016 New Revision: 297486 URL: https://svnweb.freebsd.org/changeset/base/297486 Log: Fix PowerPC LINT build after r297392 PowerPC has real Open Firmware and does not necessarily need FDT. Make ofwpci.c only PCI dependent. Pointed out by: emaste Reviewed by: nwhitehorn Obtained from: Semihalf Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Apr 1 08:55:42 2016 (r297485) +++ head/sys/conf/files.powerpc Fri Apr 1 09:07:18 2016 (r297486) @@ -57,7 +57,7 @@ dev/ofw/ofw_console.c optional aim dev/ofw/ofw_disk.c optional ofwd aim dev/ofw/ofw_iicbus.c optional iicbus aim dev/ofw/ofwbus.c optional aim | fdt -dev/ofw/ofwpci.c optional fdt pci +dev/ofw/ofwpci.c optional pci dev/ofw/ofw_standard.c optional aim powerpc dev/ofw/ofw_subr.c optional aim powerpc dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac From owner-svn-src-head@freebsd.org Fri Apr 1 09:08:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9E77AEB49C for ; Fri, 1 Apr 2016 09:08:21 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lb0-x236.google.com (mail-lb0-x236.google.com [IPv6:2a00:1450:4010:c04::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AB651978 for ; Fri, 1 Apr 2016 09:08:21 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lb0-x236.google.com with SMTP id u8so68128097lbk.0 for ; Fri, 01 Apr 2016 02:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ZA8BGHz1+SC6N+b8FPyMsXn9U80wDink8GTdqZbjmXQ=; b=i+d0BA/5SLZP9UFLw0T0WzMGD7PaKWxX9WRdZE95tyAyr7906wz7kBCFsvRIH/hCl4 WiE1+epOQwAmLmqIh9XSDLJRC1AeHUzuwuDjtoELjzqEQWGhpCvohydAlRrLh9Jaw1fm 3ySXaZkYwF/Dvgh4auSxnYypzwn3KrgqCt0BwelSqEslpIw5wMJi4FqR6oElC8bp2/U+ MNEv1Q1OnLngMqPNKIG+1uXFehwl189RIaNZtFO1uiSc0DAd1unWNcm0a9OpuwCvByUR FPb5ROw9FZw2P+s4DMwNbg+m4Q4SDBNeZCoEvvNy8NraN716v4hQQSbC9RA0IBzZUruI s4ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ZA8BGHz1+SC6N+b8FPyMsXn9U80wDink8GTdqZbjmXQ=; b=Y8ytaIazL57G49jF2mhG/Ifr1m0dqa2rF3Src26LDv/hgshvcQHxlmYoa/sDf5KUB9 USYTpfe2Vsimq4EyqXIpfMzYRcn1GWaBunLVM+I8MQmWnSAeMAWBwR7P25lxGweFsfpe jtFEMKPj6mr4HAAG/py3ji8GXTog+lVsFhz7/ZpWr7+6SPYtAYjG791sCovjo3PVnKJG hDK4MUfab1gNRe8q0EwjziEe9etEavTazXwzO/0m/VgEBitqz7EkiTUdyqshBc6HYn6d 1bbWsta+W8adyrId5i0AbHjwBSK9DxwBMMKexSoI7yuN3hBwOM0uldsWKBL1GJzeuaMH jofQ== X-Gm-Message-State: AD7BkJLaMJbmpUSVMy2QMGCEPmh1Rro5Vz0Vo1a2EjZHSlXuJEq8v1p8Rrhm+crC24ky6bCzgfO1nRup1rRVWQ== X-Received: by 10.112.148.162 with SMTP id tt2mr1118611lbb.38.1459501699576; Fri, 01 Apr 2016 02:08:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.77.202 with HTTP; Fri, 1 Apr 2016 02:07:59 -0700 (PDT) In-Reply-To: <56FDBB36.5000302@freebsd.org> References: <201603291519.u2TFJuXW051571@repo.freebsd.org> <56FBE3D6.9050205@freebsd.org> <56FC0B55.1040805@freebsd.org> <56FDBB36.5000302@freebsd.org> From: Zbigniew Bodek Date: Fri, 1 Apr 2016 11:07:59 +0200 Message-ID: Subject: Re: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries To: Nathan Whitehorn Cc: Ed Maste , Zbigniew Bodek , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 09:08:21 -0000 Thanks. Done: https://svnweb.freebsd.org/changeset/base/297486 Best regards zbb 2016-04-01 2:05 GMT+02:00 Nathan Whitehorn : > I seem to be wrong. In any event, we don't have any non-device-tree > platforms on PowerPC anymore, so you can just make it be "pci". > -Nathan > > On 03/31/16 01:18, Zbigniew Bodek wrote: > >> >> Are you sure? I don't see an example of what you are writing about. >> Instead I can see several other examples such as: >> >> dev/usb/controller/ehci_fsl.coptionalehci mpc85xx | ehci qoriq_dpaa >> dev/iicbus/adm1030.coptionalpowermac windtunnel | adm1030 powermac >> etc. >> >> Why would they do that if they could simply type: ehci mpc85xx | >> qoriq_dpaa? >> >> Best regards >> zbb >> >> 2016-03-30 19:22 GMT+02:00 Nathan Whitehorn > >: >> >> I think it should be pci aim | fdt, just like the previous line >> when the files lived in sys/powerpc. To conf, that evaluates as >> pci && (aim || fdt). >> -Nathan >> >> >> On 03/30/16 08:55, Zbigniew Bodek wrote: >> >>> >>> Thank you Nathan. Please check out new patch in the attachment. >>> >>> Best regards >>> zbb >>> >>> 2016-03-30 16:33 GMT+02:00 Nathan Whitehorn >>> >: >>> >>> PowerPC (and SPARC) can have real OFW without FDT support. >>> Adding FDT to LINT is the wrong solution: rather, it should >>> switch on fdt | aim like the rest of the Open Firmware code. >>> -Nathan >>> >>> >>> On 03/30/16 01:54, Zbigniew Bodek wrote: >>> >>>> Hello Ed, >>>> >>>> Please check out the attached patch. For powerpc we should >>>> compile-in ofwpci.c regardless of FDT option. >>>> However, it seems that LINT for powerpc does not have FDT. >>>> What do you thing about adding it (as can be seen in the >>>> attached patch)?. This would be done in a separate commit. >>>> >>>> Best regards >>>> zbb >>>> >>>> 2016-03-30 1:53 GMT+02:00 Ed Maste >>> >: >>>> >>>> On 29 March 2016 at 15:19, Zbigniew Bodek >>>> > wrote: >>>> > Author: zbb >>>> > Date: Tue Mar 29 15:19:56 2016 >>>> > New Revision: 297392 >>>> > URL: https://svnweb.freebsd.org/changeset/base/297392 >>>> > >>>> > Log: >>>> > Reduce OFW PCI code duplication - involves ARM, PPC >>>> and SPARC64 >>>> >>>> My 'make tinderbox' build is now failing (powerpc LINT) >>>> with: >>>> >>>> linking kernel >>>> cpcht.o: In function `cpcht_attach': >>>> cpcht.c:(.text+0x17dc): undefined reference to >>>> `ofw_pci_attach' >>>> cpcht.o:(.data.rel+0x0): undefined reference to >>>> `ofw_pci_driver' >>>> grackle.o: In function `grackle_attach': >>>> grackle.c:(.text+0x2dc): undefined reference to >>>> `ofw_pci_attach' >>>> grackle.o:(.data.rel+0x0): undefined reference to >>>> `ofw_pci_driver' >>>> uninorthpci.o: In function `uninorth_attach': >>>> uninorthpci.c:(.text+0x68c): undefined reference to >>>> `ofw_pci_attach' >>>> uninorthpci.o:(.data.rel+0x0): undefined reference to >>>> `ofw_pci_driver' >>>> *** [kernel] Error code 1 >>>> _______________________________________________ >>>> svn-src-all@freebsd.org >>>> mailing list >>>> https://lists.freebsd.org/mailman/listinfo/svn-src-all >>>> To unsubscribe, send any mail to >>>> "svn-src-all-unsubscribe@freebsd.org >>>> " >>>> >>>> >>>> >>> >>> >> >> > From owner-svn-src-head@freebsd.org Fri Apr 1 11:47:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 931F6AEBD38; Fri, 1 Apr 2016 11:47:18 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90]) by mx1.freebsd.org (Postfix) with ESMTP id 4460D14AF; Fri, 1 Apr 2016 11:47:18 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: by lath.rinet.ru (Postfix, from userid 222) id 5CF9C411; Fri, 1 Apr 2016 14:41:49 +0300 (MSK) Date: Fri, 1 Apr 2016 14:41:49 +0300 From: Oleg Bulyzhin To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297481 - head/sys/kern Message-ID: <20160401114149.GA41790@lath.rinet.ru> References: <20160401061250.GA24248@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160401061250.GA24248@dft-labs.eu> User-Agent: Mutt/1.5.24 (2015-08-30) X-Mailman-Approved-At: Fri, 01 Apr 2016 11:54:11 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 11:47:18 -0000 On Fri, Apr 01, 2016 at 08:12:50AM +0200, Mateusz Guzik wrote: > Author: mjg > Date: Wed Apr 1 08:10:00 2016 > New Revision: 280963 > URL: https://svnweb.freebsd.org/changeset/base/297481 Something is wrong with this commit. Revision 297481 is about head/sys/dev/hyperv/vmbus/hv_hv.c -- Oleg. ================================================================ === Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru === ================================================================ From owner-svn-src-head@freebsd.org Fri Apr 1 12:08:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D5B0AEBC91; Fri, 1 Apr 2016 12:08:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB9B315FE; Fri, 1 Apr 2016 12:07:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u31C7sSK014535 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 1 Apr 2016 15:07:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u31C7sSK014535 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u31C7sg6014534; Fri, 1 Apr 2016 15:07:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 1 Apr 2016 15:07:54 +0300 From: Konstantin Belousov To: Oleg Bulyzhin Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297481 - head/sys/kern Message-ID: <20160401120754.GU1741@kib.kiev.ua> References: <20160401061250.GA24248@dft-labs.eu> <20160401114149.GA41790@lath.rinet.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160401114149.GA41790@lath.rinet.ru> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 12:08:00 -0000 On Fri, Apr 01, 2016 at 02:41:49PM +0300, Oleg Bulyzhin wrote: > On Fri, Apr 01, 2016 at 08:12:50AM +0200, Mateusz Guzik wrote: > > Author: mjg > > Date: Wed Apr 1 08:10:00 2016 > > New Revision: 280963 > > URL: https://svnweb.freebsd.org/changeset/base/297481 > > Something is wrong with this commit. Revision 297481 is about > head/sys/dev/hyperv/vmbus/hv_hv.c > Yes, the comments where not style(9) compliant, thus the revision was taken and given to the needy developer. From owner-svn-src-head@freebsd.org Fri Apr 1 14:46:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AED3AEBE36; Fri, 1 Apr 2016 14:46:02 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x22c.google.com (mail-oi0-x22c.google.com [IPv6:2607:f8b0:4003:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 316EB1953; Fri, 1 Apr 2016 14:46:02 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x22c.google.com with SMTP id d205so108246182oia.0; Fri, 01 Apr 2016 07:46:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=pO6A0K3GtBYNjxeWflHCcQivRSzmIhVRrcMj8etYyPw=; b=S1plY98k8YraaO8tVStd6e9WhL35G82BBuliaeVBm11pxRg1zwVvc9piKNSFpzba5m PhSzOQHX9lyDOSaffjXN0mEUv7aKjTpVMC6QoK+uG67yEupzWKSnI85qnO9hk4SBPbXl hokIoRflGEeNRgZDln4Za3Qtn/Iik7EIn0jt014i1evnVpzXGGj0XO+t9KbvkQeUOiaw nOEsALTYcO2hEfO7/ScZ1lSxrQcEm2zwP0gCbcYYqDYhLRnrPkDdFtjC1AAssXlDcg8q E/+ipOXHl2Z+x13QAEVPhVCTE1+nYmCFygkwTlye08SH9V8JAKj7SkU+xefJouFSXkba dX+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=pO6A0K3GtBYNjxeWflHCcQivRSzmIhVRrcMj8etYyPw=; b=EKTaEWjTs2FsY2kVP25iyCKyvpI+NF2eMi/kFHmXNsmUDumfcJf9VX+ib5IF8Z8ZqO niyrvkhyRPaNUtFtgvUrCetRQDc90+Akozcq6IAOI4DxH15Ez9/G06DDdP0+SMeKU3Id 92Lf9KYXFg0yim8PMPrcRECOjYPeIcgR3UeIQzgaq2K4RambUB87Gk+dTzFpgM1KX/6c neoNuUIOhB2ZWKTn+K30YAQlfb0I3S/GXtSg75kbxaG05cjnQLpb3+iZc5JzXzbCswl5 uYS6EOdai3LAxdGG4LS+AyKTMdPm3ldgi7wTt7hknWYeZTJt4GSicbk0GNtFWNLePTmy UHdg== X-Gm-Message-State: AD7BkJJbkcavVnQbT8MVcK6HnsY0JIJtI3s/5ZqArDgDLeAXC9+I6AKEZFwVU0xJv+IdTcxcSuOTIaAFU8cvtQ== MIME-Version: 1.0 X-Received: by 10.157.7.74 with SMTP id 68mr2739113ote.168.1459521961406; Fri, 01 Apr 2016 07:46:01 -0700 (PDT) Received: by 10.157.46.24 with HTTP; Fri, 1 Apr 2016 07:46:01 -0700 (PDT) In-Reply-To: <20160401061250.GA24248@dft-labs.eu> References: <20160401061250.GA24248@dft-labs.eu> Date: Fri, 1 Apr 2016 09:46:01 -0500 Message-ID: Subject: Re: svn commit: r297481 - head/sys/kern From: Benjamin Kaduk To: Mateusz Guzik Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 14:46:02 -0000 On Fri, Apr 1, 2016 at 1:12 AM, Mateusz Guzik wrote: > Author: mjg > Date: Wed Apr 1 08:10:00 2016 > New Revision: 280963 > Next year should probably update the "New Revision" line... > URL: https://svnweb.freebsd.org/changeset/base/297481 > > Log: > Increase responsiveness under load by being more aggressive with > priority changes. > > MFC after: 1 week > > Modified: > head/sys/kern/sched_ule.c > > Modified: head/sys/kern/sched_ule.c > =================================================================== > --- sys/kern/sched_ule.c (revision 297480) > +++ sys/kern/sched_ule.c (working copy) > ...and use the version number instead of "working copy". -Ben > @@ -1696,15 +1696,10 @@ > } > ts = td->td_sched; > THREAD_LOCK_ASSERT(td, MA_OWNED); > - if (td->td_priority == prio) > - return; > /* > - * If the priority has been elevated due to priority > - * propagation, we may have to move ourselves to a new > - * queue. This could be optimized to not re-add in some > - * cases. > + * DOES THIS WORK LOL > */ > - if (TD_ON_RUNQ(td) && prio < td->td_priority) { > + if (TD_ON_RUNQ(td) && prio != td->td_priority) { > sched_rem(td); > td->td_priority = prio; > sched_add(td, SRQ_BORROWING); > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Fri Apr 1 14:49:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ECD5AEC059; Fri, 1 Apr 2016 14:49:44 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA99C1B4B; Fri, 1 Apr 2016 14:49:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id 127so22588496wmu.1; Fri, 01 Apr 2016 07:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9bJ19gEw0m4/yzPKnvfet6AGc17iO7WtvreN0AfHW1w=; b=VFiRYGM+yKL0tmNB/S5tzPsYDQp+20Q1ExMjWbbRsk6CsZpvsNCdIEKUECpVAlz+hc 7zgnuTYezhlocjE0+wPmnlDj84yn+aNxB/tk0nXfe80sQmjxcBPejLXx0Vnb4m05+rxW yRF1NoUsWEeAmJBH7QfKytZpLzDpkhjUDzesae+bIFF8VCeYJ+xdEeHN2cYYBbOsth9e G+Hh7Rwfmh8EY+ez1uwxiwuwvkTCGgEnHb3dHnqGxE+mXmjwTtqQXuTN6vXtwVAREV8i +9Fzs+Q0AKcoBrMXgEJhJVP0etTMZqT5WJ7bLTNibDKQySOXVcV7HIgChlG0aqkF+gIa ReeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9bJ19gEw0m4/yzPKnvfet6AGc17iO7WtvreN0AfHW1w=; b=fwXjJEbhthi237lfmXuWcVoJM8Yv7gaa2ocNqaLpOAMvLx9nwdIcSdAVsw2dLYkkA5 iKstCgJHI6mOfuZNUDg1Z4IEuPhj9Ldhb3vLsB1kL9aLI16KiIRNrxCEWDSUz1UkO5Ci 1ppRnDLPAG+Onsf3tMgogfwhJjrlwahZQ5v9wYF+S+FPJNTsnh3MJe1zdUhXfyakk0KO 9EIh/oyKm6sNx9zoimgxk374FJ3kq1f2ItWdDtgkwy+qzDQcJ2cYJqq3KaYdQW8ZgGgx IY7uC2I+XzYJduDW0tWSdF3OyA/arknjeNWuc6k0erilrQfWd50Qqf/CM5+SY9+tp9Ho 5+rw== X-Gm-Message-State: AD7BkJIAwcQl545otkgCiVnSl99rLHdZotdYjyRb5eJ+JYlv3nO0LMWPZBYhmq/gfQyFVg== X-Received: by 10.194.121.194 with SMTP id lm2mr432879wjb.71.1459522181876; Fri, 01 Apr 2016 07:49:41 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id h7sm30154256wmf.9.2016.04.01.07.49.40 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 01 Apr 2016 07:49:40 -0700 (PDT) Date: Fri, 1 Apr 2016 16:49:38 +0200 From: Mateusz Guzik To: Benjamin Kaduk Cc: Mateusz Guzik , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r297481 - head/sys/kern Message-ID: <20160401144938.GA7951@dft-labs.eu> References: <20160401061250.GA24248@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 14:49:44 -0000 On Fri, Apr 01, 2016 at 09:46:01AM -0500, Benjamin Kaduk wrote: > On Fri, Apr 1, 2016 at 1:12 AM, Mateusz Guzik wrote: > > > Author: mjg > > Date: Wed Apr 1 08:10:00 2016 > > New Revision: 280963 > > > > Next year should probably update the "New Revision" line... > > > > URL: https://svnweb.freebsd.org/changeset/base/297481 > > > > Log: > > Increase responsiveness under load by being more aggressive with > > priority changes. > > > > MFC after: 1 week > > > > Modified: > > head/sys/kern/sched_ule.c > > > > Modified: head/sys/kern/sched_ule.c > > =================================================================== > > --- sys/kern/sched_ule.c (revision 297480) > > +++ sys/kern/sched_ule.c (working copy) > > > > ...and use the version number instead of "working copy". > Worked just fine last year: https://lists.freebsd.org/pipermail/svn-src-head/2015-April/070150.html For interested parties, this was a tribute. See http://scholar.harvard.edu/files/mickens/files/thenightwatch.pdf -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Apr 1 16:16:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C5E8AEA1CF; Fri, 1 Apr 2016 16:16:27 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4B31F03; Fri, 1 Apr 2016 16:16:27 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u31GGQYG010426; Fri, 1 Apr 2016 16:16:26 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u31GGQe2010425; Fri, 1 Apr 2016 16:16:26 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201604011616.u31GGQe2010425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 1 Apr 2016 16:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297488 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 16:16:27 -0000 Author: sbruno Date: Fri Apr 1 16:16:26 2016 New Revision: 297488 URL: https://svnweb.freebsd.org/changeset/base/297488 Log: Repair a overflow condition where a user could submit a string that was not getting a proper bounds check. Thanks to CTurt for pointing at this with a big red blinking neon sign. PR: 206761 Submitted by: sson Reviewed by: cturt@hardenedbsd.org MFC after: 3 days Modified: head/sys/kern/imgact_binmisc.c Modified: head/sys/kern/imgact_binmisc.c ============================================================================== --- head/sys/kern/imgact_binmisc.c Fri Apr 1 11:32:52 2016 (r297487) +++ head/sys/kern/imgact_binmisc.c Fri Apr 1 16:16:26 2016 (r297488) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-15, Stacey D. Son + * Copyright (c) 2013-16, Stacey D. Son * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -220,16 +220,17 @@ imgact_binmisc_add_entry(ximgact_binmisc { imgact_binmisc_entry_t *ibe; char *p; + int cnt; if (xbe->xbe_msize > IBE_MAGIC_MAX) return (EINVAL); - for(p = xbe->xbe_name; *p != 0; p++) - if (!isascii((int)*p)) + for(cnt = 0, p = xbe->xbe_name; *p != 0; cnt++, p++) + if (cnt >= IBE_NAME_MAX || !isascii((int)*p)) return (EINVAL); - for(p = xbe->xbe_interpreter; *p != 0; p++) - if (!isascii((int)*p)) + for(cnt = 0, p = xbe->xbe_interpreter; *p != 0; cnt++, p++) + if (cnt >= IBE_INTERP_LEN_MAX || !isascii((int)*p)) return (EINVAL); /* Make sure we don't have any invalid #'s. */ @@ -266,8 +267,6 @@ imgact_binmisc_add_entry(ximgact_binmisc /* Preallocate a new entry. */ ibe = imgact_binmisc_new_entry(xbe); - if (!ibe) - return (ENOMEM); SLIST_INSERT_HEAD(&interpreter_list, ibe, link); interp_list_entry_count++; From owner-svn-src-head@freebsd.org Fri Apr 1 17:05:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0317CAEB3BD; Fri, 1 Apr 2016 17:05:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B745A1A94; Fri, 1 Apr 2016 17:05:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u31H5kNp025672; Fri, 1 Apr 2016 17:05:46 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u31H5kl0025671; Fri, 1 Apr 2016 17:05:46 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604011705.u31H5kl0025671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 1 Apr 2016 17:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297489 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 17:05:48 -0000 Author: trasz Date: Fri Apr 1 17:05:46 2016 New Revision: 297489 URL: https://svnweb.freebsd.org/changeset/base/297489 Log: Reduce code duplication. There should be no (intended) functional changes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Fri Apr 1 16:16:26 2016 (r297488) +++ head/sys/kern/kern_racct.c Fri Apr 1 17:05:46 2016 (r297489) @@ -114,6 +114,8 @@ SDT_PROBE_DEFINE3(racct, , rusage, set, "struct proc *", "int", "uint64_t"); SDT_PROBE_DEFINE3(racct, , rusage, set__failure, "struct proc *", "int", "uint64_t"); +SDT_PROBE_DEFINE3(racct, , rusage, set__force, + "struct proc *", "int", "uint64_t"); SDT_PROBE_DEFINE3(racct, , rusage, sub, "struct proc *", "int", "uint64_t"); SDT_PROBE_DEFINE3(racct, , rusage, sub__cred, @@ -597,8 +599,6 @@ racct_add_cred_locked(struct ucred *cred /* * Increase allocation of 'resource' by 'amount' for credential 'cred'. * Doesn't check for limits and never fails. - * - * XXX: Shouldn't this ever return an error? */ void racct_add_cred(struct ucred *cred, int resource, uint64_t amount) @@ -637,7 +637,7 @@ racct_add_force(struct proc *p, int reso } static int -racct_set_locked(struct proc *p, int resource, uint64_t amount) +racct_set_locked(struct proc *p, int resource, uint64_t amount, int force) { int64_t old_amount, decayed_amount; int64_t diff_proc, diff_cred; @@ -647,8 +647,6 @@ racct_set_locked(struct proc *p, int res ASSERT_RACCT_ENABLED(); - SDT_PROBE3(racct, , rusage, set, p, resource, amount); - /* * We need proc lock to dereference p->p_ucred. */ @@ -676,7 +674,7 @@ racct_set_locked(struct proc *p, int res resource)); #endif #ifdef RCTL - if (diff_proc > 0) { + if (!force && diff_proc > 0) { error = rctl_enforce(p, resource, diff_proc); if (error && RACCT_IS_DENIABLE(resource)) { SDT_PROBE3(racct, , rusage, set__failure, p, resource, @@ -694,6 +692,20 @@ racct_set_locked(struct proc *p, int res return (0); } +void +racct_set_force(struct proc *p, int resource, uint64_t amount) +{ + + if (!racct_enable) + return; + + SDT_PROBE3(racct, , rusage, set, p, resource, amount); + + mtx_lock(&racct_lock); + racct_set_locked(p, resource, amount, 1); + mtx_unlock(&racct_lock); +} + /* * Set allocation of 'resource' to 'amount' for process 'p'. * Return 0 if it's below limits, or errno, if it's not. @@ -709,61 +721,12 @@ racct_set(struct proc *p, int resource, if (!racct_enable) return (0); - mtx_lock(&racct_lock); - error = racct_set_locked(p, resource, amount); - mtx_unlock(&racct_lock); - return (error); -} - -static void -racct_set_force_locked(struct proc *p, int resource, uint64_t amount) -{ - int64_t old_amount, decayed_amount; - int64_t diff_proc, diff_cred; - - ASSERT_RACCT_ENABLED(); - - SDT_PROBE3(racct, , rusage, set, p, resource, amount); - - /* - * We need proc lock to dereference p->p_ucred. - */ - PROC_LOCK_ASSERT(p, MA_OWNED); - - old_amount = p->p_racct->r_resources[resource]; - /* - * The diffs may be negative. - */ - diff_proc = amount - old_amount; - if (RACCT_IS_DECAYING(resource)) { - /* - * Resources in per-credential racct containers may decay. - * If this is the case, we need to calculate the difference - * between the new amount and the proportional value of the - * old amount that has decayed in the ucred racct containers. - */ - decayed_amount = old_amount * RACCT_DECAY_FACTOR / FSCALE; - diff_cred = amount - decayed_amount; - } else - diff_cred = diff_proc; - - racct_adjust_resource(p->p_racct, resource, diff_proc); - if (diff_cred > 0) - racct_add_cred_locked(p->p_ucred, resource, diff_cred); - else if (diff_cred < 0) - racct_sub_cred_locked(p->p_ucred, resource, -diff_cred); -} - -void -racct_set_force(struct proc *p, int resource, uint64_t amount) -{ - - if (!racct_enable) - return; + SDT_PROBE3(racct, , rusage, set__force, p, resource, amount); mtx_lock(&racct_lock); - racct_set_force_locked(p, resource, amount); + error = racct_set_locked(p, resource, amount, 0); mtx_unlock(&racct_lock); + return (error); } /* @@ -930,7 +893,7 @@ racct_proc_fork(struct proc *parent, str continue; error = racct_set_locked(child, i, - parent->p_racct->r_resources[i]); + parent->p_racct->r_resources[i], 0); if (error != 0) goto out; } @@ -1002,7 +965,7 @@ racct_proc_exit(struct proc *p) pct = racct_getpcpu(p, pct_estimate); mtx_lock(&racct_lock); - racct_set_locked(p, RACCT_CPU, runtime); + racct_set_locked(p, RACCT_CPU, runtime, 0); racct_add_cred_locked(p->p_ucred, RACCT_PCTCPU, pct); for (i = 0; i <= RACCT_MAX; i++) { @@ -1010,7 +973,7 @@ racct_proc_exit(struct proc *p) continue; if (!RACCT_IS_RECLAIMABLE(i)) continue; - racct_set_locked(p, i, 0); + racct_set_locked(p, i, 0, 0); } mtx_unlock(&racct_lock); @@ -1249,11 +1212,11 @@ racctd(void) pct_estimate = 0; pct = racct_getpcpu(p, pct_estimate); mtx_lock(&racct_lock); - racct_set_force_locked(p, RACCT_PCTCPU, pct); - racct_set_locked(p, RACCT_CPU, runtime); + racct_set_locked(p, RACCT_PCTCPU, pct, 1); + racct_set_locked(p, RACCT_CPU, runtime, 0); racct_set_locked(p, RACCT_WALLCLOCK, (uint64_t)wallclock.tv_sec * 1000000 + - wallclock.tv_usec); + wallclock.tv_usec, 0); mtx_unlock(&racct_lock); PROC_UNLOCK(p); } From owner-svn-src-head@freebsd.org Fri Apr 1 17:17:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 714B2AEB83B; Fri, 1 Apr 2016 17:17:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B5B911C7; Fri, 1 Apr 2016 17:17:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u31HHWiM028762; Fri, 1 Apr 2016 17:17:32 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u31HHWpD028761; Fri, 1 Apr 2016 17:17:32 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604011717.u31HHWpD028761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 1 Apr 2016 17:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297490 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 17:17:33 -0000 Author: trasz Date: Fri Apr 1 17:17:32 2016 New Revision: 297490 URL: https://svnweb.freebsd.org/changeset/base/297490 Log: Reduce code duplication. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Fri Apr 1 17:05:46 2016 (r297489) +++ head/sys/kern/kern_racct.c Fri Apr 1 17:17:32 2016 (r297490) @@ -534,7 +534,7 @@ racct_adjust_resource(struct racct *racc } static int -racct_add_locked(struct proc *p, int resource, uint64_t amount) +racct_add_locked(struct proc *p, int resource, uint64_t amount, int force) { #ifdef RCTL int error; @@ -542,18 +542,18 @@ racct_add_locked(struct proc *p, int res ASSERT_RACCT_ENABLED(); - SDT_PROBE3(racct, , rusage, add, p, resource, amount); - /* * We need proc lock to dereference p->p_ucred. */ PROC_LOCK_ASSERT(p, MA_OWNED); #ifdef RCTL - error = rctl_enforce(p, resource, amount); - if (error && RACCT_IS_DENIABLE(resource)) { - SDT_PROBE3(racct, , rusage, add__failure, p, resource, amount); - return (error); + if (!force) { + error = rctl_enforce(p, resource, amount); + if (error && RACCT_IS_DENIABLE(resource)) { + SDT_PROBE3(racct, , rusage, add__failure, p, resource, amount); + return (error); + } } #endif racct_adjust_resource(p->p_racct, resource, amount); @@ -574,8 +574,10 @@ racct_add(struct proc *p, int resource, if (!racct_enable) return (0); + SDT_PROBE3(racct, , rusage, add, p, resource, amount); + mtx_lock(&racct_lock); - error = racct_add_locked(p, resource, amount); + error = racct_add_locked(p, resource, amount, 0); mtx_unlock(&racct_lock); return (error); } @@ -625,14 +627,8 @@ racct_add_force(struct proc *p, int reso SDT_PROBE3(racct, , rusage, add__force, p, resource, amount); - /* - * We need proc lock to dereference p->p_ucred. - */ - PROC_LOCK_ASSERT(p, MA_OWNED); - mtx_lock(&racct_lock); - racct_adjust_resource(p->p_racct, resource, amount); - racct_add_cred_locked(p->p_ucred, resource, amount); + racct_add_locked(p, resource, amount, 1); mtx_unlock(&racct_lock); } @@ -898,8 +894,8 @@ racct_proc_fork(struct proc *parent, str goto out; } - error = racct_add_locked(child, RACCT_NPROC, 1); - error += racct_add_locked(child, RACCT_NTHR, 1); + error = racct_add_locked(child, RACCT_NPROC, 1, 0); + error += racct_add_locked(child, RACCT_NTHR, 1, 0); out: mtx_unlock(&racct_lock); From owner-svn-src-head@freebsd.org Fri Apr 1 17:21:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCB2BAEB9EE; Fri, 1 Apr 2016 17:21:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84CDB15F3; Fri, 1 Apr 2016 17:21:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u31HLtaw031558; Fri, 1 Apr 2016 17:21:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u31HLt7k031557; Fri, 1 Apr 2016 17:21:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604011721.u31HLt7k031557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 1 Apr 2016 17:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297491 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 17:21:56 -0000 Author: trasz Date: Fri Apr 1 17:21:55 2016 New Revision: 297491 URL: https://svnweb.freebsd.org/changeset/base/297491 Log: Reorder the functions; no functional changes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Fri Apr 1 17:17:32 2016 (r297490) +++ head/sys/kern/kern_racct.c Fri Apr 1 17:21:55 2016 (r297491) @@ -582,6 +582,24 @@ racct_add(struct proc *p, int resource, return (error); } +/* + * Increase allocation of 'resource' by 'amount' for process 'p'. + * Doesn't check for limits and never fails. + */ +void +racct_add_force(struct proc *p, int resource, uint64_t amount) +{ + + if (!racct_enable) + return; + + SDT_PROBE3(racct, , rusage, add__force, p, resource, amount); + + mtx_lock(&racct_lock); + racct_add_locked(p, resource, amount, 1); + mtx_unlock(&racct_lock); +} + static void racct_add_cred_locked(struct ucred *cred, int resource, uint64_t amount) { @@ -614,24 +632,6 @@ racct_add_cred(struct ucred *cred, int r mtx_unlock(&racct_lock); } -/* - * Increase allocation of 'resource' by 'amount' for process 'p'. - * Doesn't check for limits and never fails. - */ -void -racct_add_force(struct proc *p, int resource, uint64_t amount) -{ - - if (!racct_enable) - return; - - SDT_PROBE3(racct, , rusage, add__force, p, resource, amount); - - mtx_lock(&racct_lock); - racct_add_locked(p, resource, amount, 1); - mtx_unlock(&racct_lock); -} - static int racct_set_locked(struct proc *p, int resource, uint64_t amount, int force) { @@ -688,20 +688,6 @@ racct_set_locked(struct proc *p, int res return (0); } -void -racct_set_force(struct proc *p, int resource, uint64_t amount) -{ - - if (!racct_enable) - return; - - SDT_PROBE3(racct, , rusage, set, p, resource, amount); - - mtx_lock(&racct_lock); - racct_set_locked(p, resource, amount, 1); - mtx_unlock(&racct_lock); -} - /* * Set allocation of 'resource' to 'amount' for process 'p'. * Return 0 if it's below limits, or errno, if it's not. @@ -725,6 +711,20 @@ racct_set(struct proc *p, int resource, return (error); } +void +racct_set_force(struct proc *p, int resource, uint64_t amount) +{ + + if (!racct_enable) + return; + + SDT_PROBE3(racct, , rusage, set, p, resource, amount); + + mtx_lock(&racct_lock); + racct_set_locked(p, resource, amount, 1); + mtx_unlock(&racct_lock); +} + /* * Returns amount of 'resource' the process 'p' can keep allocated. * Allocating more than that would be denied, unless the resource From owner-svn-src-head@freebsd.org Fri Apr 1 17:28:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA3C7AE612D; Fri, 1 Apr 2016 17:28:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB19D1E0D; Fri, 1 Apr 2016 17:28:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u31HStcw032308; Fri, 1 Apr 2016 17:28:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u31HStG5032307; Fri, 1 Apr 2016 17:28:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604011728.u31HStG5032307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 1 Apr 2016 17:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297492 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 17:28:57 -0000 Author: trasz Date: Fri Apr 1 17:28:55 2016 New Revision: 297492 URL: https://svnweb.freebsd.org/changeset/base/297492 Log: Call rctl_enforce() in all cases the resource usage goes up, even when called from racct_*_force() functions. It makes the "log" and "devctl" actions work in those cases. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Fri Apr 1 17:21:55 2016 (r297491) +++ head/sys/kern/kern_racct.c Fri Apr 1 17:28:55 2016 (r297492) @@ -548,12 +548,10 @@ racct_add_locked(struct proc *p, int res PROC_LOCK_ASSERT(p, MA_OWNED); #ifdef RCTL - if (!force) { - error = rctl_enforce(p, resource, amount); - if (error && RACCT_IS_DENIABLE(resource)) { - SDT_PROBE3(racct, , rusage, add__failure, p, resource, amount); - return (error); - } + error = rctl_enforce(p, resource, amount); + if (error && !force && RACCT_IS_DENIABLE(resource)) { + SDT_PROBE3(racct, , rusage, add__failure, p, resource, amount); + return (error); } #endif racct_adjust_resource(p->p_racct, resource, amount); @@ -670,9 +668,9 @@ racct_set_locked(struct proc *p, int res resource)); #endif #ifdef RCTL - if (!force && diff_proc > 0) { + if (diff_proc > 0) { error = rctl_enforce(p, resource, diff_proc); - if (error && RACCT_IS_DENIABLE(resource)) { + if (error && !force && RACCT_IS_DENIABLE(resource)) { SDT_PROBE3(racct, , rusage, set__failure, p, resource, amount); return (error); From owner-svn-src-head@freebsd.org Fri Apr 1 18:07:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A75F6B00096; Fri, 1 Apr 2016 18:07:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 947191120; Fri, 1 Apr 2016 18:07:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 8D8ED1BD7; Fri, 1 Apr 2016 18:07:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 42BCD20B4A; Fri, 1 Apr 2016 18:07:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id r1ry7FotS_es; Fri, 1 Apr 2016 18:07:01 +0000 (UTC) Subject: Re: svn commit: r297488 - head/sys/kern DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 619B420B42 To: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604011616.u31GGQe2010425@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <56FEB8C3.1080000@FreeBSD.org> Date: Fri, 1 Apr 2016 11:06:59 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <201604011616.u31GGQe2010425@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 18:07:04 -0000 On 4/1/16 9:16 AM, Sean Bruno wrote: > Author: sbruno > Date: Fri Apr 1 16:16:26 2016 > New Revision: 297488 > URL: https://svnweb.freebsd.org/changeset/base/297488 > > Log: > Repair a overflow condition where a user could submit a string that was > not getting a proper bounds check. > > Thanks to CTurt for pointing at this with a big red blinking neon sign. > > PR: 206761 I love this bit in the analysis: "Unfortunately, the sysctl node, `kern.binmisc.add` is only accessible as root." -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Fri Apr 1 18:29:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06992B006B7; Fri, 1 Apr 2016 18:29:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7DE31C9B; Fri, 1 Apr 2016 18:29:39 +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 u31ITcRg050644; Fri, 1 Apr 2016 18:29:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u31ITcsR050642; Fri, 1 Apr 2016 18:29:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604011829.u31ITcsR050642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 1 Apr 2016 18:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297493 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 18:29:40 -0000 Author: jhb Date: Fri Apr 1 18:29:38 2016 New Revision: 297493 URL: https://svnweb.freebsd.org/changeset/base/297493 Log: Cap IOSIZE_MAX to INT_MAX for 32-bit processes. Previously, freebsd32 binaries could submit read/write requests with lengths greater than INT_MAX that a native kernel would have rejected. Reviewed by: kib Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D5788 Modified: head/sys/kern/sys_generic.c head/sys/sys/systm.h Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Fri Apr 1 17:28:55 2016 (r297492) +++ head/sys/kern/sys_generic.c Fri Apr 1 18:29:38 2016 (r297493) @@ -89,12 +89,14 @@ __FBSDID("$FreeBSD$"); #define SYS_IOCTL_SMALL_SIZE 128 /* bytes */ #define SYS_IOCTL_SMALL_ALIGN 8 /* bytes */ -int iosize_max_clamp = 0; +#ifdef __LP64__ +static int iosize_max_clamp = 0; SYSCTL_INT(_debug, OID_AUTO, iosize_max_clamp, CTLFLAG_RW, &iosize_max_clamp, 0, "Clamp max i/o size to INT_MAX"); -int devfs_iosize_max_clamp = 1; +static int devfs_iosize_max_clamp = 1; SYSCTL_INT(_debug, OID_AUTO, devfs_iosize_max_clamp, CTLFLAG_RW, &devfs_iosize_max_clamp, 0, "Clamp max i/o size to INT_MAX for devices"); +#endif /* * Assert that the return value of read(2) and write(2) syscalls fits @@ -159,6 +161,24 @@ struct selfd { static uma_zone_t selfd_zone; static struct mtx_pool *mtxpool_select; +#ifdef __LP64__ +size_t +devfs_iosize_max(void) +{ + + return (devfs_iosize_max_clamp || SV_CURPROC_FLAG(SV_ILP32) ? + INT_MAX : SSIZE_MAX); +} + +size_t +iosize_max(void) +{ + + return (iosize_max_clamp || SV_CURPROC_FLAG(SV_ILP32) ? + INT_MAX : SSIZE_MAX); +} +#endif + #ifndef _SYS_SYSPROTO_H_ struct read_args { int fd; Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Apr 1 17:28:55 2016 (r297492) +++ head/sys/sys/systm.h Fri Apr 1 18:29:38 2016 (r297493) @@ -148,10 +148,14 @@ extern char **kenvp; extern const void *zero_region; /* address space maps to a zeroed page */ extern int unmapped_buf_allowed; -extern int iosize_max_clamp; -extern int devfs_iosize_max_clamp; -#define IOSIZE_MAX (iosize_max_clamp ? INT_MAX : SSIZE_MAX) -#define DEVFS_IOSIZE_MAX (devfs_iosize_max_clamp ? INT_MAX : SSIZE_MAX) + +#ifdef __LP64__ +#define IOSIZE_MAX iosize_max() +#define DEVFS_IOSIZE_MAX devfs_iosize_max() +#else +#define IOSIZE_MAX SSIZE_MAX +#define DEVFS_IOSIZE_MAX SSIZE_MAX +#endif /* * General function declarations. @@ -403,6 +407,11 @@ struct cdev; dev_t dev2udev(struct cdev *x); const char *devtoname(struct cdev *cdev); +#ifdef __LP64__ +size_t devfs_iosize_max(void); +size_t iosize_max(void); +#endif + int poll_no_poll(int events); /* XXX: Should be void nanodelay(u_int nsec); */ From owner-svn-src-head@freebsd.org Fri Apr 1 18:36:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E15CB009A5; Fri, 1 Apr 2016 18:36:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 466AC1172; Fri, 1 Apr 2016 18:36:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u31IaAu8053513; Fri, 1 Apr 2016 18:36:10 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u31IaAQX053512; Fri, 1 Apr 2016 18:36:10 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604011836.u31IaAQX053512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 1 Apr 2016 18:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297494 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 18:36:11 -0000 Author: trasz Date: Fri Apr 1 18:36:10 2016 New Revision: 297494 URL: https://svnweb.freebsd.org/changeset/base/297494 Log: Drop the 'resource' argument to racct_decay(); it wouldn't make sense to iterate separately for each resource. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Fri Apr 1 18:29:38 2016 (r297493) +++ head/sys/kern/kern_racct.c Fri Apr 1 18:36:10 2016 (r297494) @@ -1107,23 +1107,21 @@ racct_proc_wakeup(struct proc *p) } static void -racct_decay_resource(struct racct *racct, void * res, void* dummy) +racct_decay_callback(struct racct *racct, void *dummy1, void *dummy2) { - int resource; int64_t r_old, r_new; ASSERT_RACCT_ENABLED(); mtx_assert(&racct_lock, MA_OWNED); - resource = *(int *)res; - r_old = racct->r_resources[resource]; + r_old = racct->r_resources[RACCT_PCTCPU]; /* If there is nothing to decay, just exit. */ if (r_old <= 0) return; r_new = r_old * RACCT_DECAY_FACTOR / FSCALE; - racct->r_resources[resource] = r_new; + racct->r_resources[RACCT_PCTCPU] = r_new; } static void @@ -1141,17 +1139,17 @@ racct_decay_post(void) } static void -racct_decay(int resource) +racct_decay() { ASSERT_RACCT_ENABLED(); - ui_racct_foreach(racct_decay_resource, racct_decay_pre, - racct_decay_post, &resource, NULL); - loginclass_racct_foreach(racct_decay_resource, racct_decay_pre, - racct_decay_post, &resource, NULL); - prison_racct_foreach(racct_decay_resource, racct_decay_pre, - racct_decay_post, &resource, NULL); + ui_racct_foreach(racct_decay_callback, racct_decay_pre, + racct_decay_post, NULL, NULL); + loginclass_racct_foreach(racct_decay_callback, racct_decay_pre, + racct_decay_post, NULL, NULL); + prison_racct_foreach(racct_decay_callback, racct_decay_pre, + racct_decay_post, NULL, NULL); } static void @@ -1166,7 +1164,7 @@ racctd(void) ASSERT_RACCT_ENABLED(); for (;;) { - racct_decay(RACCT_PCTCPU); + racct_decay(); sx_slock(&allproc_lock); From owner-svn-src-head@freebsd.org Fri Apr 1 18:45:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 036F6B00BB2; Fri, 1 Apr 2016 18:45:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6588160C; Fri, 1 Apr 2016 18:45:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u31Ij5rZ056434; Fri, 1 Apr 2016 18:45:05 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u31Ij5jP056433; Fri, 1 Apr 2016 18:45:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604011845.u31Ij5jP056433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 1 Apr 2016 18:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297495 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 18:45:06 -0000 Author: trasz Date: Fri Apr 1 18:45:04 2016 New Revision: 297495 URL: https://svnweb.freebsd.org/changeset/base/297495 Log: Fix mismerge. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Fri Apr 1 18:36:10 2016 (r297494) +++ head/sys/kern/kern_racct.c Fri Apr 1 18:45:04 2016 (r297495) @@ -1139,7 +1139,7 @@ racct_decay_post(void) } static void -racct_decay() +racct_decay(void) { ASSERT_RACCT_ENABLED(); From owner-svn-src-head@freebsd.org Fri Apr 1 20:26:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8CBDAECABE; Fri, 1 Apr 2016 20:26:47 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B03C914C3; Fri, 1 Apr 2016 20:26:47 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u31KQkZP087014; Fri, 1 Apr 2016 20:26:46 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u31KQkRG087006; Fri, 1 Apr 2016 20:26:46 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201604012026.u31KQkRG087006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Fri, 1 Apr 2016 20:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297496 - in head/sys: arm/conf arm/mv conf dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 20:26:48 -0000 Author: jmcneill Date: Fri Apr 1 20:26:45 2016 New Revision: 297496 URL: https://svnweb.freebsd.org/changeset/base/297496 Log: Move support for Synopsys Designware APB UART out of ns8250 and into a separate driver. Add support for activating clock and hwreset resources for these devices when the EXT_RESOURCES option is present. Reviewed by: andrew, mmel, Emmanuel Vadot Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5749 Added: head/sys/dev/uart/uart_dev_snps.c (contents, props changed) Modified: head/sys/arm/conf/A10 head/sys/arm/conf/A20 head/sys/arm/conf/ARMADA38X head/sys/arm/conf/RK3188 head/sys/arm/mv/files.mv head/sys/conf/files head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/arm/conf/A10 ============================================================================== --- head/sys/arm/conf/A10 Fri Apr 1 18:45:04 2016 (r297495) +++ head/sys/arm/conf/A10 Fri Apr 1 20:26:45 2016 (r297496) @@ -61,7 +61,7 @@ device ahci # AHCI-compatible SATA co # Console and misc device uart -device uart_ns8250 +device uart_snps device pty device snp device md Modified: head/sys/arm/conf/A20 ============================================================================== --- head/sys/arm/conf/A20 Fri Apr 1 18:45:04 2016 (r297495) +++ head/sys/arm/conf/A20 Fri Apr 1 20:26:45 2016 (r297496) @@ -71,7 +71,7 @@ device ahci # AHCI-compatible SATA co # Console and misc device uart -device uart_ns8250 +device uart_snps device pty device snp device md Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Fri Apr 1 18:45:04 2016 (r297495) +++ head/sys/arm/conf/ARMADA38X Fri Apr 1 20:26:45 2016 (r297496) @@ -48,7 +48,7 @@ device md # Serial ports device uart -device uart_ns8250 +device uart_snps # Network device ether Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Fri Apr 1 18:45:04 2016 (r297495) +++ head/sys/arm/conf/RK3188 Fri Apr 1 20:26:45 2016 (r297496) @@ -59,7 +59,7 @@ device dwmmc # Console and misc device uart -device uart_ns8250 +device uart_snps device pty device snp device md Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Fri Apr 1 18:45:04 2016 (r297495) +++ head/sys/arm/mv/files.mv Fri Apr 1 20:26:45 2016 (r297496) @@ -26,6 +26,7 @@ dev/mge/if_mge.c optional mge dev/nand/nfc_mv.c optional nand dev/mvs/mvs_soc.c optional mvs dev/uart/uart_dev_ns8250.c optional uart +dev/uart/uart_dev_snps.c optional uart dev/usb/controller/ehci_mv.c optional ehci dev/usb/controller/xhci_mv.c optional xhci Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Apr 1 18:45:04 2016 (r297495) +++ head/sys/conf/files Fri Apr 1 20:26:45 2016 (r297496) @@ -2555,11 +2555,12 @@ dev/uart/uart_bus_puc.c optional uart p dev/uart/uart_bus_scc.c optional uart scc dev/uart/uart_core.c optional uart dev/uart/uart_dbg.c optional uart gdb -dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 +dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_snps dev/uart/uart_dev_pl011.c optional uart pl011 dev/uart/uart_dev_quicc.c optional uart quicc dev/uart/uart_dev_sab82532.c optional uart uart_sab82532 dev/uart/uart_dev_sab82532.c optional uart scc +dev/uart/uart_dev_snps.c optional uart uart_snps dev/uart/uart_dev_z8530.c optional uart uart_z8530 dev/uart/uart_dev_z8530.c optional uart scc dev/uart/uart_if.m optional uart Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Fri Apr 1 18:45:04 2016 (r297495) +++ head/sys/dev/uart/uart_dev_ns8250.c Fri Apr 1 20:26:45 2016 (r297496) @@ -398,7 +398,6 @@ struct uart_class uart_ns8250_class = { static struct ofw_compat_data compat_data[] = { {"ns16550", (uintptr_t)&uart_ns8250_class}, {"ns16550a", (uintptr_t)&uart_ns8250_class}, - {"snps,dw-apb-uart", (uintptr_t)&uart_ns8250_class}, {NULL, (uintptr_t)NULL}, }; UART_FDT_CLASS_AND_DEVICE(compat_data); @@ -451,19 +450,9 @@ ns8250_bus_attach(struct uart_softc *sc) pcell_t cell; #endif - ns8250->busy_detect = 0; - #ifdef FDT - /* - * Check whether uart requires to read USR reg when IIR_BUSY and - * has broken txfifo. - */ - ns8250->busy_detect = ofw_bus_is_compatible(sc->sc_dev, "snps,dw-apb-uart"); + /* Check whether uart has a broken txfifo. */ node = ofw_bus_get_node(sc->sc_dev); - /* XXX: This is kept for a short time for compatibility with older device trees */ - if ((OF_getencprop(node, "busy-detect", &cell, sizeof(cell))) > 0 - && cell != 0) - ns8250->busy_detect = 1; if ((OF_getencprop(node, "broken-txfifo", &cell, sizeof(cell))) > 0) broken_txfifo = cell ? 1 : 0; #endif Added: head/sys/dev/uart/uart_dev_snps.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_dev_snps.c Fri Apr 1 20:26:45 2016 (r297496) @@ -0,0 +1,283 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#ifdef EXT_RESOURCES +#include +#include +#endif + +#include "uart_if.h" + +struct snps_softc { + struct ns8250_softc ns8250; + +#ifdef EXT_RESOURCES + clk_t baudclk; + clk_t apb_pclk; + hwreset_t reset; +#endif +}; + +static int +snps_uart_attach(struct uart_softc *uart_sc) +{ + struct snps_softc *sc; + + sc = (struct snps_softc *)uart_sc; + + /* UART requires to read USR reg when IIR_BUSY */ + sc->ns8250.busy_detect = 1; + + return (ns8250_bus_attach(uart_sc)); +} + +static kobj_method_t snps_methods[] = { + KOBJMETHOD(uart_probe, ns8250_bus_probe), + KOBJMETHOD(uart_attach, snps_uart_attach), + KOBJMETHOD(uart_detach, ns8250_bus_detach), + KOBJMETHOD(uart_flush, ns8250_bus_flush), + KOBJMETHOD(uart_getsig, ns8250_bus_getsig), + KOBJMETHOD(uart_ioctl, ns8250_bus_ioctl), + KOBJMETHOD(uart_ipend, ns8250_bus_ipend), + KOBJMETHOD(uart_param, ns8250_bus_param), + KOBJMETHOD(uart_receive, ns8250_bus_receive), + KOBJMETHOD(uart_setsig, ns8250_bus_setsig), + KOBJMETHOD(uart_transmit, ns8250_bus_transmit), + KOBJMETHOD(uart_grab, ns8250_bus_grab), + KOBJMETHOD(uart_ungrab, ns8250_bus_ungrab), + KOBJMETHOD_END +}; + +struct uart_class uart_snps_class = { + "snps", + snps_methods, + sizeof(struct snps_softc), + .uc_ops = &uart_ns8250_ops, + .uc_range = 8, + .uc_rclk = 0, +}; + +static struct ofw_compat_data compat_data[] = { + { "snps,dw-apb-uart", (uintptr_t)&uart_snps_class }, + { NULL, (uintptr_t)NULL } +}; +UART_FDT_CLASS(compat_data); + +#ifdef EXT_RESOURCES +static int +snps_get_clocks(device_t dev, clk_t *baudclk, clk_t *apb_pclk) +{ + struct snps_softc *sc; + + sc = device_get_softc(dev); + *baudclk = NULL; + *apb_pclk = NULL; + + /* Baud clock is either named "baudclk", or there is a single + * unnamed clock. + */ + if (clk_get_by_ofw_name(dev, "baudclk", baudclk) != 0 && + clk_get_by_ofw_index(dev, 0, baudclk) != 0) + return (ENOENT); + + /* APB peripheral clock is optional */ + (void)clk_get_by_ofw_name(dev, "apb_pclk", apb_pclk); + + return (0); +} +#endif + +static int +snps_probe(device_t dev) +{ + struct snps_softc *sc; + struct uart_class *uart_class; + phandle_t node; + uint32_t shift, clock; + uint64_t freq; + int error; +#ifdef EXT_RESOURCES + clk_t baudclk, apb_pclk; + hwreset_t reset; +#endif + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + uart_class = (struct uart_class *)ofw_bus_search_compatible(dev, + compat_data)->ocd_data; + if (uart_class == NULL) + return (ENXIO); + + freq = 0; + sc = device_get_softc(dev); + sc->ns8250.base.sc_class = uart_class; + + node = ofw_bus_get_node(dev); + if (OF_getencprop(node, "reg-shift", &shift, sizeof(shift)) <= 0) + shift = 0; + if (OF_getencprop(node, "clock-frequency", &clock, sizeof(clock)) <= 0) + clock = 0; + +#ifdef EXT_RESOURCES + if (hwreset_get_by_ofw_idx(dev, 0, &reset) == 0) { + error = hwreset_deassert(reset); + if (error != 0) { + device_printf(dev, "cannot de-assert reset\n"); + return (error); + } + } + + if (snps_get_clocks(dev, &baudclk, &apb_pclk) == 0) { + error = clk_enable(baudclk); + if (error != 0) { + device_printf(dev, "cannot enable baud clock\n"); + return (error); + } + if (apb_pclk != NULL) { + error = clk_enable(apb_pclk); + if (error != 0) { + device_printf(dev, + "cannot enable peripheral clock\n"); + return (error); + } + } + + if (clock == 0) { + error = clk_get_freq(baudclk, &freq); + if (error != 0) { + device_printf(dev, "cannot get frequency\n"); + return (error); + } + clock = (uint32_t)freq; + } + } +#endif + + if (bootverbose && clock == 0) + device_printf(dev, "could not determine frequency\n"); + + error = uart_bus_probe(dev, (int)shift, (int)clock, 0, 0); + if (error != 0) + return (error); + +#ifdef EXT_RESOURCES + /* XXX uart_bus_probe has changed the softc, so refresh it */ + sc = device_get_softc(dev); + + /* Store clock and reset handles for detach */ + sc->baudclk = baudclk; + sc->apb_pclk = apb_pclk; + sc->reset = reset; +#endif + + return (0); +} + +static int +snps_detach(device_t dev) +{ +#ifdef EXT_RESOURCES + struct snps_softc *sc; + clk_t baudclk, apb_pclk; + hwreset_t reset; +#endif + int error; + +#ifdef EXT_RESOURCES + sc = device_get_softc(dev); + baudclk = sc->baudclk; + apb_pclk = sc->apb_pclk; + reset = sc->reset; +#endif + + error = uart_bus_detach(dev); + if (error != 0) + return (error); + +#ifdef EXT_RESOURCES + if (reset != NULL) { + error = hwreset_assert(reset); + if (error != 0) { + device_printf(dev, "cannot assert reset\n"); + return (error); + } + hwreset_release(reset); + } + if (apb_pclk != NULL) { + error = clk_release(apb_pclk); + if (error != 0) { + device_printf(dev, "cannot release peripheral clock\n"); + return (error); + } + } + if (baudclk != NULL) { + error = clk_release(baudclk); + if (error != 0) { + device_printf(dev, "cannot release baud clock\n"); + return (error); + } + } +#endif + + return (0); +} + +static device_method_t snps_bus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, snps_probe), + DEVMETHOD(device_attach, uart_bus_attach), + DEVMETHOD(device_detach, snps_detach), + DEVMETHOD_END +}; + +static driver_t snps_uart_driver = { + uart_driver_name, + snps_bus_methods, + sizeof(struct snps_softc) +}; + +DRIVER_MODULE(uart_snps, simplebus, snps_uart_driver, uart_devclass, 0, 0); From owner-svn-src-head@freebsd.org Fri Apr 1 20:38:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E92CAECF03; Fri, 1 Apr 2016 20:38:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D03DF1D40; Fri, 1 Apr 2016 20:38:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u31KcFUg090073; Fri, 1 Apr 2016 20:38:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u31KcFVi090072; Fri, 1 Apr 2016 20:38:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604012038.u31KcFVi090072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 1 Apr 2016 20:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297497 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 20:38:17 -0000 Author: tuexen Date: Fri Apr 1 20:38:15 2016 New Revision: 297497 URL: https://svnweb.freebsd.org/changeset/base/297497 Log: Set the chunk id for ERROR chunks. This is work with rrs@. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Apr 1 20:26:45 2016 (r297496) +++ head/sys/netinet/sctp_output.c Fri Apr 1 20:38:15 2016 (r297497) @@ -8943,6 +8943,8 @@ sctp_queue_op_err(struct sctp_tcb *stcb, chk->asoc = &stcb->asoc; chk->data = op_err; chk->whoTo = NULL; + chk->rec.chunk_id.id = SCTP_OPERATION_ERROR; + chk->rec.chunk_id.can_take_data = 0; hdr = mtod(op_err, struct sctp_chunkhdr *); hdr->chunk_type = SCTP_OPERATION_ERROR; hdr->chunk_flags = 0; From owner-svn-src-head@freebsd.org Fri Apr 1 23:31:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B522BB00030; Fri, 1 Apr 2016 23:31:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86516135B; Fri, 1 Apr 2016 23:31:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u31NVvgP043751; Fri, 1 Apr 2016 23:31:57 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u31NVvSh043750; Fri, 1 Apr 2016 23:31:57 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604012331.u31NVvSh043750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 1 Apr 2016 23:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297498 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 23:31:58 -0000 Author: bdrewery Date: Fri Apr 1 23:31:57 2016 New Revision: 297498 URL: https://svnweb.freebsd.org/changeset/base/297498 Log: Follow-up r297282: Make the COPTS warning more useful. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Fri Apr 1 20:38:15 2016 (r297497) +++ head/share/mk/bsd.prog.mk Fri Apr 1 23:31:57 2016 (r297498) @@ -8,7 +8,7 @@ # XXX The use of COPTS in modern makefiles is discouraged. .if defined(COPTS) -.warning COPTS should be CFLAGS. +.warning ${.CURDIR}: COPTS should be CFLAGS. CFLAGS+=${COPTS} .endif From owner-svn-src-head@freebsd.org Sat Apr 2 01:14:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25702B0018C; Sat, 2 Apr 2016 01:14:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E709B1AB6; Sat, 2 Apr 2016 01:14:52 +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 u321EqgL074737; Sat, 2 Apr 2016 01:14:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u321EqCF074736; Sat, 2 Apr 2016 01:14:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604020114.u321EqCF074736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 2 Apr 2016 01:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297499 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 01:14:53 -0000 Author: pfg Date: Sat Apr 2 01:14:51 2016 New Revision: 297499 URL: https://svnweb.freebsd.org/changeset/base/297499 Log: Small typo. Modified: head/sys/cam/scsi/scsi_ch.c Modified: head/sys/cam/scsi/scsi_ch.c ============================================================================== --- head/sys/cam/scsi/scsi_ch.c Fri Apr 1 23:31:57 2016 (r297498) +++ head/sys/cam/scsi/scsi_ch.c Sat Apr 2 01:14:51 2016 (r297499) @@ -659,7 +659,7 @@ chdone(struct cam_periph *periph, union */ if (error == ERESTART) { /* - * A retry was scheuled, so + * A retry was scheduled, so * just return. */ return; From owner-svn-src-head@freebsd.org Sat Apr 2 01:55:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87E30B00E4F; Sat, 2 Apr 2016 01:55:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60F831B63; Sat, 2 Apr 2016 01:55:44 +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 u321thcM087082; Sat, 2 Apr 2016 01:55:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u321thiD087081; Sat, 2 Apr 2016 01:55:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604020155.u321thiD087081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 2 Apr 2016 01:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297500 - head/usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 01:55:44 -0000 Author: jhb Date: Sat Apr 2 01:55:43 2016 New Revision: 297500 URL: https://svnweb.freebsd.org/changeset/base/297500 Log: Various updates to the PCI-express capability output. - Group the output so that it follows the capability register set more closely. The first line now contains device information and the second line contains link information. As a result, ARI status is now output on the first line, and the link width is moved down to the second line of link information. - Only read the DEVICE_CAP2 register to check for ARI if the capability version is >= 2. - Don't output any link information if the link capability and status registers are zero. - Label the MSI interrupt index value as "MSI" instead of "IRQ". Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Sat Apr 2 01:14:51 2016 (r297499) +++ head/usr.sbin/pciconf/cap.c Sat Apr 2 01:55:43 2016 (r297500) @@ -413,11 +413,13 @@ aspm_string(uint8_t aspm) static void cap_express(int fd, struct pci_conf *p, uint8_t ptr) { - uint32_t cap, cap2; + uint32_t cap; uint16_t ctl, flags, sta; + unsigned int version; flags = read_config(fd, &p->pc_sel, ptr + PCIER_FLAGS, 2); - printf("PCI-Express %d ", flags & PCIEM_FLAGS_VERSION); + version = flags & PCIEM_FLAGS_VERSION; + printf("PCI-Express %u ", version); switch (flags & PCIEM_FLAGS_TYPE) { case PCIEM_TYPE_ENDPOINT: printf("endpoint"); @@ -453,9 +455,8 @@ cap_express(int fd, struct pci_conf *p, if (flags & PCIEM_FLAGS_SLOT) printf(" slot"); if (flags & PCIEM_FLAGS_IRQ) - printf(" IRQ %d", (flags & PCIEM_FLAGS_IRQ) >> 9); + printf(" MSI %d", (flags & PCIEM_FLAGS_IRQ) >> 9); cap = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP, 4); - cap2 = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP2, 4); ctl = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CTL, 2); printf(" max data %d(%d)", MAX_PAYLOAD((ctl & PCIEM_CTL_MAX_PAYLOAD) >> 5), @@ -466,12 +467,22 @@ cap_express(int fd, struct pci_conf *p, printf(" RO"); if (ctl & PCIEM_CTL_NOSNOOP_ENABLE) printf(" NS"); + if (version >= 2) { + cap = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP2, 4); + if ((cap & PCIEM_CAP2_ARI) != 0) { + ctl = read_config(fd, &p->pc_sel, + ptr + PCIER_DEVICE_CTL2, 4); + printf(" ARI %s", + (ctl & PCIEM_CTL2_ARI) ? "enabled" : "disabled"); + } + } cap = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4); sta = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_STA, 2); + if (cap == 0 && sta == 0) + return; + printf("\n "); printf(" link x%d(x%d)", (sta & PCIEM_LINK_STA_WIDTH) >> 4, (cap & PCIEM_LINK_CAP_MAX_WIDTH) >> 4); - if ((cap & (PCIEM_LINK_CAP_MAX_WIDTH | PCIEM_LINK_CAP_ASPM)) != 0) - printf("\n "); if ((cap & PCIEM_LINK_CAP_MAX_WIDTH) != 0) { printf(" speed %s(%s)", (sta & PCIEM_LINK_STA_WIDTH) == 0 ? "0.0" : link_speed_string(sta & PCIEM_LINK_STA_SPEED), @@ -482,11 +493,6 @@ cap_express(int fd, struct pci_conf *p, printf(" ASPM %s(%s)", aspm_string(ctl & PCIEM_LINK_CTL_ASPMC), aspm_string((cap & PCIEM_LINK_CAP_ASPM) >> 10)); } - if ((cap2 & PCIEM_CAP2_ARI) != 0) { - ctl = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CTL2, 4); - printf(" ARI %s", - (ctl & PCIEM_CTL2_ARI) ? "enabled" : "disabled"); - } } static void From owner-svn-src-head@freebsd.org Sat Apr 2 01:59:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A3F6B00FDD; Sat, 2 Apr 2016 01:59:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DC5D1D86; Sat, 2 Apr 2016 01:59:54 +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 u321xrDX087306; Sat, 2 Apr 2016 01:59:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u321xr2V087305; Sat, 2 Apr 2016 01:59:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604020159.u321xr2V087305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 2 Apr 2016 01:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297501 - head/usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 01:59:54 -0000 Author: jhb Date: Sat Apr 2 01:59:53 2016 New Revision: 297501 URL: https://svnweb.freebsd.org/changeset/base/297501 Log: Output information about PCI-e devices with slots. In particular this includes additional information on HotPlug capable slots. Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Sat Apr 2 01:55:43 2016 (r297500) +++ head/usr.sbin/pciconf/cap.c Sat Apr 2 01:59:53 2016 (r297501) @@ -410,6 +410,28 @@ aspm_string(uint8_t aspm) } } +static int +slot_power(uint32_t cap) +{ + int mwatts; + + mwatts = (cap & PCIEM_SLOT_CAP_SPLV) >> 7; + switch (cap & PCIEM_SLOT_CAP_SPLS) { + case 0x0: + mwatts *= 1000; + break; + case 0x1: + mwatts *= 100; + break; + case 0x2: + mwatts *= 10; + break; + default: + break; + } + return (mwatts); +} + static void cap_express(int fd, struct pci_conf *p, uint8_t ptr) { @@ -452,8 +474,6 @@ cap_express(int fd, struct pci_conf *p, printf("type %d", (flags & PCIEM_FLAGS_TYPE) >> 4); break; } - if (flags & PCIEM_FLAGS_SLOT) - printf(" slot"); if (flags & PCIEM_FLAGS_IRQ) printf(" MSI %d", (flags & PCIEM_FLAGS_IRQ) >> 9); cap = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP, 4); @@ -493,6 +513,26 @@ cap_express(int fd, struct pci_conf *p, printf(" ASPM %s(%s)", aspm_string(ctl & PCIEM_LINK_CTL_ASPMC), aspm_string((cap & PCIEM_LINK_CAP_ASPM) >> 10)); } + if (!(flags & PCIEM_FLAGS_SLOT)) + return; + cap = read_config(fd, &p->pc_sel, ptr + PCIER_SLOT_CAP, 4); + sta = read_config(fd, &p->pc_sel, ptr + PCIER_SLOT_STA, 2); + ctl = read_config(fd, &p->pc_sel, ptr + PCIER_SLOT_CTL, 2); + printf("\n "); + printf(" slot %d", (cap & PCIEM_SLOT_CAP_PSN) >> 19); + printf(" power limit %d mW", slot_power(cap)); + if (cap & PCIEM_SLOT_CAP_HPC) + printf(" HotPlug(%s)", sta & PCIEM_SLOT_STA_PDS ? "present" : + "empty"); + if (cap & PCIEM_SLOT_CAP_HPS) + printf(" surprise"); + if (cap & PCIEM_SLOT_CAP_APB) + printf(" Attn Button"); + if (cap & PCIEM_SLOT_CAP_PCP) + printf(" PC(%s)", ctl & PCIEM_SLOT_CTL_PCC ? "on" : "off"); + if (cap & PCIEM_SLOT_CAP_MRLSP) + printf(" MRL(%s)", sta & PCIEM_SLOT_STA_MRLSS ? "open" : + "closed"); } static void From owner-svn-src-head@freebsd.org Sat Apr 2 08:28:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D69EEB00EA2; Sat, 2 Apr 2016 08:28:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id 99866110B; Sat, 2 Apr 2016 08:28:47 +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 u328SkoK006130; Sat, 2 Apr 2016 08:28:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u328SkDG006129; Sat, 2 Apr 2016 08:28:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604020828.u328SkDG006129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 2 Apr 2016 08:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297507 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 08:28:47 -0000 Author: mav Date: Sat Apr 2 08:28:46 2016 New Revision: 297507 URL: https://svnweb.freebsd.org/changeset/base/297507 Log: MFV r297504: 6681 zfs list burning lots of time in dodefault() via dsl_prop_* Reviewed by: Patrick Mooney Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Approved by: Matthew Ahrens Author: Alex Wilson illumos/illumos-gate@d09e4475f635b6f66ee68d8c17a32bba7be17c96 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Sat Apr 2 08:25:41 2016 (r297506) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Sat Apr 2 08:28:46 2016 (r297507) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright 2015, Joyent, Inc. */ #include @@ -41,16 +42,14 @@ #define ZPROP_RECVD_SUFFIX "$recvd" static int -dodefault(const char *propname, int intsz, int numints, void *buf) +dodefault(zfs_prop_t prop, int intsz, int numints, void *buf) { - zfs_prop_t prop; - /* * The setonce properties are read-only, BUT they still * have a default value that can be used as the initial * value. */ - if ((prop = zfs_name_to_prop(propname)) == ZPROP_INVAL || + if (prop == ZPROP_INVAL || (zfs_prop_readonly(prop) && !zfs_prop_setonce(prop))) return (SET_ERROR(ENOENT)); @@ -148,7 +147,7 @@ dsl_prop_get_dd(dsl_dir_t *dd, const cha } if (err == ENOENT) - err = dodefault(propname, intsz, numints, buf); + err = dodefault(prop, intsz, numints, buf); strfree(inheritstr); strfree(recvdstr); @@ -622,7 +621,7 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds int err; uint64_t version = spa_version(ds->ds_dir->dd_pool->dp_spa); - isint = (dodefault(propname, 8, 1, &intval) == 0); + isint = (dodefault(zfs_name_to_prop(propname), 8, 1, &intval) == 0); if (ds->ds_is_snapshot) { ASSERT(version >= SPA_VERSION_SNAP_PROPS); @@ -1180,7 +1179,7 @@ dsl_prop_nvlist_add_uint64(nvlist_t *nv, VERIFY(nvlist_alloc(&propval, NV_UNIQUE_NAME, KM_SLEEP) == 0); VERIFY(nvlist_add_uint64(propval, ZPROP_VALUE, value) == 0); /* Indicate the default source if we can. */ - if (dodefault(propname, 8, 1, &default_value) == 0 && + if (dodefault(prop, 8, 1, &default_value) == 0 && value == default_value) { VERIFY(nvlist_add_string(propval, ZPROP_SOURCE, "") == 0); } From owner-svn-src-head@freebsd.org Sat Apr 2 08:34:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC6C2AEB249; Sat, 2 Apr 2016 08:34:16 +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 mx1.freebsd.org (Postfix) with ESMTPS id A460F170B; Sat, 2 Apr 2016 08:34:16 +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 u328YFng009189; Sat, 2 Apr 2016 08:34:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u328YFnS009187; Sat, 2 Apr 2016 08:34:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604020834.u328YFnS009187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 2 Apr 2016 08:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297508 - in head/cddl/contrib/opensolaris/lib/libzpool/common: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 08:34:17 -0000 Author: mav Date: Sat Apr 2 08:34:15 2016 New Revision: 297508 URL: https://svnweb.freebsd.org/changeset/base/297508 Log: MFV r297505: 6739 userland version of cv_timedwait_hires() always assumes absolute time Reviewed by: Paul Dagnelie Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Reviewed by: Robert Mustacchi Approved by: Robert Mustacchi Author: George Wilson illumos/illumos-gate@41c6413cb54bf338d7a59ed789ec2e0e44c35e6f Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Sat Apr 2 08:28:46 2016 (r297507) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Sat Apr 2 08:34:15 2016 (r297508) @@ -366,10 +366,13 @@ cv_timedwait_hires(kcondvar_t *cv, kmute timestruc_t ts; hrtime_t delta; - ASSERT(flag == 0); + ASSERT(flag == 0 || flag == CALLOUT_FLAG_ABSOLUTE); top: - delta = tim - gethrtime(); + delta = tim; + if (flag & CALLOUT_FLAG_ABSOLUTE) + delta -= gethrtime(); + if (delta <= 0) return (-1); Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Sat Apr 2 08:28:46 2016 (r297507) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Sat Apr 2 08:34:15 2016 (r297508) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ /* @@ -324,6 +324,7 @@ extern gid_t *crgetgroups(cred_t *cr); typedef cond_t kcondvar_t; #define CV_DEFAULT USYNC_THREAD +#define CALLOUT_FLAG_ABSOLUTE 0x2 extern void cv_init(kcondvar_t *cv, char *name, int type, void *arg); extern void cv_destroy(kcondvar_t *cv); From owner-svn-src-head@freebsd.org Sat Apr 2 08:36:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26F90AEB2DB; Sat, 2 Apr 2016 08:36:26 +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 mx1.freebsd.org (Postfix) with ESMTPS id D505318EB; Sat, 2 Apr 2016 08:36:25 +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 u328aPJZ009356; Sat, 2 Apr 2016 08:36:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u328aPZY009355; Sat, 2 Apr 2016 08:36:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604020836.u328aPZY009355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 2 Apr 2016 08:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297509 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 08:36:26 -0000 Author: mav Date: Sat Apr 2 08:36:24 2016 New Revision: 297509 URL: https://svnweb.freebsd.org/changeset/base/297509 Log: MFV r297506: 6738 zfs send stream padding needs documentation Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Reviewed by: Paul Dagnelie Reviewed by: Dan McDonald Approved by: Robert Mustacchi Author: Eli Rosenthal illumos/illumos-gate@c20404ff77119516354b0d112d28b7ea0dadd303 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Apr 2 08:34:15 2016 (r297508) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Apr 2 08:36:24 2016 (r297509) @@ -107,6 +107,19 @@ dump_bytes(dmu_sendarg_t *dsp, void *buf dsl_dataset_t *ds = dmu_objset_ds(dsp->dsa_os); struct uio auio; struct iovec aiov; + + /* + * The code does not rely on this (len being a multiple of 8). We keep + * this assertion because of the corresponding assertion in + * receive_read(). Keeping this assertion ensures that we do not + * inadvertently break backwards compatibility (causing the assertion + * in receive_read() to trigger on old software). + * + * Removing the assertions could be rolled into a new feature that uses + * data that isn't 8-byte aligned; if the assertions were removed, a + * feature flag would have to be added. + */ + ASSERT0(len % 8); aiov.iov_base = buf; @@ -1824,7 +1837,10 @@ receive_read(struct receive_arg *ra, int { int done = 0; - /* some things will require 8-byte alignment, so everything must */ + /* + * The code doesn't rely on this (lengths being multiples of 8). See + * comment in dump_bytes. + */ ASSERT0(len % 8); while (done < len) { From owner-svn-src-head@freebsd.org Sat Apr 2 09:11:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 614F8B0049C; Sat, 2 Apr 2016 09:11:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B5C21A20; Sat, 2 Apr 2016 09:11:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u329Bqvh021015; Sat, 2 Apr 2016 09:11:52 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u329BqYB021014; Sat, 2 Apr 2016 09:11:52 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604020911.u329BqYB021014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 2 Apr 2016 09:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297510 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 09:11:53 -0000 Author: trasz Date: Sat Apr 2 09:11:52 2016 New Revision: 297510 URL: https://svnweb.freebsd.org/changeset/base/297510 Log: Add configurable rate limit for "log" and "devctl" actions. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_rctl.c Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Sat Apr 2 08:36:24 2016 (r297509) +++ head/sys/kern/kern_rctl.c Sat Apr 2 09:11:52 2016 (r297510) @@ -78,10 +78,16 @@ FEATURE(rctl, "Resource Limits"); #define RCTL_PCPU_SHIFT (10 * 1000000) unsigned int rctl_maxbufsize = RCTL_MAX_OUTBUFSIZE; +static int rctl_log_rate_limit = 10; +static int rctl_devctl_rate_limit = 10; SYSCTL_NODE(_kern_racct, OID_AUTO, rctl, CTLFLAG_RW, 0, "Resource Limits"); SYSCTL_UINT(_kern_racct_rctl, OID_AUTO, maxbufsize, CTLFLAG_RWTUN, &rctl_maxbufsize, 0, "Maximum output buffer size"); +SYSCTL_UINT(_kern_racct_rctl, OID_AUTO, log_rate_limit, CTLFLAG_RW, + &rctl_log_rate_limit, 0, "Maximum number of log messages per second"); +SYSCTL_UINT(_kern_racct_rctl, OID_AUTO, devctl_rate_limit, CTLFLAG_RW, + &rctl_devctl_rate_limit, 0, "Maximum number of devctl messages per second"); /* * 'rctl_rule_link' connects a rule with every racct it's related to. @@ -336,13 +342,13 @@ rctl_pcpu_available(const struct proc *p int rctl_enforce(struct proc *p, int resource, uint64_t amount) { + static struct timeval log_lasttime, devctl_lasttime; + static int log_curtime = 0, devctl_curtime = 0; struct rctl_rule *rule; struct rctl_rule_link *link; struct sbuf sb; int should_deny = 0; char *buf; - static int curtime = 0; - static struct timeval lasttime; ASSERT_RACCT_ENABLED(); @@ -383,7 +389,8 @@ rctl_enforce(struct proc *p, int resourc if (p->p_state != PRS_NORMAL) continue; - if (!ppsratecheck(&lasttime, &curtime, 10)) + if (!ppsratecheck(&log_lasttime, &log_curtime, + rctl_log_rate_limit)) continue; buf = malloc(RCTL_LOG_BUFSIZE, M_RCTL, M_NOWAIT); @@ -409,6 +416,10 @@ rctl_enforce(struct proc *p, int resourc if (p->p_state != PRS_NORMAL) continue; + if (!ppsratecheck(&devctl_lasttime, &devctl_curtime, + rctl_devctl_rate_limit)) + continue; + buf = malloc(RCTL_LOG_BUFSIZE, M_RCTL, M_NOWAIT); if (buf == NULL) { printf("rctl_enforce: out of memory\n"); From owner-svn-src-head@freebsd.org Sat Apr 2 09:49:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A4CB00F5E for ; Sat, 2 Apr 2016 09:49:55 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A70319B9 for ; Sat, 2 Apr 2016 09:49:55 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-lf0-x22c.google.com with SMTP id p188so76680852lfd.0 for ; Sat, 02 Apr 2016 02:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=VBjv9zQwXKgIZnXCaSKRoqssRGdbCyArYHPm56EYnDk=; b=kmwedgXwS2LoiJF5khIpzhOtMXq+A40qzek4sxsPv0txmppgBeYpKO1UyUiV6yxN4+ ddffQzUBE/LARPwe5FJGRAMOj/iKwCB91aEMl4zT0o/3qFyYg1UaQ+6KzpZETnOhT6l5 Bh2XYQw7BVEIZk8tpJ5gQ1smayS7Z3VtGzdYTbbO/PsWR59iNSS43oPR5RsHgJxK66sh MuEhradd0iQfDCKpsXleTmrzBIkAKX9osxqtI9PW3XzNYgtxVw/r8mXF9HuU/GM8xmvW aUzd67Oqfs6WMG9efK6j/YqCwBM9dIAHqUwiPa4DraDveHJvp4dqJV5V5+Vv4afnRhHJ zSrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=VBjv9zQwXKgIZnXCaSKRoqssRGdbCyArYHPm56EYnDk=; b=JgbuLHmGEQOwXlKkzKiilEAwEfyDwXCPyf5oypQ9Rt4xp1MRRoFsg8Gs0Cnrl1AcL6 1XAbIBKyypw+PrhPW6N+ajQyXbyeNnqLTcB7L0lJmvKoZcE4LKL/zdrOn+q7E5SfLGfU YXPXpr4uDz1crUvAzmIaI9CPoqezTJe3h+OVvY0jSIngcj+utc2+96tvtttFI6L+T6jj +S65NF1Rp2OGqpZtEcMivS2CvyzOr5FqlPCgf1YEATdj83me+njBhHQ+7m9s1kTtPnjn PAJnWO+DEMj9oFc3u1RIqfDDTs6j160Yt9+caXBJzbQgAMwEGNPO3G7Pj31DXIPg0Q5n XU6w== X-Gm-Message-State: AD7BkJLUEJKAl+cM7zma1MUB17jRTdmhlSTTT1FdC1Fa2Jb9bW4r4hcPJWMb7RD5S4LNp/trstt3JeJSLpQLMf5E MIME-Version: 1.0 X-Received: by 10.194.184.38 with SMTP id er6mr1427982wjc.93.1459590593200; Sat, 02 Apr 2016 02:49:53 -0700 (PDT) Received: by 10.194.243.98 with HTTP; Sat, 2 Apr 2016 02:49:53 -0700 (PDT) In-Reply-To: <201604020159.u321xr2V087305@repo.freebsd.org> References: <201604020159.u321xr2V087305@repo.freebsd.org> Date: Sat, 2 Apr 2016 11:49:53 +0200 Message-ID: Subject: Re: svn commit: r297501 - head/usr.sbin/pciconf From: Oliver Pinter To: John Baldwin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 09:49:55 -0000 Hi! On Saturday, April 2, 2016, John Baldwin wrote: > Author: jhb > Date: Sat Apr 2 01:59:53 2016 > New Revision: 297501 > URL: https://svnweb.freebsd.org/changeset/base/297501 > > Log: > Output information about PCI-e devices with slots. > > In particular this includes additional information on HotPlug capable > slots. > > Modified: > head/usr.sbin/pciconf/cap.c > > Modified: head/usr.sbin/pciconf/cap.c > > ============================================================================== > --- head/usr.sbin/pciconf/cap.c Sat Apr 2 01:55:43 2016 (r297500) > +++ head/usr.sbin/pciconf/cap.c Sat Apr 2 01:59:53 2016 (r297501) > @@ -410,6 +410,28 @@ aspm_string(uint8_t aspm) > } > } > > +static int > +slot_power(uint32_t cap) > +{ > + int mwatts; > + > + mwatts = (cap & PCIEM_SLOT_CAP_SPLV) >> 7; > + switch (cap & PCIEM_SLOT_CAP_SPLS) { > + case 0x0: > + mwatts *= 1000; > + break; > + case 0x1: > + mwatts *= 100; > + break; > + case 0x2: > + mwatts *= 10; > + break; > + default: > + break; > + } > + return (mwatts); > +} > + > static void > cap_express(int fd, struct pci_conf *p, uint8_t ptr) > { > @@ -452,8 +474,6 @@ cap_express(int fd, struct pci_conf *p, > printf("type %d", (flags & PCIEM_FLAGS_TYPE) >> 4); > break; > } > - if (flags & PCIEM_FLAGS_SLOT) > - printf(" slot"); > if (flags & PCIEM_FLAGS_IRQ) > printf(" MSI %d", (flags & PCIEM_FLAGS_IRQ) >> 9); > cap = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP, 4); > @@ -493,6 +513,26 @@ cap_express(int fd, struct pci_conf *p, > printf(" ASPM %s(%s)", aspm_string(ctl & > PCIEM_LINK_CTL_ASPMC), > aspm_string((cap & PCIEM_LINK_CAP_ASPM) >> 10)); > } > + if (!(flags & PCIEM_FLAGS_SLOT)) > + return; > + cap = read_config(fd, &p->pc_sel, ptr + PCIER_SLOT_CAP, 4); > + sta = read_config(fd, &p->pc_sel, ptr + PCIER_SLOT_STA, 2); > + ctl = read_config(fd, &p->pc_sel, ptr + PCIER_SLOT_CTL, 2); > + printf("\n "); > + printf(" slot %d", (cap & PCIEM_SLOT_CAP_PSN) >> 19); > + printf(" power limit %d mW", slot_power(cap)); > + if (cap & PCIEM_SLOT_CAP_HPC) > + printf(" HotPlug(%s)", sta & PCIEM_SLOT_STA_PDS ? > "present" : > + "empty"); > + if (cap & PCIEM_SLOT_CAP_HPS) > + printf(" surprise"); What is this surprise string or state? Or is this a forgotten debug string? > + if (cap & PCIEM_SLOT_CAP_APB) > + printf(" Attn Button"); > + if (cap & PCIEM_SLOT_CAP_PCP) > + printf(" PC(%s)", ctl & PCIEM_SLOT_CTL_PCC ? "on" : "off"); > + if (cap & PCIEM_SLOT_CAP_MRLSP) > + printf(" MRL(%s)", sta & PCIEM_SLOT_STA_MRLSS ? "open" : > + "closed"); > } > > static void > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org > " > From owner-svn-src-head@freebsd.org Sat Apr 2 15:40:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB09EB00805; Sat, 2 Apr 2016 15:40:02 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9660D125D; Sat, 2 Apr 2016 15:40:02 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-253-185.lns20.per4.internode.on.net [121.45.253.185]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u32FdpYu035180 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 2 Apr 2016 08:39:54 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r297326 - head/sys/nfs To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603272316.u2RNGbwi018381@repo.freebsd.org> From: Julian Elischer Message-ID: <56FFE7C1.2030904@freebsd.org> Date: Sat, 2 Apr 2016 23:39:45 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <201603272316.u2RNGbwi018381@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 15:40:02 -0000 On 28/03/2016 7:16 AM, Ian Lepore wrote: > The theory here is that since we can only have one default route, the one > most likely to be correct for mounting the rootfs is the one that was > delivered along with the rootpath option. We can have multiple default routes with weights, and we can have different default routes in different fibs. since interfaces can have fibs assigned to them you need to install the new default if it is useable in the fib of the interface. This is complicated and most companies that use these features have special code to do it.. > From owner-svn-src-head@freebsd.org Sat Apr 2 15:58:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C804AEB393 for ; Sat, 2 Apr 2016 15:58:07 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8B481EDA for ; Sat, 2 Apr 2016 15:58:06 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: bb32f4ae-f8eb-11e5-9036-c33267960ba8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sat, 2 Apr 2016 15:58:24 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u32FvtZT014736; Sat, 2 Apr 2016 09:57:55 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1459612675.1091.232.camel@freebsd.org> Subject: Re: svn commit: r297326 - head/sys/nfs From: Ian Lepore To: Julian Elischer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 02 Apr 2016 09:57:55 -0600 In-Reply-To: <56FFE7C1.2030904@freebsd.org> References: <201603272316.u2RNGbwi018381@repo.freebsd.org> <56FFE7C1.2030904@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 15:58:07 -0000 On Sat, 2016-04-02 at 23:39 +0800, Julian Elischer wrote: > On 28/03/2016 7:16 AM, Ian Lepore wrote: > > The theory here is that since we can only have one default > > route, the one > > most likely to be correct for mounting the rootfs is the one > > that was > > delivered along with the rootpath option. > > We can have multiple default routes with weights, and we can have > different default routes in different fibs. > since interfaces can have fibs assigned to them you need to install > the new default if it is useable in the fib of the interface. > This is complicated and most companies that use these features have > special code to do it.. Does any of that apply during bootpc_init(), before rootfs is even mounted? The dhcp server just delivers a router address, and on a multihomed machine you can end up with different addresses coming from different servers (which may be insane as an actual working config, I dunno). In testing what I found was that only the first address delivered ever actually got installed and all subsequent ones resulted in an (ignored) EEXIST error. If what you say applies to the bootp milieu, I'm going to need help making it right. I picked up that PR when I stumbled across it because I'm somewhat familiar with the bootp routines from earlier bugfixes, but the PR really addressed two issues, and on the default route vs. proxy-arp parts of it I'm out of my depth. I suspect in the real world there probably aren't too many configurations that require a gateway to access the nfs server providing a machine's rootfs. It seems fair to assume that if a gateway is required to reach that machine, then the dhcp server that told you about that nfs server will also be the one to give you a useful gateway address for reaching it. I would expect more complex routing stuff to be handled by the rc scripts. -- Ian From owner-svn-src-head@freebsd.org Sat Apr 2 16:25:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C725DAEBCD2; Sat, 2 Apr 2016 16:25:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1A921DBC; Sat, 2 Apr 2016 16:25:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u32GPkBr051870; Sat, 2 Apr 2016 16:25:46 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u32GPkLP051865; Sat, 2 Apr 2016 16:25:46 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604021625.u32GPkLP051865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 2 Apr 2016 16:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297513 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 16:25:47 -0000 Author: avg Date: Sat Apr 2 16:25:46 2016 New Revision: 297513 URL: https://svnweb.freebsd.org/changeset/base/297513 Log: remove emulation of VFS_HOLD and VFS_RELE from opensolaris compat On FreeBSD VFS_HOLD/VN_RELE were mapped to MNT_REF/MNT_REL that manipulate mnt_ref. But the job of properly maintaining the reference count is already automatically performed by insmntque(9) and delmntque(9). So, in effect all ZFS vnodes referenced the corresponding mountpoint twice. That was completely harmless, but we want to be very explicit about what FreeBSD VFS APIs are used, because illumos VFS_HOLD and FreeBSD MNT_REF provide quite different guarantees with respect to the held vfs_t / mountpoint. On illumos VFS_HOLD is sufficient to guarantee that vfs_t.vfs_data stays valid. On the other hand, on FreeBSD MNT_REF does *not* provide the same guarantee about mnt_data. We have to use vfs_busy() to get that guarantee. Thus, the calls to VFS_HOLD/VFS_RELE on vnode init and fini are removed. VFS_HOLD calls are replaced with vfs_busy in the ioctl handlers. And because vfs_busy has a richer interface that can not be dumbed down in all cases it's better to explicitly use it rather than trying to mask it behind VFS_HOLD. This change fixes a panic that could result from a race between zfs_umount() and zfs_ioc_rollback(). We observed a case where zfsvfs_free() tried to destroy data that zfsvfs_teardown() was still using. That happened because there was nothing to prevent unmounting of a ZFS filesystem that was in between zfs_suspend_fs() and zfs_resume_fs(). Reviewed by: kib, smh MFC after: 3 weeks Sponsored by: ClusterHQ Differential Revision: https://reviews.freebsd.org/D2794 Modified: head/sys/cddl/compat/opensolaris/sys/vfs.h head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/compat/opensolaris/sys/vfs.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/vfs.h Sat Apr 2 13:51:06 2016 (r297512) +++ head/sys/cddl/compat/opensolaris/sys/vfs.h Sat Apr 2 16:25:46 2016 (r297513) @@ -54,17 +54,6 @@ typedef struct mount vfs_t; #define VFS_NOSETUID MNT_NOSUID #define VFS_NOEXEC MNT_NOEXEC -#define VFS_HOLD(vfsp) do { \ - MNT_ILOCK(vfsp); \ - MNT_REF(vfsp); \ - MNT_IUNLOCK(vfsp); \ -} while (0) -#define VFS_RELE(vfsp) do { \ - MNT_ILOCK(vfsp); \ - MNT_REL(vfsp); \ - MNT_IUNLOCK(vfsp); \ -} while (0) - #define fs_vscan(vp, cr, async) (0) #define VROOT VV_ROOT Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Sat Apr 2 13:51:06 2016 (r297512) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Sat Apr 2 16:25:46 2016 (r297513) @@ -589,7 +589,9 @@ gfs_root_create(size_t size, vfs_t *vfsp { vnode_t *vp; +#ifdef illumos VFS_HOLD(vfsp); +#endif vp = gfs_dir_create(size, NULL, vfsp, ops, entries, inode_cb, maxlen, readdir_cb, lookup_cb); /* Manually set the inode */ @@ -700,7 +702,9 @@ found: vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); } else { ASSERT(vp->v_vfsp != NULL); +#ifdef illumos VFS_RELE(vp->v_vfsp); +#endif } #ifdef TODO if (vp->v_flag & V_XATTRDIR) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Apr 2 13:51:06 2016 (r297512) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Apr 2 16:25:46 2016 (r297513) @@ -1443,7 +1443,14 @@ getzfsvfs(const char *dsname, zfsvfs_t * mutex_enter(&os->os_user_ptr_lock); *zfvp = dmu_objset_get_user(os); if (*zfvp) { +#ifdef illumos VFS_HOLD((*zfvp)->z_vfs); +#else + if (vfs_busy((*zfvp)->z_vfs, 0) != 0) { + *zfvp = NULL; + error = SET_ERROR(ESRCH); + } +#endif } else { error = SET_ERROR(ESRCH); } @@ -1487,7 +1494,11 @@ zfsvfs_rele(zfsvfs_t *zfsvfs, void *tag) rrm_exit(&zfsvfs->z_teardown_lock, tag); if (zfsvfs->z_vfs) { +#ifdef illumos VFS_RELE(zfsvfs->z_vfs); +#else + vfs_unbusy(zfsvfs->z_vfs); +#endif } else { dmu_objset_disown(zfsvfs->z_os, zfsvfs); zfsvfs_free(zfsvfs); @@ -3018,11 +3029,13 @@ zfs_get_vfs(const char *resource) mtx_lock(&mountlist_mtx); TAILQ_FOREACH(vfsp, &mountlist, mnt_list) { if (strcmp(refstr_value(vfsp->vfs_resource), resource) == 0) { - VFS_HOLD(vfsp); + if (vfs_busy(vfsp, MBF_MNTLSTLOCK) != 0) + vfsp = NULL; break; } } - mtx_unlock(&mountlist_mtx); + if (vfsp == NULL) + mtx_unlock(&mountlist_mtx); return (vfsp); } @@ -3475,7 +3488,11 @@ zfs_unmount_snap(const char *snapname) ASSERT(!dsl_pool_config_held(dmu_objset_pool(zfsvfs->z_os))); err = vn_vfswlock(vfsp->vfs_vnodecovered); +#ifdef illumos VFS_RELE(vfsp); +#else + vfs_unbusy(vfsp); +#endif if (err != 0) return (SET_ERROR(err)); @@ -3721,7 +3738,11 @@ zfs_ioc_rollback(const char *fsname, nvl resume_err = zfs_resume_fs(zfsvfs, fsname); error = error ? error : resume_err; } +#ifdef illumos VFS_RELE(zfsvfs->z_vfs); +#else + vfs_unbusy(zfsvfs->z_vfs); +#endif } else { error = dsl_dataset_rollback(fsname, NULL, outnvl); } @@ -4376,7 +4397,11 @@ zfs_ioc_recv(zfs_cmd_t *zc) if (error == 0) error = zfs_resume_fs(zfsvfs, tofs); error = error ? error : end_err; +#ifdef illumos VFS_RELE(zfsvfs->z_vfs); +#else + vfs_unbusy(zfsvfs->z_vfs); +#endif } else { error = dmu_recv_end(&drc, NULL); } @@ -4925,7 +4950,11 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc) } if (error == 0) error = dmu_objset_userspace_upgrade(zfsvfs->z_os); +#ifdef illumos VFS_RELE(zfsvfs->z_vfs); +#else + vfs_unbusy(zfsvfs->z_vfs); +#endif } else { /* XXX kind of reading contents without owning */ error = dmu_objset_hold(zc->zc_name, FTAG, &os); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Apr 2 13:51:06 2016 (r297512) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Apr 2 16:25:46 2016 (r297513) @@ -743,7 +743,9 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu if (vp->v_type != VFIFO) VN_LOCK_ASHARE(vp); +#ifdef illumos VFS_HOLD(zfsvfs->z_vfs); +#endif return (zp); } @@ -1428,7 +1430,9 @@ zfs_znode_free(znode_t *zp) kmem_cache_free(znode_cache, zp); +#ifdef illumos VFS_RELE(zfsvfs->z_vfs); +#endif } void From owner-svn-src-head@freebsd.org Sat Apr 2 16:53:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1FCFB00777; Sat, 2 Apr 2016 16:53:13 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A465210E8; Sat, 2 Apr 2016 16:53:13 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u32GrCk8061268; Sat, 2 Apr 2016 16:53:12 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u32GrChr061267; Sat, 2 Apr 2016 16:53:12 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201604021653.u32GrChr061267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 2 Apr 2016 16:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297514 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 16:53:14 -0000 Author: jmcneill Date: Sat Apr 2 16:53:12 2016 New Revision: 297514 URL: https://svnweb.freebsd.org/changeset/base/297514 Log: Improve HDMI display detection by searching the CEA-861 extension block for an HDMI vendor-specific data block (VSDB) containing the HDMI 24-bit IEEE registration ID (0x000C03). Approved by: gonzo (mentor) Modified: head/sys/arm/allwinner/a10_hdmi.c Modified: head/sys/arm/allwinner/a10_hdmi.c ============================================================================== --- head/sys/arm/allwinner/a10_hdmi.c Sat Apr 2 16:25:46 2016 (r297513) +++ head/sys/arm/allwinner/a10_hdmi.c Sat Apr 2 16:53:12 2016 (r297514) @@ -195,6 +195,15 @@ __FBSDID("$FreeBSD$"); #define CEA_TAG_ID 0x02 #define CEA_DTD 0x03 #define DTD_BASIC_AUDIO (1 << 6) +#define CEA_REV 0x02 +#define CEA_DATA_OFF 0x03 +#define CEA_DATA_START 4 +#define BLOCK_TAG(x) (((x) >> 5) & 0x7) +#define BLOCK_TAG_VSDB 3 +#define BLOCK_LEN(x) ((x) & 0x1f) +#define HDMI_VSDB_MINLEN 5 +#define HDMI_OUI "\x03\x0c\x00" +#define HDMI_OUI_LEN 3 struct a10hdmi_softc { struct resource *res; @@ -372,6 +381,41 @@ a10hdmi_ddc_read(struct a10hdmi_softc *s return (0); } +static int +a10hdmi_detect_hdmi_vsdb(uint8_t *edid) +{ + int off, p, btag, blen; + + if (edid[EXT_TAG] != CEA_TAG_ID) + return (0); + + off = edid[CEA_DATA_OFF]; + + /* CEA data block collection starts at byte 4 */ + if (off <= CEA_DATA_START) + return (0); + + /* Parse the CEA data blocks */ + for (p = CEA_DATA_START; p < off;) { + btag = BLOCK_TAG(edid[p]); + blen = BLOCK_LEN(edid[p]); + + /* Make sure the length is sane */ + if (p + blen + 1 > off) + break; + + /* Look for a VSDB with the HDMI 24-bit IEEE registration ID */ + if (btag == BLOCK_TAG_VSDB && blen >= HDMI_VSDB_MINLEN && + memcmp(&edid[p + 1], HDMI_OUI, HDMI_OUI_LEN) == 0) + return (1); + + /* Next data block */ + p += (1 + blen); + } + + return (0); +} + static void a10hdmi_detect_hdmi(struct a10hdmi_softc *sc, int *phdmi, int *paudio) { @@ -389,7 +433,7 @@ a10hdmi_detect_hdmi(struct a10hdmi_softc if (a10hdmi_ddc_read(sc, block, edid) != 0) return; - if (edid[EXT_TAG] == CEA_TAG_ID) { + if (a10hdmi_detect_hdmi_vsdb(edid) != 0) { *phdmi = 1; *paudio = ((edid[CEA_DTD] & DTD_BASIC_AUDIO) != 0); return; @@ -518,6 +562,9 @@ a10hdmi_set_videomode(device_t dev, cons PLLCTRL0_VCO_S); /* Setup display settings */ + if (bootverbose) + device_printf(dev, "HDMI: %s, Audio: %s\n", + sc->has_hdmi ? "yes" : "no", sc->has_audio ? "yes" : "no"); val = 0; if (sc->has_hdmi) val |= VID_CTRL_HDMI_MODE; From owner-svn-src-head@freebsd.org Sat Apr 2 19:30:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F1B9AECF86; Sat, 2 Apr 2016 19:30:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DC9DA1F40; Sat, 2 Apr 2016 19:30:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id BFD8725D3857; Sat, 2 Apr 2016 19:30:34 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id CF1F6C7B6E6; Sat, 2 Apr 2016 19:30:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id eEhNwnp6wECy; Sat, 2 Apr 2016 19:30:32 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 57B90C7A885; Sat, 2 Apr 2016 19:30:32 +0000 (UTC) Date: Sat, 2 Apr 2016 19:30:31 +0000 (UTC) From: "Bjoern A. Zeeb" To: Gleb Smirnoff cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296881 - in head: contrib/bsnmp/snmp_mibII sys/netinet In-Reply-To: <201603150015.u2F0FATD089432@repo.freebsd.org> Message-ID: References: <201603150015.u2F0FATD089432@repo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 19:30:46 -0000 On Tue, 15 Mar 2016, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Mar 15 00:15:10 2016 > New Revision: 296881 > URL: https://svnweb.freebsd.org/changeset/base/296881 > > Log: > Redo r294869. The array of counters for TCP states doesn't belong to > struct tcpstat, because the structure can be zeroed out by netstat(1) -z, > and of course running connection counts shouldn't be touched. > > Place running connection counts into separate array, and provide > separate read-only sysctl oid for it. This has VNET(xxx) macros in the middle of the code. We do that nowhere else. Could you please #define V_xxx VNET(xxx) and get rid of them? > + > +static void > +tcp_vnet_init(const void *unused) Also that function name is very badly chosen. > + COUNTER_ARRAY_ALLOC(VNET(tcps_states), TCP_NSTATES, M_WAITOK); ^^^^^^^^^^^ > + COUNTER_ARRAY_FREE(VNET(tcps_states), TCP_NSTATES); > + counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]); > + m = counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]); > /* > + * Running TCP connection count by state. > + */ > +VNET_DECLARE(counter_u64_t, tcps_states[TCP_NSTATES]); > +#define TCPSTATES_INC(state) counter_u64_add(VNET(tcps_states)[state], 1) > +#define TCPSTATES_DEC(state) counter_u64_add(VNET(tcps_states)[state], -1) ^^^^^^^^^^^