From owner-svn-src-head@freebsd.org Sun Jul 19 00:36:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 090239A5FC9; Sun, 19 Jul 2015 00:36:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pd0-x22a.google.com (mail-pd0-x22a.google.com [IPv6:2607:f8b0:400e:c02::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 CF5F21E86; Sun, 19 Jul 2015 00:36:29 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by pdbnt7 with SMTP id nt7so10784732pdb.0; Sat, 18 Jul 2015 17:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=sQGEfQhYf9py93cVKmj51HvE82SKmCV0lu+3zDXTd+g=; b=D2St8/q2YiMJSUoqlG40hx5WJuiZHNaqhP+6bf8u7Ai6WND5OcCbpdhwClD3jXBn/T LAXk60NXkgTUxUSSuOlQYncApdN+SwAnNbtngUoIg1HNx9W8iQxs7VDO0tiGaGuXhRSt BHTBiZaM1vX1Jrz0cPk7oE6x6PeAOcGf3YSDusj1pl8aGdca4w03QgwCLrKrxZM/9Oj+ wvJ9BwQguQMsHqCXqKQmHXZuvpBTQzxtrKFRt+0rDShztIqzhv4VEXvHPJTjZoZGxgEd If77DFYugzJUtcvGwBlOrR6YVrioGq5E5DoaQ/nKrK/Dq63BCq5OvaiPrN1s9Muqyk3f ogJQ== X-Received: by 10.66.142.73 with SMTP id ru9mr43753535pab.78.1437266189129; Sat, 18 Jul 2015 17:36:29 -0700 (PDT) Received: from raichu ([104.232.114.184]) by smtp.gmail.com with ESMTPSA id vz2sm15393468pbc.71.2015.07.18.17.36.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Jul 2015 17:36:27 -0700 (PDT) Sender: Mark Johnston Date: Sat, 18 Jul 2015 17:36:24 -0700 From: Mark Johnston To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285664 - in head/sys: kern sys Message-ID: <20150719003624.GB2808@raichu> References: <201507180057.t6I0vVhS076519@repo.freebsd.org> <20150718185937.A1301@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150718185937.A1301@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 00:36:30 -0000 On Sat, Jul 18, 2015 at 08:55:07PM +1000, Bruce Evans wrote: > On Sat, 18 Jul 2015, Mark Johnston wrote: > > > Log: > > Pass the lock object to lockstat_nsecs() and return immediately if > > LO_NOPROFILE is set. Some timecounter handlers acquire a spin mutex, and > > we don't want to recurse if lockstat probes are enabled. > > It is an error to call timecounter code from a low-level place like the > mutex implementation. This workaround depends on all locks in timecounter > handlers being LO_NOPROFILE, and that breaks profiling of these locks. > The breakage is largest if the locks are used for more than timecounters. > E.g., the one for i386's obsolescent i8254 timer has to be used for all > accesses to the i8254. This lock is configured as MTX_SPIN | MTX_NOPROFILE > and is perhaps the main one fixed by this commit. I noticed that lock_profile (which predates lockstat a bit) does the exact same thing to avoid recursion. Specifically, lock_profile_obtain_lock_{success,failed} return immediately if LO_NOPROFILE is set on the target lock. As you pointed out, this change breaks profiling of timecounter locks, but the only timecounter implementation in the tree that currently acquires a lock during a timer read is i8254. The other two locks that set MTX_NOPROFILE are the witness lock and the i386 icu lock. Lock order checking can usually be done without taking the witness lock, so contention would be unusual, and it would strike me as strange to profile locking with witness enabled anyway. :) I'm not sure why i386's icu_lock has profiling disabled; this was done in r166001, but the commit log doesn't explain the reason. It might also be worth noting that lockstat can still be used to observe acquisitions of LO_NOPROFILE locks - the change prevents measurement of the time spent contending for such locks. > > KTR handles this problem badly in a different way. It abuses > get_cyclecount(). The abuse is parametrized by defining KTR_TIME as > get_cyclecount() and using KTR_TIME. The definition of KTR_TIME is > ifdefed but not in a usable way. This is of course undocumented, and > KTR_TIME is not a normal kernel option so it is hard to define in > config files. > > KTR needs to be about as careful about this as lockstat since it is > called from low level mutex code for debugging. I think there is nothing > like LO_NOPROFILE to turn it off. Of course you can turn off the mutex > code's calls to it using MTX_QUIET or MTX_NOWITNESS, but this breaks much > more than lock profiling. (I rarely use any lock debugging, but when > I did I found it useful to use it without WITNESS_SKIPSPIN and with > MTX_QUIET and MTX_NOWITNESS turned off for the locks being debugged. > Some console drivers use spinlocks with MTX_QUIET or MTX_NOWITNESS to > avoid various problems, and this breaks witnessing of them even for > non-console uses. Unbreaking their witnessing uncovered further bugs.) > > Abusing get_cyclecount() in KTR doesn't even fix the problem with > timecounters, since some implementations of get_cyclecount() (some > arm, some i386) use the timecounter. > > Other bugs with using get_cyclecount(): > - even if it returns cycles counted by a clock, the frequency of this > clock is unknown/unobtainable, so there is no way to convert to > human-readable units > - some arches return a shifted binuptime() that wraps very quickly > (256 seconds for arm with ARM_ARCH < 6). Such counters cannot be > monotonic. > - some arches (arm again?) used to use binuptime() with swizzling more > complicated than shifting. Their counters were further from being > monotonic. > - arm is now the only arch that uses binuptime() at a low level. > arm64 use a stub that returns 1. ARM_ARCH < 6 does the above. i386 > returns cpu_ticks(). This is the correct method. It uses the > hardware counter use by cpu_ticks() if possible, else the raw value > of the current hardware timecounter, adjusted to avoid wrap. > (This is not actually a correct method, since its implementation is > no good. The wrap adjustment is down with no locking. Also, > switching the timecounter hardware breaks the get_cyclecount() > use even more than the thread resource usage use. The latter > has incomplete recalibration.) > - KTR of course has no support for converting to human-readable units. > ktrdump prints raw timestamps and their differences in %16ju format. > kern_ktr.c seems to print them only in a ddb command. This prints > the raw value in the much worse format %10.10lld. This uses the > long long abomination and has a sign error (ktr_timestamp has type > uint64_t). > - ktr's "timestamps" are thus at best a cookie that increases strictly > monotonically > - get_cyclecount() is always rdtsc() on modern x86. rdtsc() is not > a serializing instruction. I recently learned how unserial it can > be -- hundreds of cycles on freefall. The hundred-cycle case probably > doesn't happen much in KTR's use. It happens in the test program > when the program spins waiting for something and executes rdtsc() > after that, or so it thinks. The CPU actually executes rdtsc() > speculatively hundreds of cycles earlier while spinning. Back to > back rdtsc()s seem to be executed in order on freefall, and the > speculation seems to extend to only the first one. So there is > a good chance that get_cyclecount() called on the same CPU gives > a strictly increasing value. But across CPUs, the hundred-cycle > difference are the usual case if there is no synchronization of > the threads (even when the TSCs on the different CPUs are perfectly > synchronized at the hardware level). > - get_cyclecount() doesn't bother with synchronization if it uses the > TSC (or equivalent). This is a feature. It is supposed to be > efficient even if this requires it to return garbage. But this makes > it unusable for almost everything. Certainly for timestamps. > - get_cyclecount()'s documentation has rotted to match its misuse. It > is now documented as returning a value that is monotonically > increasing inside each CPU. But it never obviously did that on x86 > (rdtsc isn't a serializing instruction, and the implementation doesn't > even have a compiler barrier), and it doesn't do that on arm < 6 > (wrap occurs after 256 seconds). Its documentation does a good job > of describing its non-monotonicity across CPUs. cpu_ticks() also > doesn't require any synchronization across CPUs. This is less clear > since it has null documenation. > > KTR shouldn't try to synchronize threads to get timestamps that are > monotonic across CPUs relative to some shared (non-relativistic) clock, > although this would be useful for debugging synchronization, since > this would be slow (100-200 cycles per sync on freefall) and would > break debugging of synchronization bugs by adding synchronization. > > Timecounters give timestamps that are almost comparable across CPUs, > even when they use the TSC timecounter. They do this by reading a > shared hardware timecounter, perhaps even with a lock that serializes > everything, or by reading something like a shared TSC that is not > fully serialized. For the TSC, low-level code gives serialization > for each CPU. The TSCs ar hopefully synced at the hardware level, > so that when you read them at almost the same physical time on separate > CPUs you get almost the same value. The physical time might be affected > relativistically, but CPUs are not yet quite fast enough for that to > be a large effect. The largest effect is probably from pipeline > delays. > > Bruce From owner-svn-src-head@freebsd.org Sun Jul 19 00:38:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22C1C999046; Sun, 19 Jul 2015 00:38:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 131E01FE7; Sun, 19 Jul 2015 00:38:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6J0cKPU062365; Sun, 19 Jul 2015 00:38:20 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6J0cKi3062363; Sun, 19 Jul 2015 00:38:20 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201507190038.t6J0cKi3062363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 19 Jul 2015 00:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285684 - in head/gnu: lib usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 00:38:21 -0000 Author: marius Date: Sun Jul 19 00:38:19 2015 New Revision: 285684 URL: https://svnweb.freebsd.org/changeset/base/285684 Log: - Record dependencies of gdb/gdbtui/kgdb on binutils/lib{bfd,iberty,opcodes}, fixing parallel builds. - Don't build gdb/gdbtui/kgdb or libreadline when MK_BINUTILS is "no" for obvious reasons. MFC after: 3 days Modified: head/gnu/lib/Makefile head/gnu/usr.bin/Makefile Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Sat Jul 18 22:47:46 2015 (r285683) +++ head/gnu/lib/Makefile Sun Jul 19 00:38:19 2015 (r285684) @@ -16,7 +16,7 @@ SUBDIR+= libssp SUBDIR+= tests .endif -.if ${MK_GDB} != "no" +.if ${MK_BINUTILS} != "no" && ${MK_GDB} != "no" SUBDIR+= libreadline .endif Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Sat Jul 18 22:47:46 2015 (r285683) +++ head/gnu/usr.bin/Makefile Sun Jul 19 00:38:19 2015 (r285684) @@ -16,6 +16,8 @@ SUBDIR= ${_binutils} \ sdiff \ ${_tests} +SUBDIR_DEPEND_gdb= ${_binutils} + .if ${MK_CXX} != "no" .if ${MK_GCC} != "no" _gperf= gperf @@ -39,13 +41,14 @@ _tests= tests .if ${MK_BINUTILS} != "no" _binutils= binutils +.if ${MK_GDB} != "no" +_gdb= gdb +.endif .endif + .if ${MK_GCC} != "no" _cc= cc .endif -.if ${MK_GDB} != "no" -_gdb= gdb -.endif SUBDIR_PARALLEL= From owner-svn-src-head@freebsd.org Sun Jul 19 08:47:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 027489A5CB8; Sun, 19 Jul 2015 08:47:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id BCAA0151A; Sun, 19 Jul 2015 08:47:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id B13023C14AE; Sun, 19 Jul 2015 18:47:15 +1000 (AEST) Date: Sun, 19 Jul 2015 18:47:14 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark Johnston cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285664 - in head/sys: kern sys In-Reply-To: <20150719003624.GB2808@raichu> Message-ID: <20150719173124.E941@besplex.bde.org> References: <201507180057.t6I0vVhS076519@repo.freebsd.org> <20150718185937.A1301@besplex.bde.org> <20150719003624.GB2808@raichu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eZjABOwH c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=KMhDvbfIn3Rwvs1JuGsA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 08:47:25 -0000 On Sat, 18 Jul 2015, Mark Johnston wrote: > On Sat, Jul 18, 2015 at 08:55:07PM +1000, Bruce Evans wrote: >> On Sat, 18 Jul 2015, Mark Johnston wrote: >> >>> Log: >>> Pass the lock object to lockstat_nsecs() and return immediately if >>> LO_NOPROFILE is set. Some timecounter handlers acquire a spin mutex, and >>> we don't want to recurse if lockstat probes are enabled. >> >> It is an error to call timecounter code from a low-level place like the >> mutex implementation. This workaround depends on all locks in timecounter >> handlers being LO_NOPROFILE, and that breaks profiling of these locks. >> ... > > I noticed that lock_profile (which predates lockstat a bit) does the > exact same thing to avoid recursion. Specifically, > lock_profile_obtain_lock_{success,failed} return immediately if > LO_NOPROFILE is set on the target lock. As you pointed out, > this change breaks profiling of timecounter locks, but the only > timecounter implementation in the tree that currently acquires a lock > during a timer read is i8254. lock_profile also has another copy of lockstat_nsecs() (spelled nanoseconds()), with different style bugs. The style bugs start with lockstat_nsecs()'s existence and nanoseconds()'s name being too generic. > The other two locks that set MTX_NOPROFILE are the witness lock and the > i386 icu lock. Lock order checking can usually be done without taking > the witness lock, so contention would be unusual, and it would strike > me as strange to profile locking with witness enabled anyway. :) > I'm not sure why i386's icu_lock has profiling disabled; this was done > in r166001, but the commit log doesn't explain the reason. I didn't know that lock profiling was independent of witness. I can't see any reason why profiling must be disabled for icu_lock, but perhaps it should be disabled for efficiency reasons for all low-level mutexes. Low-level mutexes now use combinations of MTX_QUIET and MTX_NOWITNESS with no apparent pattern. It seems right to log everything and check everything by default (except witness's lock must not witness itself recursively), and never hard-code hiding from witness or anything just for efficiency. Then if a locking error is found in a console driver lock (there are many such errors that are not found now), the error must not be reported on the consoles with the locking error. MTX_QUIET's name suggests that it controls printing of error messages, but its documentation is ambiguous: it controls "logging" and it isn't clear if that is in-memory (for future use by witness or anything) or just printing. Bruce From owner-svn-src-head@freebsd.org Sun Jul 19 08:52:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA2EA9A5E25; Sun, 19 Jul 2015 08:52:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA6331A22; Sun, 19 Jul 2015 08:52:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6J8qbVm064364; Sun, 19 Jul 2015 08:52:37 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6J8qZbP064359; Sun, 19 Jul 2015 08:52:35 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201507190852.t6J8qZbP064359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Sun, 19 Jul 2015 08:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285685 - in head: sys/compat/linprocfs sys/compat/linsysfs sys/kern sys/sys usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 08:52:38 -0000 Author: araujo (ports committer) Date: Sun Jul 19 08:52:35 2015 New Revision: 285685 URL: https://svnweb.freebsd.org/changeset/base/285685 Log: Add support to the jail framework to be able to mount linsysfs(5) and linprocfs(5). Differential Revision: D2846 Submitted by: Nikolai Lifanov Reviewed by: jamie Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linsysfs/linsysfs.c head/sys/kern/kern_jail.c head/sys/sys/jail.h head/usr.sbin/jail/jail.8 Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sun Jul 19 00:38:19 2015 (r285684) +++ head/sys/compat/linprocfs/linprocfs.c Sun Jul 19 08:52:35 2015 (r285685) @@ -1548,7 +1548,7 @@ linprocfs_uninit(PFS_INIT_ARGS) return (0); } -PSEUDOFS(linprocfs, 1, 0); +PSEUDOFS(linprocfs, 1, PR_ALLOW_MOUNT_LINPROCFS); #if defined(__amd64__) MODULE_DEPEND(linprocfs, linux_common, 1, 1, 1); #else Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Sun Jul 19 00:38:19 2015 (r285684) +++ head/sys/compat/linsysfs/linsysfs.c Sun Jul 19 08:52:35 2015 (r285685) @@ -275,7 +275,7 @@ linsysfs_uninit(PFS_INIT_ARGS) return (0); } -PSEUDOFS(linsysfs, 1, 0); +PSEUDOFS(linsysfs, 1, PR_ALLOW_MOUNT_LINSYSFS); #if defined(__amd64__) MODULE_DEPEND(linsysfs, linux_common, 1, 1, 1); #else Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sun Jul 19 00:38:19 2015 (r285684) +++ head/sys/kern/kern_jail.c Sun Jul 19 08:52:35 2015 (r285685) @@ -205,6 +205,8 @@ static char *pr_allow_names[] = { "allow.mount.procfs", "allow.mount.tmpfs", "allow.mount.fdescfs", + "allow.mount.linprocfs", + "allow.mount.linsysfs", }; const size_t pr_allow_names_size = sizeof(pr_allow_names); @@ -222,6 +224,8 @@ static char *pr_allow_nonames[] = { "allow.mount.noprocfs", "allow.mount.notmpfs", "allow.mount.nofdescfs", + "allow.mount.nolinprocfs", + "allow.mount.nolinsysfs", }; const size_t pr_allow_nonames_size = sizeof(pr_allow_nonames); @@ -4290,6 +4294,14 @@ SYSCTL_PROC(_security_jail, OID_AUTO, mo CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_PROCFS, sysctl_jail_default_allow, "I", "Processes in jail can mount the procfs file system"); +SYSCTL_PROC(_security_jail, OID_AUTO, mount_linprocfs_allowed, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + NULL, PR_ALLOW_MOUNT_LINPROCFS, sysctl_jail_default_allow, "I", + "Processes in jail can mount the linprocfs file system"); +SYSCTL_PROC(_security_jail, OID_AUTO, mount_linsysfs_allowed, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + NULL, PR_ALLOW_MOUNT_LINSYSFS, sysctl_jail_default_allow, "I", + "Processes in jail can mount the linsysfs file system"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_tmpfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_TMPFS, sysctl_jail_default_allow, "I", @@ -4456,6 +4468,10 @@ SYSCTL_JAIL_PARAM(_allow_mount, nullfs, "B", "Jail may mount the nullfs file system"); SYSCTL_JAIL_PARAM(_allow_mount, procfs, CTLTYPE_INT | CTLFLAG_RW, "B", "Jail may mount the procfs file system"); +SYSCTL_JAIL_PARAM(_allow_mount, linprocfs, CTLTYPE_INT | CTLFLAG_RW, + "B", "Jail may mount the linprocfs file system"); +SYSCTL_JAIL_PARAM(_allow_mount, linsysfs, CTLTYPE_INT | CTLFLAG_RW, + "B", "Jail may mount the linsysfs file system"); SYSCTL_JAIL_PARAM(_allow_mount, tmpfs, CTLTYPE_INT | CTLFLAG_RW, "B", "Jail may mount the tmpfs file system"); SYSCTL_JAIL_PARAM(_allow_mount, zfs, CTLTYPE_INT | CTLFLAG_RW, Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Sun Jul 19 00:38:19 2015 (r285684) +++ head/sys/sys/jail.h Sun Jul 19 08:52:35 2015 (r285685) @@ -230,7 +230,9 @@ struct prison_racct { #define PR_ALLOW_MOUNT_PROCFS 0x0400 #define PR_ALLOW_MOUNT_TMPFS 0x0800 #define PR_ALLOW_MOUNT_FDESCFS 0x1000 -#define PR_ALLOW_ALL 0x1fff +#define PR_ALLOW_MOUNT_LINPROCFS 0x2000 +#define PR_ALLOW_MOUNT_LINSYSFS 0x4000 +#define PR_ALLOW_ALL 0x7fff /* * OSD methods Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sun Jul 19 00:38:19 2015 (r285684) +++ head/usr.sbin/jail/jail.8 Sun Jul 19 08:52:35 2015 (r285685) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2015 +.Dd July 20, 2015 .Dt JAIL 8 .Os .Sh NAME @@ -563,6 +563,22 @@ This permission is effective only togeth and only when .Va enforce_statfs is set to a value lower than 2. +.It Va allow.mount.linprocfs +privileged users inside the jail will be able to mount and unmount the +linprocfs file system. +This permission is effective only together with +.Va allow.mount +and only when +.Va enforce_statfs +is set to a value lower than 2. +.It Va allow.mount.linsysfs +privileged users inside the jail will be able to mount and unmount the +linsysfs file system. +This permission is effective only together with +.Va allow.mount +and only when +.Va enforce_statfs +is set to a value lower than 2. .It Va allow.mount.tmpfs privileged users inside the jail will be able to mount and unmount the tmpfs file system. @@ -1209,6 +1225,8 @@ environment of the first jail. .Xr devfs 5 , .Xr fdescfs 5 , .Xr jail.conf 5 , +.Xr linprocfs 5 , +.Xr linsysfs 5 , .Xr procfs 5 , .Xr rc.conf 5 , .Xr sysctl.conf 5 , From owner-svn-src-head@freebsd.org Sun Jul 19 10:18:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B51F1999E92; Sun, 19 Jul 2015 10:18:03 +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 423AF196C; Sun, 19 Jul 2015 10:18:03 +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 240CE25D3A00; Sun, 19 Jul 2015 10:18:00 +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 A849BC76FEF; Sun, 19 Jul 2015 10:17:57 +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 rwkseoWsZdpf; Sun, 19 Jul 2015 10:17:55 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id A9C74C76FF4; Sun, 19 Jul 2015 10:17:53 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r285627 - in head/sys: arm/arm arm/at91 arm/cavium/cns11xx arm/samsung/s3c2xx0 arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa arm64/arm64 ddb i386/i386 powerpc/boo... From: "Bjoern A. Zeeb" In-Reply-To: <201507161046.t6GAkrEt028784@repo.freebsd.org> Date: Sun, 19 Jul 2015 10:17:50 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201507161046.t6GAkrEt028784@repo.freebsd.org> To: Zbigniew Bodek X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 10:18:03 -0000 > On 16 Jul 2015, at 10:46 , Zbigniew Bodek wrote: >=20 > Author: zbb > Date: Thu Jul 16 10:46:52 2015 > New Revision: 285627 > URL: https://svnweb.freebsd.org/changeset/base/285627 >=20 > Log: > Fix KSTACK_PAGES issue when the default value was changed in KERNCONF >=20 > If KSTACK_PAGES was changed to anything alse than the default, > the value from param.h was taken instead in some places and > the value from KENRCONF in some others. This resulted in > inconsistency which caused corruption in SMP envorinment. >=20 > Ensure all places where KSTACK_PAGES are used the opt_kstack_pages.h > is included. >=20 > The file opt_kstack_pages.h could not be included in param.h > because was breaking the toolchain compilation. >=20 > Reviewed by: kib > Obtained from: Semihalf > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D3094 Broke i386 (and pc98) LINT kernels: i386 LINT kernel failed, check _.i386.LINT for details i386 LINT-NOINET6 kernel failed, check _.i386.LINT-NOINET6 for details i386 LINT-NOINET kernel failed, check _.i386.LINT-NOINET for details pc98 LINT kernel failed, check _.pc98.LINT for details i386 LINT-NOIP kernel failed, check _.i386.LINT-NOIP for details i386 LINT-VIMAGE kernel failed, check _.i386.LINT-VIMAGE for details -------------------------------------------------------------- >>> stage 3.1: making dependencies -------------------------------------------------------------- In file included from = /scratch/tmp/bz/head.svn/sys/i386/i386/locore.s:57: ./assym.s:20:9: warning: 'KSTACK_PAGES' macro redefined = [-Wmacro-redefined] #define KSTACK_PAGES 0x3 ^ ./opt_kstack_pages.h:1:9: note: previous definition is here #define KSTACK_PAGES 3 ^ 1 warning generated. -------------------------------------------------------------- >>> stage 3.2: building everything -------------------------------------------------------------- In file included from = /scratch/tmp/bz/head.svn/sys/i386/i386/locore.s:57: ./assym.s:20:9: error: 'KSTACK_PAGES' macro redefined = [-Werror,-Wmacro-redefined] #define KSTACK_PAGES 0x3 ^ ./opt_kstack_pages.h:1:9: note: previous definition is here #define KSTACK_PAGES 3 ^ 1 error generated. --- locore.o --- *** [locore.o] Error code 1 bmake: stopped in = /storage/head/obj/i386.i386/scratch/tmp/bz/head.svn/sys/LINT =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@freebsd.org Sun Jul 19 10:45:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D3019A430E; Sun, 19 Jul 2015 10:45:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7972A1275; Sun, 19 Jul 2015 10:45:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JAjxbq008819; Sun, 19 Jul 2015 10:45:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JAjxJa008818; Sun, 19 Jul 2015 10:45:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507191045.t6JAjxJa008818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Jul 2015 10:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285686 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 10:45:59 -0000 Author: kib Date: Sun Jul 19 10:45:58 2015 New Revision: 285686 URL: https://svnweb.freebsd.org/changeset/base/285686 Log: Revert bit of the r285627, locore.s does not need include of opt_kstack_pages.h. The asm gets the right KSTACK_PAGES from the assym.s. Reported by: bz Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/locore.s Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Sun Jul 19 08:52:35 2015 (r285685) +++ head/sys/i386/i386/locore.s Sun Jul 19 10:45:58 2015 (r285686) @@ -41,7 +41,6 @@ #include "opt_bootp.h" #include "opt_compat.h" -#include "opt_kstack_pages.h" #include "opt_nfsroot.h" #include "opt_pmap.h" From owner-svn-src-head@freebsd.org Sun Jul 19 13:00:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FF8B9A6D59; Sun, 19 Jul 2015 13:00:16 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4985314BD; Sun, 19 Jul 2015 13:00:16 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id D8CAD358C62; Sun, 19 Jul 2015 15:00:12 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id BCDC428494; Sun, 19 Jul 2015 15:00:12 +0200 (CEST) Date: Sun, 19 Jul 2015 15:00:12 +0200 From: Jilles Tjoelker To: Xin LI Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284162 - head/bin/ls Message-ID: <20150719130012.GA23514@stack.nl> References: <201506081913.t58JD5KX090442@svn.freebsd.org> <20150619215423.GA34741@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150619215423.GA34741@stack.nl> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 13:00:16 -0000 On Fri, Jun 19, 2015 at 11:54:23PM +0200, Jilles Tjoelker wrote: > On Mon, Jun 08, 2015 at 07:13:05PM +0000, Xin LI wrote: > > Author: delphij > > Date: Mon Jun 8 19:13:04 2015 > > New Revision: 284162 > > URL: https://svnweb.freebsd.org/changeset/base/284162 > > Log: > > It has been long time that when doing 'ls -G /path/to/a/symlink', > > instead of using the color of symbolic link, the color is > > determined by the link target. This behavior was quite confusing. > > Looking at the file history, it looks like that r203665 intends to > > fix this but the issue was never actually fixed. > > Fix this by not setting FTS_COMFOLLOW when color is requested like > > what was done in r203665. > > MFC after: 2 weeks > > Modified: > > head/bin/ls/ls.c > Hmm. This makes -G or CLICOLOR env behave like -F in that symlinks are > no longer followed by default. This at least needs a change in the man > page to document it, and I'm not sure whether -G should actually modify > ls's action beyond adding colour. > For example, in stable/10 doing ls /sys, ls -p /sys and ls -G /sys show > a directory listing of the kernel source, while ls -F /sys shows just > the symlink. > What r203665 fixed was colour, inode number, etc. when -P was given and > -F/-d/-l were not. > I'll admit that this -F/-d/-l thing is bizarre but it has grown that way > historically and I've found ls implementations that deviate from this > annoying (e.g. on some embedded systems). What's more, the behaviour even depends on TERM, leading to strange things like: $ TERM=dumb CLICOLOR=1 ls /sys Makefile crypto libkern netsmb sparc64 amd64 ddb mips nfs sys arm dev modules nfsclient teken arm64 fs net nfsserver tools boot gdb net80211 nlm ufs bsm geom netgraph ofed vm cam gnu netinet opencrypto x86 cddl i386 netinet6 pc98 xdr compat isa netipsec powerpc xen conf kern netnatm rpc contrib kgssapi netpfil security $ TERM=xterm CLICOLOR=1 ls /sys /sys $ The bottommost /sys is purple. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Sun Jul 19 13:10:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D071E9A6EED; Sun, 19 Jul 2015 13:10:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B560A1C2A; Sun, 19 Jul 2015 13:10:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JDAmBb069091; Sun, 19 Jul 2015 13:10:48 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JDAmWC069089; Sun, 19 Jul 2015 13:10:48 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507191310.t6JDAmWC069089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 19 Jul 2015 13:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285687 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 13:10:49 -0000 Author: andrew Date: Sun Jul 19 13:10:47 2015 New Revision: 285687 URL: https://svnweb.freebsd.org/changeset/base/285687 Log: Sort the ARM atomic functions to be in alphabetical order. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/include/atomic-v4.h head/sys/arm/include/atomic-v6.h Modified: head/sys/arm/include/atomic-v4.h ============================================================================== --- head/sys/arm/include/atomic-v4.h Sun Jul 19 10:45:58 2015 (r285686) +++ head/sys/arm/include/atomic-v4.h Sun Jul 19 13:10:47 2015 (r285687) @@ -89,15 +89,15 @@ __swp(uint32_t val, volatile uint32_t *p #define ARM_HAVE_ATOMIC64 static __inline void -atomic_set_32(volatile uint32_t *address, uint32_t setmask) +atomic_add_32(volatile u_int32_t *p, u_int32_t val) { - __with_interrupts_disabled(*address |= setmask); + __with_interrupts_disabled(*p += val); } static __inline void -atomic_set_64(volatile uint64_t *address, uint64_t setmask) +atomic_add_64(volatile u_int64_t *p, u_int64_t val) { - __with_interrupts_disabled(*address |= setmask); + __with_interrupts_disabled(*p += val); } static __inline void @@ -146,29 +146,6 @@ atomic_cmpset_64(volatile u_int64_t *p, return (ret); } -static __inline void -atomic_add_32(volatile u_int32_t *p, u_int32_t val) -{ - __with_interrupts_disabled(*p += val); -} - -static __inline void -atomic_add_64(volatile u_int64_t *p, u_int64_t val) -{ - __with_interrupts_disabled(*p += val); -} - -static __inline void -atomic_subtract_32(volatile u_int32_t *p, u_int32_t val) -{ - __with_interrupts_disabled(*p -= val); -} - -static __inline void -atomic_subtract_64(volatile u_int64_t *p, u_int64_t val) -{ - __with_interrupts_disabled(*p -= val); -} static __inline uint32_t atomic_fetchadd_32(volatile uint32_t *p, uint32_t v) @@ -206,17 +183,41 @@ atomic_load_64(volatile uint64_t *p) } static __inline void +atomic_set_32(volatile uint32_t *address, uint32_t setmask) +{ + __with_interrupts_disabled(*address |= setmask); +} + +static __inline void +atomic_set_64(volatile uint64_t *address, uint64_t setmask) +{ + __with_interrupts_disabled(*address |= setmask); +} + +static __inline void atomic_store_64(volatile uint64_t *p, uint64_t value) { __with_interrupts_disabled(*p = value); } +static __inline void +atomic_subtract_32(volatile u_int32_t *p, u_int32_t val) +{ + __with_interrupts_disabled(*p -= val); +} + +static __inline void +atomic_subtract_64(volatile u_int64_t *p, u_int64_t val) +{ + __with_interrupts_disabled(*p -= val); +} + #else /* !_KERNEL */ -static __inline u_int32_t -atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval) +static __inline void +atomic_add_32(volatile u_int32_t *p, u_int32_t val) { - register int done, ras_start = ARM_RAS_START; + int start, ras_start = ARM_RAS_START; __asm __volatile("1:\n" "adr %1, 1b\n" @@ -224,22 +225,19 @@ atomic_cmpset_32(volatile u_int32_t *p, "adr %1, 2f\n" "str %1, [%0, #4]\n" "ldr %1, [%2]\n" - "cmp %1, %3\n" - "streq %4, [%2]\n" + "add %1, %1, %3\n" + "str %1, [%2]\n" "2:\n" "mov %1, #0\n" "str %1, [%0]\n" "mov %1, #0xffffffff\n" "str %1, [%0, #4]\n" - "moveq %1, #1\n" - "movne %1, #0\n" - : "+r" (ras_start), "=r" (done) - ,"+r" (p), "+r" (cmpval), "+r" (newval) : : "cc", "memory"); - return (done); + : "+r" (ras_start), "=r" (start), "+r" (p), "+r" (val) + : : "memory"); } static __inline void -atomic_add_32(volatile u_int32_t *p, u_int32_t val) +atomic_clear_32(volatile uint32_t *address, uint32_t clearmask) { int start, ras_start = ARM_RAS_START; @@ -249,21 +247,22 @@ atomic_add_32(volatile u_int32_t *p, u_i "adr %1, 2f\n" "str %1, [%0, #4]\n" "ldr %1, [%2]\n" - "add %1, %1, %3\n" + "bic %1, %1, %3\n" "str %1, [%2]\n" "2:\n" "mov %1, #0\n" "str %1, [%0]\n" "mov %1, #0xffffffff\n" "str %1, [%0, #4]\n" - : "+r" (ras_start), "=r" (start), "+r" (p), "+r" (val) + : "+r" (ras_start), "=r" (start), "+r" (address), "+r" (clearmask) : : "memory"); + } -static __inline void -atomic_subtract_32(volatile u_int32_t *p, u_int32_t val) +static __inline u_int32_t +atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval) { - int start, ras_start = ARM_RAS_START; + register int done, ras_start = ARM_RAS_START; __asm __volatile("1:\n" "adr %1, 1b\n" @@ -271,16 +270,42 @@ atomic_subtract_32(volatile u_int32_t *p "adr %1, 2f\n" "str %1, [%0, #4]\n" "ldr %1, [%2]\n" - "sub %1, %1, %3\n" - "str %1, [%2]\n" + "cmp %1, %3\n" + "streq %4, [%2]\n" "2:\n" "mov %1, #0\n" "str %1, [%0]\n" "mov %1, #0xffffffff\n" "str %1, [%0, #4]\n" + "moveq %1, #1\n" + "movne %1, #0\n" + : "+r" (ras_start), "=r" (done) + ,"+r" (p), "+r" (cmpval), "+r" (newval) : : "cc", "memory"); + return (done); +} - : "+r" (ras_start), "=r" (start), "+r" (p), "+r" (val) +static __inline uint32_t +atomic_fetchadd_32(volatile uint32_t *p, uint32_t v) +{ + uint32_t start, tmp, ras_start = ARM_RAS_START; + + __asm __volatile("1:\n" + "adr %1, 1b\n" + "str %1, [%0]\n" + "adr %1, 2f\n" + "str %1, [%0, #4]\n" + "ldr %1, [%3]\n" + "mov %2, %1\n" + "add %2, %2, %4\n" + "str %2, [%3]\n" + "2:\n" + "mov %2, #0\n" + "str %2, [%0]\n" + "mov %2, #0xffffffff\n" + "str %2, [%0, #4]\n" + : "+r" (ras_start), "=r" (start), "=r" (tmp), "+r" (p), "+r" (v) : : "memory"); + return (start); } static __inline void @@ -307,7 +332,7 @@ atomic_set_32(volatile uint32_t *address } static __inline void -atomic_clear_32(volatile uint32_t *address, uint32_t clearmask) +atomic_subtract_32(volatile u_int32_t *p, u_int32_t val) { int start, ras_start = ARM_RAS_START; @@ -317,45 +342,20 @@ atomic_clear_32(volatile uint32_t *addre "adr %1, 2f\n" "str %1, [%0, #4]\n" "ldr %1, [%2]\n" - "bic %1, %1, %3\n" + "sub %1, %1, %3\n" "str %1, [%2]\n" "2:\n" "mov %1, #0\n" "str %1, [%0]\n" "mov %1, #0xffffffff\n" "str %1, [%0, #4]\n" - : "+r" (ras_start), "=r" (start), "+r" (address), "+r" (clearmask) - : : "memory"); - -} - -static __inline uint32_t -atomic_fetchadd_32(volatile uint32_t *p, uint32_t v) -{ - uint32_t start, tmp, ras_start = ARM_RAS_START; - __asm __volatile("1:\n" - "adr %1, 1b\n" - "str %1, [%0]\n" - "adr %1, 2f\n" - "str %1, [%0, #4]\n" - "ldr %1, [%3]\n" - "mov %2, %1\n" - "add %2, %2, %4\n" - "str %2, [%3]\n" - "2:\n" - "mov %2, #0\n" - "str %2, [%0]\n" - "mov %2, #0xffffffff\n" - "str %2, [%0, #4]\n" - : "+r" (ras_start), "=r" (start), "=r" (tmp), "+r" (p), "+r" (v) + : "+r" (ras_start), "=r" (start), "+r" (p), "+r" (val) : : "memory"); - return (start); } #endif /* _KERNEL */ - static __inline uint32_t atomic_readandclear_32(volatile u_int32_t *p) { Modified: head/sys/arm/include/atomic-v6.h ============================================================================== --- head/sys/arm/include/atomic-v6.h Sun Jul 19 10:45:58 2015 (r285686) +++ head/sys/arm/include/atomic-v6.h Sun Jul 19 13:10:47 2015 (r285687) @@ -61,29 +61,18 @@ #define ARM_HAVE_ATOMIC64 -static __inline void -__do_dmb(void) -{ - -#if __ARM_ARCH >= 7 - __asm __volatile("dmb" : : : "memory"); -#else - __asm __volatile("mcr p15, 0, r0, c7, c10, 5" : : : "memory"); -#endif -} - #define ATOMIC_ACQ_REL_LONG(NAME) \ static __inline void \ atomic_##NAME##_acq_long(__volatile u_long *p, u_long v) \ { \ atomic_##NAME##_long(p, v); \ - __do_dmb(); \ + dmb(); \ } \ \ static __inline void \ atomic_##NAME##_rel_long(__volatile u_long *p, u_long v) \ { \ - __do_dmb(); \ + dmb(); \ atomic_##NAME##_long(p, v); \ } @@ -92,34 +81,34 @@ static __inline void \ atomic_##NAME##_acq_##WIDTH(__volatile uint##WIDTH##_t *p, uint##WIDTH##_t v)\ { \ atomic_##NAME##_##WIDTH(p, v); \ - __do_dmb(); \ + dmb(); \ } \ \ static __inline void \ atomic_##NAME##_rel_##WIDTH(__volatile uint##WIDTH##_t *p, uint##WIDTH##_t v)\ { \ - __do_dmb(); \ + dmb(); \ atomic_##NAME##_##WIDTH(p, v); \ } + static __inline void -atomic_set_32(volatile uint32_t *address, uint32_t setmask) +atomic_add_32(volatile uint32_t *p, uint32_t val) { uint32_t tmp = 0, tmp2 = 0; __asm __volatile("1: ldrex %0, [%2]\n" - "orr %0, %0, %3\n" + "add %0, %0, %3\n" "strex %1, %0, [%2]\n" "cmp %1, #0\n" "it ne\n" "bne 1b\n" - : "=&r" (tmp), "+r" (tmp2) - , "+r" (address), "+r" (setmask) : : "cc", "memory"); - + : "=&r" (tmp), "+r" (tmp2) + ,"+r" (p), "+r" (val) : : "cc", "memory"); } static __inline void -atomic_set_64(volatile uint64_t *p, uint64_t val) +atomic_add_64(volatile uint64_t *p, uint64_t val) { uint64_t tmp; uint32_t exflag; @@ -127,8 +116,8 @@ atomic_set_64(volatile uint64_t *p, uint __asm __volatile( "1: \n" " ldrexd %Q[tmp], %R[tmp], [%[ptr]]\n" - " orr %Q[tmp], %Q[val]\n" - " orr %R[tmp], %R[val]\n" + " adds %Q[tmp], %Q[val]\n" + " adc %R[tmp], %R[tmp], %R[val]\n" " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n" " teq %[exf], #0\n" " it ne \n" @@ -141,21 +130,16 @@ atomic_set_64(volatile uint64_t *p, uint } static __inline void -atomic_set_long(volatile u_long *address, u_long setmask) +atomic_add_long(volatile u_long *p, u_long val) { - u_long tmp = 0, tmp2 = 0; - __asm __volatile("1: ldrex %0, [%2]\n" - "orr %0, %0, %3\n" - "strex %1, %0, [%2]\n" - "cmp %1, #0\n" - "it ne\n" - "bne 1b\n" - : "=&r" (tmp), "+r" (tmp2) - , "+r" (address), "+r" (setmask) : : "cc", "memory"); - + atomic_add_32((volatile uint32_t *)p, val); } +ATOMIC_ACQ_REL(add, 32) +ATOMIC_ACQ_REL(add, 64) +ATOMIC_ACQ_REL_LONG(add) + static __inline void atomic_clear_32(volatile uint32_t *address, uint32_t setmask) { @@ -196,20 +180,16 @@ atomic_clear_64(volatile uint64_t *p, ui static __inline void atomic_clear_long(volatile u_long *address, u_long setmask) { - u_long tmp = 0, tmp2 = 0; - __asm __volatile("1: ldrex %0, [%2]\n" - "bic %0, %0, %3\n" - "strex %1, %0, [%2]\n" - "cmp %1, #0\n" - "it ne\n" - "bne 1b\n" - : "=&r" (tmp), "+r" (tmp2) - ,"+r" (address), "+r" (setmask) : : "cc", "memory"); + atomic_clear_32((volatile uint32_t *)address, setmask); } -static __inline u_int32_t -atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval) +ATOMIC_ACQ_REL(clear, 32) +ATOMIC_ACQ_REL(clear, 64) +ATOMIC_ACQ_REL_LONG(clear) + +static __inline uint32_t +atomic_cmpset_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) { uint32_t ret; @@ -260,217 +240,165 @@ atomic_cmpset_64(volatile uint64_t *p, u } static __inline u_long -atomic_cmpset_long(volatile u_long *p, volatile u_long cmpval, volatile u_long newval) +atomic_cmpset_long(volatile u_long *p, u_long cmpval, u_long newval) { - u_long ret; - - __asm __volatile("1: ldrex %0, [%1]\n" - "cmp %0, %2\n" - "itt ne\n" - "movne %0, #0\n" - "bne 2f\n" - "strex %0, %3, [%1]\n" - "cmp %0, #0\n" - "ite eq\n" - "moveq %0, #1\n" - "bne 1b\n" - "2:" - : "=&r" (ret) - ,"+r" (p), "+r" (cmpval), "+r" (newval) : : "cc", - "memory"); - return (ret); + + return (atomic_cmpset_32((volatile uint32_t *)p, cmpval, newval)); } -static __inline u_int32_t -atomic_cmpset_acq_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval) +static __inline uint32_t +atomic_cmpset_acq_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) { - u_int32_t ret = atomic_cmpset_32(p, cmpval, newval); + uint32_t ret; - __do_dmb(); + ret = atomic_cmpset_32(p, cmpval, newval); + dmb(); return (ret); } static __inline uint64_t -atomic_cmpset_acq_64(volatile uint64_t *p, volatile uint64_t cmpval, volatile uint64_t newval) +atomic_cmpset_acq_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval) { - uint64_t ret = atomic_cmpset_64(p, cmpval, newval); + uint64_t ret; - __do_dmb(); + ret = atomic_cmpset_64(p, cmpval, newval); + dmb(); return (ret); } static __inline u_long -atomic_cmpset_acq_long(volatile u_long *p, volatile u_long cmpval, volatile u_long newval) +atomic_cmpset_acq_long(volatile u_long *p, u_long cmpval, u_long newval) { - u_long ret = atomic_cmpset_long(p, cmpval, newval); + u_long ret; - __do_dmb(); + ret = atomic_cmpset_long(p, cmpval, newval); + dmb(); return (ret); } -static __inline u_int32_t -atomic_cmpset_rel_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval) +static __inline uint32_t +atomic_cmpset_rel_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) { - __do_dmb(); + dmb(); return (atomic_cmpset_32(p, cmpval, newval)); } static __inline uint64_t -atomic_cmpset_rel_64(volatile uint64_t *p, volatile uint64_t cmpval, volatile uint64_t newval) +atomic_cmpset_rel_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval) { - __do_dmb(); + dmb(); return (atomic_cmpset_64(p, cmpval, newval)); } static __inline u_long -atomic_cmpset_rel_long(volatile u_long *p, volatile u_long cmpval, volatile u_long newval) +atomic_cmpset_rel_long(volatile u_long *p, u_long cmpval, u_long newval) { - - __do_dmb(); + + dmb(); return (atomic_cmpset_long(p, cmpval, newval)); } - -static __inline void -atomic_add_32(volatile u_int32_t *p, u_int32_t val) +static __inline uint32_t +atomic_fetchadd_32(volatile uint32_t *p, uint32_t val) { - uint32_t tmp = 0, tmp2 = 0; + uint32_t tmp = 0, tmp2 = 0, ret = 0; - __asm __volatile("1: ldrex %0, [%2]\n" - "add %0, %0, %3\n" - "strex %1, %0, [%2]\n" - "cmp %1, #0\n" + __asm __volatile("1: ldrex %0, [%3]\n" + "add %1, %0, %4\n" + "strex %2, %1, [%3]\n" + "cmp %2, #0\n" "it ne\n" "bne 1b\n" - : "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "cc", "memory"); + : "+r" (ret), "=&r" (tmp), "+r" (tmp2) + ,"+r" (p), "+r" (val) : : "cc", "memory"); + return (ret); } -static __inline void -atomic_add_64(volatile uint64_t *p, uint64_t val) +static __inline uint64_t +atomic_fetchadd_64(volatile uint64_t *p, uint64_t val) { - uint64_t tmp; + uint64_t ret, tmp; uint32_t exflag; __asm __volatile( "1: \n" " ldrexd %Q[tmp], %R[tmp], [%[ptr]]\n" - " adds %Q[tmp], %Q[val]\n" - " adc %R[tmp], %R[tmp], %R[val]\n" + " adds %Q[tmp], %Q[ret], %Q[val]\n" + " adc %R[tmp], %R[ret], %R[val]\n" " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n" " teq %[exf], #0\n" " it ne \n" " bne 1b\n" - : [exf] "=&r" (exflag), + : [ret] "=&r" (ret), + [exf] "=&r" (exflag), [tmp] "=&r" (tmp) : [ptr] "r" (p), [val] "r" (val) : "cc", "memory"); + return (ret); } -static __inline void -atomic_add_long(volatile u_long *p, u_long val) +static __inline u_long +atomic_fetchadd_long(volatile u_long *p, u_long val) { - u_long tmp = 0, tmp2 = 0; - __asm __volatile("1: ldrex %0, [%2]\n" - "add %0, %0, %3\n" - "strex %1, %0, [%2]\n" - "cmp %1, #0\n" - "it ne\n" - "bne 1b\n" - : "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "cc", "memory"); + return (atomic_fetchadd_32((volatile uint32_t *)p, val)); } -static __inline void -atomic_subtract_32(volatile u_int32_t *p, u_int32_t val) +static __inline uint32_t +atomic_load_acq_32(volatile uint32_t *p) { - uint32_t tmp = 0, tmp2 = 0; + uint32_t v; - __asm __volatile("1: ldrex %0, [%2]\n" - "sub %0, %0, %3\n" - "strex %1, %0, [%2]\n" - "cmp %1, #0\n" - "it ne\n" - "bne 1b\n" - : "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "cc", "memory"); + v = *p; + dmb(); + return (v); } -static __inline void -atomic_subtract_64(volatile uint64_t *p, uint64_t val) +static __inline uint64_t +atomic_load_64(volatile uint64_t *p) { - uint64_t tmp; - uint32_t exflag; + uint64_t ret; + /* + * The only way to atomically load 64 bits is with LDREXD which puts the + * exclusive monitor into the exclusive state, so reset it to open state + * with CLREX because we don't actually need to store anything. + */ __asm __volatile( "1: \n" - " ldrexd %Q[tmp], %R[tmp], [%[ptr]]\n" - " subs %Q[tmp], %Q[val]\n" - " sbc %R[tmp], %R[tmp], %R[val]\n" - " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n" - " teq %[exf], #0\n" - " it ne \n" - " bne 1b\n" - : [exf] "=&r" (exflag), - [tmp] "=&r" (tmp) - : [ptr] "r" (p), - [val] "r" (val) + " ldrexd %Q[ret], %R[ret], [%[ptr]]\n" + " clrex \n" + : [ret] "=&r" (ret) + : [ptr] "r" (p) : "cc", "memory"); + return (ret); } -static __inline void -atomic_subtract_long(volatile u_long *p, u_long val) +static __inline uint64_t +atomic_load_acq_64(volatile uint64_t *p) { - u_long tmp = 0, tmp2 = 0; + uint64_t ret; - __asm __volatile("1: ldrex %0, [%2]\n" - "sub %0, %0, %3\n" - "strex %1, %0, [%2]\n" - "cmp %1, #0\n" - "it ne\n" - "bne 1b\n" - : "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "cc", "memory"); + ret = atomic_load_64(p); + dmb(); + return (ret); } -ATOMIC_ACQ_REL(clear, 32) -ATOMIC_ACQ_REL(add, 32) -ATOMIC_ACQ_REL(subtract, 32) -ATOMIC_ACQ_REL(set, 32) -ATOMIC_ACQ_REL(clear, 64) -ATOMIC_ACQ_REL(add, 64) -ATOMIC_ACQ_REL(subtract, 64) -ATOMIC_ACQ_REL(set, 64) -ATOMIC_ACQ_REL_LONG(clear) -ATOMIC_ACQ_REL_LONG(add) -ATOMIC_ACQ_REL_LONG(subtract) -ATOMIC_ACQ_REL_LONG(set) - -#undef ATOMIC_ACQ_REL -#undef ATOMIC_ACQ_REL_LONG - -static __inline uint32_t -atomic_fetchadd_32(volatile uint32_t *p, uint32_t val) +static __inline u_long +atomic_load_acq_long(volatile u_long *p) { - uint32_t tmp = 0, tmp2 = 0, ret = 0; + u_long v; - __asm __volatile("1: ldrex %0, [%3]\n" - "add %1, %0, %4\n" - "strex %2, %1, [%3]\n" - "cmp %2, #0\n" - "it ne\n" - "bne 1b\n" - : "+r" (ret), "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "cc", "memory"); - return (ret); + v = *p; + dmb(); + return (v); } static __inline uint32_t -atomic_readandclear_32(volatile u_int32_t *p) +atomic_readandclear_32(volatile uint32_t *p) { uint32_t ret, tmp = 0, tmp2 = 0; @@ -485,35 +413,17 @@ atomic_readandclear_32(volatile u_int32_ return (ret); } -static __inline uint32_t -atomic_load_acq_32(volatile uint32_t *p) -{ - uint32_t v; - - v = *p; - __do_dmb(); - return (v); -} - -static __inline void -atomic_store_rel_32(volatile uint32_t *p, uint32_t v) -{ - - __do_dmb(); - *p = v; -} - static __inline uint64_t -atomic_fetchadd_64(volatile uint64_t *p, uint64_t val) +atomic_readandclear_64(volatile uint64_t *p) { uint64_t ret, tmp; uint32_t exflag; __asm __volatile( "1: \n" - " ldrexd %Q[tmp], %R[tmp], [%[ptr]]\n" - " adds %Q[tmp], %Q[ret], %Q[val]\n" - " adc %R[tmp], %R[ret], %R[val]\n" + " ldrexd %Q[ret], %R[ret], [%[ptr]]\n" + " mov %Q[tmp], #0\n" + " mov %R[tmp], #0\n" " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n" " teq %[exf], #0\n" " it ne \n" @@ -521,65 +431,115 @@ atomic_fetchadd_64(volatile uint64_t *p, : [ret] "=&r" (ret), [exf] "=&r" (exflag), [tmp] "=&r" (tmp) - : [ptr] "r" (p), - [val] "r" (val) + : [ptr] "r" (p) : "cc", "memory"); return (ret); } -static __inline uint64_t -atomic_readandclear_64(volatile uint64_t *p) +static __inline u_long +atomic_readandclear_long(volatile u_long *p) { - uint64_t ret, tmp; + + return (atomic_readandclear_32((volatile uint32_t *)p)); +} + +static __inline void +atomic_set_32(volatile uint32_t *address, uint32_t setmask) +{ + uint32_t tmp = 0, tmp2 = 0; + + __asm __volatile("1: ldrex %0, [%2]\n" + "orr %0, %0, %3\n" + "strex %1, %0, [%2]\n" + "cmp %1, #0\n" + "it ne\n" + "bne 1b\n" + : "=&r" (tmp), "+r" (tmp2) + , "+r" (address), "+r" (setmask) : : "cc", "memory"); + +} + +static __inline void +atomic_set_64(volatile uint64_t *p, uint64_t val) +{ + uint64_t tmp; uint32_t exflag; __asm __volatile( "1: \n" - " ldrexd %Q[ret], %R[ret], [%[ptr]]\n" - " mov %Q[tmp], #0\n" - " mov %R[tmp], #0\n" + " ldrexd %Q[tmp], %R[tmp], [%[ptr]]\n" + " orr %Q[tmp], %Q[val]\n" + " orr %R[tmp], %R[val]\n" " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n" " teq %[exf], #0\n" " it ne \n" " bne 1b\n" - : [ret] "=&r" (ret), - [exf] "=&r" (exflag), + : [exf] "=&r" (exflag), [tmp] "=&r" (tmp) - : [ptr] "r" (p) + : [ptr] "r" (p), + [val] "r" (val) : "cc", "memory"); - return (ret); } -static __inline uint64_t -atomic_load_64(volatile uint64_t *p) +static __inline void +atomic_set_long(volatile u_long *address, u_long setmask) { - uint64_t ret; - /* - * The only way to atomically load 64 bits is with LDREXD which puts the - * exclusive monitor into the exclusive state, so reset it to open state - * with CLREX because we don't actually need to store anything. - */ + atomic_set_32((volatile uint32_t *)address, setmask); +} + +ATOMIC_ACQ_REL(set, 32) +ATOMIC_ACQ_REL(set, 64) +ATOMIC_ACQ_REL_LONG(set) + +static __inline void +atomic_subtract_32(volatile uint32_t *p, uint32_t val) +{ + uint32_t tmp = 0, tmp2 = 0; + + __asm __volatile("1: ldrex %0, [%2]\n" + "sub %0, %0, %3\n" + "strex %1, %0, [%2]\n" + "cmp %1, #0\n" + "it ne\n" + "bne 1b\n" + : "=&r" (tmp), "+r" (tmp2) + ,"+r" (p), "+r" (val) : : "cc", "memory"); +} + +static __inline void +atomic_subtract_64(volatile uint64_t *p, uint64_t val) +{ + uint64_t tmp; + uint32_t exflag; + __asm __volatile( "1: \n" - " ldrexd %Q[ret], %R[ret], [%[ptr]]\n" - " clrex \n" - : [ret] "=&r" (ret) - : [ptr] "r" (p) + " ldrexd %Q[tmp], %R[tmp], [%[ptr]]\n" + " subs %Q[tmp], %Q[val]\n" + " sbc %R[tmp], %R[tmp], %R[val]\n" + " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n" + " teq %[exf], #0\n" + " it ne \n" + " bne 1b\n" + : [exf] "=&r" (exflag), + [tmp] "=&r" (tmp) + : [ptr] "r" (p), + [val] "r" (val) : "cc", "memory"); - return (ret); } -static __inline uint64_t -atomic_load_acq_64(volatile uint64_t *p) +static __inline void +atomic_subtract_long(volatile u_long *p, u_long val) { - uint64_t ret; - ret = atomic_load_64(p); - __do_dmb(); - return (ret); + atomic_subtract_32((volatile uint32_t *)p, val); } +ATOMIC_ACQ_REL(subtract, 32) +ATOMIC_ACQ_REL(subtract, 64) +ATOMIC_ACQ_REL_LONG(subtract) + static __inline void atomic_store_64(volatile uint64_t *p, uint64_t val) { @@ -606,61 +566,30 @@ atomic_store_64(volatile uint64_t *p, ui } static __inline void -atomic_store_rel_64(volatile uint64_t *p, uint64_t val) -{ - - __do_dmb(); - atomic_store_64(p, val); -} - -static __inline u_long -atomic_fetchadd_long(volatile u_long *p, u_long val) -{ - u_long tmp = 0, tmp2 = 0, ret = 0; - - __asm __volatile("1: ldrex %0, [%3]\n" - "add %1, %0, %4\n" - "strex %2, %1, [%3]\n" - "cmp %2, #0\n" - "it ne\n" - "bne 1b\n" - : "+r" (ret), "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "cc", "memory"); - return (ret); -} - -static __inline u_long -atomic_readandclear_long(volatile u_long *p) +atomic_store_rel_32(volatile uint32_t *p, uint32_t v) { - u_long ret, tmp = 0, tmp2 = 0; - - __asm __volatile("1: ldrex %0, [%3]\n" - "mov %1, #0\n" - "strex %2, %1, [%3]\n" - "cmp %2, #0\n" - "it ne\n" - "bne 1b\n" - : "=r" (ret), "=&r" (tmp), "+r" (tmp2) - ,"+r" (p) : : "cc", "memory"); - return (ret); + + dmb(); + *p = v; } -static __inline u_long -atomic_load_acq_long(volatile u_long *p) +static __inline void +atomic_store_rel_64(volatile uint64_t *p, uint64_t val) { - u_long v; - v = *p; - __do_dmb(); - return (v); + dmb(); + atomic_store_64(p, val); } static __inline void atomic_store_rel_long(volatile u_long *p, u_long v) { - __do_dmb(); + dmb(); *p = v; } +#undef ATOMIC_ACQ_REL +#undef ATOMIC_ACQ_REL_LONG + #endif /* _MACHINE_ATOMIC_V6_H_ */ From owner-svn-src-head@freebsd.org Sun Jul 19 14:34:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 618149A4CE8; Sun, 19 Jul 2015 14:34:37 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A1201C9A; Sun, 19 Jul 2015 14:34:37 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JEYaAJ002121; Sun, 19 Jul 2015 14:34:36 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JEYag9002120; Sun, 19 Jul 2015 14:34:36 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201507191434.t6JEYag9002120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Sun, 19 Jul 2015 14:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285688 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 14:34:37 -0000 Author: markm Date: Sun Jul 19 14:34:35 2015 New Revision: 285688 URL: https://svnweb.freebsd.org/changeset/base/285688 Log: Clean up some trailing whitespace. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Jul 19 13:10:47 2015 (r285687) +++ head/UPDATING Sun Jul 19 14:34:35 2015 (r285688) @@ -87,7 +87,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 20150616: FreeBSD's old make (fmake) has been removed from the system. It is available as the devel/fmake port or via pkg install fmake. - + 20150615: The fix for the issue described in the 20150614 sendmail entry below has been been committed in revision 284436. The work @@ -110,7 +110,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 this interoperability, sendmail can be configured to use a 2048 bit DH parameter by: - 1. Edit /etc/mail/`hostname`.mc + 1. Edit /etc/mail/`hostname`.mc 2. If a setting for confDH_PARAMETERS does not exist or exists and is set to a string beginning with '5', replace it with '2'. @@ -223,7 +223,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 using a local socket. Users who have already enabled the local_unbound service should regenerate their configuration by running "service local_unbound setup" as root. - + 20150102: The GNU texinfo and GNU info pages have been removed. To be able to view GNU info pages please install texinfo from ports. @@ -614,7 +614,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 The GNU Compiler Collection and C++ standard library (libstdc++) are no longer built by default on platforms where clang is the system compiler. You can enable them with the WITH_GCC and WITH_GNUCXX - options in src.conf. + options in src.conf. 20130905: The PROCDESC kernel option is now part of the GENERIC kernel @@ -968,7 +968,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 20120727: The sparc64 ZFS loader has been changed to no longer try to auto- detect ZFS providers based on diskN aliases but now requires these - to be explicitly listed in the OFW boot-device environment variable. + to be explicitly listed in the OFW boot-device environment variable. 20120712: The OpenSSL has been upgraded to 1.0.1c. Any binaries requiring From owner-svn-src-head@freebsd.org Sun Jul 19 15:44:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EE789A5A06; Sun, 19 Jul 2015 15:44:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D2F81D48; Sun, 19 Jul 2015 15:44:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JFiqIS030527; Sun, 19 Jul 2015 15:44:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JFiqaH030526; Sun, 19 Jul 2015 15:44:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507191544.t6JFiqaH030526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 19 Jul 2015 15:44:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285689 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 15:44:53 -0000 Author: andrew Date: Sun Jul 19 15:44:51 2015 New Revision: 285689 URL: https://svnweb.freebsd.org/changeset/base/285689 Log: Clean up the style of the armv6 atomic code. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/include/atomic-v6.h Modified: head/sys/arm/include/atomic-v6.h ============================================================================== --- head/sys/arm/include/atomic-v6.h Sun Jul 19 14:34:35 2015 (r285688) +++ head/sys/arm/include/atomic-v6.h Sun Jul 19 15:44:51 2015 (r285689) @@ -97,14 +97,15 @@ atomic_add_32(volatile uint32_t *p, uint { uint32_t tmp = 0, tmp2 = 0; - __asm __volatile("1: ldrex %0, [%2]\n" - "add %0, %0, %3\n" - "strex %1, %0, [%2]\n" - "cmp %1, #0\n" - "it ne\n" - "bne 1b\n" - : "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "cc", "memory"); + __asm __volatile( + "1: ldrex %0, [%2] \n" + " add %0, %0, %3 \n" + " strex %1, %0, [%2] \n" + " cmp %1, #0 \n" + " it ne \n" + " bne 1b \n" + : "=&r" (tmp), "+r" (tmp2) + ,"+r" (p), "+r" (val) : : "cc", "memory"); } static __inline void @@ -114,19 +115,19 @@ atomic_add_64(volatile uint64_t *p, uint uint32_t exflag; __asm __volatile( - "1: \n" - " ldrexd %Q[tmp], %R[tmp], [%[ptr]]\n" - " adds %Q[tmp], %Q[val]\n" - " adc %R[tmp], %R[tmp], %R[val]\n" - " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n" - " teq %[exf], #0\n" - " it ne \n" - " bne 1b\n" - : [exf] "=&r" (exflag), - [tmp] "=&r" (tmp) - : [ptr] "r" (p), - [val] "r" (val) - : "cc", "memory"); + "1: \n" + " ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" + " adds %Q[tmp], %Q[val] \n" + " adc %R[tmp], %R[tmp], %R[val] \n" + " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]] \n" + " teq %[exf], #0 \n" + " it ne \n" + " bne 1b \n" + : [exf] "=&r" (exflag), + [tmp] "=&r" (tmp) + : [ptr] "r" (p), + [val] "r" (val) + : "cc", "memory"); } static __inline void @@ -145,14 +146,15 @@ atomic_clear_32(volatile uint32_t *addre { uint32_t tmp = 0, tmp2 = 0; - __asm __volatile("1: ldrex %0, [%2]\n" - "bic %0, %0, %3\n" - "strex %1, %0, [%2]\n" - "cmp %1, #0\n" - "it ne\n" - "bne 1b\n" - : "=&r" (tmp), "+r" (tmp2) - ,"+r" (address), "+r" (setmask) : : "cc", "memory"); + __asm __volatile( + "1: ldrex %0, [%2] \n" + " bic %0, %0, %3 \n" + " strex %1, %0, [%2] \n" + " cmp %1, #0 \n" + " it ne \n" + " bne 1b \n" + : "=&r" (tmp), "+r" (tmp2), "+r" (address), "+r" (setmask) + : : "cc", "memory"); } static __inline void @@ -162,19 +164,19 @@ atomic_clear_64(volatile uint64_t *p, ui uint32_t exflag; __asm __volatile( - "1: \n" - " ldrexd %Q[tmp], %R[tmp], [%[ptr]]\n" - " bic %Q[tmp], %Q[val]\n" - " bic %R[tmp], %R[val]\n" - " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n" - " teq %[exf], #0\n" - " it ne \n" - " bne 1b\n" - : [exf] "=&r" (exflag), - [tmp] "=&r" (tmp) - : [ptr] "r" (p), - [val] "r" (val) - : "cc", "memory"); + "1: \n" + " ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" + " bic %Q[tmp], %Q[val] \n" + " bic %R[tmp], %R[val] \n" + " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]] \n" + " teq %[exf], #0 \n" + " it ne \n" + " bne 1b \n" + : [exf] "=&r" (exflag), + [tmp] "=&r" (tmp) + : [ptr] "r" (p), + [val] "r" (val) + : "cc", "memory"); } static __inline void @@ -192,21 +194,21 @@ static __inline uint32_t atomic_cmpset_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) { uint32_t ret; - - __asm __volatile("1: ldrex %0, [%1]\n" - "cmp %0, %2\n" - "itt ne\n" - "movne %0, #0\n" - "bne 2f\n" - "strex %0, %3, [%1]\n" - "cmp %0, #0\n" - "ite eq\n" - "moveq %0, #1\n" - "bne 1b\n" - "2:" - : "=&r" (ret) - ,"+r" (p), "+r" (cmpval), "+r" (newval) : : "cc", - "memory"); + + __asm __volatile( + "1: ldrex %0, [%1] \n" + " cmp %0, %2 \n" + " itt ne \n" + " movne %0, #0 \n" + " bne 2f \n" + " strex %0, %3, [%1] \n" + " cmp %0, #0 \n" + " ite eq \n" + " moveq %0, #1 \n" + " bne 1b \n" + "2:" + : "=&r" (ret), "+r" (p), "+r" (cmpval), "+r" (newval) + : : "cc", "memory"); return (ret); } @@ -217,25 +219,25 @@ atomic_cmpset_64(volatile uint64_t *p, u uint32_t ret; __asm __volatile( - "1: \n" - " ldrexd %Q[tmp], %R[tmp], [%[ptr]]\n" - " teq %Q[tmp], %Q[cmpval]\n" - " itee eq \n" - " teqeq %R[tmp], %R[cmpval]\n" - " movne %[ret], #0\n" - " bne 2f\n" - " strexd %[ret], %Q[newval], %R[newval], [%[ptr]]\n" - " teq %[ret], #0\n" - " it ne \n" - " bne 1b\n" - " mov %[ret], #1\n" - "2: \n" - : [ret] "=&r" (ret), - [tmp] "=&r" (tmp) - : [ptr] "r" (p), - [cmpval] "r" (cmpval), - [newval] "r" (newval) - : "cc", "memory"); + "1: \n" + " ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" + " teq %Q[tmp], %Q[cmpval] \n" + " itee eq \n" + " teqeq %R[tmp], %R[cmpval] \n" + " movne %[ret], #0 \n" + " bne 2f \n" + " strexd %[ret], %Q[newval], %R[newval], [%[ptr]]\n" + " teq %[ret], #0 \n" + " it ne \n" + " bne 1b \n" + " mov %[ret], #1 \n" + "2: \n" + : [ret] "=&r" (ret), + [tmp] "=&r" (tmp) + : [ptr] "r" (p), + [cmpval] "r" (cmpval), + [newval] "r" (newval) + : "cc", "memory"); return (ret); } @@ -279,7 +281,7 @@ atomic_cmpset_acq_long(volatile u_long * static __inline uint32_t atomic_cmpset_rel_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) { - + dmb(); return (atomic_cmpset_32(p, cmpval, newval)); } @@ -287,7 +289,7 @@ atomic_cmpset_rel_32(volatile uint32_t * static __inline uint64_t atomic_cmpset_rel_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval) { - + dmb(); return (atomic_cmpset_64(p, cmpval, newval)); } @@ -305,14 +307,15 @@ atomic_fetchadd_32(volatile uint32_t *p, { uint32_t tmp = 0, tmp2 = 0, ret = 0; - __asm __volatile("1: ldrex %0, [%3]\n" - "add %1, %0, %4\n" - "strex %2, %1, [%3]\n" - "cmp %2, #0\n" - "it ne\n" - "bne 1b\n" - : "+r" (ret), "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "cc", "memory"); + __asm __volatile( + "1: ldrex %0, [%3] \n" + " add %1, %0, %4 \n" + " strex %2, %1, [%3] \n" + " cmp %2, #0 \n" + " it ne \n" + " bne 1b \n" + : "+r" (ret), "=&r" (tmp), "+r" (tmp2), "+r" (p), "+r" (val) + : : "cc", "memory"); return (ret); } @@ -323,20 +326,20 @@ atomic_fetchadd_64(volatile uint64_t *p, uint32_t exflag; __asm __volatile( - "1: \n" - " ldrexd %Q[tmp], %R[tmp], [%[ptr]]\n" - " adds %Q[tmp], %Q[ret], %Q[val]\n" - " adc %R[tmp], %R[ret], %R[val]\n" - " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n" - " teq %[exf], #0\n" - " it ne \n" - " bne 1b\n" - : [ret] "=&r" (ret), - [exf] "=&r" (exflag), - [tmp] "=&r" (tmp) - : [ptr] "r" (p), - [val] "r" (val) - : "cc", "memory"); + "1: \n" + " ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" + " adds %Q[tmp], %Q[ret], %Q[val] \n" + " adc %R[tmp], %R[ret], %R[val] \n" + " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]] \n" + " teq %[exf], #0 \n" + " it ne \n" + " bne 1b \n" + : [ret] "=&r" (ret), + [exf] "=&r" (exflag), + [tmp] "=&r" (tmp) + : [ptr] "r" (p), + [val] "r" (val) + : "cc", "memory"); return (ret); } @@ -368,12 +371,11 @@ atomic_load_64(volatile uint64_t *p) * with CLREX because we don't actually need to store anything. */ __asm __volatile( - "1: \n" - " ldrexd %Q[ret], %R[ret], [%[ptr]]\n" - " clrex \n" - : [ret] "=&r" (ret) - : [ptr] "r" (p) - : "cc", "memory"); + "ldrexd %Q[ret], %R[ret], [%[ptr]] \n" + "clrex \n" + : [ret] "=&r" (ret) + : [ptr] "r" (p) + : "cc", "memory"); return (ret); } @@ -402,14 +404,15 @@ atomic_readandclear_32(volatile uint32_t { uint32_t ret, tmp = 0, tmp2 = 0; - __asm __volatile("1: ldrex %0, [%3]\n" - "mov %1, #0\n" - "strex %2, %1, [%3]\n" - "cmp %2, #0\n" - "it ne\n" - "bne 1b\n" - : "=r" (ret), "=&r" (tmp), "+r" (tmp2) - ,"+r" (p) : : "cc", "memory"); + __asm __volatile( + "1: ldrex %0, [%3] \n" + " mov %1, #0 \n" + " strex %2, %1, [%3] \n" + " cmp %2, #0 \n" + " it ne \n" + " bne 1b \n" + : "=r" (ret), "=&r" (tmp), "+r" (tmp2), "+r" (p) + : : "cc", "memory"); return (ret); } @@ -420,19 +423,19 @@ atomic_readandclear_64(volatile uint64_t uint32_t exflag; __asm __volatile( - "1: \n" - " ldrexd %Q[ret], %R[ret], [%[ptr]]\n" - " mov %Q[tmp], #0\n" - " mov %R[tmp], #0\n" - " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n" - " teq %[exf], #0\n" - " it ne \n" - " bne 1b\n" - : [ret] "=&r" (ret), - [exf] "=&r" (exflag), - [tmp] "=&r" (tmp) - : [ptr] "r" (p) - : "cc", "memory"); + "1: \n" + " ldrexd %Q[ret], %R[ret], [%[ptr]] \n" + " mov %Q[tmp], #0 \n" + " mov %R[tmp], #0 \n" + " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]] \n" + " teq %[exf], #0 \n" + " it ne \n" + " bne 1b \n" + : [ret] "=&r" (ret), + [exf] "=&r" (exflag), + [tmp] "=&r" (tmp) + : [ptr] "r" (p) + : "cc", "memory"); return (ret); } @@ -448,15 +451,15 @@ atomic_set_32(volatile uint32_t *address { uint32_t tmp = 0, tmp2 = 0; - __asm __volatile("1: ldrex %0, [%2]\n" - "orr %0, %0, %3\n" - "strex %1, %0, [%2]\n" - "cmp %1, #0\n" - "it ne\n" - "bne 1b\n" - : "=&r" (tmp), "+r" (tmp2) - , "+r" (address), "+r" (setmask) : : "cc", "memory"); - + __asm __volatile( + "1: ldrex %0, [%2] \n" + " orr %0, %0, %3 \n" + " strex %1, %0, [%2] \n" + " cmp %1, #0 \n" + " it ne \n" + " bne 1b \n" + : "=&r" (tmp), "+r" (tmp2), "+r" (address), "+r" (setmask) + : : "cc", "memory"); } static __inline void @@ -466,19 +469,19 @@ atomic_set_64(volatile uint64_t *p, uint uint32_t exflag; __asm __volatile( - "1: \n" - " ldrexd %Q[tmp], %R[tmp], [%[ptr]]\n" - " orr %Q[tmp], %Q[val]\n" - " orr %R[tmp], %R[val]\n" - " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n" - " teq %[exf], #0\n" - " it ne \n" - " bne 1b\n" - : [exf] "=&r" (exflag), - [tmp] "=&r" (tmp) - : [ptr] "r" (p), - [val] "r" (val) - : "cc", "memory"); + "1: \n" + " ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" + " orr %Q[tmp], %Q[val] \n" + " orr %R[tmp], %R[val] \n" + " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]] \n" + " teq %[exf], #0 \n" + " it ne \n" + " bne 1b \n" + : [exf] "=&r" (exflag), + [tmp] "=&r" (tmp) + : [ptr] "r" (p), + [val] "r" (val) + : "cc", "memory"); } static __inline void @@ -497,14 +500,15 @@ atomic_subtract_32(volatile uint32_t *p, { uint32_t tmp = 0, tmp2 = 0; - __asm __volatile("1: ldrex %0, [%2]\n" - "sub %0, %0, %3\n" - "strex %1, %0, [%2]\n" - "cmp %1, #0\n" - "it ne\n" - "bne 1b\n" - : "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "cc", "memory"); + __asm __volatile( + "1: ldrex %0, [%2] \n" + " sub %0, %0, %3 \n" + " strex %1, %0, [%2] \n" + " cmp %1, #0 \n" + " it ne \n" + " bne 1b \n" + : "=&r" (tmp), "+r" (tmp2), "+r" (p), "+r" (val) + : : "cc", "memory"); } static __inline void @@ -514,19 +518,19 @@ atomic_subtract_64(volatile uint64_t *p, uint32_t exflag; __asm __volatile( - "1: \n" - " ldrexd %Q[tmp], %R[tmp], [%[ptr]]\n" - " subs %Q[tmp], %Q[val]\n" - " sbc %R[tmp], %R[tmp], %R[val]\n" - " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n" - " teq %[exf], #0\n" - " it ne \n" - " bne 1b\n" - : [exf] "=&r" (exflag), - [tmp] "=&r" (tmp) - : [ptr] "r" (p), - [val] "r" (val) - : "cc", "memory"); + "1: \n" + " ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" + " subs %Q[tmp], %Q[val] \n" + " sbc %R[tmp], %R[tmp], %R[val] \n" + " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]] \n" + " teq %[exf], #0 \n" + " it ne \n" + " bne 1b \n" + : [exf] "=&r" (exflag), + [tmp] "=&r" (tmp) + : [ptr] "r" (p), + [val] "r" (val) + : "cc", "memory"); } static __inline void @@ -552,23 +556,23 @@ atomic_store_64(volatile uint64_t *p, ui * address, so we read and discard the existing value before storing. */ __asm __volatile( - "1: \n" - " ldrexd %Q[tmp], %R[tmp], [%[ptr]]\n" - " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n" - " teq %[exf], #0\n" - " it ne \n" - " bne 1b\n" - : [tmp] "=&r" (tmp), - [exf] "=&r" (exflag) - : [ptr] "r" (p), - [val] "r" (val) - : "cc", "memory"); + "1: \n" + " ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" + " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]] \n" + " teq %[exf], #0 \n" + " it ne \n" + " bne 1b \n" + : [tmp] "=&r" (tmp), + [exf] "=&r" (exflag) + : [ptr] "r" (p), + [val] "r" (val) + : "cc", "memory"); } static __inline void atomic_store_rel_32(volatile uint32_t *p, uint32_t v) { - + dmb(); *p = v; } @@ -584,7 +588,7 @@ atomic_store_rel_64(volatile uint64_t *p static __inline void atomic_store_rel_long(volatile u_long *p, u_long v) { - + dmb(); *p = v; } From owner-svn-src-head@freebsd.org Sun Jul 19 16:05:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B27309A5E55; Sun, 19 Jul 2015 16:05:24 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 853E31612; Sun, 19 Jul 2015 16:05:24 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JG5N5M038486; Sun, 19 Jul 2015 16:05:23 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JG5NV0038485; Sun, 19 Jul 2015 16:05:23 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201507191605.t6JG5NV0038485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Sun, 19 Jul 2015 16:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285690 - 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.20 Precedence: list List-Id: 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, 19 Jul 2015 16:05:24 -0000 Author: markm Date: Sun Jul 19 16:05:23 2015 New Revision: 285690 URL: https://svnweb.freebsd.org/changeset/base/285690 Log: Optimise the buffer-size calculation. It was possible to get one block too many. Approved by: so (/dev/random blanket) Modified: head/sys/dev/random/randomdev.c Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Sun Jul 19 15:44:51 2015 (r285689) +++ head/sys/dev/random/randomdev.c Sun Jul 19 16:05:23 2015 (r285690) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); #define RANDOM_UNIT 0 +/* Return the largest number >= x that is a multiple of m */ +#define CEIL_TO_MULTIPLE(x, m) ((((x) + (m) - 1)/(m))*(m)) + static d_read_t randomdev_read; static d_write_t randomdev_write; static d_poll_t randomdev_poll; @@ -191,15 +194,15 @@ read_random_uio(struct uio *uio, bool no * which is what the underlying generator is expecting. * See the random_buf size requirements in the Yarrow/Fortuna code. */ - read_len += RANDOM_BLOCKSIZE; - read_len -= read_len % RANDOM_BLOCKSIZE; + read_len = CEIL_TO_MULTIPLE(read_len, RANDOM_BLOCKSIZE); + /* Work in chunks page-sized or less */ read_len = MIN(read_len, PAGE_SIZE); random_alg_context.ra_read(random_buf, read_len); c = MIN(uio->uio_resid, read_len); error = uiomove(random_buf, c, uio); total_read += c; } - if (total_read != uio->uio_resid && (error == ERESTART || error == EINTR) ) + if (total_read != uio->uio_resid && (error == ERESTART || error == EINTR)) /* Return partial read, not error. */ error = 0; } @@ -217,7 +220,7 @@ read_random_uio(struct uio *uio, bool no u_int read_random(void *random_buf, u_int len) { - u_int read_len, total_read, c; + u_int read_len; uint8_t local_buf[len + RANDOM_BLOCKSIZE]; KASSERT(random_buf != NULL, ("No suitable random buffer in %s", __func__)); @@ -228,22 +231,16 @@ read_random(void *random_buf, u_int len) /* XXX: FIX!! Next line as an atomic operation? */ read_rate += (len + sizeof(uint32_t))/sizeof(uint32_t); #endif - read_len = len; - /* - * Belt-and-braces. - * Round up the read length to a crypto block size multiple, - * which is what the underlying generator is expecting. - */ - read_len += RANDOM_BLOCKSIZE; - read_len -= read_len % RANDOM_BLOCKSIZE; - total_read = 0; - while (read_len) { - c = MIN(read_len, PAGE_SIZE); - random_alg_context.ra_read(&local_buf[total_read], c); - read_len -= c; - total_read += c; + if (len > 0) { + /* + * Belt-and-braces. + * Round up the read length to a crypto block size multiple, + * which is what the underlying generator is expecting. + */ + read_len = CEIL_TO_MULTIPLE(len, RANDOM_BLOCKSIZE); + random_alg_context.ra_read(local_buf, read_len); + memcpy(random_buf, local_buf, len); } - memcpy(random_buf, local_buf, len); } else len = 0; return (len); From owner-svn-src-head@freebsd.org Sun Jul 19 16:05:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDB119A5E64; Sun, 19 Jul 2015 16:05:27 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE37B1616; Sun, 19 Jul 2015 16:05:27 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JG5RlA038529; Sun, 19 Jul 2015 16:05:27 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JG5RGk038528; Sun, 19 Jul 2015 16:05:27 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201507191605.t6JG5RGk038528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Sun, 19 Jul 2015 16:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285691 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 16:05:27 -0000 Author: markm Date: Sun Jul 19 16:05:26 2015 New Revision: 285691 URL: https://svnweb.freebsd.org/changeset/base/285691 Log: Clarify the intent of the RANDOM_* options. Approved by: so (/dev/random blanket) Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Jul 19 16:05:23 2015 (r285690) +++ head/sys/conf/NOTES Sun Jul 19 16:05:26 2015 (r285691) @@ -2982,8 +2982,10 @@ options MAXFILES=999 # Random number generator # Only ONE of the below two may be used; they are mutually exclusive. # If neither is present, then the Fortuna algorithm is used. -options RANDOM_YARROW # Yarrow CSPRNG (Default) -options RANDOM_DEBUG # Debugging messages +options RANDOM_YARROW # Yarrow CSPRNG (old default) +#options RANDOM_DUMMY # Dummy CSPRNG that always blocks +# For developers. +options RANDOM_DEBUG # Extra debugging messages # Module to enable execution of application via emulators like QEMU options IMAGACT_BINMISC From owner-svn-src-head@freebsd.org Sun Jul 19 16:05:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E3EB9A5E8F; Sun, 19 Jul 2015 16:05:32 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A5A616EA; Sun, 19 Jul 2015 16:05:32 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JG5Vi8038573; Sun, 19 Jul 2015 16:05:31 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JG5V3o038572; Sun, 19 Jul 2015 16:05:31 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201507191605.t6JG5V3o038572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Sun, 19 Jul 2015 16:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285692 - 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.20 Precedence: list List-Id: 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, 19 Jul 2015 16:05:32 -0000 Author: markm Date: Sun Jul 19 16:05:30 2015 New Revision: 285692 URL: https://svnweb.freebsd.org/changeset/base/285692 Log: Fix the read blocking so that it is interruptable and slow down the rate of console warning spamming while blocked. Approved by: so (/dev/random blanket) Modified: head/sys/dev/random/randomdev.c Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Sun Jul 19 16:05:26 2015 (r285691) +++ head/sys/dev/random/randomdev.c Sun Jul 19 16:05:30 2015 (r285692) @@ -163,22 +163,28 @@ int read_random_uio(struct uio *uio, bool nonblock) { uint8_t *random_buf; - int error; + int error, spamcount; ssize_t read_len, total_read, c; random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); random_alg_context.ra_pre_read(); - /* (Un)Blocking logic */ error = 0; + spamcount = 0; + /* (Un)Blocking logic */ while (!random_alg_context.ra_seeded()) { if (nonblock) { error = EWOULDBLOCK; break; } - tsleep(&random_alg_context, 0, "randseed", hz/10); /* keep tapping away at the pre-read until we seed/unblock. */ random_alg_context.ra_pre_read(); - printf("random: %s unblock wait\n", __func__); + /* Only bother the console every 10 seconds or so */ + if (spamcount == 0) + printf("random: %s unblock wait\n", __func__); + spamcount = (spamcount + 1)%100; + error = tsleep(&random_alg_context, PCATCH, "randseed", hz/10); + if ((error == ERESTART | error == EINTR)) + break; } if (error == 0) { #if !defined(RANDOM_DUMMY) From owner-svn-src-head@freebsd.org Sun Jul 19 16:05:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 453139A5EB7; Sun, 19 Jul 2015 16:05:36 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 190481956; Sun, 19 Jul 2015 16:05:36 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JG5Z7e038615; Sun, 19 Jul 2015 16:05:35 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JG5ZQA038613; Sun, 19 Jul 2015 16:05:35 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201507191605.t6JG5ZQA038613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Sun, 19 Jul 2015 16:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285693 - 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.20 Precedence: list List-Id: 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, 19 Jul 2015 16:05:36 -0000 Author: markm Date: Sun Jul 19 16:05:34 2015 New Revision: 285693 URL: https://svnweb.freebsd.org/changeset/base/285693 Log: Remove out-of-date comments. Approved by: so (/dev/random blanket) Modified: head/sys/dev/random/fortuna.c head/sys/dev/random/yarrow.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Sun Jul 19 16:05:30 2015 (r285692) +++ head/sys/dev/random/fortuna.c Sun Jul 19 16:05:34 2015 (r285693) @@ -133,7 +133,6 @@ static void random_fortuna_deinit_alg(vo static void random_fortuna_reseed_internal(uint32_t *entropy_data, u_int blockcount); -/* Interface to Adaptors system */ struct random_algorithm random_alg_context = { .ra_ident = "Fortuna", .ra_init_alg = random_fortuna_init_alg, Modified: head/sys/dev/random/yarrow.c ============================================================================== --- head/sys/dev/random/yarrow.c Sun Jul 19 16:05:30 2015 (r285692) +++ head/sys/dev/random/yarrow.c Sun Jul 19 16:05:34 2015 (r285693) @@ -117,7 +117,6 @@ static void random_yarrow_deinit_alg(voi static void random_yarrow_reseed_internal(u_int); -/* Interface to Adaptors system */ struct random_algorithm random_alg_context = { .ra_ident = "Yarrow", .ra_init_alg = random_yarrow_init_alg, From owner-svn-src-head@freebsd.org Sun Jul 19 16:55:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 193019A5ABE; Sun, 19 Jul 2015 16:55:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0BCB113E; Sun, 19 Jul 2015 16:55:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JGtmNx062581; Sun, 19 Jul 2015 16:55:48 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JGtmnc062580; Sun, 19 Jul 2015 16:55:48 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507191655.t6JGtmnc062580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 19 Jul 2015 16:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285694 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 16:55:49 -0000 Author: andrew Date: Sun Jul 19 16:55:47 2015 New Revision: 285694 URL: https://svnweb.freebsd.org/changeset/base/285694 Log: Fix atomic_store_64, it should write the value passed in, not the value read by the load. Pointy Hat: andrew Modified: head/sys/arm/include/atomic-v6.h Modified: head/sys/arm/include/atomic-v6.h ============================================================================== --- head/sys/arm/include/atomic-v6.h Sun Jul 19 16:05:34 2015 (r285693) +++ head/sys/arm/include/atomic-v6.h Sun Jul 19 16:55:47 2015 (r285694) @@ -558,7 +558,7 @@ atomic_store_64(volatile uint64_t *p, ui __asm __volatile( "1: \n" " ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" - " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]] \n" + " strexd %[exf], %Q[val], %R[val], [%[ptr]] \n" " teq %[exf], #0 \n" " it ne \n" " bne 1b \n" From owner-svn-src-head@freebsd.org Sun Jul 19 17:03:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1405A9A5C94; Sun, 19 Jul 2015 17:03: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 89E3D16B4; Sun, 19 Jul 2015 17:03:05 +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 t6JH2s5J054882 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 19 Jul 2015 20:02:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t6JH2s5J054882 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t6JH2rQQ054881; Sun, 19 Jul 2015 20:02:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 19 Jul 2015 20:02:53 +0300 From: Konstantin Belousov To: Mark Murray Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285692 - head/sys/dev/random Message-ID: <20150719170253.GO2404@kib.kiev.ua> References: <201507191605.t6JG5V3o038572@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201507191605.t6JG5V3o038572@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 17:03:06 -0000 On Sun, Jul 19, 2015 at 04:05:31PM +0000, Mark Murray wrote: > Author: markm > Date: Sun Jul 19 16:05:30 2015 > New Revision: 285692 > URL: https://svnweb.freebsd.org/changeset/base/285692 > > Log: > Fix the read blocking so that it is interruptable and slow down the rate of console warning spamming while blocked. > > Approved by: so (/dev/random blanket) > > Modified: > head/sys/dev/random/randomdev.c > > Modified: head/sys/dev/random/randomdev.c > ============================================================================== > --- head/sys/dev/random/randomdev.c Sun Jul 19 16:05:26 2015 (r285691) > +++ head/sys/dev/random/randomdev.c Sun Jul 19 16:05:30 2015 (r285692) > @@ -163,22 +163,28 @@ int > read_random_uio(struct uio *uio, bool nonblock) > { > uint8_t *random_buf; > - int error; > + int error, spamcount; > ssize_t read_len, total_read, c; > > random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); > random_alg_context.ra_pre_read(); > - /* (Un)Blocking logic */ > error = 0; > + spamcount = 0; > + /* (Un)Blocking logic */ > while (!random_alg_context.ra_seeded()) { > if (nonblock) { > error = EWOULDBLOCK; > break; > } > - tsleep(&random_alg_context, 0, "randseed", hz/10); > /* keep tapping away at the pre-read until we seed/unblock. */ > random_alg_context.ra_pre_read(); > - printf("random: %s unblock wait\n", __func__); > + /* Only bother the console every 10 seconds or so */ > + if (spamcount == 0) > + printf("random: %s unblock wait\n", __func__); > + spamcount = (spamcount + 1)%100; Is ppsratecheck() not suitable for this due to use of > 1 sec period ? > + error = tsleep(&random_alg_context, PCATCH, "randseed", hz/10); > + if ((error == ERESTART | error == EINTR)) This is probably still valid, but I wonder if you mean || there. Then you could also remove extra (). > + break; > } > if (error == 0) { > #if !defined(RANDOM_DUMMY) All your commits are breaking all style(9) rules. It would be nice to keep the style at least for the files where you added random harvesting and which are already mostly style compliant. E.g., what about wrapping lines at position somewhere between 72 and 80 ? From owner-svn-src-head@freebsd.org Sun Jul 19 17:25:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A54669A611B; Sun, 19 Jul 2015 17:25:44 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DB6612C2; Sun, 19 Jul 2015 17:25:44 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZGsLN-0003Rx-1t; Sun, 19 Jul 2015 18:25:41 +0100 Subject: Re: svn commit: r285692 - head/sys/dev/random Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <20150719170253.GO2404@kib.kiev.ua> Date: Sun, 19 Jul 2015 18:25:34 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201507191605.t6JG5V3o038572@repo.freebsd.org> <20150719170253.GO2404@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 17:25:44 -0000 > On 19 Jul 2015, at 18:02, Konstantin Belousov = wrote: >=20 >> - printf("random: %s unblock wait\n", __func__); >> + /* Only bother the console every 10 seconds or so */ >> + if (spamcount =3D=3D 0) >> + printf("random: %s unblock wait\n", __func__); >> + spamcount =3D (spamcount + 1)%100; > Is ppsratecheck() not suitable for this due to use of > 1 sec period ? Oooh! Very probably, thank you. >> + error =3D tsleep(&random_alg_context, PCATCH, = "randseed", hz/10); >> + if ((error =3D=3D ERESTART | error =3D=3D EINTR)) > This is probably still valid, but I wonder if you mean || there. > Then you could also remove extra (). Oh, nuts. Got the wrong patch. Thank you. > All your commits are breaking all style(9) rules. It would be nice to = keep > the style at least for the files where you added random harvesting and = which > are already mostly style compliant. E.g., what about wrapping lines = at > position somewhere between 72 and 80 ? I=E2=80=99ll look, thanks! M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Sun Jul 19 17:54:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA50D9A64F3; Sun, 19 Jul 2015 17:54:43 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5BDD112A; Sun, 19 Jul 2015 17:54:43 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JHshjX090651; Sun, 19 Jul 2015 17:54:43 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JHsh48090650; Sun, 19 Jul 2015 17:54:43 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201507191754.t6JHsh48090650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sun, 19 Jul 2015 17:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285695 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 17:54:43 -0000 Author: luigi Date: Sun Jul 19 17:54:42 2015 New Revision: 285695 URL: https://svnweb.freebsd.org/changeset/base/285695 Log: small documentation update Modified: head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Sun Jul 19 16:55:47 2015 (r285694) +++ head/sys/dev/netmap/netmap_kern.h Sun Jul 19 17:54:42 2015 (r285695) @@ -503,8 +503,9 @@ struct netmap_adapter { * that cannot be changed */ #define NAF_NATIVE 16 /* the adapter is native. - * Virtual ports (vale, pipe, monitor...) - * should never use this flag. + * Virtual ports (non persistent vale ports, + * pipes, monitors...) should never use + * this flag. */ #define NAF_NETMAP_ON 32 /* netmap is active (either native or * emulated). Where possible (e.g. FreeBSD) @@ -1483,7 +1484,7 @@ PNMB(struct netmap_adapter *na, struct n * * np_refs counts the number of references to the structure: one for the fd, * plus (on FreeBSD) one for each active mmap which we track ourselves - * (they are not unmapped on close(), unlike linux). + * (linux automatically tracks them, but FreeBSD does not). * np_refs is protected by NMG_LOCK. * * Read access to the structure is lock free, because ni_nifp once set From owner-svn-src-head@freebsd.org Sun Jul 19 18:04:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EF769A65FB; Sun, 19 Jul 2015 18:04:52 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F9DC1683; Sun, 19 Jul 2015 18:04:52 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JI4pIN095417; Sun, 19 Jul 2015 18:04:51 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JI4pbg095416; Sun, 19 Jul 2015 18:04:51 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201507191804.t6JI4pbg095416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sun, 19 Jul 2015 18:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285696 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 18:04:52 -0000 Author: luigi Date: Sun Jul 19 18:04:51 2015 New Revision: 285696 URL: https://svnweb.freebsd.org/changeset/base/285696 Log: release a reference when stopping a monitor Modified: head/sys/dev/netmap/netmap_monitor.c Modified: head/sys/dev/netmap/netmap_monitor.c ============================================================================== --- head/sys/dev/netmap/netmap_monitor.c Sun Jul 19 17:54:42 2015 (r285695) +++ head/sys/dev/netmap/netmap_monitor.c Sun Jul 19 18:04:51 2015 (r285696) @@ -326,6 +326,7 @@ netmap_monitor_stop(struct netmap_adapte struct netmap_monitor_adapter *mna = (struct netmap_monitor_adapter *)mkring->na; /* forget about this adapter */ + netmap_adapter_put(mna->priv.np_na); mna->priv.np_na = NULL; } } From owner-svn-src-head@freebsd.org Sun Jul 19 18:05:50 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D582D9A662B; Sun, 19 Jul 2015 18:05:50 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C615B1945; Sun, 19 Jul 2015 18:05:50 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JI5od5095580; Sun, 19 Jul 2015 18:05:50 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JI5oug095579; Sun, 19 Jul 2015 18:05:50 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201507191805.t6JI5oug095579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sun, 19 Jul 2015 18:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285697 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 18:05:50 -0000 Author: luigi Date: Sun Jul 19 18:05:49 2015 New Revision: 285697 URL: https://svnweb.freebsd.org/changeset/base/285697 Log: do not free NULL if pipe allocation fails Modified: head/sys/dev/netmap/netmap_pipe.c Modified: head/sys/dev/netmap/netmap_pipe.c ============================================================================== --- head/sys/dev/netmap/netmap_pipe.c Sun Jul 19 18:04:51 2015 (r285696) +++ head/sys/dev/netmap/netmap_pipe.c Sun Jul 19 18:05:49 2015 (r285697) @@ -616,7 +616,7 @@ netmap_get_pipe_na(struct nmreq *nmr, st sna = malloc(sizeof(*mna), M_DEVBUF, M_NOWAIT | M_ZERO); if (sna == NULL) { error = ENOMEM; - goto free_mna; + goto unregister_mna; } /* most fields are the same, copy from master and then fix */ *sna = *mna; @@ -666,6 +666,8 @@ found: free_sna: free(sna, M_DEVBUF); +unregister_mna: + netmap_pipe_remove(pna, mna); free_mna: free(mna, M_DEVBUF); put_out: From owner-svn-src-head@freebsd.org Sun Jul 19 18:06:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 138829A667E; Sun, 19 Jul 2015 18:06:31 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 040DE1B8B; Sun, 19 Jul 2015 18:06:31 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JI6UcT095852; Sun, 19 Jul 2015 18:06:30 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JI6UAO095851; Sun, 19 Jul 2015 18:06:30 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201507191806.t6JI6UAO095851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sun, 19 Jul 2015 18:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285698 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 18:06:31 -0000 Author: luigi Date: Sun Jul 19 18:06:30 2015 New Revision: 285698 URL: https://svnweb.freebsd.org/changeset/base/285698 Log: properly destroy persistent vale ports Modified: head/sys/dev/netmap/netmap_vale.c Modified: head/sys/dev/netmap/netmap_vale.c ============================================================================== --- head/sys/dev/netmap/netmap_vale.c Sun Jul 19 18:05:49 2015 (r285697) +++ head/sys/dev/netmap/netmap_vale.c Sun Jul 19 18:06:30 2015 (r285698) @@ -506,17 +506,6 @@ netmap_vp_dtor(struct netmap_adapter *na } } -/* nm_dtor callback for persistent VALE ports */ -static void -netmap_persist_vp_dtor(struct netmap_adapter *na) -{ - struct ifnet *ifp = na->ifp; - - netmap_vp_dtor(na); - na->ifp = NULL; - nm_vi_detach(ifp); -} - /* remove a persistent VALE port from the system */ static int nm_vi_destroy(const char *name) @@ -546,6 +535,7 @@ nm_vi_destroy(const char *name) */ if_rele(ifp); netmap_detach(ifp); + nm_vi_detach(ifp); return 0; err: @@ -587,7 +577,6 @@ nm_vi_create(struct nmreq *nmr) } /* persist-specific routines */ vpna->up.nm_bdg_ctl = netmap_vp_bdg_ctl; - vpna->up.nm_dtor = netmap_persist_vp_dtor; netmap_adapter_get(&vpna->up); NMG_UNLOCK(); D("created %s", ifp->if_xname); @@ -1823,6 +1812,11 @@ netmap_vp_create(struct nmreq *nmr, stru D("max frame size %u", vpna->mfs); na->na_flags |= NAF_BDG_MAYSLEEP; + /* persistent VALE ports look like hw devices + * with a native netmap adapter + */ + if (ifp) + na->na_flags |= NAF_NATIVE; na->nm_txsync = netmap_vp_txsync; na->nm_rxsync = netmap_vp_rxsync; na->nm_register = netmap_vp_reg; From owner-svn-src-head@freebsd.org Sun Jul 19 18:07:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAF679A66B1; Sun, 19 Jul 2015 18:07:26 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C34401CF3; Sun, 19 Jul 2015 18:07:26 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JI7QnW096007; Sun, 19 Jul 2015 18:07:26 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JI7PHO096002; Sun, 19 Jul 2015 18:07:25 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201507191807.t6JI7PHO096002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sun, 19 Jul 2015 18:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285699 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 18:07:27 -0000 Author: luigi Date: Sun Jul 19 18:07:25 2015 New Revision: 285699 URL: https://svnweb.freebsd.org/changeset/base/285699 Log: add a use count so the netmap module cannot be unloaded while in use. Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Sun Jul 19 18:06:30 2015 (r285698) +++ head/sys/dev/netmap/netmap.c Sun Jul 19 18:07:25 2015 (r285699) @@ -542,6 +542,7 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, generi SYSCTL_INT(_dev_netmap, OID_AUTO, generic_rings, CTLFLAG_RW, &netmap_generic_rings, 0 , ""); NMG_LOCK_T netmap_global_lock; +int netmap_use_count = 0; /* number of active netmap instances */ /* * mark the ring as stopped, and run through the locks @@ -975,11 +976,11 @@ netmap_dtor_locked(struct netmap_priv_d { struct netmap_adapter *na = priv->np_na; - /* number of active mmaps on this fd (FreeBSD only) */ + /* number of active references to this fd */ if (--priv->np_refs > 0) { return 0; } - + netmap_use_count--; if (!na) { return 1; //XXX is it correct? } Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Sun Jul 19 18:06:30 2015 (r285698) +++ head/sys/dev/netmap/netmap_freebsd.c Sun Jul 19 18:07:25 2015 (r285699) @@ -642,6 +642,10 @@ netmap_open(struct cdev *dev, int oflags error = devfs_set_cdevpriv(priv, netmap_dtor); if (error) { free(priv, M_DEVBUF); + } else { + NMG_LOCK(); + netmap_use_count++; + NMG_UNLOCK(); } return error; } @@ -827,6 +831,16 @@ netmap_loader(__unused struct module *mo break; case MOD_UNLOAD: + /* + * if some one is still using netmap, + * then the module can not be unloaded. + */ + if (netmap_use_count) { + D("netmap module can not be unloaded - netmap_use_count: %d", + netmap_use_count); + error = EBUSY; + break; + } netmap_fini(); break; Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Sun Jul 19 18:06:30 2015 (r285698) +++ head/sys/dev/netmap/netmap_kern.h Sun Jul 19 18:07:25 2015 (r285699) @@ -1247,6 +1247,7 @@ extern int netmap_txsync_retry; extern int netmap_generic_mit; extern int netmap_generic_ringsize; extern int netmap_generic_rings; +extern int netmap_use_count; /* * NA returns a pointer to the struct netmap adapter from the ifp, From owner-svn-src-head@freebsd.org Sun Jul 19 18:07:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1E6B9A66D8; Sun, 19 Jul 2015 18:07:36 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C28DE1E43; Sun, 19 Jul 2015 18:07:36 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JI7a1O096068; Sun, 19 Jul 2015 18:07:36 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JI7a3e096067; Sun, 19 Jul 2015 18:07:36 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201507191807.t6JI7a3e096067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Sun, 19 Jul 2015 18:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285700 - 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.20 Precedence: list List-Id: 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, 19 Jul 2015 18:07:36 -0000 Author: markm Date: Sun Jul 19 18:07:35 2015 New Revision: 285700 URL: https://svnweb.freebsd.org/changeset/base/285700 Log: Fix some untidy logic. I committed the wrong local fix; please pass the pointy hat. Approved by: so (/dev/random blanket) Modified: head/sys/dev/random/randomdev.c Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Sun Jul 19 18:07:25 2015 (r285699) +++ head/sys/dev/random/randomdev.c Sun Jul 19 18:07:35 2015 (r285700) @@ -183,7 +183,7 @@ read_random_uio(struct uio *uio, bool no printf("random: %s unblock wait\n", __func__); spamcount = (spamcount + 1)%100; error = tsleep(&random_alg_context, PCATCH, "randseed", hz/10); - if ((error == ERESTART | error == EINTR)) + if (error == ERESTART || error == EINTR) break; } if (error == 0) { From owner-svn-src-head@freebsd.org Sun Jul 19 19:23:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95C7B9A6432; Sun, 19 Jul 2015 19:23:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 867271AAE; Sun, 19 Jul 2015 19:23:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JJNdjd029570; Sun, 19 Jul 2015 19:23:39 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JJNddZ029569; Sun, 19 Jul 2015 19:23:39 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201507191923.t6JJNddZ029569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 19 Jul 2015 19:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285701 - head/usr.sbin/ntp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 19:23:39 -0000 Author: delphij Date: Sun Jul 19 19:23:38 2015 New Revision: 285701 URL: https://svnweb.freebsd.org/changeset/base/285701 Log: Use fixed date/time (the time choosen was the time the import was done on -HEAD) in libntp so we can make reproducible build. PR: bin/201661 Reviewed by: gjb, cy, roberto MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D3122 Modified: head/usr.sbin/ntp/config.h Modified: head/usr.sbin/ntp/config.h ============================================================================== --- head/usr.sbin/ntp/config.h Sun Jul 19 18:07:35 2015 (r285700) +++ head/usr.sbin/ntp/config.h Sun Jul 19 19:23:38 2015 (r285701) @@ -1782,3 +1782,8 @@ typedef union mpinfou { # endif #endif /* !defined(_KERNEL) && !defined(PARSESTREAM) */ +/* + * FreeBSD specific: Explicitly specify date/time for reproducible build. + */ +#define MKREPRO_DATE "Jul 04 2015" +#define MKREPRO_TIME "15:42:16" From owner-svn-src-head@freebsd.org Sun Jul 19 19:41:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF7EE9A66BB; Sun, 19 Jul 2015 19:41:10 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0116.outbound.protection.outlook.com [157.56.110.116]) (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 C880A144E; Sun, 19 Jul 2015 19:41:09 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from BLUPR05MB706.namprd05.prod.outlook.com (10.141.207.13) by BLUPR05MB1860.namprd05.prod.outlook.com (10.162.215.146) with Microsoft SMTP Server (TLS) id 15.1.219.17; Sun, 19 Jul 2015 19:41:01 +0000 Received: from BY2PR05CA038.namprd05.prod.outlook.com (10.141.250.28) by BLUPR05MB706.namprd05.prod.outlook.com (10.141.207.13) with Microsoft SMTP Server (TLS) id 15.1.213.14; Sun, 19 Jul 2015 19:41:01 +0000 Received: from BY2FFO11FD024.protection.gbl (2a01:111:f400:7c0c::171) by BY2PR05CA038.outlook.office365.com (2a01:111:e400:2c5f::28) with Microsoft SMTP Server (TLS) id 15.1.219.17 via Frontend Transport; Sun, 19 Jul 2015 19:41:00 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.18) smtp.mailfrom=juniper.net; freebsd.org; dkim=none (message not signed) header.d=none; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.18 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.18) by BY2FFO11FD024.mail.protection.outlook.com (10.1.15.213) with Microsoft SMTP Server (TLS) id 15.1.213.8 via Frontend Transport; Sun, 19 Jul 2015 19:40:59 +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; Sun, 19 Jul 2015 12:40:59 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t6JJewD25044; Sun, 19 Jul 2015 12:40:58 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 2B6A5580AB; Sun, 19 Jul 2015 12:40:58 -0700 (PDT) To: Mark R V Murray CC: Arthur Mesh , , , , Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... In-Reply-To: <0B29F349-FB7C-4B71-A792-CE304FF72206@FreeBSD.org> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> <22423.1435862187@chaos> <20150702184255.GH90166@juniper.net> <0B29F349-FB7C-4B71-A792-CE304FF72206@FreeBSD.org> Comments: In-reply-to: Mark R V Murray message dated "Thu, 02 Jul 2015 20:21:31 +0100." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Sun, 19 Jul 2015 12:40:58 -0700 Message-ID: <21694.1437334858@chaos> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD024; 1:55tKnhYb3UUd0Cg2qjWvfBWMxxTxsr4ErleMEFDGvwATnOkaubUyX7q+AN+jXw0e6dF5GYfhKPtmwh8HW0+cW+pFfnKImsL7RoZyJl8tveWQF7TYGo+thi0vRdezbgyuEPmAq7wkjQgzMKu6PLRlmPNQahctd/BPIue4VxWBCySnNLguEMNxOoYQ58ARy0eexcqx3f7sY59LawqYKFuDZ/p3qOBHILPwL7ZrpyNoTqZU+p3vKeQKCnKIsdwb2BGUVz7N18rXTgoAN12e6LDP9/oirIXbtb35YpjHfGEm2E1sq+Dk14qq6zb2NW/uWh/ZknY3hnXhrfqqSnS2FkRG+hBxBU258GfLon6IbPwBipWuCvtyKomVrW0Rdwz28APv X-Forefront-Antispam-Report: CIP:66.129.239.18; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(24454002)(189002)(199003)(6806004)(19580395003)(57986006)(2950100001)(76506005)(87936001)(19580405001)(77096005)(110136002)(92566002)(5001960100002)(107886002)(62966003)(47776003)(450100001)(77156002)(5003940100001)(93886004)(106466001)(33716001)(5001920100001)(46102003)(86362001)(48376002)(50226001)(50986999)(76176999)(105596002)(189998001)(117636001)(4001430100001)(62816006)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR05MB706; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB706; 2:tNRVzgLfaelYctlOVA6xJ5/c8YIZlcHhZECEw9S+5ff2DTPFYdEyxNAFax+yAADu; 3:spbqPhDvWNomx9BDC+DSGeoqtphfV8CNwwXo3KiqhJ3OmTjukZ45Ry31r81N0g3b3XGmZ47beT/er8O3A/iFeSNn9a8TmaT3xmNkc+Tk5+4Kz0VTakEMFPbTW6I3H4JqLWqhx+bmU3AXCW1WnkHst2xQMLJXDcP+5XWrcD1pT7k3msoHHBqhP8UpZgwtHs7wt3wU6bn2jEghGh4pHc/BhMqdb8moyQjIuJe0Mf9k2xY=; 25:8MnipuB19FYfFIUrsicR8uUbbKxuXxOuX87AVqKmf2YtM/qeuIk2PsRnWrBm6JGB5wYTcuvYDVyZGLTvVhEINJH8N3HbGC/gRmDsLiblcma2yrSt0mn1QdVIKhIakBJMA1Mk/UCjrbPA8CGtYo04xE/zpSybrA/TfPTecsGVvmBqnjRJB+mtqsJ+A0b+9iww/LRwjLzz4Mk4ACkX/6dDzZ8IYusA3VttNZit/tAS/ZBos8nzRaEGJl8UdbvF9nsmvowgyKf4SDMEbvNqxn2fgQ== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB706; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB1860; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB706; 20:FtFIBn91KYK33GvCb+WkIlC4bav/4JD3gaofoLAziVkbKEwVCm6KmDJ0R9RiWkEodZMqOB+kbwGahGm6dUW4deOhp0xAL3XlvS+wA79Y/w41t1ekkfef2WBh75oCuTTk/FLynD8LKB+N71vEFv6BUWv9ja1MV2jpHuYepxM9993tir5Xw6Nhjv/3LTES7+tDqwGUNm+fWSEwM+qrjTDpPPYS3JVkk3fEhBkv/sl8HyOwM/dCfoY1N49Hhy79efXvfI7HNdhAzFMuSz/ViHgb4KJVsxJQRYNiikNA9f79kTkEKbzZfcXnF9yq2uw12QV0p8OML9tcxpiDe8hPeJotqE6/pd/ius09QTJCVSHpzPvX+OtE3ulMXgAl+oj8ZHfqE0/fpMJJYQ8Z9KO28UjcHjSaUw/BpfTCiDo3I5gwfVNeSuT3xP0euJ2cvxLHhkXpD12tIZQexDRunlMhCf/rFsgviWQA+T6jmUo+rm3cPLB7oSQOCIUoF+gzUiLPGrdr; 4:B1ozYwP0oUUG0ASUNnJvhF+jvfno7l7MRbP0beJA+nsHFhs8tgZJwze7/bhVp1Mmd8DMrj+NE68958QzpVSrB16y5o+2bLbbdL3ODzuNblZ5NUIQTjhMdKQfgGRv838g0BJ+ZPA7XuEW0UgMj0uolAmG4ZeyVbqx3m1+QBQV+O4dicbcmlUIY7F52nMf9TDUD9FfHvIFhrQ6woNoJARm2LghKD6N+c53q2LiaJBBGNRQmP7H4WM0YyMFjFvaBGVt+Z0WwyAXpbq1VzfV2+HzsgOsjcVrIjZjYc35/6OZxQs= BLUPR05MB706: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BLUPR05MB706; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB706; X-Forefront-PRVS: 0642A5E7BA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB706; 23:u5vrozQC0K9yaZyeTK65cO0TP27TRQFvLKjPrz7qqe?= =?us-ascii?Q?DvQROn7+SqC586CJL3V3qgnj/ssN2LEIHMzLQywj0UnIhm5ASNyp77CD6Bmi?= =?us-ascii?Q?W1X3nxLd35xXtfZ7XjoDJMyTxRyWXItxU8ugKGah+GQwBcTUOf4Kq5vCDdnx?= =?us-ascii?Q?V6Nh0pNLtxBU3zjtm3fMbzFI1rG6rY6PfKwPbRjpKqfW16br4zxRc0Uul2D3?= =?us-ascii?Q?DQutCSAfWE7ylIzsNYZFecbVPtQQjjA4txQlb5voToAu2AgRAqrEy2Eu53kS?= =?us-ascii?Q?uQLQl/5VzMoNA2r0lkrAgblIJcOChTTw0y4C7ay0lhNwqqB54UzygaLHWeNe?= =?us-ascii?Q?OEr6MNHhwYn37yCwNh2fl0JWgFGDfxtIRhzIzIvkQq79ny6h7DJjB/tUcygf?= =?us-ascii?Q?K4y+czQFrHYwGucz8prJRXdkFPggnqN08HSCDWd2fDjSHYWa9ckJSx12vmU1?= =?us-ascii?Q?6NAhomcpeaq+28RoqThqXmlcu5Bm9c4eg5Wwwu4sGFVX9kyly3/NBUWIKwKG?= =?us-ascii?Q?YDQURDK3DijsXWbGwcfg3EW2E0rEzYZFpj1lCZJYB6se91UJYNquLJWcl1H2?= =?us-ascii?Q?MbhiLIQWI4jMTBKHlcMyR3uK+zNGz8WxCU6JdAQR/PTyefjp2XMTs9vhXP51?= =?us-ascii?Q?nDpxC0ZPkD796kas9TVg2SktOHL8ii5zZC/AFsqBQZZO2yxK8DkuyqjYysKq?= =?us-ascii?Q?Cz3Xiqy3TdQ7R19qS34knk75bPK3Sh49292k7e4GQxzcOTNN4bgeO2YQFei+?= =?us-ascii?Q?zG4TISGlSjToVrRzvDOuGGwzH1Rl5RgIqdPkoiVDmbXnhj50EXHNPgrjwdEF?= =?us-ascii?Q?g2ZgVuF8maPjc7Eak05bcwJyxXkpl19A/0bA9FULn56tU4Chj7MaZJpyN2yd?= =?us-ascii?Q?KYbwRgL6g/5QyuV2m/64Dqp/pW0Gjr2KSHVqXqUz91BKlTKuT8ltMfL3OiKK?= =?us-ascii?Q?vcDSSPJbr//6+ld2s8gAyFWd1XA5NJiRz7FgodUeTLaP+g1BdhiOXiUV8c61?= =?us-ascii?Q?/z0ufNEdHUjtVJdX7q+EDK?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB706; 5:iF1WAyd9gm2ft4Jy4t1ms13Njek3nHOwdWvMGCaXBQjZhSpDpMpXgj9AX/T6ynrXod6OfV+Cz0vNm5A911qzfBAVvOPSYzARsSu0IJ+w6rqnK8xEZzVUy4RFanJQOEZKBZMcsdTVmfNl/8q1HbmKtA==; 24:kvPVXcOJ2T+wZjClk99+oLro1XkVV3jgsODwpjwuURgQ7x1qwyTT8xk9p9VNfgGsEEtkqab95zeQi+KWevN/pM1phA0VpGn/sQav0u/wGNI=; 20:iqSMU1v+LVhbeSx9dWs2jGb3/D58Sv4ftr2MNHMEbAkdPcleFDPl+n3HcgNCtTuNuempyU8f8WDN+aSFvAETDg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2015 19:40:59.9003 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.18]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB706 X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB1860; 2:9+lr5bh0oC1IQVq6V6riWK9QFNUMxBkPksvl3LFlbGEhH47jbnz++osHgb281VLl; 3:TGXMfrJ+HqkQ+qI5OKPgFMaE1dDS1/u4oQxTrSVipSYXL7rAb9AkZWnOCak3x4Yw5LjDShEEVPNzXNNUuCWQp+elQaH/yE/R2cojRKirLD6BCyOm7TIME0MtmPB9X+T+rvYTvPsVibyy/0uERQZoJ/usz/drbTCyGGNm3LRGa29+T+Ty68mTYX/IhCydDt8i8F7LDl6EAsIs5+IwM9PNELcAm7R7YnVvVBucNdTKVLA=; 25:4LFoZQfhbqLRmbDhGq08le5OTmFxAKJGG1zPxGG3AM4h8LJLGuangOqlIL1QUc55LhWL3yHvMXx286sf+EIsI44Z0cLE/d3EJ6fxu3WTPUEhitQo1qqLrYYm48FhAS/hVYLjexF7Vx/CBF388PBd6+/XARv+27UZJpnx/gXJgjb3otZMySNRvtAyxXPtvPEy5A/zdjDHqZ9eLxpzJgxLKhkYurCYJHThYOquagvUPTKnz+HduamU6cJShkDW3q+lT7wGgDPrAmwKU+pOou2x9w==; 20:+6FznglkJwcqT/o5dXOSK7/do0b1EA2qLWhfMTd/8UsdyiIxDnmBts/HBEZVhZ/RQ7geDaghO+rwPg+NsYTBSA==; 23:mk66NzJQqRgRbjPi22KZ2z+co4KLuM1oTf3sNCBHF/HfhrTC6b0UasKI1E5AolXNnFg7fsTmRWjaWAYLzSQjtGSfBbeg0hFeubDzK07yN30xlgOUl4BlZA/UHkavRSBgTtevrpR2k9+fU4Nehms+hNBWabqSna26mKUQk3m7KEy+amFXq57nObYm3a48f4jMlyl6CZvCEVNHB8FXCkaVuB4xPjcVBG1Z+eFWBRHNlejVaJ7IJc5kbtiXhTp+pBnw BLUPR05MB1860: X-MS-Exchange-Organization-RulesExecuted X-OriginatorOrg: juniper.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 19 Jul 2015 19:41:11 -0000 Mark R V Murray wrote: > > On Thu, Jul 02, 2015 at 11:36:27AM -0700, Simon J. Gerraty wrote: > >>> Sound like you just need to be able to select a single KLD at boot time? Mark, do you have an estimate of when loadable modules will be supported again? We've been holding off sync'ing from head - which is hardly ideal. From owner-svn-src-head@freebsd.org Sun Jul 19 20:10:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 444E89A6A55; Sun, 19 Jul 2015 20:10:29 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B35114D2; Sun, 19 Jul 2015 20:10:29 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZGuul-0003aS-0o; Sun, 19 Jul 2015 21:10:25 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <21694.1437334858@chaos> Date: Sun, 19 Jul 2015 21:10:16 +0100 Cc: Arthur Mesh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, stevek@juniper.net Content-Transfer-Encoding: quoted-printable Message-Id: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> <22423.1435862187@chaos> <20150702184255.GH90166@juniper.net> <0B29F349-FB7C-4B71-A792-CE304FF72206@FreeBSD.org> <21694.1437334858@chaos> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 20:10:29 -0000 > On 19 Jul 2015, at 20:40, Simon J. Gerraty wrote: >=20 > Mark R V Murray wrote: >>> On Thu, Jul 02, 2015 at 11:36:27AM -0700, Simon J. Gerraty wrote: >>>>> Sound like you just need to be able to select a single KLD at boot = time? >=20 > Mark, do you have an estimate of when loadable modules will be = supported > again? About a week, I=E2=80=99d say. > We've been holding off sync'ing from head - which is hardly ideal. Apologies. I will expedite. M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Sun Jul 19 21:31:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9070A9A5AE1; Sun, 19 Jul 2015 21:31:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 813A31D75; Sun, 19 Jul 2015 21:31:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JLVr9A084838; Sun, 19 Jul 2015 21:31:53 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JLVqAr084836; Sun, 19 Jul 2015 21:31:52 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201507192131.t6JLVqAr084836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 19 Jul 2015 21:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285702 - in head: . lib/libarchive X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 21:31:53 -0000 Author: bapt Date: Sun Jul 19 21:31:52 2015 New Revision: 285702 URL: https://svnweb.freebsd.org/changeset/base/285702 Log: Drop libarchive.pc We want to ensure we always use libarchive from ports in the ports tree. It simplifies ports maintainance and anyway libarchive.pc was not reflecting the different way libarchive can be built in base Deleted: head/lib/libarchive/libarchive.pc Modified: head/ObsoleteFiles.inc head/lib/libarchive/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Jul 19 19:23:38 2015 (r285701) +++ head/ObsoleteFiles.inc Sun Jul 19 21:31:52 2015 (r285702) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20150719: Remove libarchive.pc +OLD_FILES+=usr/libdata/pkgconfig/libarchive.pc # 20150705: Rename DTrace provider man pages. OLD_FILES+=usr/share/man/man4/dtrace-io.4.gz OLD_FILES+=usr/share/man/man4/dtrace-ip.4.gz Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Sun Jul 19 19:23:38 2015 (r285701) +++ head/lib/libarchive/Makefile Sun Jul 19 21:31:52 2015 (r285702) @@ -37,12 +37,6 @@ CFLAGS+= -DPPMD_32BIT .endif NO_WCAST_ALIGN.clang= -.ifndef COMPAT_32BIT -beforeinstall: - ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${.CURDIR}/libarchive.pc ${DESTDIR}${LIBDATADIR}/pkgconfig -.endif - .PATH: ${LIBARCHIVEDIR}/libarchive # Headers to be installed in /usr/include From owner-svn-src-head@freebsd.org Sun Jul 19 22:08:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 031899A4381; Sun, 19 Jul 2015 22:08:32 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-yk0-x230.google.com (mail-yk0-x230.google.com [IPv6:2607:f8b0:4002:c07::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0CDC121C; Sun, 19 Jul 2015 22:08:31 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by ykay190 with SMTP id y190so126817234yka.3; Sun, 19 Jul 2015 15:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=toHobfdNIm90Q9ybpfAiqDzDjf1yXRykAJGjSSDbHjQ=; b=0A+O9qoF0/Rx5yJ+peTOMRMMVnAyFz5lSF8NN9DPUmXLXD1I4eBaZVjxnry/SVy+QM Wn1buSlkuurifeZfvqnsJus+FxolOnRZuJIe02mCayR4lM7NDwzD5K/vVUhvUJTfcD6w suUDh62DiQ5fSeDC5E2KeH9EqXjk767boABCWOMha+a+tO1MwZdd46OODVUOXsy0UPup NZQAZm8YWUDiGEHoHp7SjD3ga6S6+ORQAQkcxMBYfVjRo8SPrT4myv+i/yowzSSDYG+p XkzGewt6nGNnDSD6/57tclSh5/G4cMq+EQtlDsJ/+uCYplZRWDHwf7q5FTulQN+qIkV7 0DnQ== MIME-Version: 1.0 X-Received: by 10.170.203.215 with SMTP id u206mr25718325yke.116.1437343710535; Sun, 19 Jul 2015 15:08:30 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.37.65.193 with HTTP; Sun, 19 Jul 2015 15:08:30 -0700 (PDT) In-Reply-To: <20150614012924.GA2965@troutmask.apl.washington.edu> References: <201506100127.t5A1RdX6051959@svn.freebsd.org> <20150612204309.11dd3391@kan> <20150613024916.GA98218@troutmask.apl.washington.edu> <1434208622.1415.57.camel@freebsd.org> <557C661F.8080104@freebsd.org> <860017ED-D754-450C-865D-2D81A30C2212@xcllnt.net> <20150614002640.GA2746@troutmask.apl.washington.edu> <20150614012924.GA2965@troutmask.apl.washington.edu> Date: Sun, 19 Jul 2015 18:08:30 -0400 X-Google-Sender-Auth: 4gS9_Hlekym1c8tWkOAuIif2IH4 Message-ID: Subject: Re: svn commit: r284198 - head/bin/ls From: Craig Rodrigues To: Steve Kargl Cc: Marcel Moolenaar , Marcel Moolenaar , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 22:08:32 -0000 On Sat, Jun 13, 2015 at 9:29 PM, Steve Kargl < sgk@troutmask.apl.washington.edu> wrote: > On Sat, Jun 13, 2015 at 05:40:59PM -0700, Craig Rodrigues wrote: > > On Sat, Jun 13, 2015 at 5:26 PM, Steve Kargl < > > sgk@troutmask.apl.washington.edu> wrote: > > > > > > Given the horrid state of the manpages, which I showed > > > in March, one can only wonder about the internals of > > > the libxo itself. > > > > > > > Are you talking about this comment you made? > > > https://lists.freebsd.org/pipermail/freebsd-current/2015-March/054899.html > > > > I can't make heads or tails of what you wrote, other than you seemed very > > angry. > > > > I wasn't very angry. I'm simply pointing out that the libxo > manpages, which should document what libxo is/does, are > horrible documentation. If the quality of the manpages > matches the quality of library, and the brokeness that > we have been witnesses bears this out, should be questioned. > > % cd src/contrib/libxo/libxo > % grep Nd *.3 | grep formatted > xo_attr.3:.Nd emit formatted output based on format string and arguments > xo_create.3:.Nd emit formatted output based on format string and arguments > xo_emit.3:.Nd emit formatted output based on format string and arguments > xo_finish.3:.Nd emit formatted output based on format string and arguments > xo_flush.3:.Nd emit formatted output based on format string and arguments > xo_open_list.3:.Nd emit formatted output based on format string and > arguments > xo_set_allocator.3:.Nd emit formatted output based on format string and > arguments > xo_set_flags.3:.Nd emit formatted output based on format string and > arguments > xo_set_info.3:.Nd emit formatted output based on format string and > arguments > xo_set_style.3:.Nd emit formatted output based on format string and > arguments > xo_set_writer.3:.Nd emit formatted output based on format string and > arguments > > Do you really believe that the Nd entries for these manpages are > correct? > > I opened this bug report against libxo: https://github.com/Juniper/libxo/issues/43 Phil Shafer fixed it and closed that bug report out. Hopefully these fixes will make it into FreeBSD after the next libxo import. -- Craig From owner-svn-src-head@freebsd.org Sun Jul 19 22:14:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1C0C9A4526; Sun, 19 Jul 2015 22:14:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D768D1942; Sun, 19 Jul 2015 22:14:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JMEGWc001780; Sun, 19 Jul 2015 22:14:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JMEA34001759; Sun, 19 Jul 2015 22:14:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201507192214.t6JMEA34001759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 19 Jul 2015 22:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285703 - in head/sys: amd64/conf arm/conf cddl/dev/lockstat cddl/dev/sdt conf i386/conf kern modules/dtrace modules/dtrace/dtraceall modules/dtrace/lockstat powerpc/conf sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 22:14:17 -0000 Author: markj Date: Sun Jul 19 22:14:09 2015 New Revision: 285703 URL: https://svnweb.freebsd.org/changeset/base/285703 Log: Implement the lockstat provider using SDT(9) instead of the custom provider in lockstat.ko. This means that lockstat probes now have typed arguments and will utilize SDT probe hot-patching support when it arrives. Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D2993 Deleted: head/sys/cddl/dev/lockstat/ head/sys/modules/dtrace/lockstat/ Modified: head/sys/amd64/conf/NOTES head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/NOTES head/sys/cddl/dev/sdt/sdt.c head/sys/conf/files head/sys/i386/conf/NOTES head/sys/kern/kern_lockstat.c head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/modules/dtrace/Makefile head/sys/modules/dtrace/Makefile.inc head/sys/modules/dtrace/dtraceall/dtraceall.c head/sys/powerpc/conf/NOTES head/sys/sys/lockstat.h head/sys/sys/mutex.h head/sys/sys/rwlock.h head/sys/sys/sx.h Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/amd64/conf/NOTES Sun Jul 19 22:14:09 2015 (r285703) @@ -22,7 +22,6 @@ options KDTRACE_HOOKS #device dtrace # DTrace modules -#device dtrace_lockstat #device dtrace_profile #device dtrace_sdt #device dtrace_fbt Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/arm/conf/BEAGLEBONE Sun Jul 19 22:14:09 2015 (r285703) @@ -32,7 +32,7 @@ makeoptions MODULES_EXTRA="dtb/am335x" options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # all architectures - kernel ELF linker loads CTF data makeoptions WITH_CTF=1 -makeoptions MODULES_EXTRA+="opensolaris dtrace dtrace/lockstat dtrace/profile dtrace/fbt" +makeoptions MODULES_EXTRA+="opensolaris dtrace dtrace/profile dtrace/fbt" options HZ=100 options SCHED_4BSD # 4BSD scheduler Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/arm/conf/NOTES Sun Jul 19 22:14:09 2015 (r285703) @@ -98,7 +98,6 @@ options KDTRACE_HOOKS #device dtrace # DTrace modules -#device dtrace_lockstat #device dtrace_profile #device dtrace_sdt #device dtrace_fbt Modified: head/sys/cddl/dev/sdt/sdt.c ============================================================================== --- head/sys/cddl/dev/sdt/sdt.c Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/cddl/dev/sdt/sdt.c Sun Jul 19 22:14:09 2015 (r285703) @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -197,6 +198,8 @@ sdt_enable(void *arg __unused, dtrace_id probe->id = id; probe->sdtp_lf->nenabled++; + if (strcmp(probe->prov->name, "lockstat") == 0) + lockstat_enabled++; } static void @@ -206,6 +209,8 @@ sdt_disable(void *arg __unused, dtrace_i KASSERT(probe->sdtp_lf->nenabled > 0, ("no probes enabled")); + if (strcmp(probe->prov->name, "lockstat") == 0) + lockstat_enabled--; probe->id = 0; probe->sdtp_lf->nenabled--; } Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/conf/files Sun Jul 19 22:14:09 2015 (r285703) @@ -246,7 +246,6 @@ cddl/contrib/opensolaris/uts/common/zmod cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c optional dtrace compile-with "${DTRACE_C}" \ warning "kernel contains CDDL licensed DTRACE" cddl/dev/dtmalloc/dtmalloc.c optional dtmalloc | dtraceall compile-with "${CDDL_C}" -cddl/dev/lockstat/lockstat.c optional dtrace_lockstat | dtraceall compile-with "${CDDL_C}" cddl/dev/profile/profile.c optional dtrace_profile | dtraceall compile-with "${CDDL_C}" cddl/dev/sdt/sdt.c optional dtrace_sdt | dtraceall compile-with "${CDDL_C}" cddl/dev/fbt/fbt.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/i386/conf/NOTES Sun Jul 19 22:14:09 2015 (r285703) @@ -22,7 +22,6 @@ options KDTRACE_HOOKS #device dtrace # DTrace modules -#device dtrace_lockstat #device dtrace_profile #device dtrace_sdt #device dtrace_fbt Modified: head/sys/kern/kern_lockstat.c ============================================================================== --- head/sys/kern/kern_lockstat.c Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/kern/kern_lockstat.c Sun Jul 19 22:14:09 2015 (r285703) @@ -21,31 +21,46 @@ * 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$ */ -/* - * Backend for the lock tracing (lockstat) kernel support. This is required - * to allow a module to load even though DTrace kernel support may not be - * present. - * - */ - -#ifdef KDTRACE_HOOKS +#include +__FBSDID("$FreeBSD$"); -#include +#include #include #include +#include #include -/* - * The following must match the type definition of dtrace_probe. It is - * defined this way to avoid having to rely on CDDL code. - */ -uint32_t lockstat_probemap[LS_NPROBES]; -void (*lockstat_probe_func)(uint32_t, uintptr_t, uintptr_t, - uintptr_t, uintptr_t, uintptr_t); +SDT_PROVIDER_DEFINE(lockstat); + +SDT_PROBE_DEFINE1(lockstat, , , adaptive__acquire, "struct mtx *"); +SDT_PROBE_DEFINE1(lockstat, , , adaptive__release, "struct mtx *"); +SDT_PROBE_DEFINE2(lockstat, , , adaptive__spin, "struct mtx *", "uint64_t"); +SDT_PROBE_DEFINE2(lockstat, , , adaptive__block, "struct mtx *", "uint64_t"); + +SDT_PROBE_DEFINE1(lockstat, , , spin__acquire, "struct mtx *"); +SDT_PROBE_DEFINE1(lockstat, , , spin__release, "struct mtx *"); +SDT_PROBE_DEFINE2(lockstat, , , spin__spin, "struct mtx *", "uint64_t"); + +SDT_PROBE_DEFINE1(lockstat, , , rw__acquire, "struct rwlock *"); +SDT_PROBE_DEFINE1(lockstat, , , rw__release, "struct rwlock *"); +SDT_PROBE_DEFINE5(lockstat, , , rw__block, "struct rwlock *", "uint64_t", "int", + "int", "int"); +SDT_PROBE_DEFINE2(lockstat, , , rw__spin, "struct rwlock *", "uint64_t"); +SDT_PROBE_DEFINE1(lockstat, , , rw__upgrade, "struct rwlock *"); +SDT_PROBE_DEFINE1(lockstat, , , rw__downgrade, "struct rwlock *"); + +SDT_PROBE_DEFINE1(lockstat, , , sx__acquire, "struct sx *"); +SDT_PROBE_DEFINE1(lockstat, , , sx__release, "struct sx *"); +SDT_PROBE_DEFINE5(lockstat, , , sx__block, "struct sx *", "uint64_t", "int", + "int", "int"); +SDT_PROBE_DEFINE2(lockstat, , , sx__spin, "struct sx *", "uint64_t"); +SDT_PROBE_DEFINE1(lockstat, , , sx__upgrade, "struct sx *"); +SDT_PROBE_DEFINE1(lockstat, , , sx__downgrade, "struct sx *"); + +SDT_PROBE_DEFINE2(lockstat, , , thread__spin, "struct mtx *", "uint64_t"); + int lockstat_enabled = 0; uint64_t @@ -64,5 +79,3 @@ lockstat_nsecs(struct lock_object *lo) ns += ((uint64_t)1000000000 * (uint32_t)(bt.frac >> 32)) >> 32; return (ns); } - -#endif /* KDTRACE_HOOKS */ Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/kern/kern_mutex.c Sun Jul 19 22:14:09 2015 (r285703) @@ -349,7 +349,7 @@ _mtx_trylock_flags_(volatile uintptr_t * file, line); curthread->td_locks++; if (m->mtx_recurse == 0) - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_LOCK_ACQUIRE, + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(adaptive__acquire, m, contested, waittime, file, line); } @@ -531,17 +531,17 @@ __mtx_lock_sleep(volatile uintptr_t *c, m->lock_object.lo_name, (void *)tid, file, line); } #endif - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_LOCK_ACQUIRE, m, contested, + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(adaptive__acquire, m, contested, waittime, file, line); #ifdef KDTRACE_HOOKS if (sleep_time) - LOCKSTAT_RECORD1(LS_MTX_LOCK_BLOCK, m, sleep_time); + LOCKSTAT_RECORD1(adaptive__block, m, sleep_time); /* * Only record the loops spinning and not sleeping. */ if (spin_cnt > sleep_cnt) - LOCKSTAT_RECORD1(LS_MTX_LOCK_SPIN, m, (all_time - sleep_time)); + LOCKSTAT_RECORD1(adaptive__spin, m, all_time - sleep_time); #endif } @@ -628,11 +628,11 @@ _mtx_lock_spin_cookie(volatile uintptr_t KTR_STATE0(KTR_SCHED, "thread", sched_tdname((struct thread *)tid), "running"); - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_SPIN_LOCK_ACQUIRE, m, - contested, waittime, (file), (line)); #ifdef KDTRACE_HOOKS + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, + contested, waittime, file, line); if (spin_time != 0) - LOCKSTAT_RECORD1(LS_MTX_SPIN_LOCK_SPIN, m, spin_time); + LOCKSTAT_RECORD1(spin__spin, m, spin_time); #endif } #endif /* SMP */ @@ -709,12 +709,12 @@ retry: spin_time += lockstat_nsecs(&m->lock_object); #endif if (m->mtx_recurse == 0) - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_SPIN_LOCK_ACQUIRE, - m, contested, waittime, (file), (line)); + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, + contested, waittime, file, line); LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file, line); WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line); - LOCKSTAT_RECORD1(LS_THREAD_LOCK_SPIN, m, spin_time); + LOCKSTAT_RECORD1(thread__spin, m, spin_time); } struct mtx * Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/kern/kern_rwlock.c Sun Jul 19 22:14:09 2015 (r285703) @@ -301,7 +301,7 @@ __rw_try_wlock(volatile uintptr_t *c, co WITNESS_LOCK(&rw->lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK, file, line); if (!rw_recursed(rw)) - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_RW_WLOCK_ACQUIRE, + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(rw__acquire, rw, 0, 0, file, line); curthread->td_locks++; } @@ -546,13 +546,13 @@ __rw_rlock(volatile uintptr_t *c, const #ifdef KDTRACE_HOOKS all_time += lockstat_nsecs(&rw->lock_object); if (sleep_time) - LOCKSTAT_RECORD4(LS_RW_RLOCK_BLOCK, rw, sleep_time, + LOCKSTAT_RECORD4(rw__block, rw, sleep_time, LOCKSTAT_READER, (state & RW_LOCK_READ) == 0, (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); /* Record only the loops spinning and not sleeping. */ if (spin_cnt > sleep_cnt) - LOCKSTAT_RECORD4(LS_RW_RLOCK_SPIN, rw, all_time - sleep_time, + LOCKSTAT_RECORD4(rw__spin, rw, all_time - sleep_time, LOCKSTAT_READER, (state & RW_LOCK_READ) == 0, (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); #endif @@ -561,7 +561,7 @@ __rw_rlock(volatile uintptr_t *c, const * however. turnstiles don't like owners changing between calls to * turnstile_wait() currently. */ - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_RW_RLOCK_ACQUIRE, rw, contested, + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(rw__acquire, rw, contested, waittime, file, line); LOCK_LOG_LOCK("RLOCK", &rw->lock_object, 0, 0, file, line); WITNESS_LOCK(&rw->lock_object, 0, file, line); @@ -594,7 +594,7 @@ __rw_try_rlock(volatile uintptr_t *c, co LOCK_LOG_TRY("RLOCK", &rw->lock_object, 0, 1, file, line); WITNESS_LOCK(&rw->lock_object, LOP_TRYLOCK, file, line); - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_RW_RLOCK_ACQUIRE, + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(rw__acquire, rw, 0, 0, file, line); curthread->td_locks++; curthread->td_rw_rlocks++; @@ -713,7 +713,7 @@ _rw_runlock_cookie(volatile uintptr_t *c turnstile_chain_unlock(&rw->lock_object); break; } - LOCKSTAT_PROFILE_RELEASE_LOCK(LS_RW_RUNLOCK_RELEASE, rw); + LOCKSTAT_PROFILE_RELEASE_LOCK(rw__release, rw); curthread->td_locks--; curthread->td_rw_rlocks--; } @@ -910,17 +910,17 @@ __rw_wlock_hard(volatile uintptr_t *c, u #ifdef KDTRACE_HOOKS all_time += lockstat_nsecs(&rw->lock_object); if (sleep_time) - LOCKSTAT_RECORD4(LS_RW_WLOCK_BLOCK, rw, sleep_time, + LOCKSTAT_RECORD4(rw__block, rw, sleep_time, LOCKSTAT_WRITER, (state & RW_LOCK_READ) == 0, (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); /* Record only the loops spinning and not sleeping. */ if (spin_cnt > sleep_cnt) - LOCKSTAT_RECORD4(LS_RW_WLOCK_SPIN, rw, all_time - sleep_time, + LOCKSTAT_RECORD4(rw__spin, rw, all_time - sleep_time, LOCKSTAT_READER, (state & RW_LOCK_READ) == 0, (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); #endif - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_RW_WLOCK_ACQUIRE, rw, contested, + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(rw__acquire, rw, contested, waittime, file, line); } @@ -1066,7 +1066,7 @@ __rw_try_upgrade(volatile uintptr_t *c, curthread->td_rw_rlocks--; WITNESS_UPGRADE(&rw->lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK, file, line); - LOCKSTAT_RECORD0(LS_RW_TRYUPGRADE_UPGRADE, rw); + LOCKSTAT_RECORD0(rw__upgrade, rw); } return (success); } @@ -1138,7 +1138,7 @@ __rw_downgrade(volatile uintptr_t *c, co out: curthread->td_rw_rlocks++; LOCK_LOG_LOCK("WDOWNGRADE", &rw->lock_object, 0, 0, file, line); - LOCKSTAT_RECORD0(LS_RW_DOWNGRADE_DOWNGRADE, rw); + LOCKSTAT_RECORD0(rw__downgrade, rw); } #ifdef INVARIANT_SUPPORT Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/kern/kern_sx.c Sun Jul 19 22:14:09 2015 (r285703) @@ -288,7 +288,7 @@ sx_try_slock_(struct sx *sx, const char if (atomic_cmpset_acq_ptr(&sx->sx_lock, x, x + SX_ONE_SHARER)) { LOCK_LOG_TRY("SLOCK", &sx->lock_object, 0, 1, file, line); WITNESS_LOCK(&sx->lock_object, LOP_TRYLOCK, file, line); - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_SLOCK_ACQUIRE, + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(sx__acquire, sx, 0, 0, file, line); curthread->td_locks++; return (1); @@ -351,7 +351,7 @@ sx_try_xlock_(struct sx *sx, const char WITNESS_LOCK(&sx->lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK, file, line); if (!sx_recursed(sx)) - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_XLOCK_ACQUIRE, + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(sx__acquire, sx, 0, 0, file, line); curthread->td_locks++; } @@ -420,7 +420,7 @@ sx_try_upgrade_(struct sx *sx, const cha if (success) { WITNESS_UPGRADE(&sx->lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK, file, line); - LOCKSTAT_RECORD0(LS_SX_TRYUPGRADE_UPGRADE, sx); + LOCKSTAT_RECORD0(sx__upgrade, sx); } return (success); } @@ -486,7 +486,7 @@ sx_downgrade_(struct sx *sx, const char sleepq_release(&sx->lock_object); LOCK_LOG_LOCK("XDOWNGRADE", &sx->lock_object, 0, 0, file, line); - LOCKSTAT_RECORD0(LS_SX_DOWNGRADE_DOWNGRADE, sx); + LOCKSTAT_RECORD0(sx__downgrade, sx); if (wakeup_swapper) kick_proc0(); @@ -719,16 +719,16 @@ _sx_xlock_hard(struct sx *sx, uintptr_t #ifdef KDTRACE_HOOKS all_time += lockstat_nsecs(&sx->lock_object); if (sleep_time) - LOCKSTAT_RECORD4(LS_SX_XLOCK_BLOCK, sx, sleep_time, + LOCKSTAT_RECORD4(sx__block, sx, sleep_time, LOCKSTAT_WRITER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); if (spin_cnt > sleep_cnt) - LOCKSTAT_RECORD4(LS_SX_XLOCK_SPIN, sx, all_time - sleep_time, + LOCKSTAT_RECORD4(sx__spin, sx, all_time - sleep_time, LOCKSTAT_WRITER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); #endif if (!error) - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_XLOCK_ACQUIRE, sx, + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(sx__acquire, sx, contested, waittime, file, line); GIANT_RESTORE(); return (error); @@ -983,17 +983,17 @@ _sx_slock_hard(struct sx *sx, int opts, #ifdef KDTRACE_HOOKS all_time += lockstat_nsecs(&sx->lock_object); if (sleep_time) - LOCKSTAT_RECORD4(LS_SX_SLOCK_BLOCK, sx, sleep_time, + LOCKSTAT_RECORD4(sx__block, sx, sleep_time, LOCKSTAT_READER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); if (spin_cnt > sleep_cnt) - LOCKSTAT_RECORD4(LS_SX_SLOCK_SPIN, sx, all_time - sleep_time, + LOCKSTAT_RECORD4(sx__spin, sx, all_time - sleep_time, LOCKSTAT_READER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); #endif if (error == 0) - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_SLOCK_ACQUIRE, sx, - contested, waittime, file, line); + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(sx__acquire, sx, contested, + waittime, file, line); GIANT_RESTORE(); return (error); } Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/modules/dtrace/Makefile Sun Jul 19 22:14:09 2015 (r285703) @@ -7,7 +7,6 @@ SUBDIR= dtmalloc \ dtrace \ dtraceall \ dtrace_test \ - lockstat \ profile \ prototype \ sdt \ Modified: head/sys/modules/dtrace/Makefile.inc ============================================================================== --- head/sys/modules/dtrace/Makefile.inc Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/modules/dtrace/Makefile.inc Sun Jul 19 22:14:09 2015 (r285703) @@ -6,7 +6,6 @@ load : -kldload dtrace .if ${MACHINE_CPUARCH} == "i386" -kldload sdt - -kldload lockstat -kldload fbt -kldload prototype .endif @@ -20,7 +19,6 @@ unload : .if ${MACHINE_CPUARCH} == "i386" -kldunload prototype -kldunload fbt - -kldunload lockstat -kldunload sdt .endif -kldunload dtrace Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c ============================================================================== --- head/sys/modules/dtrace/dtraceall/dtraceall.c Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Sun Jul 19 22:14:09 2015 (r285703) @@ -76,7 +76,6 @@ MODULE_DEPEND(dtraceall, fbt, 1, 1, 1); #if defined(__amd64__) || defined(__i386__) MODULE_DEPEND(dtraceall, fasttrap, 1, 1, 1); #endif -MODULE_DEPEND(dtraceall, lockstat, 1, 1, 1); MODULE_DEPEND(dtraceall, sdt, 1, 1, 1); MODULE_DEPEND(dtraceall, systrace, 1, 1, 1); #if defined(COMPAT_FREEBSD32) Modified: head/sys/powerpc/conf/NOTES ============================================================================== --- head/sys/powerpc/conf/NOTES Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/powerpc/conf/NOTES Sun Jul 19 22:14:09 2015 (r285703) @@ -14,7 +14,6 @@ options KDTRACE_HOOKS #device dtrace # DTrace modules -#device dtrace_lockstat #device dtrace_profile #device dtrace_sdt #device dtrace_fbt Modified: head/sys/sys/lockstat.h ============================================================================== --- head/sys/sys/lockstat.h Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/sys/lockstat.h Sun Jul 19 22:14:09 2015 (r285703) @@ -27,185 +27,81 @@ /* * DTrace lockstat provider definitions - * */ -#ifndef _SYS_LOCKSTAT_H +#ifndef _SYS_LOCKSTAT_H #define _SYS_LOCKSTAT_H -#ifdef _KERNEL +#ifdef _KERNEL -/* - * Spin Locks - */ -#define LS_MTX_SPIN_LOCK_ACQUIRE 0 -#define LS_MTX_SPIN_UNLOCK_RELEASE 1 -#define LS_MTX_SPIN_LOCK_SPIN 2 +#include +#include +#include + +SDT_PROVIDER_DECLARE(lockstat); + +SDT_PROBE_DECLARE(lockstat, , , adaptive__acquire); +SDT_PROBE_DECLARE(lockstat, , , adaptive__release); +SDT_PROBE_DECLARE(lockstat, , , adaptive__spin); +SDT_PROBE_DECLARE(lockstat, , , adaptive__block); + +SDT_PROBE_DECLARE(lockstat, , , spin__acquire); +SDT_PROBE_DECLARE(lockstat, , , spin__release); +SDT_PROBE_DECLARE(lockstat, , , spin__spin); + +SDT_PROBE_DECLARE(lockstat, , , rw__acquire); +SDT_PROBE_DECLARE(lockstat, , , rw__release); +SDT_PROBE_DECLARE(lockstat, , , rw__block); +SDT_PROBE_DECLARE(lockstat, , , rw__spin); +SDT_PROBE_DECLARE(lockstat, , , rw__upgrade); +SDT_PROBE_DECLARE(lockstat, , , rw__downgrade); + +SDT_PROBE_DECLARE(lockstat, , , sx__acquire); +SDT_PROBE_DECLARE(lockstat, , , sx__release); +SDT_PROBE_DECLARE(lockstat, , , sx__block); +SDT_PROBE_DECLARE(lockstat, , , sx__spin); +SDT_PROBE_DECLARE(lockstat, , , sx__upgrade); +SDT_PROBE_DECLARE(lockstat, , , sx__downgrade); -/* - * Adaptive Locks - */ -#define LS_MTX_LOCK_ACQUIRE 3 -#define LS_MTX_UNLOCK_RELEASE 4 -#define LS_MTX_LOCK_SPIN 5 -#define LS_MTX_LOCK_BLOCK 6 -#define LS_MTX_TRYLOCK_ACQUIRE 7 +SDT_PROBE_DECLARE(lockstat, , , thread__spin); -/* - * Reader/Writer Locks - */ -#define LS_RW_RLOCK_ACQUIRE 8 -#define LS_RW_RUNLOCK_RELEASE 9 -#define LS_RW_WLOCK_ACQUIRE 10 -#define LS_RW_WUNLOCK_RELEASE 11 -#define LS_RW_RLOCK_SPIN 12 -#define LS_RW_RLOCK_BLOCK 13 -#define LS_RW_WLOCK_SPIN 14 -#define LS_RW_WLOCK_BLOCK 15 -#define LS_RW_TRYUPGRADE_UPGRADE 16 -#define LS_RW_DOWNGRADE_DOWNGRADE 17 +#define LOCKSTAT_WRITER 0 +#define LOCKSTAT_READER 1 -/* - * Shared/Exclusive Locks - */ -#define LS_SX_SLOCK_ACQUIRE 18 -#define LS_SX_SUNLOCK_RELEASE 19 -#define LS_SX_XLOCK_ACQUIRE 20 -#define LS_SX_XUNLOCK_RELEASE 21 -#define LS_SX_SLOCK_SPIN 22 -#define LS_SX_SLOCK_BLOCK 23 -#define LS_SX_XLOCK_SPIN 24 -#define LS_SX_XLOCK_BLOCK 25 -#define LS_SX_TRYUPGRADE_UPGRADE 26 -#define LS_SX_DOWNGRADE_DOWNGRADE 27 +#ifdef KDTRACE_HOOKS -/* - * Thread Locks - */ -#define LS_THREAD_LOCK_SPIN 28 +#define LOCKSTAT_RECORD0(probe, lp) \ + SDT_PROBE1(lockstat, , , probe, lp) -/* - * Lockmanager Locks - * According to locking(9) Lockmgr locks are "Largely deprecated" - * so no support for these have been added in the lockstat provider. - */ +#define LOCKSTAT_RECORD1(probe, lp, arg1) \ + SDT_PROBE2(lockstat, , , probe, lp, arg1) -#define LS_NPROBES 29 +#define LOCKSTAT_RECORD2(probe, lp, arg1, arg2) \ + SDT_PROBE3(lockstat, , , probe, lp, arg1, arg2) -#define LS_MTX_LOCK "mtx_lock" -#define LS_MTX_UNLOCK "mtx_unlock" -#define LS_MTX_SPIN_LOCK "mtx_lock_spin" -#define LS_MTX_SPIN_UNLOCK "mtx_unlock_spin" -#define LS_MTX_TRYLOCK "mtx_trylock" -#define LS_RW_RLOCK "rw_rlock" -#define LS_RW_WLOCK "rw_wlock" -#define LS_RW_RUNLOCK "rw_runlock" -#define LS_RW_WUNLOCK "rw_wunlock" -#define LS_RW_TRYUPGRADE "rw_try_upgrade" -#define LS_RW_DOWNGRADE "rw_downgrade" -#define LS_SX_SLOCK "sx_slock" -#define LS_SX_XLOCK "sx_xlock" -#define LS_SX_SUNLOCK "sx_sunlock" -#define LS_SX_XUNLOCK "sx_xunlock" -#define LS_SX_TRYUPGRADE "sx_try_upgrade" -#define LS_SX_DOWNGRADE "sx_downgrade" -#define LS_THREAD_LOCK "thread_lock" - -#define LS_ACQUIRE "acquire" -#define LS_RELEASE "release" -#define LS_SPIN "spin" -#define LS_BLOCK "block" -#define LS_UPGRADE "upgrade" -#define LS_DOWNGRADE "downgrade" - -#define LS_TYPE_ADAPTIVE "adaptive" -#define LS_TYPE_SPIN "spin" -#define LS_TYPE_THREAD "thread" -#define LS_TYPE_RW "rw" -#define LS_TYPE_SX "sx" - -#define LSA_ACQUIRE (LS_TYPE_ADAPTIVE "-" LS_ACQUIRE) -#define LSA_RELEASE (LS_TYPE_ADAPTIVE "-" LS_RELEASE) -#define LSA_SPIN (LS_TYPE_ADAPTIVE "-" LS_SPIN) -#define LSA_BLOCK (LS_TYPE_ADAPTIVE "-" LS_BLOCK) -#define LSS_ACQUIRE (LS_TYPE_SPIN "-" LS_ACQUIRE) -#define LSS_RELEASE (LS_TYPE_SPIN "-" LS_RELEASE) -#define LSS_SPIN (LS_TYPE_SPIN "-" LS_SPIN) -#define LSR_ACQUIRE (LS_TYPE_RW "-" LS_ACQUIRE) -#define LSR_RELEASE (LS_TYPE_RW "-" LS_RELEASE) -#define LSR_BLOCK (LS_TYPE_RW "-" LS_BLOCK) -#define LSR_SPIN (LS_TYPE_RW "-" LS_SPIN) -#define LSR_UPGRADE (LS_TYPE_RW "-" LS_UPGRADE) -#define LSR_DOWNGRADE (LS_TYPE_RW "-" LS_DOWNGRADE) -#define LSX_ACQUIRE (LS_TYPE_SX "-" LS_ACQUIRE) -#define LSX_RELEASE (LS_TYPE_SX "-" LS_RELEASE) -#define LSX_BLOCK (LS_TYPE_SX "-" LS_BLOCK) -#define LSX_SPIN (LS_TYPE_SX "-" LS_SPIN) -#define LSX_UPGRADE (LS_TYPE_SX "-" LS_UPGRADE) -#define LSX_DOWNGRADE (LS_TYPE_SX "-" LS_DOWNGRADE) -#define LST_SPIN (LS_TYPE_THREAD "-" LS_SPIN) +#define LOCKSTAT_RECORD3(probe, lp, arg1, arg2, arg3) \ + SDT_PROBE4(lockstat, , , probe, lp, arg1, arg2, arg3) -/* - * The following must match the type definition of dtrace_probe. It is - * defined this way to avoid having to rely on CDDL code. - */ -struct lock_object; -extern uint32_t lockstat_probemap[LS_NPROBES]; -typedef void (*lockstat_probe_func_t)(uint32_t, uintptr_t arg0, uintptr_t arg1, - uintptr_t arg2, uintptr_t arg3, uintptr_t arg4); -extern lockstat_probe_func_t lockstat_probe_func; -extern uint64_t lockstat_nsecs(struct lock_object *); -extern int lockstat_enabled; +#define LOCKSTAT_RECORD4(probe, lp, arg1, arg2, arg3, arg4) \ + SDT_PROBE5(lockstat, , , probe, lp, arg1, arg2, arg3, arg4) -#ifdef KDTRACE_HOOKS -/* - * Macros to record lockstat probes. - */ -#define LOCKSTAT_RECORD4(probe, lp, arg1, arg2, arg3, arg4) do { \ - uint32_t id; \ - \ - if ((id = lockstat_probemap[(probe)])) \ - (*lockstat_probe_func)(id, (uintptr_t)(lp), (arg1), (arg2), \ - (arg3), (arg4)); \ +#define LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(probe, lp, c, wt, f, l) do { \ + lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt, f, l); \ + LOCKSTAT_RECORD0(probe, lp); \ } while (0) -#define LOCKSTAT_RECORD(probe, lp, arg1) \ - LOCKSTAT_RECORD4(probe, lp, arg1, 0, 0, 0) - -#define LOCKSTAT_RECORD0(probe, lp) \ - LOCKSTAT_RECORD4(probe, lp, 0, 0, 0, 0) - -#define LOCKSTAT_RECORD1(probe, lp, arg1) \ - LOCKSTAT_RECORD4(probe, lp, arg1, 0, 0, 0) - -#define LOCKSTAT_RECORD2(probe, lp, arg1, arg2) \ - LOCKSTAT_RECORD4(probe, lp, arg1, arg2, 0, 0) - -#define LOCKSTAT_RECORD3(probe, lp, arg1, arg2, arg3) \ - LOCKSTAT_RECORD4(probe, lp, arg1, arg2, arg3, 0) - -#define LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(probe, lp, c, wt, f, l) do { \ - uint32_t id; \ - \ - lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt, f, l); \ - if ((id = lockstat_probemap[(probe)])) \ - (*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0, 0, 0); \ +#define LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) do { \ + lock_profile_release_lock(&(lp)->lock_object); \ + LOCKSTAT_RECORD0(probe, lp); \ } while (0) -#define LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) do { \ - uint32_t id; \ - \ - lock_profile_release_lock(&(lp)->lock_object); \ - if ((id = lockstat_probemap[(probe)])) \ - (*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0, 0, 0); \ -} while (0) +extern int lockstat_enabled; -#define LOCKSTAT_WRITER 0 -#define LOCKSTAT_READER 1 +struct lock_object; +extern uint64_t lockstat_nsecs(struct lock_object *); -#else /* !KDTRACE_HOOKS */ +#else /* !KDTRACE_HOOKS */ -#define LOCKSTAT_RECORD(probe, lp, arg1) #define LOCKSTAT_RECORD0(probe, lp) #define LOCKSTAT_RECORD1(probe, lp, arg1) #define LOCKSTAT_RECORD2(probe, lp, arg1, arg2) @@ -218,8 +114,6 @@ extern int lockstat_enabled; #define LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) \ lock_profile_release_lock(&(lp)->lock_object) -#endif /* !KDTRACE_HOOKS */ - -#endif /* _KERNEL */ - -#endif /* _SYS_LOCKSTAT_H */ +#endif /* !KDTRACE_HOOKS */ +#endif /* _KERNEL */ +#endif /* _SYS_LOCKSTAT_H */ Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/sys/mutex.h Sun Jul 19 22:14:09 2015 (r285703) @@ -188,8 +188,8 @@ void thread_lock_flags_(struct thread *, if (!_mtx_obtain_lock((mp), _tid)) \ _mtx_lock_sleep((mp), _tid, (opts), (file), (line)); \ else \ - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_LOCK_ACQUIRE, \ - mp, 0, 0, (file), (line)); \ + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(adaptive__acquire, \ + mp, 0, 0, file, line); \ } while (0) /* @@ -209,8 +209,8 @@ void thread_lock_flags_(struct thread *, else \ _mtx_lock_spin((mp), _tid, (opts), (file), (line)); \ } else \ - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_SPIN_LOCK_ACQUIRE, \ - mp, 0, 0, (file), (line)); \ + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, \ + mp, 0, 0, file, line); \ } while (0) #else /* SMP */ #define __mtx_lock_spin(mp, tid, opts, file, line) do { \ @@ -231,8 +231,7 @@ void thread_lock_flags_(struct thread *, uintptr_t _tid = (uintptr_t)(tid); \ \ if ((mp)->mtx_recurse == 0) \ - LOCKSTAT_PROFILE_RELEASE_LOCK(LS_MTX_UNLOCK_RELEASE, \ - (mp)); \ + LOCKSTAT_PROFILE_RELEASE_LOCK(adaptive__release, mp); \ if (!_mtx_release_lock((mp), _tid)) \ _mtx_unlock_sleep((mp), (opts), (file), (line)); \ } while (0) @@ -252,21 +251,19 @@ void thread_lock_flags_(struct thread *, if (mtx_recursed((mp))) \ (mp)->mtx_recurse--; \ else { \ - LOCKSTAT_PROFILE_RELEASE_LOCK(LS_MTX_SPIN_UNLOCK_RELEASE, \ - mp); \ + LOCKSTAT_PROFILE_RELEASE_LOCK(spin__release, mp); \ _mtx_release_lock_quick((mp)); \ - } \ - spinlock_exit(); \ + } \ + spinlock_exit(); \ } while (0) #else /* SMP */ #define __mtx_unlock_spin(mp) do { \ if (mtx_recursed((mp))) \ (mp)->mtx_recurse--; \ else { \ - LOCKSTAT_PROFILE_RELEASE_LOCK(LS_MTX_SPIN_UNLOCK_RELEASE, \ - mp); \ + LOCKSTAT_PROFILE_RELEASE_LOCK(spin__release, mp); \ (mp)->mtx_lock = MTX_UNOWNED; \ - } \ + } \ spinlock_exit(); \ } while (0) #endif /* SMP */ Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/sys/rwlock.h Sun Jul 19 22:14:09 2015 (r285703) @@ -95,12 +95,12 @@ /* Acquire a write lock. */ #define __rw_wlock(rw, tid, file, line) do { \ uintptr_t _tid = (uintptr_t)(tid); \ - \ + \ if (!_rw_write_lock((rw), _tid)) \ _rw_wlock_hard((rw), _tid, (file), (line)); \ else \ - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_RW_WLOCK_ACQUIRE, \ - rw, 0, 0, (file), (line)); \ + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(rw__acquire, rw, \ + 0, 0, file, line); \ } while (0) /* Release a write lock. */ @@ -110,8 +110,7 @@ if ((rw)->rw_recurse) \ (rw)->rw_recurse--; \ else { \ - LOCKSTAT_PROFILE_RELEASE_LOCK(LS_RW_WUNLOCK_RELEASE, \ - (rw)); \ + LOCKSTAT_PROFILE_RELEASE_LOCK(rw__release, rw); \ if (!_rw_write_unlock((rw), _tid)) \ _rw_wunlock_hard((rw), _tid, (file), (line)); \ } \ Modified: head/sys/sys/sx.h ============================================================================== --- head/sys/sys/sx.h Sun Jul 19 21:31:52 2015 (r285702) +++ head/sys/sys/sx.h Sun Jul 19 22:14:09 2015 (r285703) @@ -153,8 +153,8 @@ __sx_xlock(struct sx *sx, struct thread if (!atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) error = _sx_xlock_hard(sx, tid, opts, file, line); else - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_XLOCK_ACQUIRE, - sx, 0, 0, file, line); + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(sx__acquire, sx, + 0, 0, file, line); return (error); } @@ -166,7 +166,7 @@ __sx_xunlock(struct sx *sx, struct threa uintptr_t tid = (uintptr_t)td; if (sx->sx_recurse == 0) - LOCKSTAT_PROFILE_RELEASE_LOCK(LS_SX_XUNLOCK_RELEASE, sx); + LOCKSTAT_PROFILE_RELEASE_LOCK(sx__release, sx); if (!atomic_cmpset_rel_ptr(&sx->sx_lock, tid, SX_LOCK_UNLOCKED)) _sx_xunlock_hard(sx, tid, file, line); } @@ -182,8 +182,8 @@ __sx_slock(struct sx *sx, int opts, cons !atomic_cmpset_acq_ptr(&sx->sx_lock, x, x + SX_ONE_SHARER)) error = _sx_slock_hard(sx, opts, file, line); else - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_SLOCK_ACQUIRE, sx, 0, - 0, file, line); + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(sx__acquire, sx, + 0, 0, file, line); return (error); } @@ -200,7 +200,7 @@ __sx_sunlock(struct sx *sx, const char * { uintptr_t x = sx->sx_lock; - LOCKSTAT_PROFILE_RELEASE_LOCK(LS_SX_SUNLOCK_RELEASE, sx); + LOCKSTAT_PROFILE_RELEASE_LOCK(sx__release, sx); if (x == (SX_SHARERS_LOCK(1) | SX_LOCK_EXCLUSIVE_WAITERS) || !atomic_cmpset_rel_ptr(&sx->sx_lock, x, x - SX_ONE_SHARER)) _sx_sunlock_hard(sx, file, line); From owner-svn-src-head@freebsd.org Sun Jul 19 22:24:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F32E29A47A4; Sun, 19 Jul 2015 22:24:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E28DF101A; Sun, 19 Jul 2015 22:24:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JMOa6f006066; Sun, 19 Jul 2015 22:24:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JMOYvO006057; Sun, 19 Jul 2015 22:24:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201507192224.t6JMOYvO006057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 19 Jul 2015 22:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285704 - in head: cddl/contrib/opensolaris/cmd/lockstat sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 22:24:37 -0000 Author: markj Date: Sun Jul 19 22:24:33 2015 New Revision: 285704 URL: https://svnweb.freebsd.org/changeset/base/285704 Log: Consistently use a reader/writer flag for lockstat probes in rwlock(9) and sx(9), rather than using the probe function name to determine whether a given lock is a read lock or a write lock. Update lockstat(1) accordingly. Modified: head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c head/sys/kern/kern_lockstat.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/sys/lockstat.h head/sys/sys/rwlock.h head/sys/sys/sx.h Modified: head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c Sun Jul 19 22:14:09 2015 (r285703) +++ head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c Sun Jul 19 22:24:33 2015 (r285704) @@ -196,17 +196,17 @@ static ls_event_info_t g_event_info[LS_M "lockstat:::spin-release", NULL, "lockstat:::spin-acquire" }, { 'H', "Lock", "R/W writer hold", "nsec", - "lockstat::rw_wunlock:rw-release", NULL, - "lockstat::rw_wlock:rw-acquire" }, + "lockstat:::rw-release", "arg1 == 0", + "lockstat:::rw-acquire" }, { 'H', "Lock", "R/W reader hold", "nsec", - "lockstat::rw_runlock:rw-release", NULL, - "lockstat::rw_rlock:rw-acquire" }, + "lockstat:::rw-release", "arg1 == 1", + "lockstat:::rw-acquire" }, { 'H', "Lock", "SX shared hold", "nsec", - "lockstat::sx_sunlock:sx-release", NULL, - "lockstat::sx_slock:sx-acquire" }, + "lockstat:::sx-release", "arg1 == 0", + "lockstat:::sx-acquire" }, { 'H', "Lock", "SX exclusive hold", "nsec", - "lockstat::sx_xunlock:sx-release", NULL, - "lockstat::sx_xlock:sx-acquire" }, + "lockstat:::sx-release", "arg1 == 1", + "lockstat:::sx-acquire" }, { 'H', "Lock", "Unknown event (type 38)", "units" }, { 'H', "Lock", "Unknown event (type 39)", "units" }, { 'H', "Lock", "Unknown event (type 40)", "units" }, Modified: head/sys/kern/kern_lockstat.c ============================================================================== --- head/sys/kern/kern_lockstat.c Sun Jul 19 22:14:09 2015 (r285703) +++ head/sys/kern/kern_lockstat.c Sun Jul 19 22:24:33 2015 (r285704) @@ -43,16 +43,16 @@ SDT_PROBE_DEFINE1(lockstat, , , spin__ac SDT_PROBE_DEFINE1(lockstat, , , spin__release, "struct mtx *"); SDT_PROBE_DEFINE2(lockstat, , , spin__spin, "struct mtx *", "uint64_t"); -SDT_PROBE_DEFINE1(lockstat, , , rw__acquire, "struct rwlock *"); -SDT_PROBE_DEFINE1(lockstat, , , rw__release, "struct rwlock *"); +SDT_PROBE_DEFINE2(lockstat, , , rw__acquire, "struct rwlock *", "int"); +SDT_PROBE_DEFINE2(lockstat, , , rw__release, "struct rwlock *", "int"); SDT_PROBE_DEFINE5(lockstat, , , rw__block, "struct rwlock *", "uint64_t", "int", "int", "int"); SDT_PROBE_DEFINE2(lockstat, , , rw__spin, "struct rwlock *", "uint64_t"); SDT_PROBE_DEFINE1(lockstat, , , rw__upgrade, "struct rwlock *"); SDT_PROBE_DEFINE1(lockstat, , , rw__downgrade, "struct rwlock *"); -SDT_PROBE_DEFINE1(lockstat, , , sx__acquire, "struct sx *"); -SDT_PROBE_DEFINE1(lockstat, , , sx__release, "struct sx *"); +SDT_PROBE_DEFINE2(lockstat, , , sx__acquire, "struct sx *", "int"); +SDT_PROBE_DEFINE2(lockstat, , , sx__release, "struct sx *", "int"); SDT_PROBE_DEFINE5(lockstat, , , sx__block, "struct sx *", "uint64_t", "int", "int", "int"); SDT_PROBE_DEFINE2(lockstat, , , sx__spin, "struct sx *", "uint64_t"); Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sun Jul 19 22:14:09 2015 (r285703) +++ head/sys/kern/kern_rwlock.c Sun Jul 19 22:24:33 2015 (r285704) @@ -301,8 +301,8 @@ __rw_try_wlock(volatile uintptr_t *c, co WITNESS_LOCK(&rw->lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK, file, line); if (!rw_recursed(rw)) - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(rw__acquire, - rw, 0, 0, file, line); + LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, + rw, 0, 0, file, line, LOCKSTAT_WRITER); curthread->td_locks++; } return (rval); @@ -561,8 +561,8 @@ __rw_rlock(volatile uintptr_t *c, const * however. turnstiles don't like owners changing between calls to * turnstile_wait() currently. */ - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(rw__acquire, rw, contested, - waittime, file, line); + LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, rw, contested, + waittime, file, line, LOCKSTAT_READER); LOCK_LOG_LOCK("RLOCK", &rw->lock_object, 0, 0, file, line); WITNESS_LOCK(&rw->lock_object, 0, file, line); curthread->td_locks++; @@ -594,8 +594,8 @@ __rw_try_rlock(volatile uintptr_t *c, co LOCK_LOG_TRY("RLOCK", &rw->lock_object, 0, 1, file, line); WITNESS_LOCK(&rw->lock_object, LOP_TRYLOCK, file, line); - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(rw__acquire, - rw, 0, 0, file, line); + LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, + rw, 0, 0, file, line, LOCKSTAT_READER); curthread->td_locks++; curthread->td_rw_rlocks++; return (1); @@ -713,7 +713,7 @@ _rw_runlock_cookie(volatile uintptr_t *c turnstile_chain_unlock(&rw->lock_object); break; } - LOCKSTAT_PROFILE_RELEASE_LOCK(rw__release, rw); + LOCKSTAT_PROFILE_RELEASE_RWLOCK(rw__release, rw, LOCKSTAT_READER); curthread->td_locks--; curthread->td_rw_rlocks--; } @@ -920,8 +920,8 @@ __rw_wlock_hard(volatile uintptr_t *c, u LOCKSTAT_READER, (state & RW_LOCK_READ) == 0, (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); #endif - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(rw__acquire, rw, contested, - waittime, file, line); + LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, rw, contested, + waittime, file, line, LOCKSTAT_WRITER); } /* Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sun Jul 19 22:14:09 2015 (r285703) +++ head/sys/kern/kern_sx.c Sun Jul 19 22:24:33 2015 (r285704) @@ -288,8 +288,8 @@ sx_try_slock_(struct sx *sx, const char if (atomic_cmpset_acq_ptr(&sx->sx_lock, x, x + SX_ONE_SHARER)) { LOCK_LOG_TRY("SLOCK", &sx->lock_object, 0, 1, file, line); WITNESS_LOCK(&sx->lock_object, LOP_TRYLOCK, file, line); - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(sx__acquire, - sx, 0, 0, file, line); + LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, + sx, 0, 0, file, line, LOCKSTAT_READER); curthread->td_locks++; return (1); } @@ -351,8 +351,8 @@ sx_try_xlock_(struct sx *sx, const char WITNESS_LOCK(&sx->lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK, file, line); if (!sx_recursed(sx)) - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(sx__acquire, - sx, 0, 0, file, line); + LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, + sx, 0, 0, file, line, LOCKSTAT_WRITER); curthread->td_locks++; } @@ -728,8 +728,8 @@ _sx_xlock_hard(struct sx *sx, uintptr_t (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); #endif if (!error) - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(sx__acquire, sx, - contested, waittime, file, line); + LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, + contested, waittime, file, line, LOCKSTAT_WRITER); GIANT_RESTORE(); return (error); } @@ -992,8 +992,8 @@ _sx_slock_hard(struct sx *sx, int opts, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); #endif if (error == 0) - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(sx__acquire, sx, contested, - waittime, file, line); + LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, + contested, waittime, file, line, LOCKSTAT_READER); GIANT_RESTORE(); return (error); } Modified: head/sys/sys/lockstat.h ============================================================================== --- head/sys/sys/lockstat.h Sun Jul 19 22:14:09 2015 (r285703) +++ head/sys/sys/lockstat.h Sun Jul 19 22:24:33 2015 (r285704) @@ -90,15 +90,25 @@ SDT_PROBE_DECLARE(lockstat, , , thread__ LOCKSTAT_RECORD0(probe, lp); \ } while (0) +#define LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(probe, lp, c, wt, f, l, a) do { \ + lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt, f, l); \ + LOCKSTAT_RECORD1(probe, lp, a); \ +} while (0) + #define LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) do { \ lock_profile_release_lock(&(lp)->lock_object); \ LOCKSTAT_RECORD0(probe, lp); \ } while (0) +#define LOCKSTAT_PROFILE_RELEASE_RWLOCK(probe, lp, a) do { \ + lock_profile_release_lock(&(lp)->lock_object); \ + LOCKSTAT_RECORD1(probe, lp, a); \ +} while (0) + extern int lockstat_enabled; struct lock_object; -extern uint64_t lockstat_nsecs(struct lock_object *); +uint64_t lockstat_nsecs(struct lock_object *); #else /* !KDTRACE_HOOKS */ @@ -111,9 +121,15 @@ extern uint64_t lockstat_nsecs(struct lo #define LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(probe, lp, c, wt, f, l) \ lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt, f, l) +#define LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(probe, lp, c, wt, f, l, a) \ + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(probe, lp, c, wt, f, l) + #define LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) \ lock_profile_release_lock(&(lp)->lock_object) +#define LOCKSTAT_PROFILE_RELEASE_RWLOCK(probe, lp, a) \ + LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) + #endif /* !KDTRACE_HOOKS */ #endif /* _KERNEL */ #endif /* _SYS_LOCKSTAT_H */ Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Sun Jul 19 22:14:09 2015 (r285703) +++ head/sys/sys/rwlock.h Sun Jul 19 22:24:33 2015 (r285704) @@ -99,8 +99,8 @@ if (!_rw_write_lock((rw), _tid)) \ _rw_wlock_hard((rw), _tid, (file), (line)); \ else \ - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(rw__acquire, rw, \ - 0, 0, file, line); \ + LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, rw, \ + 0, 0, file, line, LOCKSTAT_WRITER); \ } while (0) /* Release a write lock. */ @@ -110,7 +110,8 @@ if ((rw)->rw_recurse) \ (rw)->rw_recurse--; \ else { \ - LOCKSTAT_PROFILE_RELEASE_LOCK(rw__release, rw); \ + LOCKSTAT_PROFILE_RELEASE_RWLOCK(rw__release, rw, \ + LOCKSTAT_WRITER); \ if (!_rw_write_unlock((rw), _tid)) \ _rw_wunlock_hard((rw), _tid, (file), (line)); \ } \ Modified: head/sys/sys/sx.h ============================================================================== --- head/sys/sys/sx.h Sun Jul 19 22:14:09 2015 (r285703) +++ head/sys/sys/sx.h Sun Jul 19 22:24:33 2015 (r285704) @@ -153,8 +153,8 @@ __sx_xlock(struct sx *sx, struct thread if (!atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) error = _sx_xlock_hard(sx, tid, opts, file, line); else - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(sx__acquire, sx, - 0, 0, file, line); + LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, + 0, 0, file, line, LOCKSTAT_WRITER); return (error); } @@ -166,7 +166,8 @@ __sx_xunlock(struct sx *sx, struct threa uintptr_t tid = (uintptr_t)td; if (sx->sx_recurse == 0) - LOCKSTAT_PROFILE_RELEASE_LOCK(sx__release, sx); + LOCKSTAT_PROFILE_RELEASE_RWLOCK(sx__release, sx, + LOCKSTAT_WRITER); if (!atomic_cmpset_rel_ptr(&sx->sx_lock, tid, SX_LOCK_UNLOCKED)) _sx_xunlock_hard(sx, tid, file, line); } @@ -182,8 +183,8 @@ __sx_slock(struct sx *sx, int opts, cons !atomic_cmpset_acq_ptr(&sx->sx_lock, x, x + SX_ONE_SHARER)) error = _sx_slock_hard(sx, opts, file, line); else - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(sx__acquire, sx, - 0, 0, file, line); + LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, + 0, 0, file, line, LOCKSTAT_READER); return (error); } @@ -200,7 +201,7 @@ __sx_sunlock(struct sx *sx, const char * { uintptr_t x = sx->sx_lock; - LOCKSTAT_PROFILE_RELEASE_LOCK(sx__release, sx); + LOCKSTAT_PROFILE_RELEASE_RWLOCK(sx__release, sx, LOCKSTAT_READER); if (x == (SX_SHARERS_LOCK(1) | SX_LOCK_EXCLUSIVE_WAITERS) || !atomic_cmpset_rel_ptr(&sx->sx_lock, x, x - SX_ONE_SHARER)) _sx_sunlock_hard(sx, file, line); From owner-svn-src-head@freebsd.org Sun Jul 19 22:25:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 713A99A47E2; Sun, 19 Jul 2015 22:25:17 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61FF11171; Sun, 19 Jul 2015 22:25:17 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JMPH1A006146; Sun, 19 Jul 2015 22:25:17 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JMPHFt006145; Sun, 19 Jul 2015 22:25:17 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201507192225.t6JMPHFt006145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 19 Jul 2015 22:25:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285705 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 22:25:17 -0000 Author: mckusick Date: Sun Jul 19 22:25:16 2015 New Revision: 285705 URL: https://svnweb.freebsd.org/changeset/base/285705 Log: Restructure code for readability improvement. No functional change. Reviewed by: kib Modified: head/sys/kern/kern_intr.c Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Sun Jul 19 22:24:33 2015 (r285704) +++ head/sys/kern/kern_intr.c Sun Jul 19 22:25:16 2015 (r285705) @@ -1231,17 +1231,14 @@ intr_event_execute_handlers(struct proc * For software interrupt threads, we only execute * handlers that have their need flag set. Hardware * interrupt threads always invoke all of their handlers. + * + * ih_need can only be 0 or 1. Failed cmpset below + * means that there is no request to execute handlers, + * so a retry of the cmpset is not needed. */ - if ((ie->ie_flags & IE_SOFT) != 0) { - /* - * ih_need can only be 0 or 1. Failed cmpset - * below means that there is no request to - * execute handlers, so a retry of the cmpset - * is not needed. - */ - if (atomic_cmpset_int(&ih->ih_need, 1, 0) == 0) - continue; - } + if ((ie->ie_flags & IE_SOFT) != 0 && + atomic_cmpset_int(&ih->ih_need, 1, 0) == 0) + continue; /* Execute this handler. */ CTR6(KTR_INTR, "%s: pid %d exec %p(%p) for %s flg=%x", From owner-svn-src-head@freebsd.org Sun Jul 19 22:26:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AEC89A4839; Sun, 19 Jul 2015 22:26:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BB5312F9; Sun, 19 Jul 2015 22:26:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JMQ3k1006229; Sun, 19 Jul 2015 22:26:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JMQ3ZR006228; Sun, 19 Jul 2015 22:26:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201507192226.t6JMQ3ZR006228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 19 Jul 2015 22:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285706 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 22:26:03 -0000 Author: markj Date: Sun Jul 19 22:26:02 2015 New Revision: 285706 URL: https://svnweb.freebsd.org/changeset/base/285706 Log: Don't increment the spin count until after the first attempt to acquire a rwlock read lock. Otherwise the lockstat:::rw-spin probe will fire spuriously. MFC after: 1 week Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sun Jul 19 22:25:16 2015 (r285705) +++ head/sys/kern/kern_rwlock.c Sun Jul 19 22:26:02 2015 (r285706) @@ -382,9 +382,6 @@ __rw_rlock(volatile uintptr_t *c, const state = rw->rw_lock; #endif for (;;) { -#ifdef KDTRACE_HOOKS - spin_cnt++; -#endif /* * Handle the easy case. If no other thread has a write * lock, then try to bump up the count of read locks. Note @@ -413,6 +410,9 @@ __rw_rlock(volatile uintptr_t *c, const } continue; } +#ifdef KDTRACE_HOOKS + spin_cnt++; +#endif #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif From owner-svn-src-head@freebsd.org Sun Jul 19 23:37:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FC4D9A6466; Sun, 19 Jul 2015 23:37:48 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0985110DE; Sun, 19 Jul 2015 23:37:48 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JNblUK034037; Sun, 19 Jul 2015 23:37:47 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JNbkiU034029; Sun, 19 Jul 2015 23:37:46 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201507192337.t6JNbkiU034029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 19 Jul 2015 23:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285707 - in head: share/man/man4 sys/dev/proto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 23:37:48 -0000 Author: marcel Date: Sun Jul 19 23:37:45 2015 New Revision: 285707 URL: https://svnweb.freebsd.org/changeset/base/285707 Log: Check the hw.proto.attach environment variable for devices that proto(4) should attach to instead of the normal driver. Document the variable. Modified: head/share/man/man4/proto.4 head/sys/dev/proto/proto.h head/sys/dev/proto/proto_bus_isa.c head/sys/dev/proto/proto_bus_pci.c head/sys/dev/proto/proto_core.c Modified: head/share/man/man4/proto.4 ============================================================================== --- head/share/man/man4/proto.4 Sun Jul 19 22:26:02 2015 (r285706) +++ head/share/man/man4/proto.4 Sun Jul 19 23:37:45 2015 (r285707) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2015 +.Dd July 19, 2015 .Dt PROTO 4 .Os .\" @@ -47,6 +47,12 @@ module at boot time, place the following .Bd -literal -offset indent proto_load="YES" .Ed +.Pp +To have the driver attach to a device instead of its regular driver, +mention it in the list of devices assigned to the following loader variable: +.Bd -ragged -offset indent +hw.proto.attach="desc[,desc]" +.Ed .\" .Sh DESCRIPTION The Modified: head/sys/dev/proto/proto.h ============================================================================== --- head/sys/dev/proto/proto.h Sun Jul 19 22:26:02 2015 (r285706) +++ head/sys/dev/proto/proto.h Sun Jul 19 23:37:45 2015 (r285707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Marcel Moolenaar + * Copyright (c) 2014, 2015 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -61,6 +61,7 @@ extern char proto_driver_name[]; int proto_add_resource(struct proto_softc *, int, int, struct resource *); +int proto_probe(device_t dev, const char *prefix, char ***devnamesp); int proto_attach(device_t dev); int proto_detach(device_t dev); Modified: head/sys/dev/proto/proto_bus_isa.c ============================================================================== --- head/sys/dev/proto/proto_bus_isa.c Sun Jul 19 22:26:02 2015 (r285706) +++ head/sys/dev/proto/proto_bus_isa.c Sun Jul 19 23:37:45 2015 (r285707) @@ -59,6 +59,9 @@ static driver_t proto_isa_driver = { sizeof(struct proto_softc), }; +static char proto_isa_prefix[] = "isa"; +static char **proto_isa_devnames; + static int proto_isa_probe(device_t dev) { @@ -77,12 +80,12 @@ proto_isa_probe(device_t dev) return (ENODEV); sb = sbuf_new_auto(); - sbuf_printf(sb, "isa:%#lx", rman_get_start(res)); + sbuf_printf(sb, "%s:%#lx", proto_isa_prefix, rman_get_start(res)); sbuf_finish(sb); device_set_desc_copy(dev, sbuf_data(sb)); sbuf_delete(sb); bus_release_resource(dev, type, rid, res); - return (BUS_PROBE_HOOVER); + return (proto_probe(dev, proto_isa_prefix, &proto_isa_devnames)); } static int Modified: head/sys/dev/proto/proto_bus_pci.c ============================================================================== --- head/sys/dev/proto/proto_bus_pci.c Sun Jul 19 22:26:02 2015 (r285706) +++ head/sys/dev/proto/proto_bus_pci.c Sun Jul 19 23:37:45 2015 (r285707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Marcel Moolenaar + * Copyright (c) 2014, 2015 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,6 +59,9 @@ static driver_t proto_pci_driver = { sizeof(struct proto_softc), }; +static char proto_pci_prefix[] = "pci"; +static char **proto_pci_devnames; + static int proto_pci_probe(device_t dev) { @@ -68,12 +71,12 @@ proto_pci_probe(device_t dev) return (ENXIO); sb = sbuf_new_auto(); - sbuf_printf(sb, "pci%d:%d:%d:%d", pci_get_domain(dev), + sbuf_printf(sb, "%s%d:%d:%d:%d", proto_pci_prefix, pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev)); sbuf_finish(sb); device_set_desc_copy(dev, sbuf_data(sb)); sbuf_delete(sb); - return (BUS_PROBE_HOOVER); + return (proto_probe(dev, proto_pci_prefix, &proto_pci_devnames)); } static int Modified: head/sys/dev/proto/proto_core.c ============================================================================== --- head/sys/dev/proto/proto_core.c Sun Jul 19 22:26:02 2015 (r285706) +++ head/sys/dev/proto/proto_core.c Sun Jul 19 23:37:45 2015 (r285707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Marcel Moolenaar + * Copyright (c) 2014, 2015 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -120,6 +120,62 @@ proto_intr(void *arg) #endif int +proto_probe(device_t dev, const char *prefix, char ***devnamesp) +{ + char **devnames = *devnamesp; + const char *dn, *ep, *ev; + size_t pfxlen; + int idx, names; + + if (devnames == NULL) { + pfxlen = strlen(prefix); + names = 1; /* NULL pointer */ + ev = kern_getenv("hw.proto.attach"); + if (ev != NULL) { + dn = ev; + while (*dn != '\0') { + ep = dn; + while (*ep != ',' && *ep != '\0') + ep++; + if ((ep - dn) > pfxlen && + strncmp(dn, prefix, pfxlen) == 0) + names++; + dn = (*ep == ',') ? ep + 1 : ep; + } + } + devnames = malloc(names * sizeof(caddr_t), M_DEVBUF, + M_WAITOK | M_ZERO); + *devnamesp = devnames; + if (ev != NULL) { + dn = ev; + idx = 0; + while (*dn != '\0') { + ep = dn; + while (*ep != ',' && *ep != '\0') + ep++; + if ((ep - dn) > pfxlen && + strncmp(dn, prefix, pfxlen) == 0) { + devnames[idx] = malloc(ep - dn + 1, + M_DEVBUF, M_WAITOK | M_ZERO); + memcpy(devnames[idx], dn, ep - dn); + idx++; + } + dn = (*ep == ',') ? ep + 1 : ep; + } + freeenv(__DECONST(char *, ev)); + } + } + + dn = device_get_desc(dev); + while (*devnames != NULL) { + if (strcmp(dn, *devnames) == 0) + return (BUS_PROBE_SPECIFIC); + devnames++; + } + return (BUS_PROBE_HOOVER); +} + +int proto_attach(device_t dev) { struct proto_softc *sc; From owner-svn-src-head@freebsd.org Mon Jul 20 02:15:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2C389A5DEF; Mon, 20 Jul 2015 02:15:55 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0134.outbound.protection.outlook.com [157.56.110.134]) (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 D1B281C1E; Mon, 20 Jul 2015 02:15:54 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from BY1PR0501CA0005.namprd05.prod.outlook.com (10.162.139.15) by DM2PR05MB781.namprd05.prod.outlook.com (10.141.179.139) with Microsoft SMTP Server (TLS) id 15.1.219.17; Mon, 20 Jul 2015 02:15:45 +0000 Received: from BN1AFFO11FD047.protection.gbl (207.46.163.139) by BY1PR0501CA0005.outlook.office365.com (10.162.139.15) with Microsoft SMTP Server (TLS) id 15.1.219.17 via Frontend Transport; Mon, 20 Jul 2015 02:15:45 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.18) smtp.mailfrom=juniper.net; freebsd.org; dkim=none (message not signed) header.d=none; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.18 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.18) by BN1AFFO11FD047.mail.protection.outlook.com (10.58.53.62) with Microsoft SMTP Server (TLS) id 15.1.213.8 via Frontend Transport; Mon, 20 Jul 2015 02:15:43 +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; Sun, 19 Jul 2015 19:15:42 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t6K2FfD86956; Sun, 19 Jul 2015 19:15:41 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id AA763580AB; Sun, 19 Jul 2015 19:15:41 -0700 (PDT) To: Mark R V Murray CC: Arthur Mesh , , , , Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... In-Reply-To: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> <5238A439-F25E-40F1-96D4-140460003982@FreeBSD.org> <22423.1435862187@chaos> <20150702184255.GH90166@juniper.net> <0B29F349-FB7C-4B71-A792-CE304FF72206@FreeBSD.org> <21694.1437334858@chaos> Comments: In-reply-to: Mark R V Murray message dated "Sun, 19 Jul 2015 21:10:16 +0100." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Sun, 19 Jul 2015 19:15:41 -0700 Message-ID: <14323.1437358541@chaos> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD047; 1:QZNXXFPH6v+WmP3Zd2gSGjTNhkLYICl6QE26iJyjYtJcwAa0xUtbog7XxHchvOfq7oz7JS+XjnSYI8ggRzhKKLgSW6ONEkCA8XyAR50Z1oBRS98Pf3hS0Z7OdPja2rxBJ+wrniepR/tReGD4jnMzZ1L2pgfe8+LoYw2n/w2FH7DGDDjNDI+RRomFql6AeUtdKkIVXgm6knDhNfryNQhSlRvzG1yda+b/yHecrcFhI+P/GuqZR8M8zBenCPpYpQ0+QJ4NsuXd/I8Zft4AZsw3beDweTZWJQYy21IfGOV8hA/MWwfehiNuWcex6fRsyML4tXxrXXLxPDISnrxAizEkLYwJduv3f99EfDE/Qlnfi3wN7GHnUfPKcaleQPEosops X-Forefront-Antispam-Report: CIP:66.129.239.18; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(110136002)(5001960100002)(107886002)(117636001)(62966003)(450100001)(558084003)(50226001)(92566002)(93886004)(106466001)(105596002)(46102003)(189998001)(77156002)(87936001)(76176999)(86362001)(23676002)(50986999)(2950100001)(47776003)(77096005)(57986006)(76506005)(33716001)(50466002)(6806004)(4001430100001)(62816006)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR05MB781; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM2PR05MB781; 2:OVP8LoJpzUf2EmzAci8dJa00xf13AMbU6j4ltN9t8JOiGmRWjlcX/eglXgZCPAiY; 3:cAf/yqZwTL/HVEz2Eoibd0fesZhaL8nOlQIjGj/WRgTToKo/f9x2rHKZWNLt46/yVkx/dT+1adbxIyV8xlYl3I3L5rU2thqCtjnXZ7MKlFtf6sMdt6qofmaAnPS6Hlomh6zyOSuhycWKwl/838FU5Xm6ndpGMJdHAhWazd6/2ASU8MJ54qT5Uq25Bpq6Bjmvgrsh0zjIpmYyVlo3ml+bBP5ld8VTikP7Kzh0iDnODjk=; 25:SRVHGtlrF9RcYdKkgpS2EHWBvqWDVDq2Ip8AICLdTOyOZpx6f6kh7MbgqnNAi0xgzz3us7vj9xkjoGDBU4vHUKatISagaj4bfEtl9KEDiz1PnE+HD8WsUG69KE0mLaKr5Q6NryDy/H1emSyCmfp3Vzx1jlSlpkmgvs7g/p7lsijFPBcYSj7IIkNo/e1H0pC9t92C8GkRz5ApR2VOjXGLmo5om66QxYS8Gbmd3sAqyhnCVjSxXn3HAZIHLtdTmwIBZLKAeuC8/fvSwKXE/HdIHQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR05MB781; X-Microsoft-Exchange-Diagnostics: 1; DM2PR05MB781; 20:o0NsbddI5ouH1eY4556m8KYf+6Iee8p/+3vv5PAYRiwVLavn3LRbqtYCCJ9zQae619q9JMOWD/Q57Kk0qlk4y3PT25FD91mqjLyY7aOY/vZrR0HkOuhmoSodFJKr5DIg1z4gorDIoEvnBMNvI3owv1DYCXis01cXy3r4VQ3lSS7TbQyjce/VB4SDjkqPcLeLtGsk/cnfwy4maW/dmzOjFog3LqiW/bsaXUeEqnTD2knwj4nj+ywaQRqNXgCR6SdDVa2YX8v/RkcOpCm8oqAR7fZz02CtMxAIyUSuIRIFQ8/eoHF5kix9SvdsFBxc2roSbhWbipO7ggVbG0Yv0tIaZZ8kqeXE/ATzW6Q1vb5kHnYjmJvTweg64C0h2an0AXHo8PvHCHkP2Ay3apSIMUHqLXditYYE66jmywDIaBXsgL423i8khmhbbJ87mC3Q0mfClmpW4lrzPMAuRO5jX8i6sJIdumdRuWpI0hw0ZIv6oJYDyxNFA9R0AAJ/KzcOIM/X; 4:Ztm0FAgZ88bvBtCxXupKK81VWNmH2XwqUcU9q895wV8kj8o4pb/LRg92rU/63J+8XVjAdAQ9F9fz0VGQfsRMQuRpvoB+EzdOyZzMyf5/joc7YtbNI2RNnPnHw8JztYeQOFMYeTKz6CKBDbvuJLPjUUwVuenCLtscjbAgg8RJ2RARDfMMkdhKt2FwQ03QjmyVMGYObc6f/rDTrzBK6/Cu5KVYNhUiefew7oYtFc52kXeilIjoRBS4vsqoKuIkf0RIz/h1dSTcK/+9ZJASLcDvx0X/UjuXJPBhtm/eWMAij80= DM2PR05MB781: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:DM2PR05MB781; BCL:0; PCL:0; RULEID:; SRVR:DM2PR05MB781; X-Forefront-PRVS: 0643BDA83C X-Microsoft-Exchange-Diagnostics: 1; DM2PR05MB781; 23:N0JVmNxG9DeXIuyeHOYVAuM+kBkxH7mVkGprXTkUo07zAR9KLpYNWvwmdXA6IJBq8rj3TgjJ+ANKkiip/02zGy7B7IiwT9MEAbf3ghFXrmNLogI9ZMY8CeUgHXskfWF233fqhlROpkMkJE/s+HySahF1qB99riRdetmjjksu5QlS32elwpFkiNPSIC6wUDWeR8i9zgdjkHSJ/gpiCYFOMGDMyaLHWYZmROQZbUey3jMconpn6zdN+CW5tYfboNyy2uTSetlfElOVHud4mDt041XrIAIc09ntNMiUjIFhYLCvPkVSPZq5q1rhGTh/v5ju5mjVXG9UO5wsZNgbsG63lBJd/cLKF/WobNek0EB55WjCJlzJc5sxq2AEonjHjZhEDlpdwWb7Hwog6XDr+h93nxQQgngAS9x51MZRIoAp01p1hqsH7AkG09I1TiIFBNsX3TDHZwIeNR9kWC/zr9AqjDUYPbhDPQCg1FkMsFOTh4w93/0O4g23PaXMYoM3zJ8xnVZqKWxDAV9oCcbxqdO4VuE7GZ7Ha7YEPRz53ekqQNv/haNLtYdZ5DtoTpseeCIDIyXyDrRvnslJ3fJTIeFOBWNhEp0Z52UJG7Fa8ojMx3n9ERe6pcmcSCPd2BtFSb4Ei1mFQEU7lR73f8N0GoEWfxRIFSHS7aWVkfd/2L4oiEPYO+50wAu2O3+mHzpp/ZvkghfuqpMAi/O0w5AkyhPMrJX+GXmItuEVYk+tdmwIuxV3VJeeANi8lcpaaIXblop/4ChHcaSFE84WPwr7p8VXgmtGPbLwSvByoVFrhDwsp0/t2ziuLgzv8robDdRVeR3SADd+yIPutAxK5Z0+B24QAfXHI+Jv7xffdjcs7fr6+1/CcxTJZCL2GmQw+YMgJjg9iu75usUz8Bg5pcCo0M0YCA== X-Microsoft-Exchange-Diagnostics: 1; DM2PR05MB781; 5:BgSkP5Cbb1Cn2+UK4Eu+tSzELMxoYRs+s2fzUjTjULeQ+L4rA5eyso6fUXlCXQa1SZn8G8rg/HaLtr9Iprb7BXYF11yOdarrX0vjtGrdGLZhI39Opsc9SZrOky2w4/py83YqX5aRxzdgRgUbrl4N4Q==; 24:PIsh2cWb2theTRwMXNcBKXkBhfyyNOezSmGoHmplEraXFUj24Uvb/kouVVKqANVKSV979FyKYl2CbnT7KcOFJKp6FshSti3pX5SL+pO98iM=; 20:jDkU1vz6mGPdb0Wcg65wYlj4Y3oKrdvD8AQxQ2GblDoRV02FmpxlsZtC8iC3ndTPHuSf91omh77Amg+P0YMdNA== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2015 02:15:43.9487 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.18]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR05MB781 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 20 Jul 2015 02:15:56 -0000 > > Mark, do you have an estimate of when loadable modules will be supported > > again? >=20 > About a week, I=E2=80=99d say. Thanks! Will keep an eye out. From owner-svn-src-head@freebsd.org Mon Jul 20 02:38:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 749689A611C; Mon, 20 Jul 2015 02:38:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 655F2141E; Mon, 20 Jul 2015 02:38:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6K2cqoR006684; Mon, 20 Jul 2015 02:38:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6K2cqqx006683; Mon, 20 Jul 2015 02:38:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201507200238.t6K2cqqx006683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 20 Jul 2015 02:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285708 - 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.20 Precedence: list List-Id: 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, 20 Jul 2015 02:38:52 -0000 Author: markj Date: Mon Jul 20 02:38:51 2015 New Revision: 285708 URL: https://svnweb.freebsd.org/changeset/base/285708 Log: Fix some libxo format string errors in the pfkey stats code. PR: 201700 Modified: head/usr.bin/netstat/pfkey.c Modified: head/usr.bin/netstat/pfkey.c ============================================================================== --- head/usr.bin/netstat/pfkey.c Sun Jul 19 23:37:45 2015 (r285707) +++ head/usr.bin/netstat/pfkey.c Mon Jul 20 02:38:51 2015 (r285708) @@ -128,7 +128,7 @@ pfkey_stats(u_long off, const char *name xo_emit(m, (uintmax_t)pfkeystat.f, plural(pfkeystat.f)) /* userland -> kernel */ - p(out_total, "\t{:sent-requests//%ju} " + p(out_total, "\t{:sent-requests/%ju} " "{N:/request%s sent from userland}\n"); p(out_bytes, "\t{:sent-bytes/%ju} " "{N:/byte%s sent from userland}\n"); @@ -165,7 +165,7 @@ pfkey_stats(u_long off, const char *name "{N:/message%s with duplicate extension}\n"); p(out_invexttype, "\t{:dropped-bad-extension/%ju} " "{N:/message%s with invalid extension type}\n"); - p(out_invsatype, "\t:dropped-bad-sa-type/%ju} " + p(out_invsatype, "\t{:dropped-bad-sa-type/%ju} " "{N:/message%s with invalid sa type}\n"); p(out_invaddr, "\t{:dropped-bad-address-extension/%ju} " "{N:/message%s with invalid address extension}\n"); From owner-svn-src-head@freebsd.org Mon Jul 20 03:56:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABDB39A6D66; Mon, 20 Jul 2015 03:56:03 +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 5CFF212B1; Mon, 20 Jul 2015 03:56:03 +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 D92F425D3A9B; Mon, 20 Jul 2015 03:55:59 +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 9732BC76FE9; Mon, 20 Jul 2015 03:55:58 +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 RNxbpfGLce97; Mon, 20 Jul 2015 03:55:57 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id BB65BC76FCD; Mon, 20 Jul 2015 03:55:56 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r285704 - in head: cddl/contrib/opensolaris/cmd/lockstat sys/kern sys/sys From: "Bjoern A. Zeeb" In-Reply-To: <201507192224.t6JMOYvO006057@repo.freebsd.org> Date: Mon, 20 Jul 2015 03:55:55 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201507192224.t6JMOYvO006057@repo.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 03:56:03 -0000 > On 19 Jul 2015, at 22:24 , Mark Johnston wrote: >=20 > Author: markj > Date: Sun Jul 19 22:24:33 2015 > New Revision: 285704 > URL: https://svnweb.freebsd.org/changeset/base/285704 >=20 > Log: > Consistently use a reader/writer flag for lockstat probes in = rwlock(9) and > sx(9), rather than using the probe function name to determine whether = a > given lock is a read lock or a write lock. Update lockstat(1) = accordingly. >=20 > Modified: > head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c > head/sys/kern/kern_lockstat.c > head/sys/kern/kern_rwlock.c > head/sys/kern/kern_sx.c > head/sys/sys/lockstat.h > head/sys/sys/rwlock.h > head/sys/sys/sx.h I see PC98 LINT kernels failing: /scratch/tmp/bz/head.svn/sys/cddl/dev/sdt/sdt.c:202:3: error: use of = undeclared identifier 'lockstat_enabled' lockstat_enabled++; ^ /scratch/tmp/bz/head.svn/sys/cddl/dev/sdt/sdt.c:213:3: error: use of = undeclared identifier 'lockstat_enabled' lockstat_enabled--; ^ =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@freebsd.org Mon Jul 20 04:41:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF40E9A64FC; Mon, 20 Jul 2015 04:41:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF3A416A0; Mon, 20 Jul 2015 04:41:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6K4fQUv059153; Mon, 20 Jul 2015 04:41:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6K4fQkO059136; Mon, 20 Jul 2015 04:41:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201507200441.t6K4fQkO059136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 20 Jul 2015 04:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285709 - 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.20 Precedence: list List-Id: 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, 20 Jul 2015 04:41:27 -0000 Author: markj Date: Mon Jul 20 04:41:25 2015 New Revision: 285709 URL: https://svnweb.freebsd.org/changeset/base/285709 Log: Declare lockstat_enabled even when KDTRACE_HOOKS is not defined. Reported by: bz X-MFC-With: r285704 Modified: head/sys/sys/lockstat.h Modified: head/sys/sys/lockstat.h ============================================================================== --- head/sys/sys/lockstat.h Mon Jul 20 02:38:51 2015 (r285708) +++ head/sys/sys/lockstat.h Mon Jul 20 04:41:25 2015 (r285709) @@ -68,6 +68,8 @@ SDT_PROBE_DECLARE(lockstat, , , thread__ #define LOCKSTAT_WRITER 0 #define LOCKSTAT_READER 1 +extern int lockstat_enabled; + #ifdef KDTRACE_HOOKS #define LOCKSTAT_RECORD0(probe, lp) \ @@ -105,8 +107,6 @@ SDT_PROBE_DECLARE(lockstat, , , thread__ LOCKSTAT_RECORD1(probe, lp, a); \ } while (0) -extern int lockstat_enabled; - struct lock_object; uint64_t lockstat_nsecs(struct lock_object *); From owner-svn-src-head@freebsd.org Mon Jul 20 04:47:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5FE99A65E2; Mon, 20 Jul 2015 04:47:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B87011C5B; Mon, 20 Jul 2015 04:47:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by pachj5 with SMTP id hj5so95716844pac.3; Sun, 19 Jul 2015 21:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=yQikdnn8mMgUaUjHir4QOe/enN/abZQajbkosAc4KSk=; b=XPYtKXlQgDnpVVPNRCJcl+X4flLMpenrSSmtI1qdqUQ7PiLzQZQ87d/ngzfSePR+GJ rOMQUzQ1Gy+PYr3/oMIlRSd8qIrtvUoPAiruABNCQzpGbfSXgTilws7M0sl8GVH+CLIG dHuIFKt1IhiFx72l4DUEYD2H83VoBF0CrqviYkyEjWwdZnbvaIMDS55O04KB3QFypgx7 YsaNQvOnOqqDX8lMYCZFhrgNqU29v+OExpMiOHkaCAOaqTMcI6Hg7Jb3qwkCyciRMjcy A5FPDkIrQYApC/jyj1CWYWlZpLF7UDhURfcSDca+11h3PoX3eQYvD80ItAJhKTX2TCrW k2/A== X-Received: by 10.70.31.5 with SMTP id w5mr55627183pdh.3.1437367649511; Sun, 19 Jul 2015 21:47:29 -0700 (PDT) Received: from raichu ([104.232.114.184]) by smtp.gmail.com with ESMTPSA id a4sm4050061pdm.85.2015.07.19.21.47.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jul 2015 21:47:28 -0700 (PDT) Sender: Mark Johnston Date: Sun, 19 Jul 2015 21:47:24 -0700 From: Mark Johnston To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285704 - in head: cddl/contrib/opensolaris/cmd/lockstat sys/kern sys/sys Message-ID: <20150720044716.GA51988@raichu> References: <201507192224.t6JMOYvO006057@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 04:47:31 -0000 On Mon, Jul 20, 2015 at 03:55:55AM +0000, Bjoern A. Zeeb wrote: > > > On 19 Jul 2015, at 22:24 , Mark Johnston wrote: > > > > Author: markj > > Date: Sun Jul 19 22:24:33 2015 > > New Revision: 285704 > > URL: https://svnweb.freebsd.org/changeset/base/285704 > > > > Log: > > Consistently use a reader/writer flag for lockstat probes in rwlock(9) and > > sx(9), rather than using the probe function name to determine whether a > > given lock is a read lock or a write lock. Update lockstat(1) accordingly. > > > > Modified: > > head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c > > head/sys/kern/kern_lockstat.c > > head/sys/kern/kern_rwlock.c > > head/sys/kern/kern_sx.c > > head/sys/sys/lockstat.h > > head/sys/sys/rwlock.h > > head/sys/sys/sx.h > > > I see PC98 LINT kernels failing: > > /scratch/tmp/bz/head.svn/sys/cddl/dev/sdt/sdt.c:202:3: error: use of undeclared identifier 'lockstat_enabled' > lockstat_enabled++; > ^ > /scratch/tmp/bz/head.svn/sys/cddl/dev/sdt/sdt.c:213:3: error: use of undeclared identifier 'lockstat_enabled' > lockstat_enabled--; > ^ Sorry about that - fixed in r285709. -Mark From owner-svn-src-head@freebsd.org Mon Jul 20 06:54:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEE7C9A5CB4; Mon, 20 Jul 2015 06:54:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFD821208; Mon, 20 Jul 2015 06:54:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6K6spSX011898; Mon, 20 Jul 2015 06:54:51 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6K6sp1G011897; Mon, 20 Jul 2015 06:54:51 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201507200654.t6K6sp1G011897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 20 Jul 2015 06:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285710 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 06:54:52 -0000 Author: ae Date: Mon Jul 20 06:54:50 2015 New Revision: 285710 URL: https://svnweb.freebsd.org/changeset/base/285710 Log: Invoke LLE event handler when entry is deleted. MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Jul 20 04:41:25 2015 (r285709) +++ head/sys/netinet6/in6.c Mon Jul 20 06:54:50 2015 (r285710) @@ -2203,6 +2203,7 @@ in6_lltable_lookup(struct lltable *llt, if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) { LLE_WLOCK(lle); lle->la_flags |= LLE_DELETED; + EVENTHANDLER_INVOKE(lle_event, lle, LLENTRY_DELETED); #ifdef DIAGNOSTIC log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); #endif From owner-svn-src-head@freebsd.org Mon Jul 20 06:58:34 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BE099A5D12; Mon, 20 Jul 2015 06:58:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D262A14BE; Mon, 20 Jul 2015 06:58:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6K6wXmV012122; Mon, 20 Jul 2015 06:58:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6K6wXjo012121; Mon, 20 Jul 2015 06:58:33 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201507200658.t6K6wXjo012121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 20 Jul 2015 06:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285711 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 06:58:34 -0000 Author: ae Date: Mon Jul 20 06:58:32 2015 New Revision: 285711 URL: https://svnweb.freebsd.org/changeset/base/285711 Log: Add LLE event handler to report ND6 events to userland via rtsock. Obtained from: Yandex LLC MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Jul 20 06:54:50 2015 (r285710) +++ head/sys/netinet6/nd6.c Mon Jul 20 06:58:32 2015 (r285711) @@ -112,6 +112,8 @@ VNET_DEFINE(int, nd6_debug) = 1; VNET_DEFINE(int, nd6_debug) = 0; #endif +static eventhandler_tag lle_event_eh; + /* for debugging? */ #if 0 static int nd6_inuse, nd6_allocated; @@ -144,6 +146,58 @@ static VNET_DEFINE(struct callout, nd6_s VNET_DEFINE(struct callout, nd6_timer_ch); +static void +nd6_lle_event(void *arg __unused, struct llentry *lle, int evt) +{ + struct rt_addrinfo rtinfo; + struct sockaddr_in6 dst, *sa6; + struct sockaddr_dl gw; + struct ifnet *ifp; + int type; + + LLE_WLOCK_ASSERT(lle); + + switch (evt) { + case LLENTRY_RESOLVED: + type = RTM_ADD; + KASSERT(lle->la_flags & LLE_VALID, + ("%s: %p resolved but not valid?", __func__, lle)); + break; + case LLENTRY_EXPIRED: + type = RTM_DELETE; + break; + default: + return; + } + + sa6 = L3_ADDR_SIN6(lle); + if (sa6->sin6_family != AF_INET6) + return; + ifp = lle->lle_tbl->llt_ifp; + + bzero(&dst, sizeof(dst)); + bzero(&gw, sizeof(gw)); + bzero(&rtinfo, sizeof(rtinfo)); + dst.sin6_len = sizeof(struct sockaddr_in6); + dst.sin6_family = AF_INET6; + dst.sin6_addr = sa6->sin6_addr; + dst.sin6_scope_id = in6_getscopezone(ifp, + in6_addrscope(&sa6->sin6_addr)); + in6_clearscope(&dst.sin6_addr); /* XXX */ + gw.sdl_len = sizeof(struct sockaddr_dl); + gw.sdl_family = AF_LINK; + gw.sdl_alen = ifp->if_addrlen; + gw.sdl_index = ifp->if_index; + gw.sdl_type = ifp->if_type; + if (evt == LLENTRY_RESOLVED) + bcopy(&lle->ll_addr, gw.sdl_data, ifp->if_addrlen); + rtinfo.rti_info[RTAX_DST] = (struct sockaddr *)&dst; + rtinfo.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&gw; + rtinfo.rti_addrs = RTA_DST | RTA_GATEWAY; + rt_missmsg_fib(type, &rtinfo, RTF_HOST | RTF_LLDATA | ( + type == RTM_ADD ? RTF_UP: 0), 0, RT_DEFAULT_FIB); +} + void nd6_init(void) { @@ -159,6 +213,9 @@ nd6_init(void) nd6_slowtimo, curvnet); nd6_dad_init(); + if (IS_DEFAULT_VNET(curvnet)) + lle_event_eh = EVENTHANDLER_REGISTER(lle_event, nd6_lle_event, + NULL, EVENTHANDLER_PRI_ANY); } #ifdef VIMAGE @@ -168,6 +225,8 @@ nd6_destroy() callout_drain(&V_nd6_slowtimo_ch); callout_drain(&V_nd6_timer_ch); + if (IS_DEFAULT_VNET(curvnet)) + EVENTHANDLER_DEREGISTER(lle_event, lle_event_eh); } #endif From owner-svn-src-head@freebsd.org Mon Jul 20 07:26:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 719509A61A9; Mon, 20 Jul 2015 07:26:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 573CC1022; Mon, 20 Jul 2015 07:26:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6K7QXl1023958; Mon, 20 Jul 2015 07:26:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6K7QW7J023955; Mon, 20 Jul 2015 07:26:32 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201507200726.t6K7QW7J023955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 20 Jul 2015 07:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285712 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 20 Jul 2015 07:26:33 -0000 Author: ae Date: Mon Jul 20 07:26:31 2015 New Revision: 285712 URL: https://svnweb.freebsd.org/changeset/base/285712 Log: Add helper functions for IP checksum adjusting. Use these functions in dummynet code and for setdscp. This fixes wrong checksums in some cases. Obtained from: Yandex LLC MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_dn_io.c head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_private.h Modified: head/sys/netpfil/ipfw/ip_dn_io.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dn_io.c Mon Jul 20 06:58:32 2015 (r285711) +++ head/sys/netpfil/ipfw/ip_dn_io.c Mon Jul 20 07:26:31 2015 (r285712) @@ -429,8 +429,7 @@ ecn_mark(struct mbuf* m) switch (ip->ip_v) { case IPVERSION: { - u_int8_t otos; - int sum; + uint16_t old; if ((ip->ip_tos & IPTOS_ECN_MASK) == IPTOS_ECN_NOTECT) return (0); /* not-ECT */ @@ -441,17 +440,9 @@ ecn_mark(struct mbuf* m) * ecn-capable but not marked, * mark CE and update checksum */ - otos = ip->ip_tos; + old = *(uint16_t *)ip; ip->ip_tos |= IPTOS_ECN_CE; - /* - * update checksum (from RFC1624) - * HC' = ~(~HC + ~m + m') - */ - sum = ~ntohs(ip->ip_sum) & 0xffff; - sum += (~otos & 0xffff) + ip->ip_tos; - sum = (sum >> 16) + (sum & 0xffff); - sum += (sum >> 16); /* add carry */ - ip->ip_sum = htons(~sum & 0xffff); + ip->ip_sum = cksum_adjust(ip->ip_sum, old, *(uint16_t *)ip); return (1); } #ifdef INET6 Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Mon Jul 20 06:58:32 2015 (r285711) +++ head/sys/netpfil/ipfw/ip_fw2.c Mon Jul 20 07:26:31 2015 (r285712) @@ -2487,12 +2487,13 @@ do { \ code = TARG(cmd->arg1, dscp) & 0x3F; l = 0; /* exit inner loop */ if (is_ipv4) { - uint16_t a; + uint16_t old; - a = ip->ip_tos; - ip->ip_tos = (code << 2) | (ip->ip_tos & 0x03); - a += ntohs(ip->ip_sum) - ip->ip_tos; - ip->ip_sum = htons(a); + old = *(uint16_t *)ip; + ip->ip_tos = (code << 2) | + (ip->ip_tos & 0x03); + ip->ip_sum = cksum_adjust(ip->ip_sum, + old, *(uint16_t *)ip); } else if (is_ipv6) { uint8_t *v; Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Mon Jul 20 06:58:32 2015 (r285711) +++ head/sys/netpfil/ipfw/ip_fw_private.h Mon Jul 20 07:26:31 2015 (r285712) @@ -725,5 +725,22 @@ extern ipfw_nat_cfg_t *ipfw_nat_del_ptr; extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; extern ipfw_nat_cfg_t *ipfw_nat_get_log_ptr; +/* Helper functions for IP checksum adjustment */ +static __inline uint16_t +cksum_add(uint16_t sum, uint16_t a) +{ + uint16_t res; + + res = sum + a; + return (res + (res < a)); +} + +static __inline uint16_t +cksum_adjust(uint16_t oldsum, uint16_t old, uint16_t new) +{ + + return (~cksum_add(cksum_add(~oldsum, ~old), new)); +} + #endif /* _KERNEL */ #endif /* _IPFW2_PRIVATE_H */ From owner-svn-src-head@freebsd.org Mon Jul 20 07:42:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DF399A646A for ; Mon, 20 Jul 2015 07:42:08 +0000 (UTC) (envelope-from lesfinances@ns305830.ovh.net) Received: from ns305830.ovh.net (unknown [IPv6:2001:41d0:2:8507::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A49B1A3A for ; Mon, 20 Jul 2015 07:42:07 +0000 (UTC) (envelope-from lesfinances@ns305830.ovh.net) Received: by ns305830.ovh.net (Postfix, from userid 10016) id E7F394710474; Mon, 20 Jul 2015 07:18:27 +0200 (CEST) To: svn-src-head@freebsd.org Subject: Problem with parcel shipping, ID:0000132365 X-PHP-Originating-Script: 10016:post.php(13) : eval()'d code Date: Mon, 20 Jul 2015 07:18:27 +0200 From: "FedEx Ground" Reply-To: "FedEx Ground" Message-ID: <0fc2788ee6225cb6d3506f75a1672b85@actusports.fr> X-Priority: 3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 07:42:08 -0000 Dear Customer, Courier was unable to deliver the parcel to you. Delivery Label is attached to this email. Yours trully, Anthony Gay, FedEx Operation Agent. From owner-svn-src-head@freebsd.org Mon Jul 20 08:21:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F37B9A6C9D; Mon, 20 Jul 2015 08:21:52 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A4A31A38; Mon, 20 Jul 2015 08:21:52 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6K8LqSJ046140; Mon, 20 Jul 2015 08:21:52 GMT (envelope-from zec@FreeBSD.org) Received: (from zec@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6K8LqZK046132; Mon, 20 Jul 2015 08:21:52 GMT (envelope-from zec@FreeBSD.org) Message-Id: <201507200821.t6K8LqZK046132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zec set sender to zec@FreeBSD.org using -f From: Marko Zec Date: Mon, 20 Jul 2015 08:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285713 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 08:21:52 -0000 Author: zec Date: Mon Jul 20 08:21:51 2015 New Revision: 285713 URL: https://svnweb.freebsd.org/changeset/base/285713 Log: Prevent null-pointer dereferencing. MFC after: 3 days Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Jul 20 07:26:31 2015 (r285712) +++ head/sys/net/if.c Mon Jul 20 08:21:51 2015 (r285713) @@ -335,11 +335,12 @@ ifnet_setbyindex(u_short idx, struct ifn struct ifaddr * ifaddr_byindex(u_short idx) { - struct ifaddr *ifa; + struct ifnet *ifp; + struct ifaddr *ifa = NULL; IFNET_RLOCK_NOSLEEP(); - ifa = ifnet_byindex_locked(idx)->if_addr; - if (ifa != NULL) + ifp = ifnet_byindex_locked(idx); + if (ifp != NULL && (ifa = ifp->if_addr) != NULL) ifa_ref(ifa); IFNET_RUNLOCK_NOSLEEP(); return (ifa); From owner-svn-src-head@freebsd.org Mon Jul 20 09:37:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 897749A6A57; Mon, 20 Jul 2015 09:37:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 722BF1D0C; Mon, 20 Jul 2015 09:37:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6K9bhOp076687; Mon, 20 Jul 2015 09:37:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6K9bhGV076686; Mon, 20 Jul 2015 09:37:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201507200937.t6K9bhGV076686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 20 Jul 2015 09:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285714 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 09:37:43 -0000 Author: mav Date: Mon Jul 20 09:37:42 2015 New Revision: 285714 URL: https://svnweb.freebsd.org/changeset/base/285714 Log: Fix typo in comment. Submitted by: Masao Uebayashi Modified: head/sys/kern/kern_clocksource.c Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Mon Jul 20 08:21:51 2015 (r285713) +++ head/sys/kern/kern_clocksource.c Mon Jul 20 09:37:42 2015 (r285714) @@ -116,7 +116,7 @@ struct pcpu_state { sbintime_t now; /* Last tick time. */ sbintime_t nextevent; /* Next scheduled event on this CPU. */ sbintime_t nexttick; /* Next timer tick time. */ - sbintime_t nexthard; /* Next hardlock() event. */ + sbintime_t nexthard; /* Next hardclock() event. */ sbintime_t nextstat; /* Next statclock() event. */ sbintime_t nextprof; /* Next profclock() event. */ sbintime_t nextcall; /* Next callout event. */ From owner-svn-src-head@freebsd.org Mon Jul 20 10:20:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 945699A515D; Mon, 20 Jul 2015 10:20:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CD012D70; Mon, 20 Jul 2015 10:20:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6KAK6uH092825; Mon, 20 Jul 2015 10:20:06 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6KAK5St092822; Mon, 20 Jul 2015 10:20:05 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201507201020.t6KAK5St092822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 20 Jul 2015 10:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285715 - in head/sys: cddl/compat/opensolaris/sys kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 10:20:06 -0000 Author: ed Date: Mon Jul 20 10:20:04 2015 New Revision: 285715 URL: https://svnweb.freebsd.org/changeset/base/285715 Log: Add an API for easily creating userspace threads in kernelspace. This change refactors the existing create_thread() function to be more generic. It replaces almost all of its arguments by a callback that can be used to extract the thread ID and copy it out to the right place, but also to perform additional initialization steps, such as setting the trapframe. This also makes the difference between thr_new() and thr_create() more clear in my opinion. This function is going to be used by the CloudABI compatibility layer. It looks like the OpenSolaris compatibility framework already provides a function called thread_create(). Rename this function to do_thread_create() and use a macro to deal with the namespacing conflict. A similar approach is already used for thread_exit(). MFC after: 1 month Modified: head/sys/cddl/compat/opensolaris/sys/proc.h head/sys/kern/kern_thr.c head/sys/sys/proc.h Modified: head/sys/cddl/compat/opensolaris/sys/proc.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/proc.h Mon Jul 20 09:37:42 2015 (r285714) +++ head/sys/cddl/compat/opensolaris/sys/proc.h Mon Jul 20 10:20:04 2015 (r285715) @@ -63,7 +63,7 @@ typedef struct proc proc_t; extern struct proc *zfsproc; static __inline kthread_t * -thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, +do_thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, size_t len, proc_t *pp, int state, pri_t pri) { kthread_t *td = NULL; @@ -88,6 +88,8 @@ thread_create(caddr_t stk, size_t stksiz return (td); } +#define thread_create(stk, stksize, proc, arg, len, pp, state, pri) \ + do_thread_create(stk, stksize, proc, arg, len, pp, state, pri) #define thread_exit() kthread_exit() #endif /* _KERNEL */ Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Mon Jul 20 09:37:42 2015 (r285714) +++ head/sys/kern/kern_thr.c Mon Jul 20 10:20:04 2015 (r285715) @@ -89,29 +89,39 @@ suword_lwpid(void *addr, lwpid_t lwpid) #define suword_lwpid suword #endif -static int create_thread(struct thread *td, mcontext_t *ctx, - void (*start_func)(void *), void *arg, - char *stack_base, size_t stack_size, - char *tls_base, - long *child_tid, long *parent_tid, - int flags, struct rtprio *rtp); - /* * System call interface. */ + +struct thr_create_initthr_args { + ucontext_t ctx; + long *tid; +}; + +static int +thr_create_initthr(struct thread *td, void *thunk) +{ + struct thr_create_initthr_args *args; + + /* Copy out the child tid. */ + args = thunk; + if (args->tid != NULL && suword_lwpid(args->tid, td->td_tid)) + return (EFAULT); + + return (set_mcontext(td, &args->ctx.uc_mcontext)); +} + int sys_thr_create(struct thread *td, struct thr_create_args *uap) /* ucontext_t *ctx, long *id, int flags */ { - ucontext_t ctx; + struct thr_create_initthr_args args; int error; - if ((error = copyin(uap->ctx, &ctx, sizeof(ctx)))) + if ((error = copyin(uap->ctx, &args.ctx, sizeof(args.ctx)))) return (error); - - error = create_thread(td, &ctx.uc_mcontext, NULL, NULL, - NULL, 0, NULL, uap->id, NULL, uap->flags, NULL); - return (error); + args.tid = uap->id; + return (thread_create(td, NULL, thr_create_initthr, &args)); } int @@ -129,6 +139,35 @@ sys_thr_new(struct thread *td, struct th return (kern_thr_new(td, ¶m)); } +static int +thr_new_initthr(struct thread *td, void *thunk) +{ + stack_t stack; + struct thr_param *param; + + /* + * Here we copy out tid to two places, one for child and one + * for parent, because pthread can create a detached thread, + * if parent wants to safely access child tid, it has to provide + * its storage, because child thread may exit quickly and + * memory is freed before parent thread can access it. + */ + param = thunk; + if ((param->child_tid != NULL && + suword_lwpid(param->child_tid, td->td_tid)) || + (param->parent_tid != NULL && + suword_lwpid(param->parent_tid, td->td_tid))) + return (EFAULT); + + /* Set up our machine context. */ + stack.ss_sp = param->stack_base; + stack.ss_size = param->stack_size; + /* Set upcall address to user thread entry function. */ + cpu_set_upcall_kse(td, param->start_func, param->arg, &stack); + /* Setup user TLS address and TLS pointer register. */ + return (cpu_set_user_tls(td, param->tls_base)); +} + int kern_thr_new(struct thread *td, struct thr_param *param) { @@ -142,22 +181,13 @@ kern_thr_new(struct thread *td, struct t return (error); rtpp = &rtp; } - error = create_thread(td, NULL, param->start_func, param->arg, - param->stack_base, param->stack_size, param->tls_base, - param->child_tid, param->parent_tid, param->flags, - rtpp); - return (error); + return (thread_create(td, rtpp, thr_new_initthr, param)); } -static int -create_thread(struct thread *td, mcontext_t *ctx, - void (*start_func)(void *), void *arg, - char *stack_base, size_t stack_size, - char *tls_base, - long *child_tid, long *parent_tid, - int flags, struct rtprio *rtp) +int +thread_create(struct thread *td, struct rtprio *rtp, + int (*initialize_thread)(struct thread *, void *), void *thunk) { - stack_t stack; struct thread *newtd; struct proc *p; int error; @@ -199,24 +229,6 @@ create_thread(struct thread *td, mcontex cpu_set_upcall(newtd, td); - /* - * Try the copyout as soon as we allocate the td so we don't - * have to tear things down in a failure case below. - * Here we copy out tid to two places, one for child and one - * for parent, because pthread can create a detached thread, - * if parent wants to safely access child tid, it has to provide - * its storage, because child thread may exit quickly and - * memory is freed before parent thread can access it. - */ - if ((child_tid != NULL && - suword_lwpid(child_tid, newtd->td_tid)) || - (parent_tid != NULL && - suword_lwpid(parent_tid, newtd->td_tid))) { - thread_free(newtd); - error = EFAULT; - goto fail; - } - bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); bcopy(&td->td_startcopy, &newtd->td_startcopy, @@ -224,26 +236,11 @@ create_thread(struct thread *td, mcontex newtd->td_proc = td->td_proc; thread_cow_get(newtd, td); - if (ctx != NULL) { /* old way to set user context */ - error = set_mcontext(newtd, ctx); - if (error != 0) { - thread_cow_free(newtd); - thread_free(newtd); - goto fail; - } - } else { - /* Set up our machine context. */ - stack.ss_sp = stack_base; - stack.ss_size = stack_size; - /* Set upcall address to user thread entry function. */ - cpu_set_upcall_kse(newtd, start_func, arg, &stack); - /* Setup user TLS address and TLS pointer register. */ - error = cpu_set_user_tls(newtd, tls_base); - if (error != 0) { - thread_cow_free(newtd); - thread_free(newtd); - goto fail; - } + error = initialize_thread(newtd, thunk); + if (error != 0) { + thread_cow_free(newtd); + thread_free(newtd); + goto fail; } PROC_LOCK(p); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Mon Jul 20 09:37:42 2015 (r285714) +++ head/sys/sys/proc.h Mon Jul 20 10:20:04 2015 (r285715) @@ -992,6 +992,8 @@ void thread_cow_get_proc(struct thread * void thread_cow_get(struct thread *newtd, struct thread *td); void thread_cow_free(struct thread *td); void thread_cow_update(struct thread *td); +int thread_create(struct thread *td, struct rtprio *rtp, + int (*initialize_thread)(struct thread *, void *), void *thunk); void thread_exit(void) __dead2; void thread_free(struct thread *td); void thread_link(struct thread *td, struct proc *p); From owner-svn-src-head@freebsd.org Mon Jul 20 11:29:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED2B29A5DDB for ; Mon, 20 Jul 2015 11:29:31 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9DC51AAA for ; Mon, 20 Jul 2015 11:29:30 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by oibn4 with SMTP id n4so106513320oib.3 for ; Mon, 20 Jul 2015 04:29:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=vXJvEOP4ZJ+i9Kg454YsSx8y69Z7v6DMid/CyLDLoaE=; b=bhPa5ULnlsT7z6zu7rrb7FJr+7VdD3UNGF3R2Yl7AuF+Rx6Aklqxlw05zc//PKh11s Jbyyny8nPH7ZrC07ko/hMBERvPhAdKf+qRg+cwcJOjyPJkCeorWMvjfpteDjrHimbGQM UfYvsgPYFRLNoUF6S8+tYyEATmK9hyeI69d/yAs2xscb3jXiz8UJlf57JK9twj/lu97R sKwyaVhoDbNBHJWdaT65uK5jN3gj80N16ERAaYN9emrtiIknIUvRMR16DKTYAdT7CW9F oSZrd5nlFdtOgzfpYWd/CZ2i+jSOPspvC2DRZdLiGloJwKT3RLcPOEVdGupCdbbQ69UN FfPw== X-Gm-Message-State: ALoCoQn5XamJW4fRFbHpUsUWsOrobRYmPXQbNeBoBBxGvRuGs+GnsKIGMKc1FBXP7feiqfgYNH95 MIME-Version: 1.0 X-Received: by 10.202.48.22 with SMTP id w22mr24320470oiw.95.1437391764332; Mon, 20 Jul 2015 04:29:24 -0700 (PDT) Received: by 10.76.0.46 with HTTP; Mon, 20 Jul 2015 04:29:24 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <20150717114153.GA93168@stack.nl> References: <201507141433.t6EEXLkn035058@repo.freebsd.org> <20150717114153.GA93168@stack.nl> Date: Mon, 20 Jul 2015 13:29:24 +0200 Message-ID: Subject: Re: svn commit: r285539 - head/sys/compat/cloudabi64 From: Ed Schouten To: Jilles Tjoelker Cc: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 11:29:32 -0000 Hi Jilles, 2015-07-17 13:41 GMT+02:00 Jilles Tjoelker : > The maximum number of iovecs is part of the ABI and should therefore > probably have a CLOUDABI_* constant. > > It turns out that both FreeBSD and Linux report 1024 for getconf > IOV_MAX, so there is little practical effect. That's a good observation. What cloudlibc does is that it leaves IOV_MAX undefined, as there is no compile-time maximum. It is therefore perfectly legal to use UIO_MAXIOV in this specific piece of code, as long as it is consistent with sysconf(_SC_IOV_MAX). If my interpretation of POSIX is correct, this should be allowed. Many of the definitions in may be omitted if the actual limit is unspecified. Best regards, -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK/VAT number: 62051717 From owner-svn-src-head@freebsd.org Mon Jul 20 13:46:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D5429A5040; Mon, 20 Jul 2015 13:46:23 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63B708D4; Mon, 20 Jul 2015 13:46:23 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6KDkNPZ077569; Mon, 20 Jul 2015 13:46:23 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6KDkMht077567; Mon, 20 Jul 2015 13:46:22 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201507201346.t6KDkMht077567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 20 Jul 2015 13:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285716 - in head/sys: amd64/cloudabi64 compat/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 13:46:23 -0000 Author: ed Date: Mon Jul 20 13:46:22 2015 New Revision: 285716 URL: https://svnweb.freebsd.org/changeset/base/285716 Log: Make forking of CloudABI processes work. Just like FreeBSD+Capsicum, CloudABI uses process descriptors. Return the file descriptor number to the parent process. To the child process we both return a special value for the file descriptor number (CLOUDABI_PROCESS_CHILD). We also return the thread ID of the new thread in the copied process, so the threading library can reinitialize itself. Obtained from: https://github.com/NuxiNL/freebsd Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c head/sys/compat/cloudabi/cloudabi_proc.c Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Mon Jul 20 10:20:04 2015 (r285715) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Mon Jul 20 13:46:22 2015 (r285716) @@ -169,6 +169,16 @@ cloudabi64_set_syscall_retval(struct thr } } +static void +cloudabi64_schedtail(struct thread *td) +{ + struct trapframe *frame = td->td_frame; + + /* Initial register values for processes returning from fork. */ + frame->tf_rax = CLOUDABI_PROCESS_CHILD; + frame->tf_rdx = td->td_tid; +} + static struct sysentvec cloudabi64_elf_sysvec = { .sv_size = CLOUDABI64_SYS_MAXSYSCALL, .sv_table = cloudabi64_sysent, @@ -185,6 +195,7 @@ static struct sysentvec cloudabi64_elf_s .sv_set_syscall_retval = cloudabi64_set_syscall_retval, .sv_fetch_syscall_args = cloudabi64_fetch_syscall_args, .sv_syscallnames = cloudabi64_syscallnames, + .sv_schedtail = cloudabi64_schedtail, }; INIT_SYSENTVEC(elf_sysvec, &cloudabi64_elf_sysvec); Modified: head/sys/compat/cloudabi/cloudabi_proc.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_proc.c Mon Jul 20 10:20:04 2015 (r285715) +++ head/sys/compat/cloudabi/cloudabi_proc.c Mon Jul 20 13:46:22 2015 (r285716) @@ -33,8 +33,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include int cloudabi_sys_proc_exec(struct thread *td, @@ -65,9 +67,15 @@ int cloudabi_sys_proc_fork(struct thread *td, struct cloudabi_sys_proc_fork_args *uap) { + struct proc *p2; + int error, fd; - /* Not implemented. */ - return (ENOSYS); + error = fork1(td, RFFDG | RFPROC | RFPROCDESC, 0, &p2, &fd, 0); + if (error != 0) + return (error); + /* Return the file descriptor to the parent process. */ + td->td_retval[0] = fd; + return (0); } int From owner-svn-src-head@freebsd.org Mon Jul 20 16:08:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDA769A62D2; Mon, 20 Jul 2015 16:08:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE72C1D52; Mon, 20 Jul 2015 16:08:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6KG82qu036229; Mon, 20 Jul 2015 16:08:02 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6KG82kZ036228; Mon, 20 Jul 2015 16:08:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201507201608.t6KG82kZ036228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 20 Jul 2015 16:08:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285719 - head/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 16:08:03 -0000 Author: pfg Date: Mon Jul 20 16:08:01 2015 New Revision: 285719 URL: https://svnweb.freebsd.org/changeset/base/285719 Log: snmp_hostres(3): Fix buffer overflow. Actually just a typo. Detected by gcc + FORTIFY_SOURCE patches. CID: 1007594 MFC after: 3 days Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c Mon Jul 20 14:40:34 2015 (r285718) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c Mon Jul 20 16:08:01 2015 (r285719) @@ -175,7 +175,7 @@ get_printer_status(const struct printer goto LABEL_DONE; } - memset(&fline[0], '\0', sizeof(line)); + memset(&fline[0], '\0', sizeof(fline)); if (fgets(fline, sizeof(fline) -1, f) == NULL) { ps = PS_UNKNOWN; goto LABEL_DONE; From owner-svn-src-head@freebsd.org Mon Jul 20 16:15:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5D579A65C2; Mon, 20 Jul 2015 16:15:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D69BE14C8; Mon, 20 Jul 2015 16:15:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6KGFvQw040152; Mon, 20 Jul 2015 16:15:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6KGFv0l040151; Mon, 20 Jul 2015 16:15:57 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201507201615.t6KGFv0l040151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 20 Jul 2015 16:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285720 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 16:15:58 -0000 Author: pfg Date: Mon Jul 20 16:15:56 2015 New Revision: 285720 URL: https://svnweb.freebsd.org/changeset/base/285720 Log: libusb: Fix minor cast-qual warning. Fix a warning triggered by the gcc + FORTIFY_SOURCE patches: In function 'libusb20_parse_config_desc': lib/libusb/libusb20_desc.c:141: warning: passing argument 1 of 'memcpy' discards qualifiers from pointer target type Submitted by: hselansky Modified: head/lib/libusb/libusb20_desc.c Modified: head/lib/libusb/libusb20_desc.c ============================================================================== --- head/lib/libusb/libusb20_desc.c Mon Jul 20 16:08:01 2015 (r285719) +++ head/lib/libusb/libusb20_desc.c Mon Jul 20 16:15:56 2015 (r285720) @@ -137,15 +137,13 @@ libusb20_parse_config_desc(const void *c * Make a copy of the config descriptor, so that the caller can free * the inital config descriptor pointer! */ - ptr = (void *)(lub_endpoint + nendpoint); - memcpy(LIBUSB20_ADD_BYTES(ptr, 0), config_desc, pcdesc.len); + memcpy((void *)(lub_endpoint + nendpoint), config_desc, pcdesc.len); + + ptr = (const void *)(lub_endpoint + nendpoint); pcdesc.ptr = LIBUSB20_ADD_BYTES(ptr, 0); - config_desc = LIBUSB20_ADD_BYTES(ptr, 0); /* init config structure */ - ptr = config_desc; - LIBUSB20_INIT(LIBUSB20_CONFIG_DESC, &lub_config->desc); if (libusb20_me_decode(ptr, ptr[0], &lub_config->desc)) { From owner-svn-src-head@freebsd.org Mon Jul 20 16:27:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9AF99A68C0; Mon, 20 Jul 2015 16:27:47 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF3201D57; Mon, 20 Jul 2015 16:27:47 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6KGRlQ8044366; Mon, 20 Jul 2015 16:27:47 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6KGRjLp044357; Mon, 20 Jul 2015 16:27:45 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201507201627.t6KGRjLp044357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Mon, 20 Jul 2015 16:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285722 - in head/release: . scripts 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.20 Precedence: list List-Id: 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, 20 Jul 2015 16:27:48 -0000 Author: brd (doc,ports committer) Date: Mon Jul 20 16:27:44 2015 New Revision: 285722 URL: https://svnweb.freebsd.org/changeset/base/285722 Log: Add support for building VirtualBox Vagrant images. Abstract the build, package and upload to handle building either type. Approved by: re (gjb) Added: head/release/scripts/box.ovf (contents, props changed) head/release/tools/vagrant-virtualbox.conf (contents, props changed) head/release/tools/vagrant-vmware.conf (contents, props changed) Modified: head/release/Makefile.vagrant head/release/Makefile.vm head/release/scripts/atlas-upload.sh head/release/tools/vagrant.conf Modified: head/release/Makefile.vagrant ============================================================================== --- head/release/Makefile.vagrant Mon Jul 20 16:17:43 2015 (r285721) +++ head/release/Makefile.vagrant Mon Jul 20 16:27:44 2015 (r285722) @@ -6,8 +6,7 @@ # VAGRANT_IMG?= ${.OBJDIR}/vagrant.vmdk -VAGRANT_UPLOAD_TGTS= vagrant-check-depends \ - atlas-do-upload +VAGRANT_UPLOAD_TGTS= vagrant-check-depends CLEANFILES+= ${VAGRANT_UPLOAD_TGTS} .if defined(VAGRANT_UPLOAD_CONF) && !empty(VAGRANT_UPLOAD_CONF) @@ -18,16 +17,20 @@ ATLAS${VAR}:= ${VAGRANT${VAR}} .endif .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" -SNAPSHOT_DATE!= date +-%Y-%m-%d +SNAPSHOT_DATE!= date +%Y%m%d .endif -VAGRANT_VERSION?= ${REVISION}-${BRANCH}${SNAPSHOT_DATE} - -VAGRANT_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE}.box -VAGRANT_PROVIDERS?= vmware_desktop -#VAGRANT_PROVIDERS+= virtualbox +VAGRANT_VERSION!= date +%Y.%m.%d +VAGRANT_TARGET:= ${OSRELEASE}-${SNAPSHOT_DATE} +.if !empty(CLOUDWARE) +. for _PROVIDER in ${CLOUDWARE} +. if ${_PROVIDER:MVAGRANT*} +VAGRANT_PROVIDERS+= ${_PROVIDER:S/VAGRANT-//:tl} +. endif +. endfor +.endif +VAGRANT_PROVIDERS?= vmware virtualbox -vagrant-upload: ${VAGRANT_UPLOAD_TGTS} vagrant-check-depends: .for VAR in _KEY _USERNAME _VERSION @@ -47,48 +50,73 @@ vagrant-check-depends: . endif .endif -vagrant-do-package: cw-vagrant +.for PROVIDER in ${VAGRANT_PROVIDERS} +CLEANFILES+= vagrant-do-package-${PROVIDER} ${VAGRANT_TARGET}.${PROVIDER}.box +CLEANDIRS+= ${PROVIDER} +VAGRANT_UPLOAD_TGTS+= vagrant-do-upload-${PROVIDER} + +${PROVIDER}: + @mkdir -p ${PROVIDER} + +${VAGRANT_TARGET}.${PROVIDER}.box: ${PROVIDER} cw-vagrant-${PROVIDER} vagrant-create-${PROVIDER}-metadata + @echo "==> PACKAGING: ${VAGRANT_TARGET}.${PROVIDER}.box in `pwd`" + @cp vagrant-${PROVIDER}.vmdk ${PROVIDER}/vagrant.vmdk +. if ${PROVIDER} == "virtualbox" + @(cd ${.OBJDIR}/${PROVIDER} && echo '{"provider":"${PROVIDER}"}' > metadata.json) + @(cd ${.OBJDIR}/${PROVIDER} && tar -czf ../${VAGRANT_TARGET}.${PROVIDER}.box metadata.json box.ovf vagrant.vmdk) +. elif ${PROVIDER} == "vmware" + @(cd ${.OBJDIR}/${PROVIDER} && echo '{"provider":"${PROVIDER}_desktop"}' > metadata.json) + @(cd ${.OBJDIR}/${PROVIDER} && tar -czf ../${VAGRANT_TARGET}.${PROVIDER}.box metadata.json vagrant.vmx vagrant.vmdk) +. endif -vagrant-do-package-vmware: vagrant-create-vmware-vmx vagrant-do-package - @cd ${.OBJDIR} && echo '{"provider":"vmware_desktop"}' > metadata.json - cd ${.OBJDIR} && tar -czf ${VAGRANT_TARGET} metadata.json vagrant.vmx vagrant.vmdk +CLEANFILES+= vagrant-do-upload-${PROVIDER} +vagrant-do-upload-${PROVIDER}: ${VAGRANT_TARGET}.${PROVIDER}.box +. if ${PROVIDER} == "virtualbox" + ${.CURDIR}/scripts/atlas-upload.sh -b ${TYPE}-${REVISION}-${BRANCH} -f ${VAGRANT_TARGET}.${PROVIDER}.box -p ${PROVIDER} -k ${VAGRANT_KEY} -u ${VAGRANT_USERNAME} -v ${VAGRANT_VERSION} +. elif ${PROVIDER} == "vmware" + ${.CURDIR}/scripts/atlas-upload.sh -b ${TYPE}-${REVISION}-${BRANCH} -f ${VAGRANT_TARGET}.${PROVIDER}.box -p ${PROVIDER}_desktop -k ${VAGRANT_KEY} -u ${VAGRANT_USERNAME} -v ${VAGRANT_VERSION} +. endif touch ${.OBJDIR}/${.TARGET} - -atlas-do-upload: vagrant-do-package-vmware -.for PROVIDER in ${VAGRANT_PROVIDERS} - ${.CURDIR}/scripts/atlas-upload.sh -b FreeBSD-${REVISION}-${BRANCH} -f ${VAGRANT_TARGET} -p ${PROVIDER} -k ${VAGRANT_KEY} -u ${VAGRANT_USERNAME} -v ${VAGRANT_VERSION} .endfor - touch ${.OBJDIR}/${.TARGET} -vagrant-create-vmware-vmx: - @cd ${.OBJDIR} && echo '.encoding = "UTF-8"' > vagrant.vmx - @cd ${.OBJDIR} && echo 'bios.bootorder = "hdd,CDROM"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'checkpoint.vmstate = ""' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'cleanshutdown = "TRUE"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'config.version = "8"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'displayname = "${VAGRANT_TARGET}"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'ethernet0.addresstype = "generated"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'ethernet0.bsdname = "en0"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'ethernet0.connectiontype = "nat"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'ethernet0.displayname = "Ethernet"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'ethernet0.linkstatepropagation.enable = "FALSE"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'ethernet0.pcislotnumber = "33"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'ethernet0.present = "TRUE"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'ethernet0.virtualdev = "e1000"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'ethernet0.wakeonpcktrcv = "FALSE"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'floppy0.present = "FALSE"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'guestos = "freebsd-64"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'gui.fullscreenatpoweron = "FALSE"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'gui.viewmodeatpoweron = "windowed"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'memsize = "512"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'sound.startconnected = "FALSE"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'softpoweroff = "TRUE"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'scsi0.pcislotnumber = "16"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'scsi0.present = "TRUE"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'scsi0.virtualdev = "lsilogic"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'scsi0:0.filename = "vagrant.vmdk"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'scsi0:0.present = "TRUE"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'tools.synctime = "TRUE"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'usb.present = "FALSE"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'virtualhw.productcompatibility = "hosted"' >> vagrant.vmx - @cd ${.OBJDIR} && echo 'virtualhw.version = "9"' >> vagrant.vmx +vagrant-upload: ${VAGRANT_UPLOAD_TGTS} + +vagrant-create-virtualbox-metadata: virtualbox/box.ovf + +virtualbox/box.ovf: ${.CURDIR}/scripts/box.ovf + cp ${.ALLSRC} virtualbox/ + +vmware/vagrant.vmx: + @(cd vmware && echo '.encoding = "UTF-8"' > vagrant.vmx) + @(cd vmware && echo 'bios.bootorder = "hdd,CDROM"' >> vagrant.vmx) + @(cd vmware && echo 'checkpoint.vmstate = ""' >> vagrant.vmx) + @(cd vmware && echo 'cleanshutdown = "TRUE"' >> vagrant.vmx) + @(cd vmware && echo 'config.version = "8"' >> vagrant.vmx) + @(cd vmware && echo 'displayname = "${VAGRANT_TARGET}"' >> vagrant.vmx) + @(cd vmware && echo 'ethernet0.addresstype = "generated"' >> vagrant.vmx) + @(cd vmware && echo 'ethernet0.bsdname = "en0"' >> vagrant.vmx) + @(cd vmware && echo 'ethernet0.connectiontype = "nat"' >> vagrant.vmx) + @(cd vmware && echo 'ethernet0.displayname = "Ethernet"' >> vagrant.vmx) + @(cd vmware && echo 'ethernet0.linkstatepropagation.enable = "FALSE"' >> vagrant.vmx) + @(cd vmware && echo 'ethernet0.pcislotnumber = "33"' >> vagrant.vmx) + @(cd vmware && echo 'ethernet0.present = "TRUE"' >> vagrant.vmx) + @(cd vmware && echo 'ethernet0.virtualdev = "e1000"' >> vagrant.vmx) + @(cd vmware && echo 'ethernet0.wakeonpcktrcv = "FALSE"' >> vagrant.vmx) + @(cd vmware && echo 'floppy0.present = "FALSE"' >> vagrant.vmx) + @(cd vmware && echo 'guestos = "freebsd-64"' >> vagrant.vmx) + @(cd vmware && echo 'gui.fullscreenatpoweron = "FALSE"' >> vagrant.vmx) + @(cd vmware && echo 'gui.viewmodeatpoweron = "windowed"' >> vagrant.vmx) + @(cd vmware && echo 'memsize = "512"' >> vagrant.vmx) + @(cd vmware && echo 'sound.startconnected = "FALSE"' >> vagrant.vmx) + @(cd vmware && echo 'softpoweroff = "TRUE"' >> vagrant.vmx) + @(cd vmware && echo 'scsi0.pcislotnumber = "16"' >> vagrant.vmx) + @(cd vmware && echo 'scsi0.present = "TRUE"' >> vagrant.vmx) + @(cd vmware && echo 'scsi0.virtualdev = "lsilogic"' >> vagrant.vmx) + @(cd vmware && echo 'scsi0:0.filename = "vagrant.vmdk"' >> vagrant.vmx) + @(cd vmware && echo 'scsi0:0.present = "TRUE"' >> vagrant.vmx) + @(cd vmware && echo 'tools.synctime = "TRUE"' >> vagrant.vmx) + @(cd vmware && echo 'usb.present = "FALSE"' >> vagrant.vmx) + @(cd vmware && echo 'virtualhw.productcompatibility = "hosted"' >> vagrant.vmx) + @(cd vmware && echo 'virtualhw.version = "9"' >> vagrant.vmx) + +vagrant-create-vmware-metadata: vmware/vagrant.vmx Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Mon Jul 20 16:17:43 2015 (r285721) +++ head/release/Makefile.vm Mon Jul 20 16:27:44 2015 (r285722) @@ -19,7 +19,8 @@ CLOUDWARE?= AZURE \ EC2 \ GCE \ OPENSTACK \ - VAGRANT + VAGRANT-VIRTUALBOX \ + VAGRANT-VMWARE AZURE_FORMAT= vhdf AZURE_DESC= Microsoft Azure platform image AZURE_DISK= ${OSRELEASE}.${AZURE_FORMAT} @@ -32,9 +33,12 @@ GCE_DISK= disk.${GCE_FORMAT} OPENSTACK_FORMAT=qcow2 OPENSTACK_DESC= OpenStack platform image OPENSTACK_DISK= ${OSRELEASE}.${OPENSTACK_FORMAT} -VAGRANT_FORMAT= vmdk -VAGRANT_DESC= Vagrant Image -VAGRANT_DISK= ${OSRELEASE}.${VAGRANT_FORMAT} +VAGRANT-VIRTUALBOX_FORMAT= vmdk +VAGRANT-VIRTUALBOX_DESC= Vagrant Image for VirtualBox +VAGRANT-VIRTUALBOX_DISK= ${OSRELEASE}.vbox.${VAGRANT_FORMAT} +VAGRANT-VMWARE_FORMAT= vmdk +VAGRANT-VMWARE_DESC= Vagrant Image for VMWare +VAGRANT-VMWARE_DISK= ${OSRELEASE}.vmware.${VAGRANT_FORMAT} .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE) . for _CW in ${CLOUDWARE} Modified: head/release/scripts/atlas-upload.sh ============================================================================== --- head/release/scripts/atlas-upload.sh Mon Jul 20 16:17:43 2015 (r285721) +++ head/release/scripts/atlas-upload.sh Mon Jul 20 16:27:44 2015 (r285722) @@ -28,20 +28,23 @@ ATLAS_API_URL='' ATLAS_UPLOAD_URL='https://binstore.hashicorp.com' -VERSION_DESCRIPTION="FreeBSD Snapshot Build" +DESCRIPTION="FreeBSD Snapshot Build" usage() { echo "${0} usage:" - echo "-b box-name -f box-to-upload -k api-key -p provider -u user -v version" + echo "-b box-name -d 'box description' -f box-to-upload -k api-key -p provider -u user -v version" return 1 } main () { - while getopts "b:f:k:p:u:v:" arg; do + while getopts "b:d:f:k:p:u:v:" arg; do case "${arg}" in b) BOX="${OPTARG}" ;; + d) + DESCRIPTION="${OPTARG}" + ;; f) FILE="${OPTARG}" ;; @@ -83,6 +86,7 @@ main () { echo "Creating box: ${BOX}" /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/boxes -X POST -d "box[name]=${BOX}" -d "access_token=${KEY}" > /dev/null /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX} -X PUT -d "box[is_private]=false" -d "access_token=${KEY}" > /dev/null + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX} -X PUT -d "box[description]='${DESCRIPTION}'" -d "access_token=${KEY}" > /dev/null else echo "Box already exists" fi @@ -97,7 +101,7 @@ main () { if [ $? != 0 ]; then echo "Creating version: ${VERSION}" /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/versions -X POST -d "version[version]=${VERSION}" -d "access_token=${KEY}" > /dev/null - /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION} -X PUT -d "version[description]=${VERSION_DESCRIPTION}" -d "access_token=${KEY}" > /dev/null + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION} -X PUT -d "version[description]=${DESCRIPTION}" -d "access_token=${KEY}" > /dev/null VERSIONRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}?access_token=${KEY}") echo $VERSIONRESULT | grep "\"version\":\"${VERSION}\"" > /dev/null if [ $? != 0 ]; then Added: head/release/scripts/box.ovf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/scripts/box.ovf Mon Jul 20 16:27:44 2015 (r285722) @@ -0,0 +1,226 @@ + + + + + + + List of the virtual disks used in the package + + + + Logical networks used in the package + + Logical network used by this appliance. + + + + A virtual machine + + The kind of installed guest operating system + FreeBSD_64 + FreeBSD_64 + + + Virtual hardware requirements for a virtual machine + + Virtual Hardware Family + 0 + freebsd + virtualbox-2.2 + + + 1 virtual CPU + Number of virtual CPUs + 1 virtual CPU + 1 + 3 + 1 + + + MegaBytes + 512 MB of memory + Memory Size + 512 MB of memory + 2 + 4 + 512 + + + 0 + ideController0 + IDE Controller + ideController0 + 3 + PIIX4 + 5 + + + 1 + ideController1 + IDE Controller + ideController1 + 4 + PIIX4 + 5 + + + 0 + disk1 + Disk Image + disk1 + /disk/vmdisk1 + 5 + 3 + 17 + + + true + Ethernet adapter on 'NAT' + NAT + Ethernet adapter on 'NAT' + 6 + E1000 + 10 + + + + Complete VirtualBox machine configuration in VirtualBox format + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: head/release/tools/vagrant-virtualbox.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/tools/vagrant-virtualbox.conf Mon Jul 20 16:27:44 2015 (r285722) @@ -0,0 +1,18 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +. ${WORLDDIR}/release/tools/vagrant.conf + +export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} virtualbox-ose-additions" + +vm_extra_pre_umount () { + # VirtualBox first boot pkgs + echo 'firstboot_pkgs_list="sudo rsync virtualbox-ose-additions"' >> ${DESTDIR}/etc/rc.conf + echo 'vboxguest_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'vboxservice_enable="YES"' >> ${DESTDIR}/etc/rc.conf + + # Setup the Vagrant common items + vagrant_common +} Added: head/release/tools/vagrant-vmware.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/tools/vagrant-vmware.conf Mon Jul 20 16:27:44 2015 (r285722) @@ -0,0 +1,22 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +. ${WORLDDIR}/release/tools/vagrant.conf + +export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} open-vm-tools-nox11" + +vm_extra_pre_umount () { + # VMWare first boot pkgs + echo 'firstboot_pkgs_list="sudo rsync open-vm-tools-nox11"' >> ${DESTDIR}/etc/rc.conf + + echo 'vmware_guest_vmblock_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'vmware_guest_vmhgfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'vmware_guest_vmmemctl_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'vmware_guest_vmxnet_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'vmware_guestd_enable="YES"' >> ${DESTDIR}/etc/rc.conf + + # Setup the Vagrant common items + vagrant_common +} Modified: head/release/tools/vagrant.conf ============================================================================== --- head/release/tools/vagrant.conf Mon Jul 20 16:17:43 2015 (r285721) +++ head/release/tools/vagrant.conf Mon Jul 20 16:27:44 2015 (r285722) @@ -10,17 +10,14 @@ export VM_EXTRA_PACKAGES="firstboot-free # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="firstboot_freebsd_update firstboot_pkgs" -vm_extra_pre_umount() { +vagrant_common () { # The firstboot_pkgs rc.d script will download the repository # catalogue and install or update pkg when the instance first # launches, so these files would just be replaced anyway; removing # them from the image allows it to boot faster. env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} delete -f -y pkg rm ${DESTDIR}/var/db/pkg/repo-*.sqlite - - # The size of the EC2 root disk can be configured at instance launch - # time; expand our filesystem to fill the disk. - echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf + env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} clean -y -a # Vagrant instances use DHCP to get their network configuration. echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf @@ -36,9 +33,6 @@ vm_extra_pre_umount() { echo 'sendmail_outbound_enable="NO"' >> ${DESTDIR}/etc/rc.conf echo 'sendmail_msp_queue_enable="NO"' >> ${DESTDIR}/etc/rc.conf - # sudo is required - echo 'firstboot_pkgs_list="sudo rsync"' >> ${DESTDIR}/etc/rc.conf - # Create the vagrant user with a password of vagrant /usr/sbin/pw -R ${DESTDIR} \ groupadd vagrant -g 1001 From owner-svn-src-head@freebsd.org Mon Jul 20 17:48:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 572939A6BB0; Mon, 20 Jul 2015 17:48:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4829E1ADE; Mon, 20 Jul 2015 17:48:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6KHm1wo076894; Mon, 20 Jul 2015 17:48:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6KHm1WU076893; Mon, 20 Jul 2015 17:48:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201507201748.t6KHm1WU076893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 20 Jul 2015 17:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285723 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 17:48:01 -0000 Author: mav Date: Mon Jul 20 17:48:00 2015 New Revision: 285723 URL: https://svnweb.freebsd.org/changeset/base/285723 Log: Increase output amp on ASUS UX31A by +5dB. While there, implement couple helper functions. Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Mon Jul 20 16:27:44 2015 (r285722) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Mon Jul 20 17:48:00 2015 (r285723) @@ -696,6 +696,22 @@ hdaa_patch(struct hdaa_devinfo *devinfo) } } +static uint32_t +hdaa_read_coef(device_t dev, nid_t nid, uint16_t idx) +{ + + hda_command(dev, HDA_CMD_SET_COEFF_INDEX(0, nid, idx)); + return (hda_command(dev, HDA_CMD_GET_PROCESSING_COEFF(0, nid))); +} + +static uint32_t +hdaa_write_coef(device_t dev, nid_t nid, uint16_t idx, uint16_t val) +{ + + hda_command(dev, HDA_CMD_SET_COEFF_INDEX(0, nid, idx)); + return (hda_command(dev, HDA_CMD_SET_PROCESSING_COEFF(0, nid, val))); +} + void hdaa_patch_direct(struct hdaa_devinfo *devinfo) { @@ -737,10 +753,12 @@ hdaa_patch_direct(struct hdaa_devinfo *d * That results in silence if downmix it to mono. * To workaround, make codec to handle signal as mono. */ - hda_command(dev, HDA_CMD_SET_COEFF_INDEX(0, 0x20, 0x07)); - val = hda_command(dev, HDA_CMD_GET_PROCESSING_COEFF(0, 0x20)); - hda_command(dev, HDA_CMD_SET_COEFF_INDEX(0, 0x20, 0x07)); - hda_command(dev, HDA_CMD_SET_PROCESSING_COEFF(0, 0x20, val|0x80)); + val = hdaa_read_coef(dev, 0x20, 0x07); + hdaa_write_coef(dev, 0x20, 0x07, val|0x80); + } + if (subid == 0x15171043) { + /* Increase output amp on ASUS UX31A by +5dB. */ + hdaa_write_coef(dev, 0x20, 0x12, 0x2800); } } } From owner-svn-src-head@freebsd.org Mon Jul 20 19:51:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF1A09A42BE; Mon, 20 Jul 2015 19:51:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBC2319A2; Mon, 20 Jul 2015 19:51:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6KJpgYs029314; Mon, 20 Jul 2015 19:51:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6KJpgrv029313; Mon, 20 Jul 2015 19:51:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507201951.t6KJpgrv029313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 20 Jul 2015 19:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285724 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 20 Jul 2015 19:51:43 -0000 Author: kib Date: Mon Jul 20 19:51:41 2015 New Revision: 285724 URL: https://svnweb.freebsd.org/changeset/base/285724 Log: Typo in comment. Modified: head/sys/x86/iommu/intel_idpgtbl.c Modified: head/sys/x86/iommu/intel_idpgtbl.c ============================================================================== --- head/sys/x86/iommu/intel_idpgtbl.c Mon Jul 20 17:48:00 2015 (r285723) +++ head/sys/x86/iommu/intel_idpgtbl.c Mon Jul 20 19:51:41 2015 (r285724) @@ -386,7 +386,7 @@ retry: * Prevent potential free while pgtbl_obj is * unlocked in the recursive call to * domain_pgtbl_map_pte(), if other thread did - * pte write and clean while the lock if + * pte write and clean while the lock is * dropped. */ m->wire_count++; From owner-svn-src-head@freebsd.org Mon Jul 20 23:24:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD47B9A7B3A; Mon, 20 Jul 2015 23:24:26 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD4B81A3C; Mon, 20 Jul 2015 23:24:26 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6KNOQaP014795; Mon, 20 Jul 2015 23:24:26 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6KNOQbH014794; Mon, 20 Jul 2015 23:24:26 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201507202324.t6KNOQbH014794@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, 20 Jul 2015 23:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285730 - head/sbin/pfctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 20 Jul 2015 23:24:27 -0000 Author: gnn Date: Mon Jul 20 23:24:25 2015 New Revision: 285730 URL: https://svnweb.freebsd.org/changeset/base/285730 Log: Only report the lack of ALTQ support if pfctl is using verbose (-v) mode. PR: 194935 Submitted by: Jim Thompson MFC after: 2 weeks Modified: head/sbin/pfctl/pfctl.c Modified: head/sbin/pfctl/pfctl.c ============================================================================== --- head/sbin/pfctl/pfctl.c Mon Jul 20 22:32:43 2015 (r285729) +++ head/sbin/pfctl/pfctl.c Mon Jul 20 23:24:25 2015 (r285730) @@ -1924,7 +1924,7 @@ pfctl_test_altqsupport(int dev, int opts if (ioctl(dev, DIOCGETALTQS, &pa)) { if (errno == ENODEV) { - if (!(opts & PF_OPT_QUIET)) + if (opts & PF_OPT_VERBOSE) fprintf(stderr, "No ALTQ support in kernel\n" "ALTQ related functions disabled\n"); return (0); From owner-svn-src-head@freebsd.org Tue Jul 21 00:33:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 079AA9A684E; Tue, 21 Jul 2015 00:33:17 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1B18CDE; Tue, 21 Jul 2015 00:33:16 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6L0XGEi043677; Tue, 21 Jul 2015 00:33:16 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6L0XGau043676; Tue, 21 Jul 2015 00:33:16 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201507210033.t6L0XGau043676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 21 Jul 2015 00:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285732 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 00:33:17 -0000 Author: allanjude (doc committer) Date: Tue Jul 21 00:33:15 2015 New Revision: 285732 URL: https://svnweb.freebsd.org/changeset/base/285732 Log: Add the Dell E7240 laptop and Intel DP965LT motherboard to the list for the GPT active workaround PR: 194359 Requested by: sbruno, hiren Approved by: marcel MFC after: 3 days Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3139 Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Tue Jul 21 00:31:13 2015 (r285731) +++ head/usr.sbin/bsdinstall/scripts/auto Tue Jul 21 00:33:15 2015 (r285732) @@ -53,7 +53,7 @@ error() { } hline_arrows_tab_enter="Press arrows, TAB or ENTER" -msg_gpt_active_fix="Your hardware is known to have issues booting in BIOS mode from GPT partitions that are not set active. Would you like the installer to apply this workaround for you?" +msg_gpt_active_fix="Your hardware is known to have issues booting in CSM/Legacy/BIOS mode from GPT partitions that are not set active. Would you like the installer to apply this workaround for you?" msg_lenovo_fix="Your model of Lenovo is known to have a BIOS bug that prevents it booting from GPT partitions without UEFI. Would you like the installer to apply a workaround for you?" msg_no="NO" msg_yes="YES" @@ -166,6 +166,14 @@ if f_interactive; then f_dprintf "smbios.system.product=[%s]" "$sys_model" sys_version=$( kenv -q smbios.system.version ) f_dprintf "smbios.system.version=[%s]" "$sys_version" + sys_mb_maker=$( kenv -q smbios.planar.maker ) + f_dprintf "smbios.planar.maker=[%s]" "$sys_mb_maker" + sys_mb_product=$( kenv -q smbios.planar.product ) + f_dprintf "smbios.planar.product=[%s]" "$sys_mb_product" + + # + # Laptop Models + # case "$sys_maker" in "LENOVO") case "$sys_version" in @@ -182,7 +190,25 @@ if f_interactive; then ;; "Dell Inc.") case "$sys_model" in - "Latitude E7440") + "Latitude E7440"|"Latitude E7240") + dialog_workaround "$msg_gpt_active_fix" + retval=$? + f_dprintf "gpt_active_fix_prompt=[%s]" "$retval" + if [ $retval -eq $DIALOG_OK ]; then + export ZFSBOOT_PARTITION_SCHEME="GPT + Active" + export WORKAROUND_GPTACTIVE=1 + fi + ;; + esac + ;; + esac + # + # Motherboard Models + # + case "$sys_mb_maker" in + "Intel Corporation") + case "$sys_mb_product" in + "DP965LT") dialog_workaround "$msg_gpt_active_fix" retval=$? f_dprintf "gpt_active_fix_prompt=[%s]" "$retval" From owner-svn-src-head@freebsd.org Tue Jul 21 01:41:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4595E9A7410; Tue, 21 Jul 2015 01:41:59 +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 21B209AC; Tue, 21 Jul 2015 01:41:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (75-48-78-19.lightspeed.cncrca.sbcglobal.net [75.48.78.19]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2E376B94F; Mon, 20 Jul 2015 21:41:58 -0400 (EDT) From: John Baldwin To: Alan Cox Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285387 - in head: lib/libc/sys share/man/man4 sys/conf sys/kern sys/sys sys/vm usr.bin usr.bin/numactl Date: Mon, 20 Jul 2015 10:47:58 -0700 Message-ID: <14982298.P5Y2Xh6Asn@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <55A1445F.50901@rice.edu> References: <201507111521.t6BFLcrv039934@repo.freebsd.org> <55A1445F.50901@rice.edu> 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, 20 Jul 2015 21:41:58 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 21 Jul 2015 01:41:59 -0000 On Saturday, July 11, 2015 11:29:19 AM Alan Cox wrote: > On 07/11/2015 10:21, Adrian Chadd wrote: > > * The VM doesn't handle unbalanced domains very well, and if you have an overly > > unbalanced memory setup whilst under high memory pressure, VM page allocation > > may fail leading to a kernel panic. This was a problem in the past, but it's > > much more easily triggered now with these tools. > > > > > For the record, no, it doesn't panic. Both the first-touch scheme in > 9.x and the round-robin scheme in 10.x fall back to allocating from a > different domain until some page is found. I got a panic (don't recall exactly which) with the 9.x version once (albeit with that version backported to 8.x) where vm_page_alloc() returned NULL when a caller did not expect it based on the global paging targets. Unfortunately I no longer have access to the core (or any notes I might have had from debugging it). I don't recall why it didn't fall back to using a page from another domain (especially since the 9.x version just prefers local, doesn't require local). Note that I only saw this once across hundreds of machines running the 9.x version in production for 5 years or so. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Jul 21 01:41:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BDD19A735B; Tue, 21 Jul 2015 01:41:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 686C99A3; Tue, 21 Jul 2015 01:41:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (75-48-78-19.lightspeed.cncrca.sbcglobal.net [75.48.78.19]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6EE5FB913; Mon, 20 Jul 2015 21:41:56 -0400 (EDT) From: John Baldwin To: Bruce Evans Cc: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285639 - head/sys/dev/e1000 Date: Mon, 20 Jul 2015 11:04:58 -0700 Message-ID: <1772930.9D9KgtoGqa@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20150717030840.B3034@besplex.bde.org> References: <201507161632.t6GGWwJA072336@repo.freebsd.org> <20150717030840.B3034@besplex.bde.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 20 Jul 2015 21:41:56 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 21 Jul 2015 01:41:57 -0000 On Friday, July 17, 2015 03:45:36 AM Bruce Evans wrote: > On Thu, 16 Jul 2015, Sean Bruno wrote: > > > Log: > > Add an adapter CORE lock in the DDB hook em_dump_queue to avoid WITNESS > > panic in em_init_locked() while debugging. > > It is a bug to lock anything from within ddb. Agreed. DDB commands should avoid locking. If anything what you might do is use a try lock and fail the request if having the lock held means you can't safely proceed (this is what the 'kill' command in DDB does/did). If you are fine with waiting for a lock, then you shouldn't do this in DDB at all, but perhaps add a dev.em.X.reset sysctl node that does the reset when it is set to a non-zero value. (You could set CTLFLAG_SKIP to hide it from sysctl -a if desired.) If you truly need a sledgehammer that works from DDB, then locking is the last thing you want to add. I would just ignore the witness warning if possible. Alternatively you can just hack the driver to not do any locking when kdb_active is true. Your current change means that if the lock is held when you enter DDB and run the command your machine probably hard hangs. If you instead disable locking by checking kdb_active then if you drop into DDB while the lock is held you might surprise the interrupted code, but you will always get a DDB prompt back after you run the command. If surprising the interrupting code is too disruptive, then use a try lock and fail the command if the lock is held. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Jul 21 03:18:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AD799A6359; Tue, 21 Jul 2015 03:18:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C413682; Tue, 21 Jul 2015 03:18:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6L3Is4V009698; Tue, 21 Jul 2015 03:18:54 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6L3IsjR009697; Tue, 21 Jul 2015 03:18:54 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201507210318.t6L3IsjR009697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 21 Jul 2015 03:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285733 - head/release/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.20 Precedence: list List-Id: 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, 21 Jul 2015 03:18:54 -0000 Author: gjb Date: Tue Jul 21 03:18:53 2015 New Revision: 285733 URL: https://svnweb.freebsd.org/changeset/base/285733 Log: Fix an out-of-order execution issue regarding pkg(8): - pkg(8) cannot be removed before subsequent reinvocations - The PKG_CACHEDIR cannot be cleaned after the repo*.sqlite has been removed - pkg(8) cannot be removed as a precursor to any of the other steps involved here MFC after: 3 days X-MFC-With: r285722 X-MFC-Before: 10.2-{BETA3,RC1} (whichever happens next) Sponsored by: The FreeBSD Foundation Modified: head/release/tools/vagrant.conf Modified: head/release/tools/vagrant.conf ============================================================================== --- head/release/tools/vagrant.conf Tue Jul 21 00:33:15 2015 (r285732) +++ head/release/tools/vagrant.conf Tue Jul 21 03:18:53 2015 (r285733) @@ -15,9 +15,9 @@ vagrant_common () { # catalogue and install or update pkg when the instance first # launches, so these files would just be replaced anyway; removing # them from the image allows it to boot faster. + env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} clean -y -a env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} delete -f -y pkg rm ${DESTDIR}/var/db/pkg/repo-*.sqlite - env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} clean -y -a # Vagrant instances use DHCP to get their network configuration. echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf From owner-svn-src-head@freebsd.org Tue Jul 21 05:04:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C57229A7450; Tue, 21 Jul 2015 05:04:00 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADCE51E6F; Tue, 21 Jul 2015 05:04:00 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6L5404Z055152; Tue, 21 Jul 2015 05:04:00 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6L53xar055142; Tue, 21 Jul 2015 05:03:59 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201507210503.t6L53xar055142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 21 Jul 2015 05:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285734 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 05:04:01 -0000 Author: allanjude (doc committer) Date: Tue Jul 21 05:03:59 2015 New Revision: 285734 URL: https://svnweb.freebsd.org/changeset/base/285734 Log: Fix some issues with the application of libxo to ls(1) * Add whitespace trimming to some fields (username, group, size, inode, blocks) to avoid whitespace in JSON strings * fix -m mode, was invalid JSON (repeated keys), and was missing outer array container * in -n mode, numeric uids and gids were returned as strings Approved by: eadler (mentor) Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D2854 Modified: head/bin/ls/ls.c head/bin/ls/ls.h head/bin/ls/print.c Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Tue Jul 21 03:18:53 2015 (r285733) +++ head/bin/ls/ls.c Tue Jul 21 05:03:59 2015 (r285734) @@ -119,7 +119,7 @@ static int f_nofollow; /* don't follow int f_nonprint; /* show unprintables as ? */ static int f_nosort; /* don't sort output */ int f_notabs; /* don't use tab-separated multi-col output */ -static int f_numericonly; /* don't convert uid/gid to name */ + int f_numericonly; /* don't convert uid/gid to name */ int f_octal; /* show unprintables as \xxx */ int f_octal_escape; /* like f_octal but use C escapes if possible */ static int f_recursive; /* ls subdirectories also */ @@ -195,6 +195,7 @@ main(int argc, char *argv[]) if (argc < 0) return (1); xo_set_flags(NULL, XOF_COLUMNS); + xo_set_version(LS_XO_VERSION); while ((ch = getopt(argc, argv, "1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,")) != -1) { Modified: head/bin/ls/ls.h ============================================================================== --- head/bin/ls/ls.h Tue Jul 21 03:18:53 2015 (r285733) +++ head/bin/ls/ls.h Tue Jul 21 05:03:59 2015 (r285734) @@ -37,6 +37,8 @@ #define HUMANVALSTR_LEN 5 +#define LS_XO_VERSION "1" + extern long blocksize; /* block size units */ extern int f_accesstime; /* use time of last access */ @@ -58,6 +60,7 @@ extern int f_statustime; /* use time of extern int f_thousands; /* show file sizes with thousands separators */ extern char *f_timeformat; /* user-specified time format */ extern int f_notabs; /* don't use tab-separated multi-col output */ +extern int f_numericonly; /* don't convert uid/gid to name */ extern int f_type; /* add type character for non-regular files */ #ifdef COLORLS extern int f_color; /* add type in color for non-regular files */ Modified: head/bin/ls/print.c ============================================================================== --- head/bin/ls/print.c Tue Jul 21 03:18:53 2015 (r285733) +++ head/bin/ls/print.c Tue Jul 21 05:03:59 2015 (r285734) @@ -171,7 +171,7 @@ printlong(const DISPLAY *dp) xo_open_list("entry"); for (p = dp->list; p; p = p->fts_link) { - char *name; + char *name, *type; if (IS_NOPRINT(p)) continue; xo_open_instance("entry"); @@ -180,22 +180,46 @@ printlong(const DISPLAY *dp) if (name) xo_emit("{ke:name/%hs}", name); if (f_inode) - xo_emit("{:inode/%*ju} ", + xo_emit("{t:inode/%*ju} ", dp->s_inode, (uintmax_t)sp->st_ino); if (f_size) - xo_emit("{:blocks/%*jd} ", + xo_emit("{t:blocks/%*jd} ", dp->s_block, howmany(sp->st_blocks, blocksize)); strmode(sp->st_mode, buf); aclmode(buf, p); np = p->fts_pointer; xo_attr("value", "%03o", (int) sp->st_mode & ALLPERMS); - xo_emit("{t:mode/%s} {:links/%*u} {:user/%-*s} {:group/%-*s} ", - buf, dp->s_nlink, sp->st_nlink, - dp->s_user, np->user, dp->s_group, np->group); + if (f_numericonly) { + xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {td:user/%-*s}{e:user/%ju} {td:group/%-*s}{e:group/%ju} ", + buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, + dp->s_user, np->user, sp->st_uid, dp->s_group, np->group, sp->st_gid); + } else { + xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {t:user/%-*s} {t:group/%-*s} ", + buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, + dp->s_user, np->user, dp->s_group, np->group); + } + if (S_ISBLK(sp->st_mode)) + asprintf(&type, "block"); + if (S_ISCHR(sp->st_mode)) + asprintf(&type, "character"); + if (S_ISDIR(sp->st_mode)) + asprintf(&type, "directory"); + if (S_ISFIFO(sp->st_mode)) + asprintf(&type, "fifo"); + if (S_ISLNK(sp->st_mode)) + asprintf(&type, "symlink"); + if (S_ISREG(sp->st_mode)) + asprintf(&type, "regular"); + if (S_ISSOCK(sp->st_mode)) + asprintf(&type, "socket"); + if (S_ISWHT(sp->st_mode)) + asprintf(&type, "whiteout"); + xo_emit("{e:type/%s}", type); + free(type); if (f_flags) xo_emit("{:flags/%-*s} ", dp->s_flags, np->flags); if (f_label) - xo_emit("{:label/%-*s} ", dp->s_label, np->label); + xo_emit("{t:label/%-*s} ", dp->s_label, np->label); if (S_ISCHR(sp->st_mode) || S_ISBLK(sp->st_mode)) printdev(dp->s_size, sp->st_rdev); else @@ -238,6 +262,7 @@ printstream(const DISPLAY *dp) FTSENT *p; int chcnt; + xo_open_list("entry"); for (p = dp->list, chcnt = 0; p; p = p->fts_link) { if (p->fts_number == NO_PRINT) continue; @@ -247,12 +272,15 @@ printstream(const DISPLAY *dp) xo_emit("\n"); chcnt = 0; } + xo_open_instance("file"); chcnt += printaname(p, dp->s_inode, dp->s_block); + xo_close_instance("file"); if (p->fts_link) { xo_emit(", "); chcnt += 2; } } + xo_close_list("entry"); if (chcnt) xo_emit("\n"); } @@ -369,10 +397,10 @@ printaname(const FTSENT *p, u_long inode sp = p->fts_statp; chcnt = 0; if (f_inode) - chcnt += xo_emit("{:inode/%*ju} ", + chcnt += xo_emit("{t:inode/%*ju} ", (int)inodefield, (uintmax_t)sp->st_ino); if (f_size) - chcnt += xo_emit("{:size/%*jd} ", + chcnt += xo_emit("{t:size/%*jd} ", (int)sizefield, howmany(sp->st_blocks, blocksize)); #ifdef COLORLS if (f_color) @@ -425,9 +453,11 @@ printtime(const char *field, time_t ftim format = d_first ? "%e %b %Y" : "%b %e %Y"; strftime(longstring, sizeof(longstring), format, localtime(&ftime)); - snprintf(fmt, sizeof(fmt), "{:%s/%%hs} ", field); + snprintf(fmt, sizeof(fmt), "{d:%s/%%hs} ", field); xo_attr("value", "%ld", (long) ftime); xo_emit(fmt, longstring); + snprintf(fmt, sizeof(fmt), "{en:%s/%%ld} ", field); + xo_emit(fmt, (long) ftime); } static int From owner-svn-src-head@freebsd.org Tue Jul 21 06:18:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1251E9A7E1C; Tue, 21 Jul 2015 06:18:44 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EECCE1A2A; Tue, 21 Jul 2015 06:18:43 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6L6IhLL083908; Tue, 21 Jul 2015 06:18:43 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6L6Ihi7083907; Tue, 21 Jul 2015 06:18:43 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201507210618.t6L6Ihi7083907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 21 Jul 2015 06:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285735 - head/sbin/geom/class/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 21 Jul 2015 06:18:44 -0000 Author: ae Date: Tue Jul 21 06:18:42 2015 New Revision: 285735 URL: https://svnweb.freebsd.org/changeset/base/285735 Log: lseek() allows an offset to be set beyond the end of file. Using it to check that partition has enough space to write bootcode doesn't work. Use the known size of provider instead. PR: 201504 MFC after: 1 week Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Tue Jul 21 05:03:59 2015 (r285734) +++ head/sbin/geom/class/part/geom_part.c Tue Jul 21 06:18:42 2015 (r285735) @@ -1106,14 +1106,11 @@ gpart_write_partcode(struct ggeom *gp, i if (pp != NULL) { snprintf(dsf, sizeof(dsf), "/dev/%s", pp->lg_name); + if (pp->lg_mediasize < size) + errx(EXIT_FAILURE, "%s: not enough space", dsf); fd = open(dsf, O_WRONLY); if (fd == -1) err(EXIT_FAILURE, "%s", dsf); - if (lseek(fd, size, SEEK_SET) != size) - errx(EXIT_FAILURE, "%s: not enough space", dsf); - if (lseek(fd, 0, SEEK_SET) != 0) - err(EXIT_FAILURE, "%s", dsf); - /* * When writing to a disk device, the write must be * sector aligned and not write to any partial sectors, @@ -1152,11 +1149,11 @@ gpart_write_partcode_vtoc8(struct ggeom if (pp->lg_sectorsize != sizeof(struct vtoc8)) errx(EXIT_FAILURE, "%s: unexpected sector " "size (%d)\n", dsf, pp->lg_sectorsize); + if (pp->lg_mediasize < VTOC_BOOTSIZE) + continue; fd = open(dsf, O_WRONLY); if (fd == -1) err(EXIT_FAILURE, "%s", dsf); - if (lseek(fd, VTOC_BOOTSIZE, SEEK_SET) != VTOC_BOOTSIZE) - continue; /* * We ignore the first VTOC_BOOTSIZE bytes of boot code in * order to avoid overwriting the label. From owner-svn-src-head@freebsd.org Tue Jul 21 06:21:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E3149A7F3A; Tue, 21 Jul 2015 06:21:31 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03E6C1CBE; Tue, 21 Jul 2015 06:21:31 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igbpg9 with SMTP id pg9so55074931igb.0; Mon, 20 Jul 2015 23:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Kk8sbQT7d9ohmbfjup2YucZSqnrU/1scyZ8rSyYWNyI=; b=On0ZnhVc9TdV2n2akfTC1NwreY+elu6qd04ZqBvZ47G4enX7tZv0Unw5L9++nTL4kY RcVlRM4BTJcLNZTz2psp3H1KNx+EzqU/Zc5w29hBZsddCQKtNdruWQ2YsNm7DWGtpl5P 3pBP3D6MiGHXF7CfTe0Y+Rh0wLhH7t0pZIOytFvXigkgsYzdx3zQSseek0ZCgVWb7eT3 e84XVkyVaplGL83z5IXU7tkm8d8N3dG8g+rCSM6jevR3nvVNO2jy6Ae60gdrZgOJWjPe +A538X55Bqhkl7v/pWkIQ5vQkW8bVPg6/OamFxKMZs/hz8q/52xspDdpmn/QoZye/Oej Q0pA== MIME-Version: 1.0 X-Received: by 10.50.60.100 with SMTP id g4mr20925880igr.41.1437459690308; Mon, 20 Jul 2015 23:21:30 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Mon, 20 Jul 2015 23:21:30 -0700 (PDT) In-Reply-To: <201507040654.t646sGO7044196@repo.freebsd.org> References: <201507040654.t646sGO7044196@repo.freebsd.org> Date: Mon, 20 Jul 2015 23:21:30 -0700 Message-ID: Subject: Re: svn commit: r285125 - in head/sys: kern sys From: Adrian Chadd 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 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 06:21:31 -0000 Bad mjg! this happend whilst doing 'sysctl -vmstat 1' in one window, 'top' in another window, and 'kldunload uhci' as root: Unread portion of the kernel message buffer: uhci5: detached panic: sleepq_add: td 0xc75d06a0 to sleep on wchan 0xc0b3e8e4 with sleeping prohibited cpuid =3D 1 KDB: stack backtrace: db_trace_self_wrapper(c09f8c12,20676e69,686f7270,74696269,a6465,...) at db_trace_self_wrapper+0x2a/frame 0xeaa61838 kdb_backtrace(c0a3f06b,1,c09fa9f1,eaa61920,1,...) at kdb_backtrace+0x2d/frame 0xeaa618a0 vpanic(c09fa9f1,eaa61920,c09fa9f1,eaa61920,c75d06a0,...) at vpanic+0x117/frame 0xeaa618d4 kassert_panic(c09fa9f1,c09faa29,c75d06a0,c0b3e8e4,c06f40cc,...) at kassert_panic+0x15c/frame 0xeaa61914 sleepq_add(c0b3e8e4,0,c09f2d20,3,0,...) at sleepq_add+0x2eb/frame 0xeaa6194= 0 _sx_xlock_hard(c0b3e8e4,c75d06a0,0,c09f2d35,19b,...) at _sx_xlock_hard+0x6cb/frame 0xeaa619ec _sx_xlock(c0b3e8e4,0,c09f2d35,19b,c0b3e8e4,...) at _sx_xlock+0xe1/frame 0xeaa61a1c _rm_rlock(c0b3e8cc,eaa61ad0,0,aa,0,...) at _rm_rlock+0x1f0/frame 0xeaa61a4c _rm_rlock_debug(c0b3e8cc,eaa61ad0,0,c09f4c54,aa,...) at _rm_rlock_debug+0x11d/frame 0xeaa61a78 sysctl_root_handler_locked(0,eaa61b28,eaa61ad0,0,eaa61b28,...) at sysctl_root_handler_locked+0x104/frame 0xeaa61aa8 sysctl_root(eaa61b28,28,2,c75f5720,eaa61be8,...) at sysctl_root+0x1b1/frame 0xeaa61b08 userland_sysctl(c75d06a0,eaa61bac,2,28803040,bfbfecf8,...) at userland_sysctl+0x172/frame 0xeaa61b70 sys___sysctl(c75d06a0,eaa61ca8,c09ebfdf,4,eaa61c4c,...) at sys___sysctl+0x98/frame 0xeaa61c18 syscall(eaa61ce8) at syscall+0x33e/frame 0xeaa61cdc Xint0x80_syscall() at Xint0x80_syscall+0x2c/frame 0xeaa61cdc --- syscall (202, FreeBSD ELF32, sys___sysctl), eip =3D 0x281b4547, esp =3D 0xbfbfeca0, ebp =3D 0xbfbfeccc --- KDB: enter: panic Reading symbols from /boot/kernel/if_tap.ko.symbols...done. Loaded symbols for /boot/kernel/if_tap.ko.symbols Reading symbols from /boot/kernel/if_tun.ko.symbols...done. Loaded symbols for /boot/kernel/if_tun.ko.symbols Reading symbols from /boot/kernel/if_em.ko.symbols...done. Loaded symbols for /boot/kernel/if_em.ko.symbols Reading symbols from /boot/kernel/sound.ko.symbols...done. Loaded symbols for /boot/kernel/sound.ko.symbols Reading symbols from /boot/kernel/snd_hda.ko.symbols...done. Loaded symbols for /boot/kernel/snd_hda.ko.symbols Reading symbols from /boot/kernel/usb.ko.symbols...done. Loaded symbols for /boot/kernel/usb.ko.symbols Reading symbols from /boot/kernel/ukbd.ko.symbols...done. Loaded symbols for /boot/kernel/ukbd.ko.symbols Reading symbols from /boot/kernel/umass.ko.symbols...done. Loaded symbols for /boot/kernel/umass.ko.symbols Reading symbols from /boot/kernel/agp.ko.symbols...done. Loaded symbols for /boot/kernel/agp.ko.symbols Reading symbols from /boot/kernel/acpi_video.ko.symbols...done. Loaded symbols for /boot/kernel/acpi_video.ko.symbols Reading symbols from /boot/kernel/firmware.ko.symbols...done. Loaded symbols for /boot/kernel/firmware.ko.symbols Reading symbols from /boot/kernel/acpi_ibm.ko.symbols...done. Loaded symbols for /boot/kernel/acpi_ibm.ko.symbols Reading symbols from /boot/kernel/sem.ko.symbols...done. Loaded symbols for /boot/kernel/sem.ko.symbols Reading symbols from /boot/kernel/cpufreq.ko.symbols...done. Loaded symbols for /boot/kernel/cpufreq.ko.symbols Reading symbols from /boot/kernel/ata.ko.symbols...done. Loaded symbols for /boot/kernel/ata.ko.symbols Reading symbols from /boot/kernel/atapci.ko.symbols...done. Loaded symbols for /boot/kernel/atapci.ko.symbols Reading symbols from /boot/kernel/ahci.ko.symbols...done. Loaded symbols for /boot/kernel/ahci.ko.symbols Reading symbols from /boot/kernel/uhci.ko.symbols...done. Loaded symbols for /boot/kernel/uhci.ko.symbols Reading symbols from /boot/kernel/ehci.ko.symbols...done. Loaded symbols for /boot/kernel/ehci.ko.symbols Reading symbols from /boot/kernel/pccard.ko.symbols...done. Loaded symbols for /boot/kernel/pccard.ko.symbols Reading symbols from /boot/kernel/cbb.ko.symbols...done. Loaded symbols for /boot/kernel/cbb.ko.symbols Reading symbols from /boot/kernel/exca.ko.symbols...done. Loaded symbols for /boot/kernel/exca.ko.symbols Reading symbols from /boot/kernel/cardbus.ko.symbols...done. Loaded symbols for /boot/kernel/cardbus.ko.symbols Reading symbols from /boot/kernel/wlan.ko.symbols...done. Loaded symbols for /boot/kernel/wlan.ko.symbols Reading symbols from /boot/kernel/wlan_ccmp.ko.symbols...done. Loaded symbols for /boot/kernel/wlan_ccmp.ko.symbols Reading symbols from /boot/kernel/wlan_tkip.ko.symbols...done. Loaded symbols for /boot/kernel/wlan_tkip.ko.symbols Reading symbols from /boot/kernel/wlan_wep.ko.symbols...done. Loaded symbols for /boot/kernel/wlan_wep.ko.symbols Reading symbols from /boot/kernel/wlan_amrr.ko.symbols...done. Loaded symbols for /boot/kernel/wlan_amrr.ko.symbols Reading symbols from /boot/kernel/wlan_xauth.ko.symbols...done. Loaded symbols for /boot/kernel/wlan_xauth.ko.symbols Reading symbols from /boot/kernel/cuse.ko.symbols...done. Loaded symbols for /boot/kernel/cuse.ko.symbols Reading symbols from /boot/kernel/ng_ubt.ko.symbols...done. Loaded symbols for /boot/kernel/ng_ubt.ko.symbols Reading symbols from /boot/kernel/netgraph.ko.symbols...done. Loaded symbols for /boot/kernel/netgraph.ko.symbols Reading symbols from /boot/kernel/ng_hci.ko.symbols...done. Loaded symbols for /boot/kernel/ng_hci.ko.symbols Reading symbols from /boot/kernel/ng_bluetooth.ko.symbols...done. Loaded symbols for /boot/kernel/ng_bluetooth.ko.symbols Reading symbols from /boot/kernel/ng_l2cap.ko.symbols...done. Loaded symbols for /boot/kernel/ng_l2cap.ko.symbols Reading symbols from /boot/kernel/ng_btsocket.ko.symbols...done. Loaded symbols for /boot/kernel/ng_btsocket.ko.symbols Reading symbols from /boot/kernel/ng_socket.ko.symbols...done. Loaded symbols for /boot/kernel/ng_socket.ko.symbols Reading symbols from /boot/kernel/ipfw.ko.symbols...done. Loaded symbols for /boot/kernel/ipfw.ko.symbols Reading symbols from /boot/kernel/i915kms.ko.symbols...done. Loaded symbols for /boot/kernel/i915kms.ko.symbols Reading symbols from /boot/kernel/drm2.ko.symbols...done. Loaded symbols for /boot/kernel/drm2.ko.symbols Reading symbols from /boot/kernel/iicbus.ko.symbols...done. Loaded symbols for /boot/kernel/iicbus.ko.symbols Reading symbols from /boot/kernel/iic.ko.symbols...done. Loaded symbols for /boot/kernel/iic.ko.symbols Reading symbols from /boot/kernel/iicbb.ko.symbols...done. Loaded symbols for /boot/kernel/iicbb.ko.symbols Reading symbols from /boot/kernel/wlan_rssadapt.ko.symbols...done. Loaded symbols for /boot/kernel/wlan_rssadapt.ko.symbols Reading symbols from /boot/kernel/if_ath.ko.symbols...done. Loaded symbols for /boot/kernel/if_ath.ko.symbols Reading symbols from /boot/kernel/if_ath_pci.ko.symbols...done. Loaded symbols for /boot/kernel/if_ath_pci.ko.symbols Reading symbols from /boot/kernel/if_iwn.ko.symbols...done. Loaded symbols for /boot/kernel/if_iwn.ko.symbols Reading symbols from /boot/kernel/if_wpi.ko.symbols...done. Loaded symbols for /boot/kernel/if_wpi.ko.symbols #0 doadump (textdump=3D-1061434632) at pcpu.h:205 205 pcpu.h: No such file or directory. in pcpu.h (kgdb) bt #0 doadump (textdump=3D-1061434632) at pcpu.h:205 #1 0xc050bc1d in db_fncall (dummy1=3D-358214152, dummy2=3Dfalse, dummy3=3D-960040368, dummy4=3D0xeaa615e4 "'>S=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF= =BF=BD=EF=BF=BD") at /usr/home/adrian/work/freebsd/head/src/sys/ddb/db_command.c:568 #2 0xc050b9f6 in db_command (cmd_table=3D) at /usr/home/adrian/work/freebsd/head/src/sys/ddb/db_command.c:440 #3 0xc050b640 in db_command_loop () at /usr/home/adrian/work/freebsd/head/src/sys/ddb/db_command.c:493 #4 0xc050e086 in db_trap (code=3D) at /usr/home/adrian/work/freebsd/head/src/sys/ddb/db_main.c:251 #5 0xc06e8387 in kdb_trap (tf=3D) at /usr/home/adrian/work/freebsd/head/src/sys/kern/subr_kdb.c:654 #6 0xc0969de2 in trap (frame=3D) at /usr/home/adrian/work/freebsd/head/src/sys/i386/i386/trap.c:693 #7 0xc0955bb7 in calltrap () at /usr/home/adrian/work/freebsd/head/src/sys/i386/i386/exception.s:172 #8 0xc06e7c1d in kdb_enter (why=3D0xc09f3c1c "panic", msg=3D) at cpufunc.h:60 #9 0xc06a8967 in vpanic (fmt=3D, ap=3D) at /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_shutdown.c:737 #10 0xc06a882c in kassert_panic (fmt=3D) at /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_shutdown.c:634 #11 0xc06f449b in sleepq_add (wchan=3D0xc0b3e8e4, wmesg=3D, flags=3D, queue=3D) at /usr/home/adrian/work/freebsd/head/src/sys/kern/subr_sleepqueue.c:308 #12 0xc06b167b in _sx_xlock_hard (sx=3D0xc0b3e8e4, tid=3D, opts=3D, file=3D0x0, line=3D18) at /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sx.c:697 #13 0xc06b0841 in _sx_xlock (sx=3D0xc0b3e8e4, opts=3D, file=3D0xc09f2d35 "/usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c", line=3D411) at sx.h:154 #14 0xc06a4510 in _rm_rlock (rm=3D0xc0b3e8cc, tracker=3D0xeaa61ad0, trylock=3D) at /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c:411 #15 0xc06a4e2d in _rm_rlock_debug (rm=3D0xc0b3e8cc, tracker=3D0xeaa61ad0, trylock=3D0) at /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock= .c:665 #16 0xc06b5da4 in sysctl_root_handler_locked (oid=3D0xc0a6ee20, arg1=3D, arg2=3D, req=3D, tracker=3D0xeaa61ad0) at /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:170 #17 0xc06b5531 in sysctl_root (arg1=3D, arg2=3D) at /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1692 #18 0xc06b5ac2 in userland_sysctl (td=3D, name=3D, namelen=3D2, old=3D, oldlenp=3D, inkernel=3D, new=3D, newlen=3D, retval=3D0x12, flags=3D) at /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1797 #19 0xc06b5908 in sys___sysctl (uap=3D0xeaa61ca8) at /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1724 #20 0xc096aaee in syscall (frame=3D) at subr_syscall.c= :133 #21 0xc0955c5c in Xint0x80_syscall () at /usr/home/adrian/work/freebsd/head/src/sys/i386/i386/exception.s:278 #22 0x00000033 in ?? () Previous frame inner to this frame (corrupt stack?) Current language: auto; currently minimal From owner-svn-src-head@freebsd.org Tue Jul 21 06:48:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D3DF9A62CE; Tue, 21 Jul 2015 06:48:37 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82C8316C1; Tue, 21 Jul 2015 06:48:37 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6L6mboX095918; Tue, 21 Jul 2015 06:48:37 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6L6mbZ7095917; Tue, 21 Jul 2015 06:48:37 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201507210648.t6L6mbZ7095917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Tue, 21 Jul 2015 06:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285736 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 06:48:37 -0000 Author: hiren Date: Tue Jul 21 06:48:36 2015 New Revision: 285736 URL: https://svnweb.freebsd.org/changeset/base/285736 Log: Remove a couple of TUNABLE_INT() calls which are unnecessary after r267961. r267961 did remove them but they "reappeared" when ixgbe(4) rewrite happened in r280182. Sponsored by: Limelight Networks Modified: head/sys/dev/ixgbe/if_ix.c Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Tue Jul 21 06:18:42 2015 (r285735) +++ head/sys/dev/ixgbe/if_ix.c Tue Jul 21 06:48:36 2015 (r285736) @@ -273,7 +273,6 @@ SYSCTL_INT(_hw_ix, OID_AUTO, max_interru /* How many packets rxeof tries to clean at a time */ static int ixgbe_rx_process_limit = 256; -TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit); SYSCTL_INT(_hw_ix, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, &ixgbe_rx_process_limit, 0, "Maximum number of received packets to process at a time," @@ -281,7 +280,6 @@ SYSCTL_INT(_hw_ix, OID_AUTO, rx_process_ /* How many packets txeof tries to clean at a time */ static int ixgbe_tx_process_limit = 256; -TUNABLE_INT("hw.ixgbe.tx_process_limit", &ixgbe_tx_process_limit); SYSCTL_INT(_hw_ix, OID_AUTO, tx_process_limit, CTLFLAG_RDTUN, &ixgbe_tx_process_limit, 0, "Maximum number of sent packets to process at a time," From owner-svn-src-head@freebsd.org Tue Jul 21 08:39:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 173F99A7847; Tue, 21 Jul 2015 08:39:29 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9D1E1B89; Tue, 21 Jul 2015 08:39:28 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by wicgb10 with SMTP id gb10so48376527wic.1; Tue, 21 Jul 2015 01:39:27 -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-type:content-disposition:in-reply-to:user-agent; bh=yNf+tXPWZajWHnLZ7ustMkmcLxLubv2tyyLiMsaWBeg=; b=YwK9HANiUKFXEsVQEMOa7Lpi2hkeIQr7K668DyOiRM20ng56KXVJXAc0aztVHxSe2H uhC9R0Q9eDtN+BHu9NQsn3F2VmmRyPCghOpoSxPuLrVHqMxTOhDaDp/8afQ5HKN90j9E BWOZZhZ73/4GMS60U1exiZlw/q9FKLgmMdTRvkTTpcOQyopU+S/CAmaDf+dgqODFrGJ0 cX7KO145O6TuOK+pz+3lcWrpDPiBqR8ZlA+GpPsHQ4Cr2hjrzreuT14vXgIcoPilnqug t1w8N19Xt1tS+hGna8U/MwaeQ6gPdiAQBLDh8cJ3+lXEnmx5SuLF/mEVytxWt1wgMxze K2DA== X-Received: by 10.194.172.130 with SMTP id bc2mr69335020wjc.85.1437467967119; Tue, 21 Jul 2015 01:39:27 -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 ez4sm15612052wid.14.2015.07.21.01.39.24 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 21 Jul 2015 01:39:25 -0700 (PDT) Date: Tue, 21 Jul 2015 10:39:22 +0200 From: Mateusz Guzik To: Adrian Chadd Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , jhb@freebsd.org Subject: Re: svn commit: r285125 - in head/sys: kern sys Message-ID: <20150721083922.GB6736@dft-labs.eu> References: <201507040654.t646sGO7044196@repo.freebsd.org> 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.20 Precedence: list List-Id: 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, 21 Jul 2015 08:39:29 -0000 Cc'ing jhb@ who made relevant changes to rmlocks On Mon, Jul 20, 2015 at 11:21:30PM -0700, Adrian Chadd wrote: > this happend whilst doing 'sysctl -vmstat 1' in one window, 'top' in > another window, and 'kldunload uhci' as root: > > Unread portion of the kernel message buffer: > uhci5: detached > panic: sleepq_add: td 0xc75d06a0 to sleep on wchan 0xc0b3e8e4 with > sleeping prohibited > [..] > #10 0xc06a882c in kassert_panic (fmt=) at > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_shutdown.c:634 > #11 0xc06f449b in sleepq_add (wchan=0xc0b3e8e4, wmesg= out>, flags=, queue=) at > /usr/home/adrian/work/freebsd/head/src/sys/kern/subr_sleepqueue.c:308 > #12 0xc06b167b in _sx_xlock_hard (sx=0xc0b3e8e4, tid= out>, opts=, file=0x0, line=18) at > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sx.c:697 > #13 0xc06b0841 in _sx_xlock (sx=0xc0b3e8e4, opts= out>, file=0xc09f2d35 > "/usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c", > line=411) at sx.h:154 > #14 0xc06a4510 in _rm_rlock (rm=0xc0b3e8cc, tracker=0xeaa61ad0, > trylock=) at > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c:411 > #15 0xc06a4e2d in _rm_rlock_debug (rm=0xc0b3e8cc, tracker=0xeaa61ad0, > trylock=0) at /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c:665 > #16 0xc06b5da4 in sysctl_root_handler_locked (oid=0xc0a6ee20, > arg1=, arg2=, req= optimized out>, tracker=0xeaa61ad0) at > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:170 > #17 0xc06b5531 in sysctl_root (arg1=, arg2= optimized out>) at > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1692 > #18 0xc06b5ac2 in userland_sysctl (td=, > name=, namelen=2, old=, > oldlenp=, inkernel=, > new=, newlen=, retval=0x12, > flags=) at > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1797 > #19 0xc06b5908 in sys___sysctl (uap=0xeaa61ca8) at > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1724 > #20 0xc096aaee in syscall (frame=) at subr_syscall.c:133 > #21 0xc0955c5c in Xint0x80_syscall () at > /usr/home/adrian/work/freebsd/head/src/sys/i386/i386/exception.s:278 rmlock(9) states: Sleepable read-mostly locks are created by passing RM_SLEEPABLE to rm_init_flags(). Unlike normal read-mostly locks, sleepable read-mostly locks follow the same lock ordering rules as sx(9) locks. Sleepable read-mostly locks do not propagate priority to writers, but they do propagate priority to readers. Writers are permitted to sleep while holding a read-mostly lock, but readers are not. Unlike other sleepable locks such as sx(9) locks, readers must use try operations on other sleepable locks to avoid sleeping. May be that's my bad English, but I read that: rm_rlock(...); /* can't sleep here */ rm_runlock(...); Turns out it's the rm_rlock itself which must not sleep and you have to rm_try_rlock instead. Now, why does not rm_rlock panic outright when passed a sleepable lock? Further, that's a rather unfortunate property. With only skimming through rmlock implementation, I get why you would want to actualy not sleep in rm_rlock. So how about a helper (say rm_rlock_sleepable) which would be roughly: void _rm_rlock_sleepable(struct rmlock *rm, struct rm_priotracker *tracker) { MPASS(rm->lock_object.lo_flags & LO_SLEEPABLE); while (rm_try_rlock(rm, tracker) == 0) { sx_slock(&rm->rm_lock_sx); sx_sunlock(&rm->rm_lock_sx); } } As for the usage here, sysctl seems like a natural consumer for the lock since after the kernel boots multiuser tree change is a "once in a year" event. This offers a very minor performance gain as well. The patch can be reverted back to a mere sx lock, but currently sysctl is the only in-tree consumer of sleepable rmlocks, so I would argue it is beneficial to keep it as a user if only to know the feature is somewhat operational. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Jul 21 09:44:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97C0C9A6708; Tue, 21 Jul 2015 09:44:46 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 884611FBF; Tue, 21 Jul 2015 09:44:46 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6L9ikWu068930; Tue, 21 Jul 2015 09:44:46 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6L9ikcx068929; Tue, 21 Jul 2015 09:44:46 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201507210944.t6L9ikcx068929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Tue, 21 Jul 2015 09:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285739 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 21 Jul 2015 09:44:46 -0000 Author: pluknet Date: Tue Jul 21 09:44:45 2015 New Revision: 285739 URL: https://svnweb.freebsd.org/changeset/base/285739 Log: Add missing priority argument in example code in BUGS section. PR: 201725 Submitted by: Thomas Cort MFC after: 1 week Modified: head/lib/libc/gen/syslog.3 Modified: head/lib/libc/gen/syslog.3 ============================================================================== --- head/lib/libc/gen/syslog.3 Tue Jul 21 07:22:18 2015 (r285738) +++ head/lib/libc/gen/syslog.3 Tue Jul 21 09:44:45 2015 (r285739) @@ -28,7 +28,7 @@ .\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 30, 2004 +.Dd July 21, 2015 .Dt SYSLOG 3 .Os .Sh NAME @@ -292,4 +292,4 @@ for later interpolation by .Pp Always use the proper secure idiom: .Pp -.Dl syslog("%s", string); +.Dl syslog(priority, "%s", string); From owner-svn-src-head@freebsd.org Tue Jul 21 09:54:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C8199A6AB0; Tue, 21 Jul 2015 09:54:33 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CB7B19D2; Tue, 21 Jul 2015 09:54:33 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6L9sXig073697; Tue, 21 Jul 2015 09:54:33 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6L9sWtm073695; Tue, 21 Jul 2015 09:54:32 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201507210954.t6L9sWtm073695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 21 Jul 2015 09:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285740 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 09:54:33 -0000 Author: rrs Date: Tue Jul 21 09:54:31 2015 New Revision: 285740 URL: https://svnweb.freebsd.org/changeset/base/285740 Log: When a tunneling protocol is being used with UDP we must release the lock on the INP before calling the tunnel protocol, else a LOR may occur (it does with SCTP for sure). Instead we must acquire a ref count and release the lock, taking care to allow for the case where the UDP socket has gone away and *not* unlocking since the refcnt decrement on the inp will do the unlock in that case. Reviewed by: tuexen MFC after: 3 weeks Modified: head/sys/netinet/udp_usrreq.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue Jul 21 09:44:45 2015 (r285739) +++ head/sys/netinet/udp_usrreq.c Tue Jul 21 09:54:31 2015 (r285740) @@ -293,8 +293,17 @@ udplite_destroy(void) * contains the source address. If the socket ends up being an IPv6 socket, * udp_append() will convert to a sockaddr_in6 before passing the address * into the socket code. + * + * In the normal case udp_append() will return 0, indicating that you + * must unlock the inp. However if a tunneling protocol is in place we increment + * the inpcb refcnt and unlock the inp, on return from the tunneling protocol we + * then decrement the reference count. If the inp_rele returns 1, indicating the + * inp is gone, we return that to the caller to tell them *not* to unlock + * the inp. In the case of multi-cast this will cause the distribution + * to stop (though most tunneling protocols known currently do *not* use + * multicast). */ -static void +static int udp_append(struct inpcb *inp, struct ip *ip, struct mbuf *n, int off, struct sockaddr_in *udp_in) { @@ -313,9 +322,12 @@ udp_append(struct inpcb *inp, struct ip */ up = intoudpcb(inp); if (up->u_tun_func != NULL) { + in_pcbref(inp); + INP_RUNLOCK(inp); (*up->u_tun_func)(n, off, inp, (struct sockaddr *)udp_in, up->u_tun_ctx); - return; + INP_RLOCK(inp); + return (in_pcbrele_rlocked(inp)); } off += sizeof(struct udphdr); @@ -324,7 +336,7 @@ udp_append(struct inpcb *inp, struct ip /* Check AH/ESP integrity. */ if (ipsec4_in_reject(n, inp)) { m_freem(n); - return; + return (0); } #ifdef IPSEC_NAT_T up = intoudpcb(inp); @@ -332,14 +344,14 @@ udp_append(struct inpcb *inp, struct ip if (up->u_flags & UF_ESPINUDP_ALL) { /* IPSec UDP encaps. */ n = udp4_espdecap(inp, n, off); if (n == NULL) /* Consumed. */ - return; + return (0); } #endif /* IPSEC_NAT_T */ #endif /* IPSEC */ #ifdef MAC if (mac_inpcb_check_deliver(inp, n) != 0) { m_freem(n); - return; + return (0); } #endif /* MAC */ if (inp->inp_flags & INP_CONTROLOPTS || @@ -373,6 +385,7 @@ udp_append(struct inpcb *inp, struct ip UDPSTAT_INC(udps_fullsock); } else sorwakeup_locked(so); + return (0); } int @@ -579,8 +592,10 @@ udp_input(struct mbuf **mp, int *offp, i if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { UDP_PROBE(receive, NULL, last, ip, last, uh); - udp_append(last, ip, n, iphlen, - &udp_in); + if (udp_append(last, ip, n, iphlen, + &udp_in)) { + goto inp_lost; + } } INP_RUNLOCK(last); } @@ -611,8 +626,9 @@ udp_input(struct mbuf **mp, int *offp, i goto badunlocked; } UDP_PROBE(receive, NULL, last, ip, last, uh); - udp_append(last, ip, m, iphlen, &udp_in); - INP_RUNLOCK(last); + if (udp_append(last, ip, m, iphlen, &udp_in) == 0) + INP_RUNLOCK(last); + inp_lost: INP_INFO_RUNLOCK(pcbinfo); return (IPPROTO_DONE); } @@ -700,8 +716,8 @@ udp_input(struct mbuf **mp, int *offp, i } UDP_PROBE(receive, NULL, inp, ip, inp, uh); - udp_append(inp, ip, m, iphlen, &udp_in); - INP_RUNLOCK(inp); + if (udp_append(inp, ip, m, iphlen, &udp_in) == 0) + INP_RUNLOCK(inp); return (IPPROTO_DONE); badunlocked: Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Tue Jul 21 09:44:45 2015 (r285739) +++ head/sys/netinet6/udp6_usrreq.c Tue Jul 21 09:54:31 2015 (r285740) @@ -136,7 +136,7 @@ __FBSDID("$FreeBSD$"); extern struct protosw inetsw[]; static void udp6_detach(struct socket *so); -static void +static int udp6_append(struct inpcb *inp, struct mbuf *n, int off, struct sockaddr_in6 *fromsa) { @@ -151,21 +151,24 @@ udp6_append(struct inpcb *inp, struct mb */ up = intoudpcb(inp); if (up->u_tun_func != NULL) { + in_pcbref(inp); + INP_RUNLOCK(inp); (*up->u_tun_func)(n, off, inp, (struct sockaddr *)fromsa, up->u_tun_ctx); - return; + INP_RLOCK(inp); + return (in_pcbrele_rlocked(inp)); } #ifdef IPSEC /* Check AH/ESP integrity. */ if (ipsec6_in_reject(n, inp)) { m_freem(n); - return; + return (0); } #endif /* IPSEC */ #ifdef MAC if (mac_inpcb_check_deliver(inp, n) != 0) { m_freem(n); - return; + return (0); } #endif opts = NULL; @@ -185,6 +188,7 @@ udp6_append(struct inpcb *inp, struct mb UDPSTAT_INC(udps_fullsock); } else sorwakeup_locked(so); + return (0); } int @@ -367,7 +371,8 @@ udp6_input(struct mbuf **mp, int *offp, INP_RLOCK(last); UDP_PROBE(receive, NULL, last, ip6, last, uh); - udp6_append(last, n, off, &fromsa); + if (udp6_append(last, n, off, &fromsa)) + goto inp_lost; INP_RUNLOCK(last); } } @@ -398,8 +403,9 @@ udp6_input(struct mbuf **mp, int *offp, INP_RLOCK(last); INP_INFO_RUNLOCK(pcbinfo); UDP_PROBE(receive, NULL, last, ip6, last, uh); - udp6_append(last, m, off, &fromsa); - INP_RUNLOCK(last); + if (udp6_append(last, m, off, &fromsa)) + INP_RUNLOCK(last); + inp_lost: return (IPPROTO_DONE); } /* @@ -477,8 +483,8 @@ udp6_input(struct mbuf **mp, int *offp, } } UDP_PROBE(receive, NULL, inp, ip6, inp, uh); - udp6_append(inp, m, off, &fromsa); - INP_RUNLOCK(inp); + if (udp6_append(inp, m, off, &fromsa) == 0) + INP_RUNLOCK(inp); return (IPPROTO_DONE); badheadlocked: From owner-svn-src-head@freebsd.org Tue Jul 21 09:57:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 146E39A6B13; Tue, 21 Jul 2015 09:57:14 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 053501B46; Tue, 21 Jul 2015 09:57:14 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6L9vDZw074309; Tue, 21 Jul 2015 09:57:13 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6L9vDpZ074308; Tue, 21 Jul 2015 09:57:13 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201507210957.t6L9vDpZ074308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Tue, 21 Jul 2015 09:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285741 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 09:57:14 -0000 Author: pluknet Date: Tue Jul 21 09:57:13 2015 New Revision: 285741 URL: https://svnweb.freebsd.org/changeset/base/285741 Log: Fix sb_state constant names as used e.g. to display in DDB ``show sockbuf''. MFC after: 1 week Modified: head/sys/kern/uipc_debug.c Modified: head/sys/kern/uipc_debug.c ============================================================================== --- head/sys/kern/uipc_debug.c Tue Jul 21 09:54:31 2015 (r285740) +++ head/sys/kern/uipc_debug.c Tue Jul 21 09:57:13 2015 (r285741) @@ -209,15 +209,15 @@ db_print_sbstate(short sb_state) comma = 0; if (sb_state & SBS_CANTSENDMORE) { - db_printf("%sSS_CANTSENDMORE", comma ? ", " : ""); + db_printf("%sSBS_CANTSENDMORE", comma ? ", " : ""); comma = 1; } if (sb_state & SBS_CANTRCVMORE) { - db_printf("%sSS_CANTRCVMORE", comma ? ", " : ""); + db_printf("%sSBS_CANTRCVMORE", comma ? ", " : ""); comma = 1; } if (sb_state & SBS_RCVATMARK) { - db_printf("%sSS_RCVATMARK", comma ? ", " : ""); + db_printf("%sSBS_RCVATMARK", comma ? ", " : ""); comma = 1; } } From owner-svn-src-head@freebsd.org Tue Jul 21 10:52:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 459349A79F6; Tue, 21 Jul 2015 10:52:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31C77144A; Tue, 21 Jul 2015 10:52:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LAq6eW002182; Tue, 21 Jul 2015 10:52:06 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LAq6qQ002181; Tue, 21 Jul 2015 10:52:06 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201507211052.t6LAq6qQ002181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 21 Jul 2015 10:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285742 - head/usr.bin/last X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 10:52:07 -0000 Author: ed Date: Tue Jul 21 10:52:05 2015 New Revision: 285742 URL: https://svnweb.freebsd.org/changeset/base/285742 Log: Unbreak "last reboot". According to the last(1) man page, the "reboot" pseudo-user should print all system reboot entries. This got broken by the utmpx import, as records are typed. Re-add support for "last reboot" by specifically matching against SHUTDOWN_TIME and BOOT_TIME records. PR: 168844 Submitted by: matthew@ MFC after: 1 month Modified: head/usr.bin/last/last.c Modified: head/usr.bin/last/last.c ============================================================================== --- head/usr.bin/last/last.c Tue Jul 21 09:57:13 2015 (r285741) +++ head/usr.bin/last/last.c Tue Jul 21 10:52:05 2015 (r285742) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); typedef struct arg { char *name; /* argument */ +#define REBOOT_TYPE -1 #define HOST_TYPE -2 #define TTY_TYPE -3 #define USER_TYPE -4 @@ -180,6 +181,8 @@ main(int argc, char *argv[]) if (argc) { setlinebuf(stdout); for (argv += optind; *argv; ++argv) { + if (strcmp(*argv, "reboot") == 0) + addarg(REBOOT_TYPE, *argv); #define COMPATIBILITY #ifdef COMPATIBILITY /* code to allow "last p5" to work */ @@ -389,6 +392,11 @@ want(struct utmpx *bp) for (step = arglist; step; step = step->next) switch(step->type) { + case REBOOT_TYPE: + if (bp->ut_type == BOOT_TIME || + bp->ut_type == SHUTDOWN_TIME) + return (YES); + break; case HOST_TYPE: if (!strcasecmp(step->name, bp->ut_host)) return (YES); From owner-svn-src-head@freebsd.org Tue Jul 21 12:15:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C4519A709C; Tue, 21 Jul 2015 12:15:01 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D9CF1F9D; Tue, 21 Jul 2015 12:15:01 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LCF1pI036170; Tue, 21 Jul 2015 12:15:01 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LCF19n036169; Tue, 21 Jul 2015 12:15:01 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201507211215.t6LCF19n036169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 21 Jul 2015 12:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285743 - head/sys/arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 12:15:01 -0000 Author: zbb Date: Tue Jul 21 12:15:00 2015 New Revision: 285743 URL: https://svnweb.freebsd.org/changeset/base/285743 Log: Improve ARM64 CPU_MATCH Add a method to identify CPU based on RAW MIDR value. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3117 Modified: head/sys/arm64/include/cpu.h Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Tue Jul 21 10:52:05 2015 (r285742) +++ head/sys/arm64/include/cpu.h Tue Jul 21 12:15:00 2015 (r285743) @@ -92,10 +92,17 @@ #define CPU_VAR_MASK (0xf << 20) #define CPU_REV_MASK (0xf << 0) -#define CPU_MATCH(mask, impl, part, var, rev) \ - (((mask) & PCPU_GET(midr)) == (CPU_IMPL_TO_MIDR((impl)) | \ - CPU_PART_TO_MIDR((part)) | CPU_VAR_TO_MIDR((var)) | \ - CPU_REV_TO_MIDR((rev)))) +#define CPU_ID_RAW(impl, part, var, rev) \ + (CPU_IMPL_TO_MIDR((impl)) | \ + CPU_PART_TO_MIDR((part)) | CPU_VAR_TO_MIDR((var)) | \ + CPU_REV_TO_MIDR((rev))) + +#define CPU_MATCH(mask, impl, part, var, rev) \ + (((mask) & PCPU_GET(midr)) == \ + ((mask) & CPU_ID_RAW((impl), (part), (var), (rev)))) + +#define CPU_MATCH_RAW(mask, devid) \ + (((mask) & PCPU_GET(midr)) == ((mask) & (devid))) extern char btext[]; extern char etext[]; From owner-svn-src-head@freebsd.org Tue Jul 21 12:47:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BACD9A77CB; Tue, 21 Jul 2015 12:47:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3B8014A3; Tue, 21 Jul 2015 12:47:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LClGtK048913; Tue, 21 Jul 2015 12:47:16 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LClGNv048910; Tue, 21 Jul 2015 12:47:16 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201507211247.t6LClGNv048910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 21 Jul 2015 12:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285744 - in head/sys: amd64/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.20 Precedence: list List-Id: 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, 21 Jul 2015 12:47:17 -0000 Author: ed Date: Tue Jul 21 12:47:15 2015 New Revision: 285744 URL: https://svnweb.freebsd.org/changeset/base/285744 Log: Make thread creation work for CloudABI processes. Summary: Remove the stub system call that was put in place during the system call import and replace it by a target-dependent version stored in sys/amd64. Initialize the thread in a way similar to cpu_set_upcall_kse(). We provide the entry point with two arguments: the thread ID and the argument pointer. Test Plan: Thread creation still seems to work, both for FreeBSD and CloudABI binaries. Reviewers: dchagin, mjg, kib Reviewed By: kib Subscribers: imp Differential Revision: https://reviews.freebsd.org/D3110 Added: head/sys/compat/cloudabi64/cloudabi64_util.h (contents, props changed) Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c head/sys/compat/cloudabi64/cloudabi64_thread.c Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Tue Jul 21 12:15:00 2015 (r285743) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Tue Jul 21 12:47:15 2015 (r285744) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include extern const char *cloudabi64_syscallnames[]; extern struct sysent cloudabi64_sysent[]; @@ -179,6 +180,28 @@ cloudabi64_schedtail(struct thread *td) frame->tf_rdx = td->td_tid; } +void +cloudabi64_thread_setregs(struct thread *td, + const cloudabi64_threadattr_t *attr) +{ + struct trapframe *frame; + stack_t stack; + + /* Perform standard register initialization. */ + stack.ss_sp = (void *)attr->stack; + stack.ss_size = attr->stack_size; + cpu_set_upcall_kse(td, (void *)attr->entry_point, NULL, &stack); + + /* + * Pass in the thread ID of the new thread and the argument + * pointer provided by the parent thread in as arguments to the + * entry point. + */ + frame = td->td_frame; + frame->tf_rdi = td->td_tid; + frame->tf_rsi = attr->argument; +} + static struct sysentvec cloudabi64_elf_sysvec = { .sv_size = CLOUDABI64_SYS_MAXSYSCALL, .sv_table = cloudabi64_sysent, Modified: head/sys/compat/cloudabi64/cloudabi64_thread.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_thread.c Tue Jul 21 12:15:00 2015 (r285743) +++ head/sys/compat/cloudabi64/cloudabi64_thread.c Tue Jul 21 12:47:15 2015 (r285744) @@ -26,14 +26,45 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include + #include #include +#include + +struct thread_create_args { + cloudabi64_threadattr_t attr; + lwpid_t tid; +}; + +static int +initialize_thread(struct thread *td, void *thunk) +{ + struct thread_create_args *args = thunk; + + /* Save the thread ID, so it can be returned. */ + args->tid = td->td_tid; + + /* Set up initial register contents. */ + cloudabi64_thread_setregs(td, &args->attr); + return (0); +} int cloudabi64_sys_thread_create(struct thread *td, struct cloudabi64_sys_thread_create_args *uap) { + struct thread_create_args args; + int error; - /* Not implemented. */ - return (ENOSYS); + error = copyin(uap->attr, &args.attr, sizeof(args.attr)); + if (error != 0) + return (error); + error = thread_create(td, NULL, initialize_thread, &args); + if (error != 0) + return (error); + td->td_retval[0] = args.tid; + return (0); } Added: head/sys/compat/cloudabi64/cloudabi64_util.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/cloudabi64/cloudabi64_util.h Tue Jul 21 12:47:15 2015 (r285744) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2015 Nuxi, https://nuxi.nl/ + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _CLOUDABI64_UTIL_H_ +#define _CLOUDABI64_UTIL_H_ + +#include + +struct thread; + +void cloudabi64_thread_setregs(struct thread *, + const cloudabi64_threadattr_t *); + +#endif From owner-svn-src-head@freebsd.org Tue Jul 21 12:50:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09D8F9A78F0; Tue, 21 Jul 2015 12:50:47 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF46A1B1C; Tue, 21 Jul 2015 12:50:46 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LCokjV051784; Tue, 21 Jul 2015 12:50:46 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LCokFf051783; Tue, 21 Jul 2015 12:50:46 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201507211250.t6LCokFf051783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 21 Jul 2015 12:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285745 - head/sys/arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 12:50:47 -0000 Author: zbb Date: Tue Jul 21 12:50:45 2015 New Revision: 285745 URL: https://svnweb.freebsd.org/changeset/base/285745 Log: Implement get_cyclecount() on ARM64 Use Vritual Counter register associated with Generic Timer to read the cyclecount. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3134 Modified: head/sys/arm64/include/cpu.h Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Tue Jul 21 12:47:15 2015 (r285744) +++ head/sys/arm64/include/cpu.h Tue Jul 21 12:50:45 2015 (r285745) @@ -43,6 +43,7 @@ #include #include +#include #define TRAPF_PC(tfp) ((tfp)->tf_lr) #define TRAPF_USERMODE(tfp) (((tfp)->tf_elr & (1ul << 63)) == 0) @@ -120,9 +121,11 @@ void swi_vm(void *v); static __inline uint64_t get_cyclecount(void) { + uint64_t ret; - /* TODO: This is bogus */ - return (1); + ret = READ_SPECIALREG(cntvct_el0); + + return (ret); } #define ADDRESS_TRANSLATE_FUNC(stage) \ From owner-svn-src-head@freebsd.org Tue Jul 21 12:53:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 940FD9A7A29; Tue, 21 Jul 2015 12:53:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 854631E83; Tue, 21 Jul 2015 12:53:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LCrm1o053159; Tue, 21 Jul 2015 12:53:48 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LCrm5M053158; Tue, 21 Jul 2015 12:53:48 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201507211253.t6LCrm5M053158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 21 Jul 2015 12:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285746 - head/sys/amd64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 12:53:48 -0000 Author: ed Date: Tue Jul 21 12:53:47 2015 New Revision: 285746 URL: https://svnweb.freebsd.org/changeset/base/285746 Log: Describe COMPAT_CLOUDABI64 in the amd64 configuration NOTES file. Modified: head/sys/amd64/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Jul 21 12:50:45 2015 (r285745) +++ head/sys/amd64/conf/NOTES Tue Jul 21 12:53:47 2015 (r285746) @@ -620,6 +620,9 @@ options COMPAT_FREEBSD32 # Emulate spx device for client side of SVR3 local X interface #XXX#options SPX_HACK +# Enable 64-bit runtime support for CloudABI binaries. +options COMPAT_CLOUDABI64 + # Enable Linux ABI emulation #XXX#options COMPAT_LINUX From owner-svn-src-head@freebsd.org Tue Jul 21 14:39:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B9D09A7470; Tue, 21 Jul 2015 14:39:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 444A91A76; Tue, 21 Jul 2015 14:39:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LEdZUB093931; Tue, 21 Jul 2015 14:39:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LEdZT8093930; Tue, 21 Jul 2015 14:39:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507211439.t6LEdZT8093930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 21 Jul 2015 14:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285751 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 14:39:35 -0000 Author: kib Date: Tue Jul 21 14:39:34 2015 New Revision: 285751 URL: https://svnweb.freebsd.org/changeset/base/285751 Log: The part of r285680 which removed release semantic for two stores to it_need was wrong [*]. Restore the releases and add a comment explaining why it is needed. Noted by: alc [*] Reviewed by: bde [*] Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_intr.c Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Tue Jul 21 14:36:33 2015 (r285750) +++ head/sys/kern/kern_intr.c Tue Jul 21 14:39:34 2015 (r285751) @@ -829,8 +829,14 @@ ok: * Ensure that the thread will process the handler list * again and remove this handler if it has already passed * it on the list. + * + * The release part of the following store ensures + * that the update of ih_flags is ordered before the + * it_need setting. See the comment before + * atomic_cmpset_acq(&ithd->it_need, ...) operation in + * the ithread_execute_handlers(). */ - ie->ie_thread->it_need = 1; + atomic_store_rel_int(&ie->ie_thread->it_need, 1); } else TAILQ_REMOVE(&ie->ie_handlers, handler, ih_next); thread_unlock(ie->ie_thread->it_thread); @@ -979,8 +985,14 @@ ok: * Ensure that the thread will process the handler list * again and remove this handler if it has already passed * it on the list. + * + * The release part of the following store ensures + * that the update of ih_flags is ordered before the + * it_need setting. See the comment before + * atomic_cmpset_acq(&ithd->it_need, ...) operation in + * the ithread_execute_handlers(). */ - it->it_need = 1; + atomic_store_rel_int(&it->it_need, 1); } else TAILQ_REMOVE(&ie->ie_handlers, handler, ih_next); thread_unlock(it->it_thread); From owner-svn-src-head@freebsd.org Tue Jul 21 14:47:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E8919A75FA; Tue, 21 Jul 2015 14:47:25 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42174101A; Tue, 21 Jul 2015 14:47:25 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LElPQ9098033; Tue, 21 Jul 2015 14:47:25 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LElO3r098030; Tue, 21 Jul 2015 14:47:24 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201507211447.t6LElO3r098030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 21 Jul 2015 14:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285752 - in head/sys: arm64/arm64 dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 14:47:25 -0000 Author: zbb Date: Tue Jul 21 14:47:23 2015 New Revision: 285752 URL: https://svnweb.freebsd.org/changeset/base/285752 Log: Add support for vendor specific function for PCI devid acquisition in ITS It is possible that some HW will use different PCI devids, hence allow to replace the default domain:bus:slot:func schema by implementing and registering custom function. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3118 Modified: head/sys/arm64/arm64/gic_v3_its.c head/sys/arm64/arm64/gic_v3_var.h head/sys/dev/pci/pcireg.h Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Tue Jul 21 14:39:34 2015 (r285751) +++ head/sys/arm64/arm64/gic_v3_its.c Tue Jul 21 14:47:23 2015 (r285752) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -89,6 +90,7 @@ static void its_free_tables(struct gic_v static void its_init_commandq(struct gic_v3_its_softc *); static int its_init_cpu(struct gic_v3_its_softc *); static void its_init_cpu_collection(struct gic_v3_its_softc *); +static uint32_t its_get_devid(device_t); static int its_cmd_send(struct gic_v3_its_softc *, struct its_cmd_desc *); @@ -133,6 +135,23 @@ const char *its_ptab_type[] = { [GITS_BASER_TYPE_RES7] = "Reserved (7)", }; +/* + * Vendor specific quirks. + * One needs to add appropriate entry to its_quirks[] + * table if the imlementation varies from the generic ARM ITS. + */ + +/* Cavium ThunderX PCI devid acquire function */ +static uint32_t its_get_devid_thunder(device_t); + +static const struct its_quirks its_quirks[] = { + { + .cpuid = CPU_ID_RAW(CPU_IMPL_CAVIUM, CPU_PART_THUNDER, 0, 0), + .cpuid_mask = CPU_IMPL_MASK | CPU_PART_MASK, + .devid_func = its_get_devid_thunder, + }, +}; + static struct gic_v3_its_softc *its_sc; #define gic_its_read(sc, len, reg) \ @@ -1300,7 +1319,7 @@ its_device_alloc_locked(struct gic_v3_it if (newdev != NULL) return (newdev); - devid = PCI_DEVID(pci_dev); + devid = its_get_devid(pci_dev); /* There was no previously created device. Create one now */ newdev = malloc(sizeof(*newdev), M_GIC_V3_ITS, (M_WAITOK | M_ZERO)); @@ -1353,6 +1372,73 @@ its_device_asign_lpi_locked(struct gic_v its_dev->lpis.lpi_free); its_dev->lpis.lpi_free--; } + +/* + * ITS quirks. + * Add vendor specific PCI devid function here. + */ +static uint32_t +its_get_devid_thunder(device_t pci_dev) +{ + int bsf; + int pem; + uint32_t bus; + + bus = pci_get_bus(pci_dev); + + bsf = PCI_RID(pci_get_bus(pci_dev), pci_get_slot(pci_dev), + pci_get_function(pci_dev)); + + /* ECAM is on bus=0 */ + if (bus == 0) { + return ((pci_get_domain(pci_dev) << PCI_RID_DOMAIN_SHIFT) | + bsf); + /* PEM otherwise */ + } else { + /* PEM number is equal to domain */ + pem = pci_get_domain(pci_dev); + + /* Hardcode appropriate PEM numbers */ + if (pem < 3 ) + return ((0x1 << PCI_RID_DOMAIN_SHIFT) | bsf); + + if (pem < 6 ) + return ((0x3 << PCI_RID_DOMAIN_SHIFT) | bsf); + + if (pem < 9 ) + return ((0x9 << PCI_RID_DOMAIN_SHIFT) | bsf); + + if (pem < 12 ) + return ((0xB << PCI_RID_DOMAIN_SHIFT) | bsf); + } + + return (0); +} + +static __inline uint32_t +its_get_devid_default(device_t pci_dev) +{ + + return (PCI_DEVID_GENERIC(pci_dev)); +} + +static uint32_t +its_get_devid(device_t pci_dev) +{ + const struct its_quirks *quirk; + size_t i; + + for (i = 0; i < nitems(its_quirks); i++) { + quirk = &its_quirks[i]; + if (CPU_MATCH_RAW(quirk->cpuid_mask, quirk->cpuid)) { + if (quirk->devid_func != NULL) + return ((*quirk->devid_func)(pci_dev)); + } + } + + return (its_get_devid_default(pci_dev)); +} + /* * Message signalled interrupts handling. */ Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Tue Jul 21 14:39:34 2015 (r285751) +++ head/sys/arm64/arm64/gic_v3_var.h Tue Jul 21 14:47:23 2015 (r285752) @@ -234,6 +234,15 @@ struct gic_v3_its_softc { struct mtx its_spin_mtx; }; +/* Stuff that is specific to the vendor's implementation */ +typedef uint32_t (*its_devid_func_t)(device_t); + +struct its_quirks { + uint64_t cpuid; + uint64_t cpuid_mask; + its_devid_func_t devid_func; +}; + extern devclass_t gic_v3_its_devclass; int gic_v3_its_detach(device_t); @@ -277,13 +286,12 @@ void lpi_mask_irq(device_t, uint32_t); reg, val); \ }) -#define PCI_DEVID(pci_dev) \ -({ \ - (((pci_get_domain(pci_dev) >> 2) << 19) | \ - ((pci_get_domain(pci_dev) % 4) << 16) | \ - (pci_get_bus(pci_dev) << 8) | \ - (pci_get_slot(pci_dev) << 3) | \ - (pci_get_function(pci_dev) << 0)); \ +#define PCI_DEVID_GENERIC(pci_dev) \ +({ \ + ((pci_get_domain(pci_dev) << PCI_RID_DOMAIN_SHIFT) | \ + (pci_get_bus(pci_dev) << PCI_RID_BUS_SHIFT) | \ + (pci_get_slot(pci_dev) << PCI_RID_SLOT_SHIFT) | \ + (pci_get_function(pci_dev) << PCI_RID_FUNC_SHIFT)); \ }) /* Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Tue Jul 21 14:39:34 2015 (r285751) +++ head/sys/dev/pci/pcireg.h Tue Jul 21 14:47:23 2015 (r285752) @@ -51,6 +51,7 @@ #define PCIE_ARI_SLOTMAX 0 #define PCIE_ARI_FUNCMAX 255 +#define PCI_RID_DOMAIN_SHIFT 16 #define PCI_RID_BUS_SHIFT 8 #define PCI_RID_SLOT_SHIFT 3 #define PCI_RID_FUNC_SHIFT 0 From owner-svn-src-head@freebsd.org Tue Jul 21 15:02:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 456579A7922; Tue, 21 Jul 2015 15:02:25 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id D723E1AF8; Tue, 21 Jul 2015 15:02:24 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from bender (global-1-26.nat.csx.cam.ac.uk [131.111.184.26]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 64388D7907; Tue, 21 Jul 2015 15:01:47 +0000 (UTC) Date: Tue, 21 Jul 2015 16:01:45 +0100 From: Andrew Turner To: Zbigniew Bodek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285752 - in head/sys: arm64/arm64 dev/pci Message-ID: <20150721160145.65c9798b@bender> In-Reply-To: <201507211447.t6LElO3r098030@repo.freebsd.org> References: <201507211447.t6LElO3r098030@repo.freebsd.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; amd64-portbld-freebsd10.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.20 Precedence: list List-Id: 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, 21 Jul 2015 15:02:25 -0000 On Tue, 21 Jul 2015 14:47:24 +0000 (UTC) Zbigniew Bodek wrote: > Author: zbb > Date: Tue Jul 21 14:47:23 2015 > New Revision: 285752 > URL: https://svnweb.freebsd.org/changeset/base/285752 > > Log: > Add support for vendor specific function for PCI devid acquisition > in ITS > It is possible that some HW will use different PCI devids, > hence allow to replace the default domain:bus:slot:func schema > by implementing and registering custom function. > > Obtained from: Semihalf > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D3118 > > Modified: > head/sys/arm64/arm64/gic_v3_its.c > head/sys/arm64/arm64/gic_v3_var.h > head/sys/dev/pci/pcireg.h > > Modified: head/sys/arm64/arm64/gic_v3_its.c > ============================================================================== > --- head/sys/arm64/arm64/gic_v3_its.c Tue Jul 21 14:39:34 > 2015 (r285751) +++ head/sys/arm64/arm64/gic_v3_its.c > Tue Jul 21 14:47:23 2015 (r285752) @@ -44,6 +44,7 @@ > __FBSDID("$FreeBSD$"); #include > #include > > +#include > #include > > #include > @@ -89,6 +90,7 @@ static void its_free_tables(struct gic_v > static void its_init_commandq(struct gic_v3_its_softc *); > static int its_init_cpu(struct gic_v3_its_softc *); > static void its_init_cpu_collection(struct gic_v3_its_softc *); > +static uint32_t its_get_devid(device_t); > > static int its_cmd_send(struct gic_v3_its_softc *, struct > its_cmd_desc *); > @@ -133,6 +135,23 @@ const char *its_ptab_type[] = { > [GITS_BASER_TYPE_RES7] = "Reserved (7)", > }; > > +/* > + * Vendor specific quirks. > + * One needs to add appropriate entry to its_quirks[] > + * table if the imlementation varies from the generic ARM ITS. > + */ > + > +/* Cavium ThunderX PCI devid acquire function */ > +static uint32_t its_get_devid_thunder(device_t); > + > +static const struct its_quirks its_quirks[] = { > + { > + .cpuid = CPU_ID_RAW(CPU_IMPL_CAVIUM, > CPU_PART_THUNDER, 0, 0), > + .cpuid_mask = CPU_IMPL_MASK | CPU_PART_MASK, > + .devid_func = its_get_devid_thunder, > + }, > +}; > + > static struct gic_v3_its_softc *its_sc; > > #define gic_its_read(sc, len, reg) \ > @@ -1300,7 +1319,7 @@ its_device_alloc_locked(struct gic_v3_it > if (newdev != NULL) > return (newdev); > > - devid = PCI_DEVID(pci_dev); > + devid = its_get_devid(pci_dev); > > /* There was no previously created device. Create one now */ > newdev = malloc(sizeof(*newdev), M_GIC_V3_ITS, (M_WAITOK | > M_ZERO)); @@ -1353,6 +1372,73 @@ its_device_asign_lpi_locked(struct > gic_v its_dev->lpis.lpi_free); > its_dev->lpis.lpi_free--; > } > + > +/* > + * ITS quirks. > + * Add vendor specific PCI devid function here. > + */ > +static uint32_t > +its_get_devid_thunder(device_t pci_dev) > +{ > + int bsf; > + int pem; > + uint32_t bus; > + > + bus = pci_get_bus(pci_dev); > + > + bsf = PCI_RID(pci_get_bus(pci_dev), pci_get_slot(pci_dev), > + pci_get_function(pci_dev)); > + > + /* ECAM is on bus=0 */ > + if (bus == 0) { > + return ((pci_get_domain(pci_dev) << > PCI_RID_DOMAIN_SHIFT) | > + bsf); > + /* PEM otherwise */ > + } else { > + /* PEM number is equal to domain */ > + pem = pci_get_domain(pci_dev); But what is a PEM number? > + > + /* Hardcode appropriate PEM numbers */ > + if (pem < 3 ) > + return ((0x1 << PCI_RID_DOMAIN_SHIFT) | bsf); > + > + if (pem < 6 ) > + return ((0x3 << PCI_RID_DOMAIN_SHIFT) | bsf); > + > + if (pem < 9 ) > + return ((0x9 << PCI_RID_DOMAIN_SHIFT) | bsf); > + > + if (pem < 12 ) > + return ((0xB << PCI_RID_DOMAIN_SHIFT) | bsf); What do these magic numbers mean? > + } > + > + return (0); > +} > + Andrew From owner-svn-src-head@freebsd.org Tue Jul 21 15:08:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D6509A79FD; Tue, 21 Jul 2015 15:08:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E0DF1F3F; Tue, 21 Jul 2015 15:08:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LF8E6d006509; Tue, 21 Jul 2015 15:08:14 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LF8D91006507; Tue, 21 Jul 2015 15:08:13 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201507211508.t6LF8D91006507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 21 Jul 2015 15:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285754 - head/sys/compat/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 15:08:14 -0000 Author: ed Date: Tue Jul 21 15:08:13 2015 New Revision: 285754 URL: https://svnweb.freebsd.org/changeset/base/285754 Log: Make clock_gettime() and clock_getres() work for CloudABI programs. Though the standard C library uses a 'struct timespec' using a 64-bit 'time_t', there is no need to use such a type at the system call level. CloudABI uses a simple 64-bit unsigned timestamp in nanoseconds. This is sufficient to express any time value from 1970 to 2554. The CloudABI low-level interface also supports fetching timestamp values with a lower precision. Instead of overloading the clock ID argument for this purpose, the system call provides a precision argument that may be used to specify the maximum slack. The current system call implementation does not use this information, but it's good to already have this available. Expose cloudabi_convert_timespec(), as we're going to need this for fstat() as well. Obtained from: https://github.com/NuxiNL/freebsd Modified: head/sys/compat/cloudabi/cloudabi_clock.c head/sys/compat/cloudabi/cloudabi_util.h Modified: head/sys/compat/cloudabi/cloudabi_clock.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_clock.c Tue Jul 21 15:06:22 2015 (r285753) +++ head/sys/compat/cloudabi/cloudabi_clock.c Tue Jul 21 15:08:13 2015 (r285754) @@ -26,22 +26,100 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include +#include + #include +#include +#include + +/* Converts a CloudABI clock ID to a FreeBSD clock ID. */ +static int +cloudabi_convert_clockid(cloudabi_clockid_t in, clockid_t *out) +{ + switch (in) { + case CLOUDABI_CLOCK_MONOTONIC: + *out = CLOCK_MONOTONIC; + return (0); + case CLOUDABI_CLOCK_PROCESS_CPUTIME_ID: + *out = CLOCK_PROCESS_CPUTIME_ID; + return (0); + case CLOUDABI_CLOCK_REALTIME: + *out = CLOCK_REALTIME; + return (0); + case CLOUDABI_CLOCK_THREAD_CPUTIME_ID: + *out = CLOCK_THREAD_CPUTIME_ID; + return (0); + default: + return (EINVAL); + } +} + +/* Converts a struct timespec to a CloudABI timestamp. */ +int +cloudabi_convert_timespec(const struct timespec *in, cloudabi_timestamp_t *out) +{ + cloudabi_timestamp_t s, ns; + + if (in->tv_sec < 0) { + /* Timestamps from before the Epoch cannot be expressed. */ + *out = 0; + return (EOVERFLOW); + } + s = in->tv_sec; + ns = in->tv_nsec; + if (s > UINT64_MAX / 1000000000 || + (s == UINT64_MAX / 1000000000 && ns > UINT64_MAX % 1000000000)) { + /* Addition of seconds and nanoseconds would overflow. */ + *out = UINT64_MAX; + return (EOVERFLOW); + } + *out = s * 1000000000 + ns; + return (0); +} int cloudabi_sys_clock_res_get(struct thread *td, struct cloudabi_sys_clock_res_get_args *uap) { + struct timespec ts; + cloudabi_timestamp_t cts; + int error; + clockid_t clockid; - /* Not implemented. */ - return (ENOSYS); + error = cloudabi_convert_clockid(uap->clock_id, &clockid); + if (error != 0) + return (error); + error = kern_clock_getres(td, clockid, &ts); + if (error != 0) + return (error); + error = cloudabi_convert_timespec(&ts, &cts); + if (error != 0) + return (error); + td->td_retval[0] = cts; + return (0); } int cloudabi_sys_clock_time_get(struct thread *td, struct cloudabi_sys_clock_time_get_args *uap) { + struct timespec ts; + cloudabi_timestamp_t cts; + int error; + clockid_t clockid; - /* Not implemented. */ - return (ENOSYS); + error = cloudabi_convert_clockid(uap->clock_id, &clockid); + if (error != 0) + return (error); + error = kern_clock_gettime(td, clockid, &ts); + if (error != 0) + return (error); + error = cloudabi_convert_timespec(&ts, &cts); + if (error != 0) + return (error); + td->td_retval[0] = cts; + return (0); } Modified: head/sys/compat/cloudabi/cloudabi_util.h ============================================================================== --- head/sys/compat/cloudabi/cloudabi_util.h Tue Jul 21 15:06:22 2015 (r285753) +++ head/sys/compat/cloudabi/cloudabi_util.h Tue Jul 21 15:08:13 2015 (r285754) @@ -30,7 +30,12 @@ #include +struct timespec; + /* Converts a FreeBSD errno to a CloudABI errno. */ cloudabi_errno_t cloudabi_convert_errno(int); +/* Converts a struct timespec to a CloudABI timestamp. */ +int cloudabi_convert_timespec(const struct timespec *, cloudabi_timestamp_t *); + #endif From owner-svn-src-head@freebsd.org Tue Jul 21 15:28:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BE849A7E24; Tue, 21 Jul 2015 15:28:09 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D80761D6C; Tue, 21 Jul 2015 15:28:08 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LFS8fS014885; Tue, 21 Jul 2015 15:28:08 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LFS8Vq014884; Tue, 21 Jul 2015 15:28:08 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201507211528.t6LFS8Vq014884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 21 Jul 2015 15:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285755 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 15:28:09 -0000 Author: zbb Date: Tue Jul 21 15:28:07 2015 New Revision: 285755 URL: https://svnweb.freebsd.org/changeset/base/285755 Log: Don't allow malloc() to wait for resource while holding a lock in ITS malloc() should not go to sleep in case of lack of resource while the kernel thread is holding a non-sleepable lock. - change malloc() flags to M_NOWAIT in such cases implement lpi_free_chunk() routine as it will be needed when ITT allocation fails in its_device_alloc_locked() - do not increase verbosity of this code since upper layers will communicate an error if the interrupt setup fails Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3121 Modified: head/sys/arm64/arm64/gic_v3_its.c Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Tue Jul 21 15:08:13 2015 (r285754) +++ head/sys/arm64/arm64/gic_v3_its.c Tue Jul 21 15:28:07 2015 (r285755) @@ -814,6 +814,26 @@ retry: } static void +lpi_free_chunk(struct gic_v3_its_softc *sc, struct lpi_chunk *lpic) +{ + int start, end; + uint8_t *bitmap; + + bitmap = (uint8_t *)sc->its_lpi_bitmap; + + KASSERT((lpic->lpi_free == lpic->lpi_num), + ("Trying to free LPI chunk that is still in use.\n")); + + /* First bit of this chunk in a global bitmap */ + start = lpic->lpi_base - GIC_FIRST_LPI; + /* and last bit of this chunk... */ + end = start + lpic->lpi_num - 1; + + /* Finally free this chunk */ + bit_nclear(bitmap, start, end); +} + +static void lpi_configure(struct gic_v3_its_softc *sc, struct its_dev *its_dev, uint32_t lpinum, boolean_t unmask) { @@ -1322,7 +1342,10 @@ its_device_alloc_locked(struct gic_v3_it devid = its_get_devid(pci_dev); /* There was no previously created device. Create one now */ - newdev = malloc(sizeof(*newdev), M_GIC_V3_ITS, (M_WAITOK | M_ZERO)); + newdev = malloc(sizeof(*newdev), M_GIC_V3_ITS, (M_NOWAIT | M_ZERO)); + if (newdev == NULL) + return (NULL); + newdev->pci_dev = pci_dev; newdev->devid = devid; @@ -1340,7 +1363,12 @@ its_device_alloc_locked(struct gic_v3_it */ newdev->itt = (vm_offset_t)contigmalloc( roundup2(roundup2(nvecs, 2) * esize, 0x100), M_GIC_V3_ITS, - (M_WAITOK | M_ZERO), 0, ~0UL, 0x100, 0); + (M_NOWAIT | M_ZERO), 0, ~0UL, 0x100, 0); + if (newdev->itt == 0) { + lpi_free_chunk(sc, &newdev->lpis); + free(newdev, M_GIC_V3_ITS); + return (NULL); + } /* * XXX ARM64TODO: Currently all interrupts are going From owner-svn-src-head@freebsd.org Tue Jul 21 16:02:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D92149A74D7 for ; Tue, 21 Jul 2015 16:02:45 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74B811199 for ; Tue, 21 Jul 2015 16:02:45 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by wibxm9 with SMTP id xm9so125233081wib.0 for ; Tue, 21 Jul 2015 09:02:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=dZUaUU23kdVTYYOj6PGEqW6uokvG/L0H50J9NPSB/Vc=; b=N2RyWvZjY7/pcyWP0+uiGzMITpx1kdgcmt1zbSgVBioHXknyPZzz9m5WIo3R5d+QOd ciQpHmj5wWU4gGVM06Ydr1szGQo+UBg1DgsgG4E/UZt8DeZR/kmS/UciiccPeDs+Uwzb +QI0LibpOCLogl0Ay2DCxBIsaArLkvsA3EECSezljZfSJlcdgOwy2SHq+uLO2KI+7UZY D8S8wvpKrsYjFe9PrTt+vZu9l5AF4U8OiRAiOLiNd/H/13qhKsQ5501mFQta8V78yKO4 UEigsfRU/VsQLtnIQoIj6/enpWenkcYFaewy1UNxoQYyPSyFg7kYD6R6IqTTsW85b46b EKNw== X-Gm-Message-State: ALoCoQlFHDZo2dLCHQWqtMaIke/vT/BnjsBD7/No5q1hdM+gJ20phZMoZApvRNpurHkhFgz14WDz X-Received: by 10.180.84.202 with SMTP id b10mr33417332wiz.23.1437494557798; Tue, 21 Jul 2015 09:02:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.180.75.12 with HTTP; Tue, 21 Jul 2015 09:02:18 -0700 (PDT) In-Reply-To: <20150721160145.65c9798b@bender> References: <201507211447.t6LElO3r098030@repo.freebsd.org> <20150721160145.65c9798b@bender> From: Zbigniew Bodek Date: Tue, 21 Jul 2015 18:02:18 +0200 Message-ID: Subject: Re: svn commit: r285752 - in head/sys: arm64/arm64 dev/pci To: Andrew Turner Cc: Zbigniew Bodek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 16:02:46 -0000 Hello Andrew, Please check in-line. Best regards zbb 2015-07-21 17:01 GMT+02:00 Andrew Turner : > On Tue, 21 Jul 2015 14:47:24 +0000 (UTC) > Zbigniew Bodek wrote: > >> Author: zbb >> Date: Tue Jul 21 14:47:23 2015 >> New Revision: 285752 >> URL: https://svnweb.freebsd.org/changeset/base/285752 >> >> Log: >> Add support for vendor specific function for PCI devid acquisition >> in ITS >> It is possible that some HW will use different PCI devids, >> hence allow to replace the default domain:bus:slot:func schema >> by implementing and registering custom function. >> >> Obtained from: Semihalf >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D3118 >> >> Modified: >> head/sys/arm64/arm64/gic_v3_its.c >> head/sys/arm64/arm64/gic_v3_var.h >> head/sys/dev/pci/pcireg.h >> >> Modified: head/sys/arm64/arm64/gic_v3_its.c >> ============================================================================== >> --- head/sys/arm64/arm64/gic_v3_its.c Tue Jul 21 14:39:34 >> 2015 (r285751) +++ head/sys/arm64/arm64/gic_v3_its.c >> Tue Jul 21 14:47:23 2015 (r285752) @@ -44,6 +44,7 @@ >> __FBSDID("$FreeBSD$"); #include >> #include >> >> +#include >> #include >> >> #include >> @@ -89,6 +90,7 @@ static void its_free_tables(struct gic_v >> static void its_init_commandq(struct gic_v3_its_softc *); >> static int its_init_cpu(struct gic_v3_its_softc *); >> static void its_init_cpu_collection(struct gic_v3_its_softc *); >> +static uint32_t its_get_devid(device_t); >> >> static int its_cmd_send(struct gic_v3_its_softc *, struct >> its_cmd_desc *); >> @@ -133,6 +135,23 @@ const char *its_ptab_type[] = { >> [GITS_BASER_TYPE_RES7] = "Reserved (7)", >> }; >> >> +/* >> + * Vendor specific quirks. >> + * One needs to add appropriate entry to its_quirks[] >> + * table if the imlementation varies from the generic ARM ITS. >> + */ >> + >> +/* Cavium ThunderX PCI devid acquire function */ >> +static uint32_t its_get_devid_thunder(device_t); >> + >> +static const struct its_quirks its_quirks[] = { >> + { >> + .cpuid = CPU_ID_RAW(CPU_IMPL_CAVIUM, >> CPU_PART_THUNDER, 0, 0), >> + .cpuid_mask = CPU_IMPL_MASK | CPU_PART_MASK, >> + .devid_func = its_get_devid_thunder, >> + }, >> +}; >> + >> static struct gic_v3_its_softc *its_sc; >> >> #define gic_its_read(sc, len, reg) \ >> @@ -1300,7 +1319,7 @@ its_device_alloc_locked(struct gic_v3_it >> if (newdev != NULL) >> return (newdev); >> >> - devid = PCI_DEVID(pci_dev); >> + devid = its_get_devid(pci_dev); >> >> /* There was no previously created device. Create one now */ >> newdev = malloc(sizeof(*newdev), M_GIC_V3_ITS, (M_WAITOK | >> M_ZERO)); @@ -1353,6 +1372,73 @@ its_device_asign_lpi_locked(struct >> gic_v its_dev->lpis.lpi_free); >> its_dev->lpis.lpi_free--; >> } >> + >> +/* >> + * ITS quirks. >> + * Add vendor specific PCI devid function here. >> + */ >> +static uint32_t >> +its_get_devid_thunder(device_t pci_dev) >> +{ >> + int bsf; >> + int pem; >> + uint32_t bus; >> + >> + bus = pci_get_bus(pci_dev); >> + >> + bsf = PCI_RID(pci_get_bus(pci_dev), pci_get_slot(pci_dev), >> + pci_get_function(pci_dev)); >> + >> + /* ECAM is on bus=0 */ >> + if (bus == 0) { >> + return ((pci_get_domain(pci_dev) << >> PCI_RID_DOMAIN_SHIFT) | >> + bsf); >> + /* PEM otherwise */ >> + } else { >> + /* PEM number is equal to domain */ >> + pem = pci_get_domain(pci_dev); > > But what is a PEM number? PEM == PCI-E MAC. This is the number of root complex. > >> + >> + /* Hardcode appropriate PEM numbers */ >> + if (pem < 3 ) >> + return ((0x1 << PCI_RID_DOMAIN_SHIFT) | bsf); >> + >> + if (pem < 6 ) >> + return ((0x3 << PCI_RID_DOMAIN_SHIFT) | bsf); >> + >> + if (pem < 9 ) >> + return ((0x9 << PCI_RID_DOMAIN_SHIFT) | bsf); >> + >> + if (pem < 12 ) >> + return ((0xB << PCI_RID_DOMAIN_SHIFT) | bsf); > > What do these magic numbers mean? This is a domain portion of PCI device ID passed by the HW along with the transaction to memory. In that case the methodology differs from the genuine (default in this driver) ARM implementation and it is Thunder-specific. > >> + } >> + >> + return (0); >> +} >> + > > Andrew > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Tue Jul 21 16:24:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2201B9A7993 for ; Tue, 21 Jul 2015 16:24:59 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2B7F10EE for ; Tue, 21 Jul 2015 16:24:58 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by pabkd10 with SMTP id kd10so50763244pab.2 for ; Tue, 21 Jul 2015 09:24:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=17rTFaQU4MI4ioPHRYZuD3JbtYcQ5T8ILLH2pmFvL/o=; b=K5MHsSqVMsPeoAvOu6qOdZ/fMDNAaE66qAkSC6h/KhO8+wgSX6phoW+1aA1qMCDGRw 23yKYZ3w6QBmwLk8i4P8mqViwQhMbUx0kuVSOCg14VdjtcaG41ycbZh+3PaZ3XFvZq1e UP5JeuI2U114HoO8DzBAnAtkdaWjiVVsqADEPTaVk4Tv3VQ3Bt0OlO2pSwKID3DsL9vy WVj5IAQAvqYO4yQj53g9A1kOw0Au7HIxKurRW0bySOyosaOrXVI8FqYuPKSqngmUNgh5 GDgZN0ZHPCesI3EWBN0JmCgyln6wodiCR3ymJW2BxTdWD/ccRwsILgflMRF332fwOTTu E2SA== X-Gm-Message-State: ALoCoQlLRfbo89wyh5mb1rgrq0zyWBmRsaFSS/Tj8Ti4gUc9hZE0JNFXXcTSzqj5Ij1G1EG+7VqM X-Received: by 10.70.98.200 with SMTP id ek8mr74706679pdb.95.1437495892588; Tue, 21 Jul 2015 09:24:52 -0700 (PDT) Received: from [10.64.26.8] ([69.53.236.236]) by smtp.gmail.com with ESMTPSA id hl6sm28367379pdb.28.2015.07.21.09.24.50 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Jul 2015 09:24:51 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r285752 - in head/sys: arm64/arm64 dev/pci Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: multipart/signed; boundary="Apple-Mail=_BC466D0C-78A5-4437-812A-B519F59F46FE"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5 From: Warner Losh In-Reply-To: Date: Tue, 21 Jul 2015 10:24:48 -0600 Cc: Andrew Turner , Zbigniew Bodek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-Id: <90C4DA24-6770-4DB5-AF87-20CB8E812657@bsdimp.com> References: <201507211447.t6LElO3r098030@repo.freebsd.org> <20150721160145.65c9798b@bender> To: Zbigniew Bodek X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 16:24:59 -0000 --Apple-Mail=_BC466D0C-78A5-4437-812A-B519F59F46FE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Zbigniew, This is a great brief explanation. Perhaps a one or two line comment to this effect would be useful for others trying to figure it out later? Warner > On Jul 21, 2015, at 10:02 AM, Zbigniew Bodek wrote: >=20 > Hello Andrew, >=20 > Please check in-line. >=20 > Best regards > zbb >=20 > 2015-07-21 17:01 GMT+02:00 Andrew Turner : >> On Tue, 21 Jul 2015 14:47:24 +0000 (UTC) >> Zbigniew Bodek wrote: >>=20 >>> Author: zbb >>> Date: Tue Jul 21 14:47:23 2015 >>> New Revision: 285752 >>> URL: https://svnweb.freebsd.org/changeset/base/285752 >>>=20 >>> Log: >>> Add support for vendor specific function for PCI devid acquisition >>> in ITS >>> It is possible that some HW will use different PCI devids, >>> hence allow to replace the default domain:bus:slot:func schema >>> by implementing and registering custom function. >>>=20 >>> Obtained from: Semihalf >>> Sponsored by: The FreeBSD Foundation >>> Differential Revision: https://reviews.freebsd.org/D3118 >>>=20 >>> Modified: >>> head/sys/arm64/arm64/gic_v3_its.c >>> head/sys/arm64/arm64/gic_v3_var.h >>> head/sys/dev/pci/pcireg.h >>>=20 >>> Modified: head/sys/arm64/arm64/gic_v3_its.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/arm64/arm64/gic_v3_its.c Tue Jul 21 14:39:34 >>> 2015 (r285751) +++ head/sys/arm64/arm64/gic_v3_its.c >>> Tue Jul 21 14:47:23 2015 (r285752) @@ -44,6 +44,7 @@ >>> __FBSDID("$FreeBSD$"); #include >>> #include >>>=20 >>> +#include >>> #include >>>=20 >>> #include >>> @@ -89,6 +90,7 @@ static void its_free_tables(struct gic_v >>> static void its_init_commandq(struct gic_v3_its_softc *); >>> static int its_init_cpu(struct gic_v3_its_softc *); >>> static void its_init_cpu_collection(struct gic_v3_its_softc *); >>> +static uint32_t its_get_devid(device_t); >>>=20 >>> static int its_cmd_send(struct gic_v3_its_softc *, struct >>> its_cmd_desc *); >>> @@ -133,6 +135,23 @@ const char *its_ptab_type[] =3D { >>> [GITS_BASER_TYPE_RES7] =3D "Reserved (7)", >>> }; >>>=20 >>> +/* >>> + * Vendor specific quirks. >>> + * One needs to add appropriate entry to its_quirks[] >>> + * table if the imlementation varies from the generic ARM ITS. >>> + */ >>> + >>> +/* Cavium ThunderX PCI devid acquire function */ >>> +static uint32_t its_get_devid_thunder(device_t); >>> + >>> +static const struct its_quirks its_quirks[] =3D { >>> + { >>> + .cpuid =3D CPU_ID_RAW(CPU_IMPL_CAVIUM, >>> CPU_PART_THUNDER, 0, 0), >>> + .cpuid_mask =3D CPU_IMPL_MASK | CPU_PART_MASK, >>> + .devid_func =3D its_get_devid_thunder, >>> + }, >>> +}; >>> + >>> static struct gic_v3_its_softc *its_sc; >>>=20 >>> #define gic_its_read(sc, len, reg) \ >>> @@ -1300,7 +1319,7 @@ its_device_alloc_locked(struct gic_v3_it >>> if (newdev !=3D NULL) >>> return (newdev); >>>=20 >>> - devid =3D PCI_DEVID(pci_dev); >>> + devid =3D its_get_devid(pci_dev); >>>=20 >>> /* There was no previously created device. Create one now */ >>> newdev =3D malloc(sizeof(*newdev), M_GIC_V3_ITS, (M_WAITOK | >>> M_ZERO)); @@ -1353,6 +1372,73 @@ its_device_asign_lpi_locked(struct >>> gic_v its_dev->lpis.lpi_free); >>> its_dev->lpis.lpi_free--; >>> } >>> + >>> +/* >>> + * ITS quirks. >>> + * Add vendor specific PCI devid function here. >>> + */ >>> +static uint32_t >>> +its_get_devid_thunder(device_t pci_dev) >>> +{ >>> + int bsf; >>> + int pem; >>> + uint32_t bus; >>> + >>> + bus =3D pci_get_bus(pci_dev); >>> + >>> + bsf =3D PCI_RID(pci_get_bus(pci_dev), pci_get_slot(pci_dev), >>> + pci_get_function(pci_dev)); >>> + >>> + /* ECAM is on bus=3D0 */ >>> + if (bus =3D=3D 0) { >>> + return ((pci_get_domain(pci_dev) << >>> PCI_RID_DOMAIN_SHIFT) | >>> + bsf); >>> + /* PEM otherwise */ >>> + } else { >>> + /* PEM number is equal to domain */ >>> + pem =3D pci_get_domain(pci_dev); >>=20 >> But what is a PEM number? >=20 > PEM =3D=3D PCI-E MAC. > This is the number of root complex. >=20 >>=20 >>> + >>> + /* Hardcode appropriate PEM numbers */ >>> + if (pem < 3 ) >>> + return ((0x1 << PCI_RID_DOMAIN_SHIFT) | bsf); >>> + >>> + if (pem < 6 ) >>> + return ((0x3 << PCI_RID_DOMAIN_SHIFT) | bsf); >>> + >>> + if (pem < 9 ) >>> + return ((0x9 << PCI_RID_DOMAIN_SHIFT) | bsf); >>> + >>> + if (pem < 12 ) >>> + return ((0xB << PCI_RID_DOMAIN_SHIFT) | bsf); >>=20 >> What do these magic numbers mean? >=20 > This is a domain portion of PCI device ID passed by the HW along with > the transaction to memory. > In that case the methodology differs from the genuine (default in this > driver) ARM implementation and it is Thunder-specific. >=20 >>=20 >>> + } >>> + >>> + return (0); >>> +} >>> + >>=20 >> Andrew >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to = "svn-src-all-unsubscribe@freebsd.org" --Apple-Mail=_BC466D0C-78A5-4437-812A-B519F59F46FE Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJVrnJQAAoJEGwc0Sh9sBEA/gQQAJERGWu5K1VvJgHiRVBnC70e B+5P4dxg2ANK0qHe4e2IZBbK8RLi70NGKHUkxsNf13eR3Tnu+g0sd+KDeUmdx3Pc 4J+GLGF190bDFG4MY8BGvGgQJnxcZrsFNDA4j0Rr9Brq4ymxY+0wHz7OxWwFn/JF q15iThqHIpUEPjld8/R3s/dV9NHih6k+l3O05EHzId4n3Ub6CjicVT7bZrJpZ0KH RxPHUKRgWHD8ps+0SGJ6tWCnxs8+AE0zI1CrRMEzVtCT3vIJfxyXbKjFqYIhz+q4 f43Zr+CrpLyzMlllAXPkVqI0X6MorhZuwIjrJY82TJBQ6Ha2VnyckLthcZAoNt0t bQwd1fKuiUHtVT9ut9gQ2DniWSOp4Nhit+37AK8I96RPhLnWsVcPHkU9lv80iR/A diBZZSDpxwYyzlyNK+4O3ZTle0CeLJVmZ/QHXyUBlPSJ1bDIG37us09ko6iyNOZh InYxuytaWY4rNrF0VvZH3ZYVpnPav9VOtQH6MI+L57Oe7p6Jl3b546hAMbpUNzeJ 0B9+gfqtV8qO/cCSw9FC8ofvBBtK6Bztn2/C62vH+UtwCRCsao8Y3Y4J5D45gJb7 Z02xQO6+jOuNAH+Is+QEc/+qVBgakuzeSqknOZ46ANpzjSzjItXbB9GHiK5R4IP1 /W7KVPz50o/H+OTwzMGF =Hu8R -----END PGP SIGNATURE----- --Apple-Mail=_BC466D0C-78A5-4437-812A-B519F59F46FE-- From owner-svn-src-head@freebsd.org Tue Jul 21 16:50:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C60A9A7D3B; Tue, 21 Jul 2015 16:50:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7DA91BFA; Tue, 21 Jul 2015 16:50:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by wicmv11 with SMTP id mv11so47478690wic.0; Tue, 21 Jul 2015 09:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=jFzxUZMFzIYFYCps/lJSzdxJ3NBo4PBd3tpTjs93p3I=; b=zhld78ADa/w0fxj2ftUIsrDXxbux7TP/2iQTQ55GBVYUr0cP8UEh14srFBYMBRhux4 OGY5JLRVABnWwYCylahoyEg31A81zAqPVU2upJ+YTsjResjA3V6TIu3FqkP+4iXNl6+0 n31NB77KCrF843JxTMZUV0KMKILBI1gtvdWwQUIjbd8+w4juiaP3gWF1ublDzHpVcwh8 4qqgge9rmD0VD1bAdpniAx2QA8HRTeJ7XmCOitHyGywbRpcOwjYYiwrsNgIMNwIp2Ffj WXrDdmpm8pgtkHR5WxJEYCGnMwAPC1CMszXv6D/j9bEKAQ4PrmizqaB7pv/2Ym2SlJ52 jzqg== MIME-Version: 1.0 X-Received: by 10.180.90.81 with SMTP id bu17mr33477701wib.35.1437497409032; Tue, 21 Jul 2015 09:50:09 -0700 (PDT) Received: by 10.180.88.194 with HTTP; Tue, 21 Jul 2015 09:50:08 -0700 (PDT) In-Reply-To: <20150721083922.GB6736@dft-labs.eu> References: <201507040654.t646sGO7044196@repo.freebsd.org> <20150721083922.GB6736@dft-labs.eu> Date: Tue, 21 Jul 2015 09:50:08 -0700 Message-ID: Subject: Re: svn commit: r285125 - in head/sys: kern sys From: Adrian Chadd To: Mateusz Guzik Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , John Baldwin Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 16:50:11 -0000 Heh, well, the sysctl tree changes for me multiple times an hour. How about we revert this for now and then play around with the better longer term solution outside of -HEAD? I'm worried that this'll trip up other developers who load/unload drivers. Note suspend will also delete sysctl nodes as devices get detached. It's not just kldunload. -adrian From owner-svn-src-head@freebsd.org Tue Jul 21 16:51:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E491E9A7E4A for ; Tue, 21 Jul 2015 16:51:41 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5839A1EF2 for ; Tue, 21 Jul 2015 16:51:41 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by wibud3 with SMTP id ud3so134236772wib.0 for ; Tue, 21 Jul 2015 09:51:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=sCvnUK8Ay1AjMgRSwKtwNqLIxF5L5m/r5hvriYVel7c=; b=Uwu/NSgw9BOPnZPh7sl0ZrncIq/rxwSlSMG5TtbDl+T20FG517kOvuKhB7SeejDg2K jEqFknY36hdWdCd6V/DG14eqxGXYYdu4sbaDK7YC3DBF/uZmiJNC1mNuFN3HsDAxjGgZ PNdAiyb0G+27sN20YYH79UXh1Iw3iYc6x1miI3Gr2GE89p5t9RZEnepBEDLzSTkvlqM4 SLakWlKebtDE2rfx18+mU2rx72RAEhO+BY91vDIGcwYXGRTw986pHwJycwnjfTtftFG+ 3fdsHKd2orUpU3Eoq9YbUPvKE99DO6ZbR5CeNtiRxTVOdREPwStyRCZS3FC0UqCQHrho hRFA== X-Gm-Message-State: ALoCoQlOtERxvhPw4TlUPXps0+SPJnjl9pELW5m6SQSrtlTvWSC9rs8rCuCqTVn5I+5UqEctN/oJ X-Received: by 10.180.74.162 with SMTP id u2mr34578056wiv.0.1437497493082; Tue, 21 Jul 2015 09:51:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.180.75.12 with HTTP; Tue, 21 Jul 2015 09:51:13 -0700 (PDT) In-Reply-To: <90C4DA24-6770-4DB5-AF87-20CB8E812657@bsdimp.com> References: <201507211447.t6LElO3r098030@repo.freebsd.org> <20150721160145.65c9798b@bender> <90C4DA24-6770-4DB5-AF87-20CB8E812657@bsdimp.com> From: Zbigniew Bodek Date: Tue, 21 Jul 2015 18:51:13 +0200 Message-ID: Subject: Re: svn commit: r285752 - in head/sys: arm64/arm64 dev/pci To: Warner Losh Cc: Andrew Turner , Zbigniew Bodek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Type: multipart/mixed; boundary=f46d043c07a271152b051b657786 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 21 Jul 2015 16:51:42 -0000 --f46d043c07a271152b051b657786 Content-Type: text/plain; charset=UTF-8 Hello Warner, Do you think this will do the trick (please check out the attachment)? Best regards zbb 2015-07-21 18:24 GMT+02:00 Warner Losh : > > > Hi Zbigniew, > > This is a great brief explanation. Perhaps a one or two line comment > to this effect would be useful for others trying to figure it out later? > > Warner > >> On Jul 21, 2015, at 10:02 AM, Zbigniew Bodek wrote: >> >> Hello Andrew, >> >> Please check in-line. >> >> Best regards >> zbb >> >> 2015-07-21 17:01 GMT+02:00 Andrew Turner : >>> On Tue, 21 Jul 2015 14:47:24 +0000 (UTC) >>> Zbigniew Bodek wrote: >>> >>>> Author: zbb >>>> Date: Tue Jul 21 14:47:23 2015 >>>> New Revision: 285752 >>>> URL: https://svnweb.freebsd.org/changeset/base/285752 >>>> >>>> Log: >>>> Add support for vendor specific function for PCI devid acquisition >>>> in ITS >>>> It is possible that some HW will use different PCI devids, >>>> hence allow to replace the default domain:bus:slot:func schema >>>> by implementing and registering custom function. >>>> >>>> Obtained from: Semihalf >>>> Sponsored by: The FreeBSD Foundation >>>> Differential Revision: https://reviews.freebsd.org/D3118 >>>> >>>> Modified: >>>> head/sys/arm64/arm64/gic_v3_its.c >>>> head/sys/arm64/arm64/gic_v3_var.h >>>> head/sys/dev/pci/pcireg.h >>>> >>>> Modified: head/sys/arm64/arm64/gic_v3_its.c >>>> ============================================================================== >>>> --- head/sys/arm64/arm64/gic_v3_its.c Tue Jul 21 14:39:34 >>>> 2015 (r285751) +++ head/sys/arm64/arm64/gic_v3_its.c >>>> Tue Jul 21 14:47:23 2015 (r285752) @@ -44,6 +44,7 @@ >>>> __FBSDID("$FreeBSD$"); #include >>>> #include >>>> >>>> +#include >>>> #include >>>> >>>> #include >>>> @@ -89,6 +90,7 @@ static void its_free_tables(struct gic_v >>>> static void its_init_commandq(struct gic_v3_its_softc *); >>>> static int its_init_cpu(struct gic_v3_its_softc *); >>>> static void its_init_cpu_collection(struct gic_v3_its_softc *); >>>> +static uint32_t its_get_devid(device_t); >>>> >>>> static int its_cmd_send(struct gic_v3_its_softc *, struct >>>> its_cmd_desc *); >>>> @@ -133,6 +135,23 @@ const char *its_ptab_type[] = { >>>> [GITS_BASER_TYPE_RES7] = "Reserved (7)", >>>> }; >>>> >>>> +/* >>>> + * Vendor specific quirks. >>>> + * One needs to add appropriate entry to its_quirks[] >>>> + * table if the imlementation varies from the generic ARM ITS. >>>> + */ >>>> + >>>> +/* Cavium ThunderX PCI devid acquire function */ >>>> +static uint32_t its_get_devid_thunder(device_t); >>>> + >>>> +static const struct its_quirks its_quirks[] = { >>>> + { >>>> + .cpuid = CPU_ID_RAW(CPU_IMPL_CAVIUM, >>>> CPU_PART_THUNDER, 0, 0), >>>> + .cpuid_mask = CPU_IMPL_MASK | CPU_PART_MASK, >>>> + .devid_func = its_get_devid_thunder, >>>> + }, >>>> +}; >>>> + >>>> static struct gic_v3_its_softc *its_sc; >>>> >>>> #define gic_its_read(sc, len, reg) \ >>>> @@ -1300,7 +1319,7 @@ its_device_alloc_locked(struct gic_v3_it >>>> if (newdev != NULL) >>>> return (newdev); >>>> >>>> - devid = PCI_DEVID(pci_dev); >>>> + devid = its_get_devid(pci_dev); >>>> >>>> /* There was no previously created device. Create one now */ >>>> newdev = malloc(sizeof(*newdev), M_GIC_V3_ITS, (M_WAITOK | >>>> M_ZERO)); @@ -1353,6 +1372,73 @@ its_device_asign_lpi_locked(struct >>>> gic_v its_dev->lpis.lpi_free); >>>> its_dev->lpis.lpi_free--; >>>> } >>>> + >>>> +/* >>>> + * ITS quirks. >>>> + * Add vendor specific PCI devid function here. >>>> + */ >>>> +static uint32_t >>>> +its_get_devid_thunder(device_t pci_dev) >>>> +{ >>>> + int bsf; >>>> + int pem; >>>> + uint32_t bus; >>>> + >>>> + bus = pci_get_bus(pci_dev); >>>> + >>>> + bsf = PCI_RID(pci_get_bus(pci_dev), pci_get_slot(pci_dev), >>>> + pci_get_function(pci_dev)); >>>> + >>>> + /* ECAM is on bus=0 */ >>>> + if (bus == 0) { >>>> + return ((pci_get_domain(pci_dev) << >>>> PCI_RID_DOMAIN_SHIFT) | >>>> + bsf); >>>> + /* PEM otherwise */ >>>> + } else { >>>> + /* PEM number is equal to domain */ >>>> + pem = pci_get_domain(pci_dev); >>> >>> But what is a PEM number? >> >> PEM == PCI-E MAC. >> This is the number of root complex. >> >>> >>>> + >>>> + /* Hardcode appropriate PEM numbers */ >>>> + if (pem < 3 ) >>>> + return ((0x1 << PCI_RID_DOMAIN_SHIFT) | bsf); >>>> + >>>> + if (pem < 6 ) >>>> + return ((0x3 << PCI_RID_DOMAIN_SHIFT) | bsf); >>>> + >>>> + if (pem < 9 ) >>>> + return ((0x9 << PCI_RID_DOMAIN_SHIFT) | bsf); >>>> + >>>> + if (pem < 12 ) >>>> + return ((0xB << PCI_RID_DOMAIN_SHIFT) | bsf); >>> >>> What do these magic numbers mean? >> >> This is a domain portion of PCI device ID passed by the HW along with >> the transaction to memory. >> In that case the methodology differs from the genuine (default in this >> driver) ARM implementation and it is Thunder-specific. >> >>> >>>> + } >>>> + >>>> + return (0); >>>> +} >>>> + >>> >>> Andrew >>> _______________________________________________ >>> svn-src-all@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/svn-src-all >>> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > --f46d043c07a271152b051b657786 Content-Type: text/plain; charset=US-ASCII; name="its_comment.diff" Content-Disposition: attachment; filename="its_comment.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_icdkt5wd1 ZGlmZiAtLWdpdCBhL3N5cy9hcm02NC9hcm02NC9naWNfdjNfaXRzLmMgYi9zeXMvYXJtNjQvYXJt NjQvZ2ljX3YzX2l0cy5jCmluZGV4IDI2OTdjN2QuLjM1YTc2OTYgMTAwNjQ0Ci0tLSBhL3N5cy9h cm02NC9hcm02NC9naWNfdjNfaXRzLmMKKysrIGIvc3lzL2FybTY0L2FybTY0L2dpY192M19pdHMu YwpAQCAtMTQyMywxMCArMTQyMywxNCBAQCBpdHNfZ2V0X2RldmlkX3RodW5kZXIoZGV2aWNlX3Qg cGNpX2RldikKIAkJICAgIGJzZik7CiAJLyogUEVNIG90aGVyd2lzZSAqLwogCX0gZWxzZSB7Ci0J CS8qIFBFTSBudW1iZXIgaXMgZXF1YWwgdG8gZG9tYWluICovCisJCS8qIFBFTSAoUENJZSBNQUMv cm9vdCBjb21wbGV4KSBudW1iZXIgaXMgZXF1YWwgdG8gZG9tYWluICovCiAJCXBlbSA9IHBjaV9n ZXRfZG9tYWluKHBjaV9kZXYpOwogCi0JCS8qIEhhcmRjb2RlIGFwcHJvcHJpYXRlIFBFTSBudW1i ZXJzICovCisJCS8qCisJCSAqIFNldCBhcHByb3ByaWF0ZSBkZXZpY2UgSUQgKHBhc3NlZCBieSB0 aGUgSFcgYWxvbmcgd2l0aAorCQkgKiB0aGUgdHJhbnNhY3Rpb24gdG8gbWVtb3J5KSBmb3IgZGlm ZmVyZW50IHJvb3QgY29tcGxleAorCQkgKiBudW1iZXJzIHVzaW5nIGhhcmQtY29kZWQgZG9tYWlu IHBvcnRpb24gZm9yIGVhY2ggZ3JvdXAuCisJCSAqLwogCQlpZiAocGVtIDwgMyApCiAJCQlyZXR1 cm4gKCgweDEgPDwgUENJX1JJRF9ET01BSU5fU0hJRlQpIHwgYnNmKTsKIAo= --f46d043c07a271152b051b657786-- From owner-svn-src-head@freebsd.org Tue Jul 21 17:14:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63E0C9A722F; Tue, 21 Jul 2015 17:14:25 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53E5E1B21; Tue, 21 Jul 2015 17:14:25 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LHEPWL058748; Tue, 21 Jul 2015 17:14:25 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LHEP04058747; Tue, 21 Jul 2015 17:14:25 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201507211714.t6LHEP04058747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 21 Jul 2015 17:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285758 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 17:14:25 -0000 Author: zbb Date: Tue Jul 21 17:14:24 2015 New Revision: 285758 URL: https://svnweb.freebsd.org/changeset/base/285758 Log: Add some more explanation to r285752 Add brief commentary to vendor-specific devid function in ITS and remove redundant spaces by the way. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/gic_v3_its.c Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Tue Jul 21 16:53:45 2015 (r285757) +++ head/sys/arm64/arm64/gic_v3_its.c Tue Jul 21 17:14:24 2015 (r285758) @@ -1423,20 +1423,24 @@ its_get_devid_thunder(device_t pci_dev) bsf); /* PEM otherwise */ } else { - /* PEM number is equal to domain */ + /* PEM (PCIe MAC/root complex) number is equal to domain */ pem = pci_get_domain(pci_dev); - /* Hardcode appropriate PEM numbers */ - if (pem < 3 ) + /* + * Set appropriate device ID (passed by the HW along with + * the transaction to memory) for different root complex + * numbers using hard-coded domain portion for each group. + */ + if (pem < 3) return ((0x1 << PCI_RID_DOMAIN_SHIFT) | bsf); - if (pem < 6 ) + if (pem < 6) return ((0x3 << PCI_RID_DOMAIN_SHIFT) | bsf); - if (pem < 9 ) + if (pem < 9) return ((0x9 << PCI_RID_DOMAIN_SHIFT) | bsf); - if (pem < 12 ) + if (pem < 12) return ((0xB << PCI_RID_DOMAIN_SHIFT) | bsf); } From owner-svn-src-head@freebsd.org Tue Jul 21 18:08:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 994EE9A7B73; Tue, 21 Jul 2015 18:08:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 898131446; Tue, 21 Jul 2015 18:08:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LI8B6p079948; Tue, 21 Jul 2015 18:08:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LI8BcF079947; Tue, 21 Jul 2015 18:08:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507211808.t6LI8BcF079947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 21 Jul 2015 18:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285761 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 18:08:11 -0000 Author: andrew Date: Tue Jul 21 18:08:10 2015 New Revision: 285761 URL: https://svnweb.freebsd.org/changeset/base/285761 Log: Teach the GICv2 driver about the Qualcomm GICv2 compatible string. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/gic_fdt.c Modified: head/sys/arm64/arm64/gic_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_fdt.c Tue Jul 21 17:19:03 2015 (r285760) +++ head/sys/arm64/arm64/gic_fdt.c Tue Jul 21 18:08:10 2015 (r285761) @@ -52,6 +52,7 @@ static struct ofw_compat_data compat_dat {"arm,cortex-a7-gic", true}, {"arm,arm11mp-gic", true}, {"brcm,brahma-b15-gic", true}, + {"qcom,msm-qgic2", true}, {NULL, false} }; From owner-svn-src-head@freebsd.org Tue Jul 21 18:50:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2D129A7269; Tue, 21 Jul 2015 18:50:35 +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 835C618DA; Tue, 21 Jul 2015 18:50:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (75-48-78-19.lightspeed.cncrca.sbcglobal.net [75.48.78.19]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B8E26B941; Tue, 21 Jul 2015 14:50:33 -0400 (EDT) From: John Baldwin To: Mateusz Guzik Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r285125 - in head/sys: kern sys Date: Tue, 21 Jul 2015 11:50:12 -0700 Message-ID: <3863130.vz23U50G0A@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20150721083922.GB6736@dft-labs.eu> References: <201507040654.t646sGO7044196@repo.freebsd.org> <20150721083922.GB6736@dft-labs.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 21 Jul 2015 14:50:33 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 21 Jul 2015 18:50:35 -0000 On Tuesday, July 21, 2015 10:39:22 AM Mateusz Guzik wrote: > Cc'ing jhb@ who made relevant changes to rmlocks > > On Mon, Jul 20, 2015 at 11:21:30PM -0700, Adrian Chadd wrote: > > this happend whilst doing 'sysctl -vmstat 1' in one window, 'top' in > > another window, and 'kldunload uhci' as root: > > > > Unread portion of the kernel message buffer: > > uhci5: detached > > panic: sleepq_add: td 0xc75d06a0 to sleep on wchan 0xc0b3e8e4 with > > sleeping prohibited > > > [..] > > > #10 0xc06a882c in kassert_panic (fmt=) at > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_shutdown.c:634 > > #11 0xc06f449b in sleepq_add (wchan=0xc0b3e8e4, wmesg= > out>, flags=, queue=) at > > /usr/home/adrian/work/freebsd/head/src/sys/kern/subr_sleepqueue.c:308 > > #12 0xc06b167b in _sx_xlock_hard (sx=0xc0b3e8e4, tid= > out>, opts=, file=0x0, line=18) at > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sx.c:697 > > #13 0xc06b0841 in _sx_xlock (sx=0xc0b3e8e4, opts= > out>, file=0xc09f2d35 > > "/usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c", > > line=411) at sx.h:154 > > #14 0xc06a4510 in _rm_rlock (rm=0xc0b3e8cc, tracker=0xeaa61ad0, > > trylock=) at > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c:411 > > #15 0xc06a4e2d in _rm_rlock_debug (rm=0xc0b3e8cc, tracker=0xeaa61ad0, > > trylock=0) at /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c:665 > > #16 0xc06b5da4 in sysctl_root_handler_locked (oid=0xc0a6ee20, > > arg1=, arg2=, req= > optimized out>, tracker=0xeaa61ad0) at > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:170 > > #17 0xc06b5531 in sysctl_root (arg1=, arg2= > optimized out>) at > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1692 > > #18 0xc06b5ac2 in userland_sysctl (td=, > > name=, namelen=2, old=, > > oldlenp=, inkernel=, > > new=, newlen=, retval=0x12, > > flags=) at > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1797 > > #19 0xc06b5908 in sys___sysctl (uap=0xeaa61ca8) at > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1724 > > #20 0xc096aaee in syscall (frame=) at subr_syscall.c:133 > > #21 0xc0955c5c in Xint0x80_syscall () at > > /usr/home/adrian/work/freebsd/head/src/sys/i386/i386/exception.s:278 > > rmlock(9) states: > Sleepable read-mostly locks are created by passing RM_SLEEPABLE to > rm_init_flags(). Unlike normal read-mostly locks, sleepable read-mostly > locks follow the same lock ordering rules as sx(9) locks. Sleepable > read-mostly locks do not propagate priority to writers, but they do > propagate priority to readers. Writers are permitted to sleep while > holding a read-mostly lock, but readers are not. Unlike other sleepable > locks such as sx(9) locks, readers must use try operations on other > sleepable locks to avoid sleeping. > > May be that's my bad English, but I read that: > rm_rlock(...); > /* can't sleep here */ > rm_runlock(...); That is correct. > Turns out it's the rm_rlock itself which must not sleep and you have to > rm_try_rlock instead. Hmm, I think instead, the THREAD_NO_SLEEPING in rm_rlock() just needs to be moved. Or rather, rm_rlock_hard() needs to do THREAD_SLEEPING_OK around the sx_xlock and then THREAD_NO_SLEEPING afterwards. Something like this: Index: kern/kern_rmlock.c =================================================================== --- kern/kern_rmlock.c (revision 284344) +++ kern/kern_rmlock.c (working copy) @@ -407,9 +407,11 @@ return (0); } } else { - if (rm->lock_object.lo_flags & LO_SLEEPABLE) + if (rm->lock_object.lo_flags & LO_SLEEPABLE) { + THREAD_SLEEPING_OK(); sx_xlock(&rm->rm_lock_sx); - else + THREAD_NO_SLEEPING(); + } else mtx_lock(&rm->rm_lock_mtx); } > As for the usage here, sysctl seems like a natural consumer for the lock > since after the kernel boots multiuser tree change is a "once in a year" > event. This offers a very minor performance gain as well. The patch can > be reverted back to a mere sx lock, but currently sysctl is the only > in-tree consumer of sleepable rmlocks, so I would argue it is beneficial > to keep it as a user if only to know the feature is somewhat > operational. RM_SLEEPABLE was first added as a feature for an out-of-tree consumer (Isilon). I merely documented it when adding WITNESS support to rmlocks and fleshing out assertions, etc. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Jul 21 20:30:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FE1D9A6683; Tue, 21 Jul 2015 20:30:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4908C1F5F; Tue, 21 Jul 2015 20:30:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LKU8B3039709; Tue, 21 Jul 2015 20:30:08 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LKU7Za039474; Tue, 21 Jul 2015 20:30:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201507212030.t6LKU7Za039474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 21 Jul 2015 20:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285765 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 20:30:08 -0000 Author: cem Date: Tue Jul 21 20:30:06 2015 New Revision: 285765 URL: https://svnweb.freebsd.org/changeset/base/285765 Log: vt: De-static VT_SYSCTL_INT-defined objects Explicitly mark existing VT_SYSCTL_INTs static. This is in preparation for D2181. Reviewed by: dumbbell, emaste Approved by: markj (mentor) MFC after: 1 week Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Tue Jul 21 19:41:39 2015 (r285764) +++ head/sys/dev/vt/vt.h Tue Jul 21 20:30:06 2015 (r285765) @@ -83,7 +83,7 @@ #define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG) #define VT_SYSCTL_INT(_name, _default, _descr) \ -static int vt_##_name = (_default); \ +int vt_##_name = (_default); \ SYSCTL_INT(_kern_vt, OID_AUTO, _name, CTLFLAG_RWTUN, &vt_##_name, 0, _descr) struct vt_driver; Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Tue Jul 21 19:41:39 2015 (r285764) +++ head/sys/dev/vt/vt_core.c Tue Jul 21 20:30:06 2015 (r285765) @@ -121,22 +121,22 @@ const struct terminal_class vt_termclass (vw)->vw_number) static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, "vt(9) parameters"); -VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); -VT_SYSCTL_INT(enable_bell, 1, "Enable bell"); -VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); -VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); -VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); +static VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); +static VT_SYSCTL_INT(enable_bell, 1, "Enable bell"); +static VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); +static VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); +static VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); /* Allow to disable some keyboard combinations. */ -VT_SYSCTL_INT(kbd_halt, 1, "Enable halt keyboard combination. " +static VT_SYSCTL_INT(kbd_halt, 1, "Enable halt keyboard combination. " "See kbdmap(5) to configure."); -VT_SYSCTL_INT(kbd_poweroff, 1, "Enable Power Off keyboard combination. " +static VT_SYSCTL_INT(kbd_poweroff, 1, "Enable Power Off keyboard combination. " "See kbdmap(5) to configure."); -VT_SYSCTL_INT(kbd_reboot, 1, "Enable reboot keyboard combination. " +static VT_SYSCTL_INT(kbd_reboot, 1, "Enable reboot keyboard combination. " "See kbdmap(5) to configure (typically Ctrl-Alt-Delete)."); -VT_SYSCTL_INT(kbd_debug, 1, "Enable key combination to enter debugger. " +static VT_SYSCTL_INT(kbd_debug, 1, "Enable key combination to enter debugger. " "See kbdmap(5) to configure (typically Ctrl-Alt-Esc)."); -VT_SYSCTL_INT(kbd_panic, 0, "Enable request to panic. " +static VT_SYSCTL_INT(kbd_panic, 0, "Enable request to panic. " "See kbdmap(5) to configure."); static struct vt_device vt_consdev; From owner-svn-src-head@freebsd.org Tue Jul 21 20:33:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 375669A67C7; Tue, 21 Jul 2015 20:33:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 265381371; Tue, 21 Jul 2015 20:33:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LKXd8a041665; Tue, 21 Jul 2015 20:33:39 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LKXbTj041660; Tue, 21 Jul 2015 20:33:37 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201507212033.t6LKXbTj041660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 21 Jul 2015 20:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285766 - in head/sys: conf dev/vt dev/vt/logo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 20:33:39 -0000 Author: cem Date: Tue Jul 21 20:33:36 2015 New Revision: 285766 URL: https://svnweb.freebsd.org/changeset/base/285766 Log: vt: Draw logos per CPU core This feature is inspired by another Unix-alike OS commonly found on airplane headrests. A number of beasties[0] are drawn at top of framebuffer during boot, based on the number of active SMP CPUs[1]. Console buffer output continues to scroll in the screen area below beastie(s)[2]. After some time[3] has passed, the beasties are erased leaving the entire terminal for use. Includes two 80x80 vga16 beastie graphics and an 80x80 vga16 orb graphic. (The graphics are RLE compressed to save some space -- 3x 3200 bytes uncompressed, or 4208 compressed.) [0]: The user may select the style of beastie with kern.vt.splash_cpu_style=(0|1|2) [1]: Or the number may be overridden with tunable kern.vt.splash_ncpu. [2]: https://www.youtube.com/watch?v=UP2jizfr3_o [3]: Configurable with kern.vt.splash_cpu_duration (seconds, def. 10). Differential Revision: https://reviews.freebsd.org/D2181 Reviewed by: dumbbell, emaste Approved by: markj (mentor) MFC after: 2 weeks Added: head/sys/dev/vt/logo/logo_beastie.c (contents, props changed) head/sys/dev/vt/vt_cpulogos.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jul 21 20:30:06 2015 (r285765) +++ head/sys/conf/files Tue Jul 21 20:33:36 2015 (r285766) @@ -2726,9 +2726,11 @@ dev/vt/hw/efifb/efifb.c optional vt_efi dev/vt/hw/fb/vt_fb.c optional vt dev/vt/hw/vga/vt_vga.c optional vt vt_vga dev/vt/logo/logo_freebsd.c optional vt splash +dev/vt/logo/logo_beastie.c optional vt splash dev/vt/vt_buf.c optional vt dev/vt/vt_consolectl.c optional vt dev/vt/vt_core.c optional vt +dev/vt/vt_cpulogos.c optional vt splash dev/vt/vt_font.c optional vt dev/vt/vt_sysmouse.c optional vt dev/vte/if_vte.c optional vte pci Added: head/sys/dev/vt/logo/logo_beastie.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/vt/logo/logo_beastie.c Tue Jul 21 20:33:36 2015 (r285766) @@ -0,0 +1,398 @@ +/*- + * Copyright (c) 2015 Conrad Meyer + * Copyright (c) 2005 The FreeBSD Foundation + * Copyright (c) 1996 Larry Ewing + * Copyright (c) 1988 Kirk McKusick + * + * 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 + +const unsigned int vt_logo_sprite_width = 80; +const unsigned int vt_logo_sprite_height = 80; + +const unsigned char vt_beastie_vga16[] = { + 0x16, 0x00, 0x62, 0x16, 0x88, 0x03, 0x80, 0x16, 0x00, 0x23, 0x88, 0x80, + 0x00, 0x00, 0x08, 0x88, 0x16, 0x00, 0x21, 0x08, 0x16, 0x00, 0x06, 0x88, + 0x16, 0x00, 0x20, 0x80, 0x16, 0x00, 0x06, 0x08, 0x80, 0x16, 0x00, 0x1e, + 0x08, 0x16, 0x00, 0x08, 0x88, 0x16, 0x00, 0x1e, 0x08, 0x16, 0x00, 0x06, + 0x87, 0x00, 0x08, 0x16, 0x00, 0x1e, 0x80, 0x16, 0x00, 0x06, 0x77, 0x80, + 0x00, 0x80, 0x16, 0x00, 0x1d, 0x80, 0x16, 0x00, 0x06, 0x08, 0x00, 0x00, + 0x08, 0x16, 0x00, 0x1d, 0x80, 0x16, 0x00, 0x09, 0x08, 0x16, 0x00, 0x1c, + 0x08, 0x16, 0x00, 0x0a, 0x08, 0x16, 0x00, 0x1c, 0x08, 0x16, 0x00, 0x0b, + 0x80, 0x16, 0x00, 0x1b, 0x08, 0x16, 0x00, 0x0b, 0x80, 0x16, 0x00, 0x1b, + 0x08, 0x00, 0x08, 0x70, 0x16, 0x00, 0x03, 0x77, 0x70, 0x16, 0x00, 0x03, + 0x80, 0x16, 0x00, 0x1b, 0x08, 0x00, 0x87, 0x77, 0x00, 0x00, 0x07, 0xff, + 0xf7, 0x16, 0x00, 0x03, 0x80, 0x16, 0x00, 0x1b, 0x08, 0x08, 0x77, 0xff, + 0x00, 0x00, 0x7f, 0x77, 0xf7, 0x16, 0x00, 0x03, 0x80, 0x16, 0x00, 0x1b, + 0x08, 0x08, 0x70, 0x0f, 0x80, 0x00, 0xf7, 0x08, 0x7f, 0x70, 0x00, 0x00, + 0x80, 0x16, 0x00, 0x1b, 0x08, 0x08, 0x80, 0x07, 0x80, 0x00, 0xf8, 0x00, + 0x8f, 0x70, 0x00, 0x00, 0x80, 0x16, 0x00, 0x1b, 0x08, 0x08, 0x70, 0x07, + 0x88, 0x88, 0xf8, 0x00, 0x8f, 0x70, 0x00, 0x00, 0x80, 0x16, 0x00, 0x1b, + 0x08, 0x00, 0xf0, 0x06, 0x16, 0xe6, 0x03, 0x00, 0x8f, 0x16, 0x00, 0x03, + 0x80, 0x16, 0x00, 0x1b, 0x08, 0x00, 0x77, 0x16, 0x6e, 0x05, 0x77, 0x16, + 0x00, 0x03, 0x80, 0x16, 0x00, 0x1b, 0x08, 0x00, 0x06, 0x16, 0xe6, 0x06, + 0x16, 0x00, 0x03, 0x80, 0x16, 0x00, 0x1b, 0x08, 0x00, 0x16, 0x6e, 0x07, + 0x60, 0x00, 0x00, 0x08, 0x16, 0x00, 0x1b, 0x08, 0x80, 0x16, 0xe6, 0x07, + 0x60, 0x00, 0x00, 0x08, 0x16, 0x00, 0x1b, 0x08, 0x80, 0x16, 0x6e, 0x05, + 0x66, 0x66, 0x80, 0x08, 0x00, 0x00, 0x80, 0x16, 0x00, 0x1a, 0x08, 0x80, + 0x86, 0x16, 0xe6, 0x03, 0x16, 0x66, 0x03, 0x80, 0x08, 0x78, 0x00, 0x80, + 0x16, 0x00, 0x1a, 0x08, 0x80, 0x86, 0x16, 0x66, 0x05, 0x77, 0x70, 0x00, + 0x77, 0x00, 0x08, 0x16, 0x00, 0x1a, 0x08, 0x00, 0x87, 0x16, 0x66, 0x04, + 0x77, 0x77, 0x78, 0x00, 0x88, 0x00, 0x08, 0x16, 0x00, 0x1a, 0x08, 0x00, + 0x87, 0x76, 0x66, 0x66, 0x77, 0x77, 0xff, 0xf7, 0x16, 0x00, 0x03, 0x08, + 0x16, 0x00, 0x1a, 0x80, 0x08, 0xff, 0x16, 0x77, 0x04, 0x16, 0xff, 0x03, + 0x80, 0x16, 0x00, 0x03, 0x80, 0x16, 0x00, 0x19, 0x80, 0x07, 0xff, 0x16, + 0x77, 0x03, 0x7f, 0x16, 0xff, 0x03, 0x70, 0x16, 0x00, 0x03, 0x80, 0x16, + 0x00, 0x18, 0x08, 0x00, 0x8f, 0xff, 0xf7, 0x77, 0x77, 0x16, 0xff, 0x04, + 0xf0, 0x16, 0x00, 0x03, 0x08, 0x16, 0x00, 0x18, 0x80, 0x08, 0x7f, 0x16, + 0xff, 0x08, 0xf8, 0x16, 0x00, 0x04, 0x80, 0x16, 0x00, 0x16, 0x08, 0x00, + 0x08, 0x16, 0xff, 0x09, 0xf7, 0x16, 0x00, 0x04, 0x08, 0x16, 0x00, 0x16, + 0x08, 0x00, 0x08, 0x16, 0xff, 0x0a, 0x16, 0x00, 0x05, 0x80, 0x16, 0x00, + 0x15, 0x80, 0x00, 0x87, 0x16, 0xff, 0x0a, 0x80, 0x16, 0x00, 0x04, 0x08, + 0x16, 0x00, 0x14, 0x08, 0x00, 0x00, 0x87, 0x77, 0xff, 0xf7, 0x77, 0x16, + 0xff, 0x03, 0x16, 0x77, 0x03, 0x78, 0x16, 0x00, 0x04, 0x08, 0x16, 0x00, + 0x14, 0x08, 0x00, 0x00, 0x77, 0x7f, 0xff, 0xff, 0x7f, 0x16, 0xff, 0x04, + 0x77, 0x77, 0x78, 0x00, 0x80, 0x16, 0x00, 0x03, 0x80, 0x16, 0x00, 0x13, + 0x80, 0x00, 0x00, 0x7f, 0x16, 0xff, 0x09, 0xf7, 0x77, 0x00, 0x08, 0x80, + 0x00, 0x00, 0x80, 0x16, 0x00, 0x13, 0x80, 0x80, 0x08, 0x16, 0xff, 0x0b, + 0x77, 0x80, 0x00, 0x08, 0x00, 0x00, 0x08, 0x16, 0x00, 0x12, 0x08, 0x00, + 0x80, 0x07, 0x16, 0xff, 0x0c, 0x78, 0x00, 0x08, 0x80, 0x00, 0x08, 0x16, + 0x00, 0x12, 0x08, 0x08, 0x00, 0x8f, 0x16, 0xff, 0x0c, 0xf7, 0x08, 0x80, + 0x80, 0x00, 0x08, 0x16, 0x00, 0x12, 0x16, 0x08, 0x03, 0x7f, 0x16, 0xff, + 0x0c, 0xf7, 0x08, 0x80, 0x80, 0x00, 0x00, 0x80, 0x16, 0x00, 0x11, 0x80, + 0x08, 0x07, 0x16, 0xff, 0x0e, 0x80, 0x00, 0x08, 0x00, 0x00, 0x80, 0x16, + 0x00, 0x11, 0x80, 0x80, 0x0f, 0x16, 0xff, 0x0e, 0x70, 0x00, 0x08, 0x00, + 0x00, 0x80, 0x16, 0x00, 0x10, 0x08, 0x00, 0x80, 0x8f, 0x16, 0xff, 0x0e, + 0x70, 0x00, 0x08, 0x00, 0x00, 0x80, 0x16, 0x00, 0x10, 0x08, 0x08, 0x00, + 0x7f, 0x16, 0xff, 0x0e, 0x70, 0x00, 0x08, 0x00, 0x00, 0x08, 0x16, 0x00, + 0x10, 0x80, 0x08, 0x00, 0x16, 0xff, 0x05, 0x7f, 0x16, 0xff, 0x09, 0xf0, + 0x00, 0x08, 0x00, 0x00, 0x08, 0x16, 0x00, 0x0f, 0x08, 0x00, 0x08, 0x00, + 0x16, 0xff, 0x05, 0x7f, 0x16, 0xff, 0x09, 0xf0, 0x00, 0x08, 0x00, 0x00, + 0x08, 0x16, 0x00, 0x0f, 0x08, 0x00, 0x08, 0x08, 0x16, 0xff, 0x05, 0x7f, + 0x16, 0xff, 0x09, 0xf0, 0x00, 0x08, 0x00, 0x00, 0x08, 0x16, 0x00, 0x0f, + 0x08, 0x00, 0x08, 0x08, 0x16, 0xff, 0x05, 0x7f, 0x16, 0xff, 0x09, 0xf0, + 0x00, 0x08, 0x00, 0x00, 0x08, 0x16, 0x00, 0x0f, 0x08, 0x00, 0x00, 0x88, + 0x16, 0xff, 0x05, 0x7f, 0x16, 0xff, 0x09, 0xf0, 0x00, 0x08, 0x00, 0x00, + 0x08, 0x16, 0x00, 0x0f, 0x08, 0x00, 0x00, 0x08, 0x16, 0xff, 0x05, 0x7f, + 0x16, 0xff, 0x09, 0xf0, 0x88, 0x88, 0x80, 0x00, 0x08, 0x16, 0x00, 0x0f, + 0x08, 0x06, 0xe6, 0x00, 0x8f, 0x16, 0xff, 0x04, 0x7f, 0x16, 0xff, 0x09, + 0xf8, 0x00, 0x00, 0x08, 0x80, 0x08, 0x16, 0x00, 0x10, 0x6e, 0x6e, 0x60, + 0x08, 0x16, 0xff, 0x04, 0x7f, 0x16, 0xff, 0x08, 0xe6, 0xe0, 0x16, 0x00, + 0x03, 0x88, 0x80, 0x16, 0x00, 0x0f, 0x06, 0x16, 0xe6, 0x03, 0x00, 0x8f, + 0x16, 0xff, 0x0b, 0xfe, 0x6e, 0x60, 0x16, 0x00, 0x04, 0x60, 0x16, 0x00, + 0x0f, 0x16, 0x6e, 0x04, 0x60, 0x08, 0x16, 0xff, 0x0b, 0xf6, 0xe6, 0xe0, + 0x16, 0x00, 0x03, 0x06, 0xe6, 0x16, 0x00, 0x0c, 0x06, 0x16, 0xe6, 0x06, + 0xe0, 0x00, 0x8f, 0x16, 0xff, 0x0a, 0xfe, 0x6e, 0x60, 0x16, 0x00, 0x03, + 0x0e, 0x6e, 0x16, 0x00, 0x0c, 0x16, 0x6e, 0x08, 0x00, 0x08, 0x16, 0xff, + 0x0a, 0x76, 0xe6, 0xe6, 0x16, 0x00, 0x03, 0xe6, 0xe6, 0x16, 0x00, 0x0c, + 0x16, 0xe6, 0x08, 0xe0, 0x00, 0x8f, 0x16, 0xff, 0x08, 0xf7, 0x7e, 0x16, + 0x6e, 0x07, 0x16, 0x00, 0x0c, 0x16, 0x6e, 0x08, 0x60, 0x00, 0x08, 0x16, + 0xff, 0x08, 0xf7, 0x76, 0x16, 0xe6, 0x07, 0xe0, 0x16, 0x00, 0x0b, 0x16, + 0xe6, 0x09, 0x00, 0x00, 0x0f, 0x16, 0xff, 0x07, 0xf7, 0x7e, 0x16, 0x6e, + 0x08, 0x16, 0x00, 0x0b, 0x16, 0x6e, 0x09, 0x60, 0x00, 0x0f, 0x16, 0xff, + 0x07, 0xf7, 0x76, 0x16, 0xe6, 0x08, 0xe0, 0x16, 0x00, 0x0a, 0x16, 0xe6, + 0x09, 0xe0, 0x00, 0x8f, 0x16, 0xff, 0x07, 0xf7, 0x8e, 0x16, 0x6e, 0x09, + 0x16, 0x00, 0x0a, 0x16, 0x6e, 0x0a, 0x88, 0x16, 0xff, 0x08, 0x78, 0x86, + 0x16, 0xe6, 0x0a, 0x16, 0x00, 0x09, 0x16, 0xe6, 0x0a, 0xef, 0x16, 0xff, + 0x07, 0xf7, 0x80, 0x06, 0x16, 0x6e, 0x0a, 0x16, 0x00, 0x09, 0x16, 0x6e, + 0x0b, 0x16, 0xff, 0x07, 0x78, 0x00, 0x06, 0x16, 0xe6, 0x09, 0xe0, 0x16, + 0x00, 0x09, 0x16, 0xe6, 0x0b, 0x7f, 0x16, 0xff, 0x05, 0x78, 0x80, 0x00, + 0x06, 0x16, 0x6e, 0x09, 0x16, 0x00, 0x09, 0x0e, 0x16, 0x6e, 0x0a, 0x66, + 0x67, 0x16, 0xff, 0x04, 0x78, 0x80, 0x00, 0x00, 0x86, 0x16, 0xe6, 0x08, + 0xe0, 0x16, 0x00, 0x09, 0x06, 0x16, 0xe6, 0x0b, 0x60, 0x16, 0x00, 0x08, + 0x86, 0x16, 0x6e, 0x06, 0x66, 0x60, 0x16, 0x00, 0x0a, 0x0e, 0x16, 0x6e, + 0x0a, 0x66, 0x60, 0x16, 0x00, 0x08, 0x86, 0x16, 0xe6, 0x06, 0x60, 0x16, + 0x00, 0x0c, 0x16, 0xe6, 0x0b, 0x60, 0x16, 0x00, 0x08, 0x86, 0x16, 0x6e, + 0x04, 0x66, 0x66, 0x16, 0x00, 0x0f, 0x16, 0x66, 0x03, 0x16, 0x6e, 0x05, + 0x66, 0x60, 0x00, 0x16, 0x88, 0x05, 0x80, 0x00, 0x06, 0x66, 0x16, 0xe6, + 0x03, 0x66, 0x16, 0x00, 0x12, 0x16, 0x66, 0x04, 0xe6, 0xe6, 0x66, 0x88, + 0x88, 0x16, 0x00, 0x05, 0x08, 0x88, 0x86, 0x66, 0x6e, 0x6e, 0x66, 0x60, + 0x16, 0x00, 0x14, 0x06, 0x16, 0x66, 0x04, 0x16, 0x00, 0x09, 0x06, 0x16, + 0x66, 0x04, 0x16, 0x00, 0x16, 0x06, 0x66, 0x66, 0x60, 0x16, 0x00, 0x0a, + 0x16, 0x66, 0x03, 0x60, 0x16, 0x00, 0x82 +}; + +const unsigned char vt_beastie2_vga16[] = { + 0x16, 0x00, 0x11, 0x04, 0x16, 0x00, 0x26, 0x04, 0x44, 0x16, 0x00, 0x26, + 0x44, 0x40, 0x16, 0x00, 0x25, 0x44, 0x44, 0x16, 0x00, 0x0b, 0x44, 0x16, + 0x00, 0x19, 0x04, 0x44, 0x40, 0x16, 0x00, 0x0b, 0x04, 0x40, 0x16, 0x00, + 0x18, 0x44, 0x44, 0x40, 0x16, 0x00, 0x0b, 0x04, 0x44, 0x16, 0x00, 0x17, + 0x04, 0x44, 0x44, 0x16, 0x00, 0x0d, 0x44, 0x40, 0x16, 0x00, 0x16, 0x16, + 0x44, 0x03, 0x16, 0x00, 0x03, 0x04, 0x04, 0x16, 0x00, 0x08, 0x44, 0x44, + 0x16, 0x00, 0x16, 0x16, 0x44, 0x03, 0x00, 0x04, 0x16, 0x44, 0x05, 0x16, + 0x00, 0x06, 0x44, 0x44, 0x16, 0x00, 0x15, 0x04, 0x44, 0x44, 0x40, 0x40, + 0x16, 0x44, 0x07, 0x40, 0x16, 0x00, 0x04, 0x44, 0x44, 0x40, 0x16, 0x00, + 0x14, 0x04, 0x16, 0x44, 0x06, 0x04, 0x04, 0x16, 0x44, 0x03, 0x04, 0x16, + 0x00, 0x03, 0x04, 0x44, 0x44, 0x40, 0x16, 0x00, 0x14, 0x04, 0x16, 0x44, + 0x07, 0x40, 0x16, 0x44, 0x04, 0x40, 0x00, 0x00, 0x16, 0x44, 0x03, 0x40, + 0x16, 0x00, 0x14, 0x04, 0x16, 0x44, 0x03, 0x84, 0x16, 0x44, 0x04, 0x04, + 0x16, 0x44, 0x04, 0x04, 0x16, 0x44, 0x04, 0x40, 0x16, 0x00, 0x14, 0x04, + 0x44, 0x44, 0x0f, 0xf8, 0x44, 0x48, 0x84, 0x16, 0x44, 0x0b, 0x40, 0x16, + 0x00, 0x14, 0x04, 0x44, 0x40, 0xff, 0xf8, 0x40, 0xff, 0xff, 0x16, 0x44, + 0x0b, 0x40, 0x16, 0x00, 0x14, 0x04, 0x44, 0x0f, 0xff, 0x74, 0x47, 0xff, + 0xff, 0x74, 0x16, 0x44, 0x0a, 0x40, 0x16, 0x00, 0x14, 0x04, 0x04, 0xff, + 0xff, 0x44, 0x7f, 0xff, 0xff, 0xf4, 0x16, 0x44, 0x0a, 0x16, 0x00, 0x15, + 0x04, 0x48, 0xff, 0xf7, 0x40, 0x16, 0xff, 0x03, 0xf6, 0x16, 0x44, 0x0a, + 0x16, 0x00, 0x16, 0x4f, 0xff, 0xf8, 0x47, 0x16, 0xff, 0x03, 0xf8, 0x16, + 0x44, 0x09, 0x40, 0x16, 0x00, 0x16, 0x07, 0x07, 0xf8, 0x0f, 0x16, 0xff, + 0x03, 0xf8, 0x16, 0x44, 0x08, 0x40, 0x40, 0x16, 0x00, 0x15, 0x04, 0x77, + 0x80, 0xf4, 0x78, 0x0f, 0xff, 0xff, 0xf8, 0x16, 0x44, 0x09, 0x16, 0x00, + 0x16, 0x04, 0x8f, 0x00, 0xf0, 0x8f, 0x88, 0xff, 0xff, 0xf8, 0x16, 0x44, + 0x08, 0x16, 0x00, 0x17, 0x04, 0x00, 0x00, 0x88, 0x0f, 0x00, 0xff, 0xff, + 0xf6, 0x16, 0x44, 0x07, 0x40, 0x16, 0x00, 0x17, 0x40, 0x00, 0x00, 0x48, + 0x07, 0x00, 0xff, 0xff, 0xf4, 0x16, 0x44, 0x06, 0x40, 0x16, 0x00, 0x18, + 0x44, 0x80, 0x08, 0x48, 0x00, 0x00, 0xff, 0xff, 0xf4, 0x16, 0x44, 0x06, + 0x16, 0x00, 0x18, 0x04, 0x44, 0x40, 0x04, 0x48, 0x00, 0x00, 0xff, 0xff, + 0x84, 0x16, 0x44, 0x06, 0x40, 0x16, 0x00, 0x17, 0x44, 0x44, 0x04, 0x00, + 0x48, 0x00, 0x07, 0xff, 0xff, 0x16, 0x44, 0x07, 0x40, 0x16, 0x00, 0x17, + 0x44, 0x40, 0x16, 0x44, 0x03, 0xf7, 0xff, 0xff, 0xf0, 0x16, 0x44, 0x07, + 0x40, 0x16, 0x00, 0x16, 0x04, 0x44, 0x40, 0x44, 0x44, 0x40, 0x0f, 0xff, + 0xf7, 0x00, 0x16, 0x44, 0x07, 0x40, 0x16, 0x00, 0x14, 0x6e, 0x00, 0x04, + 0x16, 0x44, 0x05, 0x40, 0x40, 0x16, 0x44, 0x08, 0x40, 0x40, 0x16, 0x00, + 0x14, 0x0e, 0xe0, 0x00, 0x44, 0x44, 0x04, 0x16, 0x44, 0x0d, 0x16, 0x00, + 0x15, 0x06, 0x66, 0x00, 0x16, 0x44, 0x03, 0x16, 0x40, 0x03, 0x16, 0x44, + 0x09, 0x04, 0x16, 0x00, 0x13, 0x60, 0x00, 0x00, 0x06, 0x60, 0x44, 0x44, + 0x04, 0x16, 0x44, 0x0c, 0x40, 0x16, 0x00, 0x13, 0x0e, 0xe0, 0x00, 0x00, + 0xe0, 0x04, 0x44, 0x40, 0x16, 0x44, 0x0b, 0x40, 0x40, 0x16, 0x00, 0x13, + 0x06, 0xee, 0x00, 0x00, 0xe0, 0x00, 0x04, 0x16, 0x44, 0x07, 0x40, 0x40, + 0x16, 0x44, 0x04, 0x16, 0x00, 0x14, 0x06, 0x06, 0xe6, 0x00, 0xe0, 0x00, + 0x00, 0x04, 0x04, 0x16, 0x44, 0x04, 0x40, 0x16, 0x44, 0x05, 0x16, 0x00, + 0x17, 0x6e, 0x6e, 0x60, 0x16, 0x00, 0x04, 0x16, 0x44, 0x03, 0x40, 0x16, + 0x44, 0x04, 0x40, 0x40, 0x16, 0x00, 0x13, 0x68, 0x60, 0x00, 0x00, 0x06, + 0xee, 0x60, 0x16, 0x00, 0x05, 0x40, 0x40, 0x16, 0x44, 0x03, 0x04, 0x16, + 0x00, 0x16, 0x0e, 0xe0, 0x00, 0x00, 0x6e, 0xe6, 0xe6, 0x04, 0x44, 0x44, + 0x00, 0x00, 0x16, 0x44, 0x04, 0x04, 0x44, 0x40, 0x40, 0x16, 0x00, 0x15, + 0x6e, 0x66, 0x6e, 0xe6, 0x66, 0xee, 0x04, 0x44, 0x44, 0x16, 0x00, 0x03, + 0x16, 0x40, 0x03, 0x44, 0x44, 0x40, 0x16, 0x00, 0x16, 0x06, 0x6e, 0xee, + 0x68, 0x00, 0x0e, 0x64, 0x44, 0x44, 0x16, 0x00, 0x03, 0x16, 0x44, 0x06, + 0x04, 0x16, 0x00, 0x1b, 0x60, 0x44, 0x40, 0x16, 0x00, 0x03, 0x16, 0x44, + 0x06, 0x40, 0x16, 0x00, 0x1a, 0x04, 0x44, 0x40, 0x16, 0x00, 0x03, 0x04, + 0x16, 0x44, 0x06, 0x04, 0x16, 0x00, 0x1a, 0x04, 0x16, 0x44, 0x05, 0x04, + 0x16, 0x44, 0x06, 0x40, 0x16, 0x00, 0x1a, 0x04, 0x16, 0x44, 0x04, 0x04, + 0x04, 0x44, 0x04, 0x16, 0x44, 0x03, 0x04, 0x40, 0x40, 0x16, 0x00, 0x19, + 0x04, 0x44, 0x44, 0x04, 0x40, 0x44, 0x04, 0x44, 0x44, 0x04, 0x44, 0x40, + 0x44, 0x44, 0x16, 0x00, 0x1b, 0x04, 0x40, 0x44, 0x04, 0x16, 0x44, 0x04, + 0x40, 0x40, 0x44, 0x44, 0x40, 0x40, 0x16, 0x00, 0x1a, 0x04, 0x16, 0x44, + 0x03, 0x40, 0x16, 0x44, 0x08, 0x16, 0x00, 0x1c, 0x04, 0x40, 0x44, 0x04, + 0x16, 0x44, 0x07, 0x40, 0x40, 0x16, 0x00, 0x1e, 0x16, 0x44, 0x09, 0x16, + 0x00, 0x1e, 0x04, 0x16, 0x44, 0x06, 0x40, 0x44, 0x44, 0x04, 0x16, 0x00, + 0x1d, 0x04, 0x16, 0x44, 0x06, 0x40, 0x44, 0x44, 0x40, 0x16, 0x00, 0x1e, + 0x16, 0x44, 0x06, 0x40, 0x44, 0x16, 0x00, 0x20, 0x04, 0x00, 0x16, 0x44, + 0x04, 0x04, 0x00, 0x04, 0x16, 0x00, 0x1f, 0x40, 0x16, 0x44, 0x05, 0x00, + 0x04, 0x16, 0x00, 0x1f, 0x04, 0x44, 0x00, 0x04, 0x04, 0x40, 0x40, 0x04, + 0x00, 0x40, 0x40, 0x16, 0x00, 0x1d, 0x04, 0x44, 0x44, 0x00, 0x40, 0x06, + 0x6e, 0x60, 0x04, 0x16, 0x00, 0x20, 0x16, 0x44, 0x04, 0x40, 0x6e, 0xe6, + 0x00, 0x40, 0x40, 0x16, 0x00, 0x1e, 0x16, 0x44, 0x05, 0x46, 0xee, 0x60, + 0x16, 0x00, 0x20, 0x16, 0x44, 0x05, 0x04, 0x6e, 0xee, 0x04, 0x04, 0x16, + 0x00, 0x1e, 0x04, 0x16, 0x44, 0x05, 0x06, 0x6e, 0xe0, 0x00, 0x04, 0x16, + 0x00, 0x1e, 0x16, 0x44, 0x06, 0x6e, 0x64, 0x04, 0x16, 0x00, 0x1f, 0x04, + 0x04, 0x00, 0x00, 0x16, 0x04, 0x04, 0x00, 0x04, 0x16, 0x00, 0x1e, 0x04, + 0x44, 0x04, 0x04, 0x16, 0x40, 0x04, 0x44, 0x40, 0x04, 0x16, 0x00, 0x1d, + 0x44, 0x84, 0x74, 0x86, 0x87, 0x84, 0x44, 0x04, 0x00, 0x44, 0x40, 0x04, + 0x16, 0x00, 0x1c, 0x87, 0xc7, 0x40, 0x77, 0x74, 0x04, 0x04, 0x80, 0x00, + 0x00, 0x44, 0x40, 0x16, 0x00, 0x1b, 0x7c, 0x7c, 0x84, 0x74, 0x84, 0x44, + 0x84, 0x48, 0x78, 0x40, 0x00, 0x00, 0x44, 0x44, 0x04, 0x16, 0x00, 0x16, + 0x40, 0x48, 0xc8, 0xc7, 0x44, 0x40, 0x84, 0x44, 0x76, 0x04, 0x48, 0x78, + 0x16, 0x00, 0x04, 0x04, 0x40, 0x44, 0x04, 0x16, 0x00, 0x10, 0x08, 0x77, + 0xff, 0x77, 0x84, 0x44, 0x04, 0x00, 0x00, 0x46, 0x48, 0x74, 0x04, 0x44, + 0x40, 0x80, 0x40, 0x16, 0x00, 0x04, 0x04, 0x16, 0x44, 0x05, 0x40, 0x40, + 0x16, 0x00, 0x0a, 0x87, 0x16, 0xff, 0x03, 0xf7, 0x70, 0x88, 0x77, 0x77, + 0x84, 0x04, 0x44, 0x40, 0x44, 0x04, 0x44, 0x44, 0x04, 0x16, 0x00, 0x07, + 0x04, 0x16, 0x44, 0x03, 0x04, 0x40, 0x16, 0x00, 0x08, 0x07, 0x88, 0x16, + 0xff, 0x03, 0x77, 0x87, 0x16, 0xff, 0x03, 0x77, 0x84, 0x04, 0x04, 0x44, + 0x44, 0x16, 0x40, 0x03, 0x80, 0x16, 0x00, 0x09, 0x04, 0x44, 0x44, 0x40, + 0x16, 0x00, 0x07, 0x0f, 0xff, 0x16, 0x88, 0x03, 0x80, 0x7f, 0x16, 0xff, + 0x03, 0xf7, 0x78, 0x16, 0x44, 0x03, 0x04, 0x04, 0x48, 0x87, 0x80, 0x16, + 0x00, 0x0b, 0x04, 0x44, 0x16, 0x00, 0x07, 0x08, 0x16, 0xff, 0x03, 0x77, + 0x88, 0x87, 0x16, 0xff, 0x03, 0x77, 0x77, 0x16, 0x04, 0x03, 0x40, 0x48, + 0x87, 0x77, 0x16, 0x00, 0x0d, 0x44, 0x40, 0x16, 0x00, 0x07, 0x88, 0x77, + 0xf7, 0x77, 0x8f, 0x77, 0x16, 0x88, 0x05, 0x80, 0x88, 0x88, 0x87, 0x77, + 0x77, 0x80, 0x16, 0x00, 0x0d, 0x44, 0x40, 0x16, 0x00, 0x0b, 0x07, 0x16, + 0xff, 0x03, 0x7f, 0x16, 0x77, 0x06, 0x78, 0x16, 0x00, 0x0a, 0x04, 0x40, + 0x16, 0x00, 0x03, 0x44, 0x40, 0x16, 0x00, 0x0c, 0x87, 0x7f, 0xff, 0xff, + 0x16, 0x77, 0x04, 0x88, 0x80, 0x16, 0x00, 0x0a, 0x04, 0x44, 0x44, 0x00, + 0x00, 0x04, 0x44, 0x40, 0x16, 0x00, 0x0e, 0x08, 0x08, 0x88, 0x08, 0x16, + 0x00, 0x0e, 0x16, 0x44, 0x06, 0x40, 0x16, 0x00, 0x20, 0x16, 0x44, 0x06, + 0x16, 0x00, 0x21, 0x16, 0x44, 0x05, 0x40, 0x16, 0x00, 0x22, 0x40, 0x40, + 0x16, 0x00, 0x08 +}; + +const unsigned char vt_orb_vga16[] = { + 0x16, 0x00, 0x52, 0x04, 0x04, 0x16, 0x00, 0x0c, 0x16, 0x80, 0x03, 0x88, + 0x88, 0x16, 0x80, 0x04, 0x16, 0x00, 0x0b, 0x40, 0x40, 0x16, 0x00, 0x03, + 0x04, 0x44, 0x6c, 0xcc, 0x64, 0x16, 0x00, 0x08, 0x08, 0x08, 0x88, 0x77, + 0x16, 0x7f, 0x04, 0x77, 0x78, 0x88, 0x80, 0x80, 0x16, 0x00, 0x07, 0x04, + 0x6c, 0x6c, 0x44, 0x40, 0x00, 0x00, 0x04, 0x46, 0x4c, 0x77, 0x7c, 0xcc, + 0x40, 0x16, 0x00, 0x04, 0x08, 0x08, 0x88, 0x7f, 0x16, 0xff, 0x08, 0xf7, + 0x78, 0x80, 0x80, 0x16, 0x00, 0x05, 0x4c, 0xc7, 0xc7, 0xcc, 0x44, 0x44, + 0x00, 0x00, 0x44, 0x44, 0x46, 0xcc, 0xf7, 0xfc, 0x7c, 0x60, 0x00, 0x00, + 0x08, 0x08, 0x87, 0x16, 0xff, 0x0c, 0xf7, 0x88, 0x08, 0x16, 0x00, 0x03, + 0x6c, 0x16, 0xf7, 0x03, 0xc6, 0x44, 0x44, 0x00, 0x00, 0x16, 0x44, 0x03, + 0xc7, 0x7f, 0xf7, 0x77, 0xc7, 0x60, 0x00, 0x80, 0x77, 0x16, 0xff, 0x0e, + 0xf7, 0x70, 0x80, 0x08, 0x67, 0xff, 0x7f, 0x7f, 0x7c, 0xc4, 0x44, 0x44, + 0x00, 0x00, 0x16, 0x44, 0x03, 0x4c, 0xc7, 0xff, 0xf7, 0xf7, 0x77, 0x68, + 0x8f, 0x16, 0xff, 0x09, 0x16, 0xf7, 0x03, 0x16, 0xff, 0x05, 0x88, 0x67, + 0xff, 0x7f, 0xff, 0xff, 0x7c, 0x64, 0x44, 0x44, 0x00, 0x00, 0x04, 0x16, + 0x44, 0x03, 0x6c, 0xcf, 0x16, 0x7f, 0x04, 0x16, 0xff, 0x0d, 0x16, 0xf7, + 0x03, 0xff, 0xff, 0x7e, 0x16, 0xff, 0x04, 0x7c, 0xc6, 0x16, 0x44, 0x03, + 0x00, 0x00, 0x04, 0x16, 0x44, 0x03, 0x46, 0xcc, 0x7c, 0xf7, 0x16, 0xff, + 0x0d, 0x16, 0x7f, 0x03, 0x7c, 0xc6, 0xcc, 0x7e, 0x16, 0xff, 0x04, 0xf7, + 0x7c, 0x6c, 0x16, 0x44, 0x03, 0x00, 0x00, 0x04, 0x16, 0x44, 0x03, 0x4c, + 0x4c, 0xcc, 0xcf, 0x16, 0xff, 0x0f, 0xf7, 0xc4, 0x44, 0x4c, 0x16, 0xff, + 0x04, 0xf7, 0x7c, 0xcc, 0xc4, 0x16, 0x44, 0x03, 0x00, 0x00, 0x04, 0x16, + 0x44, 0x04, 0x4c, 0xcc, 0x7f, 0x16, 0xff, 0x0e, 0xf7, 0xf7, 0x44, 0x46, + 0xcf, 0x16, 0xff, 0x03, 0xf7, 0xf7, 0x77, 0xcc, 0x16, 0x44, 0x03, 0xc0, + 0x16, 0x00, 0x03, 0x16, 0x44, 0x04, 0xc4, 0xc7, 0x16, 0xff, 0x10, 0xf7, + 0x44, 0x47, 0x16, 0xff, 0x05, 0x77, 0xcc, 0xc4, 0x44, 0x44, 0x46, 0x40, + 0x16, 0x00, 0x03, 0xc4, 0x16, 0x44, 0x03, 0x4c, 0xcf, 0x16, 0xff, 0x11, + 0x44, 0x6f, 0x16, 0xff, 0x04, 0x7f, 0x77, 0x7c, 0x16, 0x44, 0x03, 0x4c, + 0x40, 0x16, 0x00, 0x03, 0x46, 0x16, 0x44, 0x03, 0xcc, 0x16, 0xff, 0x12, + 0xc6, 0xcf, 0x16, 0xff, 0x04, 0xf7, 0x7c, 0xc4, 0x16, 0x44, 0x03, 0x8c, + 0x16, 0x00, 0x04, 0x0c, 0x44, 0x44, 0x64, 0x7f, 0x16, 0xff, 0x12, 0x77, + 0xcf, 0x16, 0xff, 0x04, 0x7f, 0xcc, 0x16, 0x44, 0x03, 0x48, 0xc4, 0x16, + 0x00, 0x04, 0x08, 0xc4, 0x44, 0x4c, 0x16, 0xff, 0x13, 0xfc, 0x7e, 0x16, + 0xff, 0x03, 0xf7, 0xfc, 0x64, 0x16, 0x44, 0x03, 0x4c, 0xc0, 0x16, 0x00, + 0x05, 0xc6, 0x44, 0xc7, 0x16, 0xff, 0x13, 0x7f, 0x77, 0x16, 0xff, 0x03, + 0xfc, 0xcc, 0x16, 0x44, 0x04, 0x67, 0x60, 0x16, 0x00, 0x05, 0x8c, 0x84, + 0x7f, 0x16, 0xff, 0x09, 0x7f, 0xef, 0xff, 0x16, 0xf7, 0x06, 0xff, 0xff, + 0x77, 0xff, 0xff, 0x7c, 0xcc, 0xc4, 0x16, 0x44, 0x03, 0x48, 0xc7, 0x40, + 0x16, 0x00, 0x05, 0x07, 0xc7, 0x16, 0xff, 0x0c, 0x7f, 0x7f, 0xef, 0xef, + 0xfe, 0xff, 0xff, 0x7f, 0x7f, 0x76, 0xcf, 0xc7, 0xcc, 0xcc, 0x16, 0x44, + 0x04, 0x8c, 0x76, 0x16, 0x00, 0x06, 0x06, 0x7f, 0x7f, 0x16, 0xff, 0x08, + 0x16, 0x7f, 0x03, 0xfe, 0xfe, 0x16, 0xf7, 0x07, 0xfc, 0x6c, 0x7c, 0xcc, + 0xc4, 0x16, 0x44, 0x04, 0x67, 0xc8, 0x16, 0x00, 0x07, 0x7f, 0x16, 0xff, + 0x08, 0x7f, 0xf7, 0xf7, 0xfe, 0x7f, 0x7f, 0x7e, 0x7e, 0x16, 0xf7, 0x06, + 0x8c, 0xcc, 0xcc, 0xc4, 0x16, 0x44, 0x03, 0x48, 0xc7, 0x60, 0x16, 0x00, + 0x06, 0x08, 0xff, 0xff, 0xf7, 0x16, 0xff, 0x06, 0x16, 0xf7, 0x03, 0x77, + 0xfc, 0xfc, 0xf7, 0x77, 0x77, 0x16, 0x7f, 0x05, 0xc8, 0xcc, 0xc4, 0x16, + 0x44, 0x04, 0x8c, 0x7c, 0x78, 0x16, 0x00, 0x06, 0x0f, 0x7f, 0xff, 0x7f, + 0x16, 0xff, 0x05, 0x7f, 0x7f, 0x77, 0x7e, 0x7e, 0xcf, 0xcf, 0xce, 0x77, + 0x16, 0x7c, 0x04, 0x16, 0x77, 0x03, 0x4c, 0x4c, 0x16, 0x44, 0x04, 0xc7, + 0x77, 0x77, 0x16, 0x00, 0x06, 0x8f, 0xff, 0xff, 0x7f, 0x7f, 0x16, 0xff, + 0x04, 0xf7, 0xf7, 0x7e, 0x77, 0x77, 0x7c, 0xec, 0xcc, 0xcc, 0x16, 0xc6, + 0x04, 0xcc, 0xc7, 0xc7, 0x76, 0x16, 0x44, 0x04, 0x48, 0xc7, 0xc7, 0xf7, + 0x80, 0x16, 0x00, 0x05, 0x7f, 0x7f, 0xf7, 0x7f, 0x16, 0xff, 0x04, 0x7f, + 0x7f, 0xcf, 0xc7, 0xce, 0xcc, 0xc6, 0x16, 0xc4, 0x03, 0x4c, 0x4c, 0x44, + 0x4c, 0x48, 0x66, 0xc8, 0xc7, 0x84, 0x16, 0x44, 0x03, 0x8c, 0x7c, 0x67, + 0x7f, 0x80, 0x16, 0x00, 0x04, 0x08, 0x7f, 0xff, 0x77, 0xf7, 0x16, 0xff, + 0x04, 0xfe, 0x77, 0x7c, 0xec, 0xec, 0xc6, 0x4c, 0x46, 0x4c, 0x4c, 0x44, + 0x44, 0x4c, 0x16, 0x44, 0x03, 0x64, 0x86, 0xc8, 0x64, 0x44, 0x44, 0xc7, + 0x7c, 0x87, 0x7f, 0x70, 0x16, 0x00, 0x04, 0x08, 0xf7, 0xff, 0xe7, 0x7f, + 0x16, 0xff, 0x03, 0xfe, 0xfc, 0xfc, 0xec, 0xcc, 0x16, 0x44, 0x0b, 0x64, + 0x46, 0x44, 0x8c, 0x86, 0x84, 0x44, 0x6c, 0x46, 0x8c, 0x77, 0xf8, 0x16, + 0x00, 0x04, 0x0f, 0x7f, 0xf7, 0xcf, 0x7f, 0x7f, 0xff, 0xff, 0xed, 0xe7, + 0xce, 0xcc, 0x64, 0x64, 0xc4, 0x16, 0x44, 0x0b, 0x46, 0x16, 0x48, 0x03, + 0x84, 0x84, 0x88, 0x88, 0x77, 0xf8, 0x16, 0x00, 0x04, 0x0f, 0xf7, 0xfe, + 0x7e, 0x7f, 0xff, 0xff, 0xef, 0x7e, 0xcc, 0xcc, 0x64, 0x16, 0x44, 0x10, + 0x48, 0x68, 0x68, 0x88, 0x48, 0x68, 0xc7, 0x7f, 0x16, 0x00, 0x04, 0x7f, + 0x7f, 0x7c, 0x7c, 0xfe, 0xff, 0xff, 0xf7, 0xec, 0x7c, 0x64, 0x4c, 0x16, + 0x44, 0x10, 0x84, 0x48, 0x48, 0x68, 0x88, 0x88, 0x67, 0xf7, 0x80, 0x16, + 0x00, 0x03, 0x7f, 0x7f, 0xc7, 0xce, 0x7f, 0xff, 0xff, 0xe7, 0xec, 0x66, + 0x4c, 0x16, 0x44, 0x11, 0x16, 0x48, 0x03, 0x88, 0x68, 0x68, 0x67, 0x7f, + 0x80, 0x16, 0x00, 0x03, 0xf7, 0x7f, 0xcc, 0xec, 0xfe, 0xff, 0xff, 0x7e, + 0xc6, 0x16, 0x44, 0x15, 0x04, 0x84, 0x88, 0x88, 0x6c, 0x7f, 0x70, 0x00, + 0x00, 0x08, 0x7f, 0x77, 0x6c, 0xc7, 0xef, 0xff, 0xf7, 0xec, 0xc4, 0x64, + 0x16, 0x44, 0x13, 0x04, 0x84, 0x04, 0x84, 0x84, 0x86, 0x7f, 0x70, 0x00, + 0x00, 0x08, 0xf7, 0x7c, 0xc6, 0xec, 0xe7, 0xef, 0xe7, 0xc6, 0x64, 0x16, + 0x44, 0x15, 0x04, 0x84, 0x06, 0x86, 0x46, 0x7f, 0x78, 0x00, 0x00, 0x08, + 0xf7, 0x7c, 0x6c, 0xcc, 0xe7, 0x77, 0xcc, 0xc6, 0xc4, 0x16, 0x44, 0x13, + 0x04, 0x04, 0x16, 0x40, 0x04, 0x46, 0x7f, 0xf0, 0x00, 0x00, 0x08, 0xf7, + 0xcc, 0x6c, 0x6e, 0xce, 0xce, 0xc6, 0x66, 0x64, 0x16, 0x44, 0x17, 0x04, + 0x04, 0x46, 0xcf, 0x78, 0x00, 0x00, 0x07, 0xf7, 0x74, 0x6c, 0x6c, 0xcc, + 0x16, 0xc6, 0x03, 0x64, 0x16, 0x44, 0x13, 0x04, 0x44, 0x40, 0x40, 0x44, + 0x40, 0x46, 0x7f, 0xf8, 0x00, 0x00, 0x08, 0xf7, 0xc6, 0x46, 0x66, 0x6c, + 0x6c, 0x66, 0x46, 0x46, 0x16, 0x44, 0x17, 0x04, 0x04, 0x44, 0xef, 0x78, + 0x00, 0x00, 0x07, 0xf7, 0xc6, 0x46, 0x4c, 0x16, 0x46, 0x03, 0x66, 0x64, + 0x16, 0x44, 0x15, 0x04, 0x04, 0x44, 0x44, 0x46, 0x7f, 0xf8, 0x00, 0x00, + 0x07, 0xf7, 0xc4, 0x16, 0x64, 0x07, 0x16, 0x44, 0x17, 0x04, 0x04, 0x44, + 0xff, 0x78, 0x00, 0x00, 0x08, 0xf7, 0xc4, 0x16, 0x46, 0x07, 0x16, 0x44, + 0x15, 0x04, 0x04, 0x44, 0x44, 0x4c, 0xef, 0xf8, 0x00, 0x00, 0x07, 0xf7, + 0xc4, 0x64, 0x16, 0x46, 0x06, 0x16, 0x44, 0x14, 0x40, 0x44, 0x44, 0x04, + 0x44, 0x4c, 0xff, 0x78, 0x00, 0x00, 0x08, 0xf7, 0x84, 0x46, 0x44, 0x16, + 0x64, 0x06, 0x16, 0x44, 0x14, 0x04, 0x04, 0x44, 0x44, 0x47, 0xef, 0xf8, + 0x00, 0x00, 0x08, 0xff, 0xc4, 0x44, 0x46, 0x44, 0x16, 0x46, 0x04, 0x16, + 0x44, 0x14, 0x04, 0x16, 0x44, 0x04, 0xce, 0xff, 0x78, 0x00, 0x00, 0x08, + 0xff, 0x84, 0x46, 0x44, 0x16, 0x64, 0x05, 0x66, 0x16, 0x44, 0x13, 0x40, + 0x40, 0x44, 0x44, 0x46, 0xcf, 0xef, 0x70, 0x16, 0x00, 0x03, 0xff, 0xc4, + 0x16, 0x44, 0x04, 0x16, 0x46, 0x04, 0x16, 0x44, 0x12, 0x40, 0x16, 0x44, + 0x04, 0x4c, 0xee, 0xff, 0x70, 0x16, 0x00, 0x03, 0x7f, 0x74, 0x44, 0x44, + 0x16, 0x64, 0x07, 0x16, 0x44, 0x12, 0x04, 0x04, 0x44, 0x44, 0x4e, 0xef, + 0xef, 0x70, 0x16, 0x00, 0x03, 0x7f, 0x76, 0x16, 0x44, 0x05, 0x16, 0x46, + 0x04, 0x16, 0x44, 0x11, 0x40, 0x16, 0x44, 0x04, 0xee, 0xfe, 0xff, 0x80, + 0x16, 0x00, 0x03, 0x8f, 0xf8, 0x16, 0x44, 0x03, 0x16, 0x64, 0x06, 0x16, + 0x44, 0x12, 0x40, 0x44, 0x44, 0x4c, 0xee, 0xef, 0xf7, 0x80, 0x16, 0x00, + 0x03, 0x8f, 0xfc, 0x16, 0x44, 0x06, 0x16, 0x46, 0x03, 0x16, 0x44, 0x11, + 0x04, 0x04, 0x44, 0x44, 0x6e, 0xef, 0xef, 0xf7, 0x16, 0x00, 0x04, 0x07, + 0xf7, 0x16, 0x44, 0x04, 0x16, 0x64, 0x03, 0x16, 0x46, 0x03, 0x16, 0x44, + 0x13, 0x46, 0xce, 0xee, 0xff, 0x77, 0x16, 0x00, 0x04, 0x08, 0xff, 0x84, + 0x16, 0x44, 0x05, 0x46, 0x44, 0x16, 0x64, 0x03, 0x16, 0x44, 0x0f, 0x04, + 0x44, 0x44, 0x4c, 0xec, 0xef, 0xef, 0xf8, 0x16, 0x00, 0x04, 0x08, 0x7f, + 0x74, 0x16, 0x44, 0x03, 0x46, 0x46, 0x44, 0x16, 0x46, 0x04, 0x16, 0x44, + 0x12, 0xcc, 0xec, 0xef, 0xff, 0x70, 0x16, 0x00, 0x05, 0x7f, 0xf4, 0x16, + 0x44, 0x05, 0x46, 0x44, 0x44, 0x16, 0x64, 0x03, 0x16, 0x44, 0x10, 0x46, + 0xc6, 0xcc, 0xf7, 0xf7, 0x70, 0x16, 0x00, 0x05, 0x8f, 0xf7, 0x04, 0x16, + 0x44, 0x05, 0x16, 0x46, 0x05, 0x16, 0x44, 0x10, 0xc4, 0xc6, 0xcc, 0xfe, + 0xf7, 0x16, 0x00, 0x06, 0x07, 0xff, 0x16, 0x44, 0x05, 0x46, 0x16, 0x44, + 0x03, 0x16, 0x64, 0x04, 0x16, 0x44, 0x0c, 0x46, 0x66, 0x66, 0x6c, 0x67, + 0x7f, 0x77, 0x16, 0x00, 0x06, 0x08, 0xff, 0x74, 0x04, 0x16, 0x44, 0x04, + 0x16, 0x46, 0x05, 0x4c, 0x46, 0x16, 0x44, 0x0c, 0x64, 0xc4, 0xc4, 0xc6, + 0xc7, 0x7f, 0x70, 0x16, 0x00, 0x07, 0x8f, 0xf6, 0x16, 0x44, 0x09, 0x16, + 0x64, 0x05, 0x16, 0x44, 0x08, 0x46, 0xc6, 0xc6, 0x66, 0x6c, 0x6c, 0x77, + 0x77, 0x80, 0x16, 0x00, 0x07, 0x87, 0xf7, 0x40, 0x16, 0x44, 0x05, 0x16, + 0x46, 0x09, 0x16, 0x44, 0x06, 0xc6, 0xc6, 0x66, 0x66, 0xc6, 0xc6, 0xc7, + 0x77, 0xf7, 0x16, 0x00, 0x08, 0x08, 0xff, 0xc4, 0x16, 0x44, 0x09, 0x16, + 0x64, 0x05, 0x66, 0x66, 0x64, 0x66, 0x6c, 0x16, 0x66, 0x03, 0xc6, 0xc6, + 0x6c, 0x6c, 0xc7, 0x77, 0x78, 0x16, 0x00, 0x09, 0x7f, 0xf6, 0x04, 0x16, + 0x44, 0x05, 0x16, 0x46, 0x08, 0x64, 0x64, 0x6c, 0x66, 0x66, 0x16, 0xc6, + 0x03, 0x66, 0x66, 0xc6, 0x6c, 0x77, 0x7f, 0x80, 0x16, 0x00, 0x09, 0x07, + 0xf7, 0x16, 0x44, 0x0a, 0x16, 0x64, 0x04, 0x66, 0xc6, 0x64, 0x64, 0x16, + 0x66, 0x04, 0xc6, 0xc6, 0x6c, 0xc7, 0xe7, 0x77, 0x16, 0x00, 0x0a, 0x08, + 0x7f, 0x74, 0x16, 0x44, 0x06, 0x16, 0x46, 0x03, 0x44, 0x16, 0x64, 0x05, + 0xc6, 0x66, 0x66, 0x16, 0xc6, 0x03, 0x66, 0x6c, 0x6c, 0xe7, 0x77, 0x70, + 0x16, 0x00, 0x0b, 0x87, 0xfc, 0x16, 0x44, 0x09, 0x64, 0x16, 0x46, 0x03, + 0x4c, 0x16, 0x46, 0x04, 0x16, 0x66, 0x03, 0xc6, 0xc6, 0xce, 0xde, 0x77, + 0x80, 0x16, 0x00, 0x0b, 0x08, 0x7f, 0xc4, 0x16, 0x44, 0x07, 0x64, 0x44, + 0x16, 0x64, 0x05, 0x16, 0x66, 0x03, 0x46, 0xc6, 0xc6, 0x66, 0x6c, 0x77, + 0xe7, 0x78, 0x16, 0x00, 0x0d, 0x87, 0xfc, 0x16, 0x44, 0x08, 0x64, 0x44, + 0x46, 0x46, 0x4c, 0x16, 0x46, 0x04, 0x16, 0x66, 0x03, 0xc6, 0xce, 0x7e, + 0xd7, 0x80, 0x16, 0x00, 0x0d, 0x08, 0x7f, 0xc4, 0x16, 0x44, 0x08, 0x16, + 0x64, 0x06, 0xc6, 0x66, 0x4c, 0x46, 0xc6, 0xce, 0x7c, 0x77, 0x78, 0x16, + 0x00, 0x0f, 0x87, 0xf7, 0x16, 0x44, 0x0a, 0x16, 0x46, 0x06, 0x66, 0x66, + 0x6c, 0xec, 0xe7, 0xe7, 0x16, 0x00, 0x11, 0x8f, 0x7c, 0x16, 0x44, 0x07, + 0x16, 0x64, 0x09, 0x6c, 0xec, 0xe7, 0xc7, 0x80, 0x16, 0x00, 0x11, 0x08, + 0x77, 0xc6, 0x16, 0x44, 0x09, 0x16, 0x46, 0x04, 0x4c, 0x6c, 0xec, 0xee, + 0xc7, 0x78, 0x16, 0x00, 0x13, 0x07, 0x77, 0xcc, 0x16, 0x44, 0x06, 0x16, + 0x64, 0x05, 0xc4, 0xc6, 0xce, 0xce, 0xec, 0x78, 0x16, 0x00, 0x15, 0x88, + 0x77, 0xc6, 0xc4, 0xc4, 0x16, 0x44, 0x07, 0xc6, 0xc6, 0x16, 0xec, 0x03, + 0x78, 0x80, 0x16, 0x00, 0x16, 0x88, 0x77, 0xcc, 0x16, 0x4c, 0x06, 0x16, + 0x6c, 0x03, 0xec, 0xec, 0xe6, 0xe8, 0x80, 0x16, 0x00, 0x18, 0x88, 0x87, + 0xcc, 0x16, 0xc6, 0x03, 0x16, 0xcc, 0x03, 0xe6, 0xec, 0xe6, 0xe6, 0x78, + 0x16, 0x00, 0x1c, 0x88, 0x87, 0x16, 0xcc, 0x06, 0xc6, 0x76, 0x88, 0x16, + 0x00, 0x1f, 0x80, 0x16, 0x88, 0x05, 0x80, 0x16, 0x00, 0x88 +}; Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Tue Jul 21 20:30:06 2015 (r285765) +++ head/sys/dev/vt/vt.h Tue Jul 21 20:33:36 2015 (r285766) @@ -164,7 +164,12 @@ struct vt_device { #define VD_PASTEBUFSZ(vd) ((vd)->vd_pastebuf.vpb_bufsz) #define VD_PASTEBUFLEN(vd) ((vd)->vd_pastebuf.vpb_len) +#define VT_LOCK(vd) mtx_lock(&(vd)->vd_lock) +#define VT_UNLOCK(vd) mtx_unlock(&(vd)->vd_lock) +#define VT_LOCK_ASSERT(vd, what) mtx_assert(&(vd)->vd_lock, what) + void vt_resume(struct vt_device *vd); +void vt_resume_flush_timer(struct vt_device *vd, int ms); void vt_suspend(struct vt_device *vd); /* @@ -363,6 +368,7 @@ struct vt_driver { * Utility macro to make early vt(4) instances work. */ +extern struct terminal vt_consterm; extern const struct terminal_class vt_termclass; void vt_upgrade(struct vt_device *vd); @@ -427,10 +433,29 @@ void vt_mouse_state(int show); #define VT_MOUSE_HIDE 0 /* Utilities. */ +void vt_compute_drawable_area(struct vt_window *); void vt_determine_colors(term_char_t c, int cursor, term_color_t *fg, term_color_t *bg); int vt_is_cursor_in_area(const struct vt_device *vd, const term_rect_t *area); +void vt_termsize(struct vt_device *, struct vt_font *, term_pos_t *); +void vt_winsize(struct vt_device *, struct vt_font *, struct winsize *); + +/* Logos-on-boot. */ +#define VT_LOGOS_DRAW_BEASTIE 0 +#define VT_LOGOS_DRAW_ALT_BEASTIE 1 +#define VT_LOGOS_DRAW_ORB 2 + +extern int vt_draw_logo_cpus; +extern int vt_splash_cpu; +extern int vt_splash_ncpu; +extern int vt_splash_cpu_style; +extern int vt_splash_cpu_duration; + +extern const unsigned int vt_logo_sprite_height; +extern const unsigned int vt_logo_sprite_width; + +void vtterm_draw_cpu_logos(struct vt_device *); #endif /* !_DEV_VT_VT_H_ */ Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Tue Jul 21 20:30:06 2015 (r285765) +++ head/sys/dev/vt/vt_core.c Tue Jul 21 20:33:36 2015 (r285766) @@ -113,10 +113,6 @@ const struct terminal_class vt_termclass #define VT_BELLDURATION ((5 * hz + 99) / 100) #define VT_BELLPITCH 800 -#define VT_LOCK(vd) mtx_lock(&(vd)->vd_lock) -#define VT_UNLOCK(vd) mtx_unlock(&(vd)->vd_lock) -#define VT_LOCK_ASSERT(vd, what) mtx_assert(&(vd)->vd_lock, what) - #define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS + \ (vw)->vw_number) @@ -139,6 +135,15 @@ static VT_SYSCTL_INT(kbd_debug, 1, "Enab static VT_SYSCTL_INT(kbd_panic, 0, "Enable request to panic. " "See kbdmap(5) to configure."); +/* Used internally, not a tunable. */ +int vt_draw_logo_cpus; +VT_SYSCTL_INT(splash_cpu, 1, "Show logo CPUs during boot"); +VT_SYSCTL_INT(splash_ncpu, 0, "Override number of logos displayed " + "(0 = do not override)"); +VT_SYSCTL_INT(splash_cpu_style, 1, "Draw logo style " + "(0=Beastie, 1=Alternate beastie, 2=Orb)"); +VT_SYSCTL_INT(splash_cpu_duration, 10, "Hide logos after (seconds)"); + static struct vt_device vt_consdev; static unsigned int vt_unit = 0; static MALLOC_DEFINE(M_VT, "vt", "vt device"); @@ -176,7 +181,7 @@ SET_DECLARE(vt_drv_set, struct vt_driver #define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)) #define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)) -static struct terminal vt_consterm; +struct terminal vt_consterm; static struct vt_window vt_conswindow; static struct vt_device vt_consdev = { .vd_driver = NULL, @@ -223,7 +228,7 @@ static struct vt_window vt_conswindow = .vw_kbdmode = K_XLATE, .vw_grabbed = 0, }; -static struct terminal vt_consterm = { +struct terminal vt_consterm = { .tm_class = &vt_termclass, .tm_softc = &vt_conswindow, .tm_flags = TF_CONS, @@ -275,7 +280,7 @@ vt_schedule_flush(struct vt_device *vd, callout_schedule(&vd->vd_timer, hz / (1000 / ms)); } -static void +void vt_resume_flush_timer(struct vt_device *vd, int ms) { @@ -548,11 +553,13 @@ vt_window_switch(struct vt_window *vw) return (0); } -static inline void +void vt_termsize(struct vt_device *vd, struct vt_font *vf, term_pos_t *size) { size->tp_row = vd->vd_height; + if (vt_draw_logo_cpus) + size->tp_row -= vt_logo_sprite_height; size->tp_col = vd->vd_width; if (vf != NULL) { size->tp_row /= vf->vf_height; @@ -561,10 +568,33 @@ vt_termsize(struct vt_device *vd, struct } static inline void +vt_termrect(struct vt_device *vd, struct vt_font *vf, term_rect_t *rect) +{ + + rect->tr_begin.tp_row = rect->tr_begin.tp_col = 0; + if (vt_draw_logo_cpus) + rect->tr_begin.tp_row = vt_logo_sprite_height; + + rect->tr_end.tp_row = vd->vd_height; + rect->tr_end.tp_col = vd->vd_width; + + if (vf != NULL) { + rect->tr_begin.tp_row = + howmany(rect->tr_begin.tp_row, vf->vf_height); + + rect->tr_end.tp_row /= vf->vf_height; + rect->tr_end.tp_col /= vf->vf_width; + } +} + +void vt_winsize(struct vt_device *vd, struct vt_font *vf, struct winsize *size) { - size->ws_row = size->ws_ypixel = vd->vd_height; + size->ws_ypixel = vd->vd_height; + if (vt_draw_logo_cpus) + size->ws_ypixel -= vt_logo_sprite_height; + size->ws_row = size->ws_ypixel; size->ws_col = size->ws_xpixel = vd->vd_width; if (vf != NULL) { size->ws_row /= vf->vf_height; @@ -572,17 +602,20 @@ vt_winsize(struct vt_device *vd, struct } } -static inline void +void vt_compute_drawable_area(struct vt_window *vw) { struct vt_device *vd; struct vt_font *vf; + vt_axis_t height; vd = vw->vw_device; if (vw->vw_font == NULL) { vw->vw_draw_area.tr_begin.tp_col = 0; vw->vw_draw_area.tr_begin.tp_row = 0; + if (vt_draw_logo_cpus) + vw->vw_draw_area.tr_begin.tp_row = vt_logo_sprite_height; vw->vw_draw_area.tr_end.tp_col = vd->vd_width; vw->vw_draw_area.tr_end.tp_row = vd->vd_height; return; @@ -595,12 +628,17 @@ vt_compute_drawable_area(struct vt_windo * the screen. */ + height = vd->vd_height; + if (vt_draw_logo_cpus) + height -= vt_logo_sprite_height; vw->vw_draw_area.tr_begin.tp_col = (vd->vd_width % vf->vf_width) / 2; - vw->vw_draw_area.tr_begin.tp_row = (vd->vd_height % vf->vf_height) / 2; + vw->vw_draw_area.tr_begin.tp_row = (height % vf->vf_height) / 2; + if (vt_draw_logo_cpus) + vw->vw_draw_area.tr_begin.tp_row += vt_logo_sprite_height; vw->vw_draw_area.tr_end.tp_col = vw->vw_draw_area.tr_begin.tp_col + vd->vd_width / vf->vf_width * vf->vf_width; vw->vw_draw_area.tr_end.tp_row = vw->vw_draw_area.tr_begin.tp_row + - vd->vd_height / vf->vf_height * vf->vf_height; + height / vf->vf_height * vf->vf_height; } static void @@ -1111,7 +1149,6 @@ vt_flush(struct vt_device *vd) struct vt_window *vw; struct vt_font *vf; term_rect_t tarea; - term_pos_t size; #ifndef SC_NO_CUTPASTE int cursor_was_shown, cursor_moved; #endif @@ -1166,14 +1203,14 @@ vt_flush(struct vt_device *vd) #endif vtbuf_undirty(&vw->vw_buf, &tarea); - vt_termsize(vd, vf, &size); /* Force a full redraw when the screen contents are invalid. */ if (vd->vd_flags & VDF_INVALID) { - tarea.tr_begin.tp_row = tarea.tr_begin.tp_col = 0; - tarea.tr_end = size; - vd->vd_flags &= ~VDF_INVALID; + + vt_termrect(vd, vf, &tarea); + if (vt_draw_logo_cpus) + vtterm_draw_cpu_logos(vd); } if (tarea.tr_begin.tp_col < tarea.tr_end.tp_col) { @@ -1318,7 +1355,8 @@ vtterm_cnprobe(struct terminal *tm, stru if (vtdbest != NULL) { #ifdef DEV_SPLASH - vtterm_splash(vd); + if (!vt_splash_cpu) + vtterm_splash(vd); #endif vd->vd_flags |= VDF_INITIALIZED; } Added: head/sys/dev/vt/vt_cpulogos.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/vt/vt_cpulogos.c Tue Jul 21 20:33:36 2015 (r285766) @@ -0,0 +1,266 @@ +/*- + * Copyright (c) 2015 Conrad Meyer + * 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 + +extern const unsigned char vt_beastie_vga16[]; +extern const unsigned char vt_beastie2_vga16[]; +extern const unsigned char vt_orb_vga16[]; + +static struct callout vt_splash_cpu_callout; + +static inline unsigned char +vt_vga2bsd(unsigned char vga) +{ + static const unsigned char lut[8] = { + 0, + 4, /* 1 and 4 swap */ + 2, + 6, /* 3 and 6 swap */ + 1, /* 4 and 1 swap */ + 5, + 3, /* 6 and 3 swap */ + 7, + }; + unsigned int bright; + + bright = (vga & 0x8); + return (lut[vga & 0x7] | bright); +} + +static void +vt_draw_2_vga16_px(struct vt_device *vd, vt_axis_t x, vt_axis_t y, + unsigned char color) +{ + + vd->vd_driver->vd_setpixel(vd, x, y, vt_vga2bsd(color >> 4)); + vd->vd_driver->vd_setpixel(vd, x + 1, y, vt_vga2bsd(color & 0xf)); +} + +static void +vt_draw_1_logo(struct vt_device *vd, vt_axis_t top, vt_axis_t left) +{ + const unsigned char rle_sent = 0x16, *data; + unsigned int xy, run, runcolor, i; + + switch (vt_splash_cpu_style) { + case VT_LOGOS_DRAW_ALT_BEASTIE: + data = vt_beastie2_vga16; + break; + case VT_LOGOS_DRAW_ORB: + data = vt_orb_vga16; + break; + case VT_LOGOS_DRAW_BEASTIE: + /* FALLTHROUGH */ + default: + data = vt_beastie_vga16; + break; + } + + /* Decode basic RLE (gets us to 30-40% of uncompressed data size): */ + for (i = 0, xy = 0; xy < vt_logo_sprite_height * vt_logo_sprite_width;) { + if (data[i] == rle_sent) { + runcolor = data[i + 1]; + run = data[i + 2]; + + for (; run; run--, xy += 2) + vt_draw_2_vga16_px(vd, + left + (xy % vt_logo_sprite_width), + top + (xy / vt_logo_sprite_width), + runcolor); + + i += 3; + } else { + vt_draw_2_vga16_px(vd, left + (xy % vt_logo_sprite_width), + top + (xy / vt_logo_sprite_width), data[i]); + + i++; + xy += 2; + } + } +} + +void +vtterm_draw_cpu_logos(struct vt_device *vd) +{ + unsigned int ncpu, i; + vt_axis_t left; + + if (vt_splash_ncpu) + ncpu = vt_splash_ncpu; + else { + ncpu = mp_ncpus; + if (ncpu < 1) + ncpu = 1; + } + + if (vd->vd_driver->vd_drawrect) + vd->vd_driver->vd_drawrect(vd, 0, 0, vd->vd_width, + vt_logo_sprite_height, 1, TC_BLACK); + /* + * Blank is okay because we only ever draw beasties on full screen + * refreshes. + */ + else if (vd->vd_driver->vd_blank) + vd->vd_driver->vd_blank(vd, TC_BLACK); + + ncpu = MIN(ncpu, vd->vd_width / vt_logo_sprite_width); + for (i = 0, left = 0; i < ncpu; left += vt_logo_sprite_width, i++) + vt_draw_1_logo(vd, 0, left); +} + +static void +vt_fini_logos(void *dummy __unused) +{ + struct vt_device *vd; + struct vt_window *vw; + struct terminal *tm; + struct vt_font *vf; + struct winsize wsz; + term_pos_t size; + + if (!vt_draw_logo_cpus) + return; + if (!vty_enabled(VTY_VT)) + return; + if (!vt_splash_cpu) + return; + + tm = &vt_consterm; + vw = tm->tm_softc; + if (vw == NULL) + return; + vd = vw->vw_device; + if (vd == NULL) + return; + vf = vw->vw_font; + if (vf == NULL) + return; + + VT_LOCK(vd); + if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0) + goto out; + + vt_draw_logo_cpus = 0; + VT_UNLOCK(vd); + + vt_termsize(vd, vf, &size); + vt_winsize(vd, vf, &wsz); + + /* Resize screen buffer and terminal. */ + terminal_mute(tm, 1); + vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size); + terminal_set_winsize_blank(tm, &wsz, 0, NULL); + terminal_set_cursor(tm, &vw->vw_buf.vb_cursor); + terminal_mute(tm, 0); + + VT_LOCK(vd); + vt_compute_drawable_area(vw); + + if (vd->vd_curwindow == vw) { + vd->vd_flags |= VDF_INVALID; + vt_resume_flush_timer(vd, 0); + } + +out: + VT_UNLOCK(vd); +} + +static void +vt_init_logos(void *dummy) +{ + struct vt_device *vd; + struct vt_window *vw; + struct terminal *tm; + struct vt_font *vf; + struct winsize wsz; + term_pos_t size; + + if (!vty_enabled(VTY_VT)) + return; + if (!vt_splash_cpu) + return; + + tm = &vt_consterm; + vw = tm->tm_softc; + if (vw == NULL) + return; + vd = vw->vw_device; + if (vd == NULL) + return; + vf = vw->vw_font; + if (vf == NULL) + return; + + VT_LOCK(vd); + KASSERT((vd->vd_flags & VDF_INITIALIZED) != 0, + ("vd %p not initialized", vd)); + + if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0) + goto out; + if (vd->vd_height <= vt_logo_sprite_height) + goto out; + + vt_draw_logo_cpus = 1; + VT_UNLOCK(vd); + + vt_termsize(vd, vf, &size); + vt_winsize(vd, vf, &wsz); + + /* Resize screen buffer and terminal. */ + terminal_mute(tm, 1); + vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size); + terminal_set_winsize_blank(tm, &wsz, 0, NULL); + terminal_set_cursor(tm, &vw->vw_buf.vb_cursor); + terminal_mute(tm, 0); + + VT_LOCK(vd); + vt_compute_drawable_area(vw); + + if (vd->vd_curwindow == vw) { + vd->vd_flags |= VDF_INVALID; + vt_resume_flush_timer(vd, 0); + } + + callout_init(&vt_splash_cpu_callout, 1); + callout_reset(&vt_splash_cpu_callout, vt_splash_cpu_duration * hz, + vt_fini_logos, NULL); + +out: + VT_UNLOCK(vd); +} +SYSINIT(vt_logos, SI_SUB_CPU + 1, SI_ORDER_ANY, vt_init_logos, NULL); From owner-svn-src-head@freebsd.org Tue Jul 21 20:53:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43D689A6C2F; Tue, 21 Jul 2015 20:53:22 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 344F01E90; Tue, 21 Jul 2015 20:53:22 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LKrM1M049837; Tue, 21 Jul 2015 20:53:22 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LKrMm8049836; Tue, 21 Jul 2015 20:53:22 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201507212053.t6LKrMm8049836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Tue, 21 Jul 2015 20:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285767 - head/sys/dev/nvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 20:53:22 -0000 Author: jimharris Date: Tue Jul 21 20:53:21 2015 New Revision: 285767 URL: https://svnweb.freebsd.org/changeset/base/285767 Log: nvd: set d_delmaxsize to full capacity of NVMe namespace The NVMe specification has no ability to specify a maximum delete size that is less than the full capacity of the namespace - so just using the namespace size is the correct value here. This fixes reported issues where ZFS trim on init looked like it was hanging the system - previously the default I/O max size (128KB on Intel NVMe controllers) was used for delete operations which worked out to only about 8MB/s. With this patch I can add an 800GB DC P3700 drive to a ZFS pool in about 15-20 seconds. Reported by: Dylan Just MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvd/nvd.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Tue Jul 21 20:33:36 2015 (r285766) +++ head/sys/dev/nvd/nvd.c Tue Jul 21 20:53:21 2015 (r285767) @@ -278,6 +278,7 @@ nvd_new_disk(struct nvme_namespace *ns, disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns); disk->d_sectorsize = nvme_ns_get_sector_size(ns); disk->d_mediasize = (off_t)nvme_ns_get_size(ns); + disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns); if (TAILQ_EMPTY(&disk_head)) disk->d_unit = 0; From owner-svn-src-head@freebsd.org Tue Jul 21 21:07:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EC009A6E39; Tue, 21 Jul 2015 21:07:19 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FC2815BA; Tue, 21 Jul 2015 21:07:19 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LL7IN9054036; Tue, 21 Jul 2015 21:07:18 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LL7It7054035; Tue, 21 Jul 2015 21:07:18 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201507212107.t6LL7It7054035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 21 Jul 2015 21:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285768 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 21 Jul 2015 21:07:19 -0000 Author: erj Date: Tue Jul 21 21:07:18 2015 New Revision: 285768 URL: https://svnweb.freebsd.org/changeset/base/285768 Log: Fix for a customer issue with ixl(4): - Add required MAC/VLAN filter when adding an LAA - Fix bug where code did not check for I40E_SUCCESS from a successful i40e_validate_mac_address() call in ixl_init_locked(), when setting an LAA. PR: 201240 Differential Revision: https://reviews.freebsd.org/D3111 Submitted by: Gregory Rose Reviewed by: gnn, rstone Approved by: gnn MFC after: 2 weeks Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Tue Jul 21 20:53:21 2015 (r285767) +++ head/sys/dev/ixl/if_ixl.c Tue Jul 21 21:07:18 2015 (r285768) @@ -1141,7 +1141,8 @@ ixl_init_locked(struct ixl_pf *pf) bcopy(IF_LLADDR(vsi->ifp), tmpaddr, I40E_ETH_LENGTH_OF_ADDRESS); if (!cmp_etheraddr(hw->mac.addr, tmpaddr) && - i40e_validate_mac_addr(tmpaddr)) { + (i40e_validate_mac_addr(tmpaddr) == I40E_SUCCESS)) { + ixl_del_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); bcopy(tmpaddr, hw->mac.addr, I40E_ETH_LENGTH_OF_ADDRESS); ret = i40e_aq_mac_address_write(hw, @@ -1151,6 +1152,8 @@ ixl_init_locked(struct ixl_pf *pf) device_printf(dev, "LLA address" "change failed!!\n"); return; + } else { + ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); } } From owner-svn-src-head@freebsd.org Tue Jul 21 21:46:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0DD19A7635; Tue, 21 Jul 2015 21:46:26 +0000 (UTC) (envelope-from eri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1D061954; Tue, 21 Jul 2015 21:46:26 +0000 (UTC) (envelope-from eri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LLkQ15069954; Tue, 21 Jul 2015 21:46:26 GMT (envelope-from eri@FreeBSD.org) Received: (from eri@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LLkP1e069951; Tue, 21 Jul 2015 21:46:25 GMT (envelope-from eri@FreeBSD.org) Message-Id: <201507212146.t6LLkP1e069951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eri set sender to eri@FreeBSD.org using -f From: Ermal Luçi Date: Tue, 21 Jul 2015 21:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285770 - in head/sys: netinet netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 21:46:26 -0000 Author: eri Date: Tue Jul 21 21:46:24 2015 New Revision: 285770 URL: https://svnweb.freebsd.org/changeset/base/285770 Log: IPSEC, remove variable argument function its already due. Differential Revision: https://reviews.freebsd.org/D3080 Reviewed by: gnn, ae Approved by: gnn(mentor) Modified: head/sys/netinet/udp_usrreq.c head/sys/netipsec/ipsec.h head/sys/netipsec/ipsec_input.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue Jul 21 21:12:28 2015 (r285769) +++ head/sys/netinet/udp_usrreq.c Tue Jul 21 21:46:24 2015 (r285770) @@ -1666,7 +1666,8 @@ udp4_espdecap(struct inpcb *inp, struct if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) m->m_pkthdr.csum_flags &= ~(CSUM_DATA_VALID|CSUM_PSEUDO_HDR); - (void) ipsec4_common_input(m, iphlen, ip->ip_p); + (void) ipsec_common_input(m, iphlen, offsetof(struct ip, ip_p), + AF_INET, ip->ip_p); return (NULL); /* NB: consumed, bypass processing. */ } #endif /* defined(IPSEC) && defined(IPSEC_NAT_T) */ Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Tue Jul 21 21:12:28 2015 (r285769) +++ head/sys/netipsec/ipsec.h Tue Jul 21 21:46:24 2015 (r285770) @@ -337,7 +337,7 @@ extern void ah4_ctlinput(int cmd, struct extern int esp4_input(struct mbuf **mp, int *offp, int proto); extern void esp4_ctlinput(int cmd, struct sockaddr *sa, void *); extern int ipcomp4_input(struct mbuf **mp, int *offp, int proto); -extern int ipsec4_common_input(struct mbuf *m, ...); +extern int ipsec_common_input(struct mbuf *m, int, int, int, int); extern int ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int protoff); extern int ipsec4_process_packet(struct mbuf *, struct ipsecrequest *); Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Tue Jul 21 21:12:28 2015 (r285769) +++ head/sys/netipsec/ipsec_input.c Tue Jul 21 21:46:24 2015 (r285770) @@ -118,7 +118,7 @@ static void ipsec4_common_ctlinput(int, * and call the appropriate transform. The transform callback * takes care of further processing (like ingress filtering). */ -static int +int ipsec_common_input(struct mbuf *m, int skip, int protoff, int af, int sproto) { char buf[INET6_ADDRSTRLEN]; @@ -243,24 +243,6 @@ ipsec_common_input(struct mbuf *m, int s } #ifdef INET -/* - * Common input handler for IPv4 AH, ESP, and IPCOMP. - */ -int -ipsec4_common_input(struct mbuf *m, ...) -{ - va_list ap; - int off, nxt; - - va_start(ap, m); - off = va_arg(ap, int); - nxt = va_arg(ap, int); - va_end(ap); - - return ipsec_common_input(m, off, offsetof(struct ip, ip_p), - AF_INET, nxt); -} - int ah4_input(struct mbuf **mp, int *offp, int proto) { @@ -271,7 +253,8 @@ ah4_input(struct mbuf **mp, int *offp, i off = *offp; *mp = NULL; - ipsec4_common_input(m, off, IPPROTO_AH); + ipsec_common_input(m, off, offsetof(struct ip, ip_p), + AF_INET, IPPROTO_AH); return (IPPROTO_DONE); } void @@ -292,7 +275,8 @@ esp4_input(struct mbuf **mp, int *offp, off = *offp; mp = NULL; - ipsec4_common_input(m, off, IPPROTO_ESP); + ipsec_common_input(m, off, offsetof(struct ip, ip_p), + AF_INET, IPPROTO_ESP); return (IPPROTO_DONE); } @@ -314,7 +298,8 @@ ipcomp4_input(struct mbuf **mp, int *off off = *offp; mp = NULL; - ipsec4_common_input(m, off, IPPROTO_IPCOMP); + ipsec_common_input(m, off, offsetof(struct ip, ip_p), + AF_INET, IPPROTO_IPCOMP); return (IPPROTO_DONE); } From owner-svn-src-head@freebsd.org Tue Jul 21 22:56:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D78D19A748A; Tue, 21 Jul 2015 22:56:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C84FD1A84; Tue, 21 Jul 2015 22:56:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LMulws097991; Tue, 21 Jul 2015 22:56:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LMul0x097990; Tue, 21 Jul 2015 22:56:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507212256.t6LMul0x097990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 21 Jul 2015 22:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285771 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 22:56:47 -0000 Author: kib Date: Tue Jul 21 22:56:46 2015 New Revision: 285771 URL: https://svnweb.freebsd.org/changeset/base/285771 Log: The smp_rendezvous_cpus() function should ensure that all accesses done by the functions called on other CPUs, are visible to the caller. Pair otherwise useless acquire on smp_rv_waiters[3] with a release add to ensure synchronized with relation, which guarantees visibility. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Tue Jul 21 21:46:24 2015 (r285770) +++ head/sys/kern/subr_smp.c Tue Jul 21 22:56:46 2015 (r285771) @@ -455,8 +455,13 @@ smp_rendezvous_action(void) * This means that no member of smp_rv_* pseudo-structure will be * accessed by this target CPU after this point; in particular, * memory pointed by smp_rv_func_arg. + * + * The release semantic ensures that all accesses performed by + * the current CPU are visible when smp_rendezvous_cpus() + * returns, by synchronizing with the + * atomic_load_acq_int(&smp_rv_waiters[3]). */ - atomic_add_int(&smp_rv_waiters[3], 1); + atomic_add_rel_int(&smp_rv_waiters[3], 1); td->td_critnest--; KASSERT(owepreempt == td->td_owepreempt, @@ -522,6 +527,11 @@ smp_rendezvous_cpus(cpuset_t map, * CPUs to finish the rendezvous, so that smp_rv_* * pseudo-structure and the arg are guaranteed to not * be in use. + * + * Load acquire synchronizes with the release add in + * smp_rendezvous_action(), which ensures that our caller sees + * all memory actions done by the called functions on other + * CPUs. */ while (atomic_load_acq_int(&smp_rv_waiters[3]) < ncpus) cpu_spinwait(); From owner-svn-src-head@freebsd.org Tue Jul 21 22:57:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D59F19A74DD; Tue, 21 Jul 2015 22:57:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C68691C0C; Tue, 21 Jul 2015 22:57:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LMvTax098066; Tue, 21 Jul 2015 22:57:29 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LMvS1A098063; Tue, 21 Jul 2015 22:57:28 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201507212257.t6LMvS1A098063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 21 Jul 2015 22:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285772 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 22:57:30 -0000 Author: cem Date: Tue Jul 21 22:57:27 2015 New Revision: 285772 URL: https://svnweb.freebsd.org/changeset/base/285772 Log: patch(1): Add -Vnone option to disable backup files Differential Revision: https://reviews.freebsd.org/D3146 Reviewed by: pfg Approved by: markj (mentor) MFC after: 1 week Relnotes: yes Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/patch/backupfile.c head/usr.bin/patch/patch.1 head/usr.bin/patch/patch.c Modified: head/usr.bin/patch/backupfile.c ============================================================================== --- head/usr.bin/patch/backupfile.c Tue Jul 21 22:56:46 2015 (r285771) +++ head/usr.bin/patch/backupfile.c Tue Jul 21 22:57:27 2015 (r285772) @@ -219,11 +219,11 @@ invalid_arg(const char *kind, const char } static const char *backup_args[] = { - "never", "simple", "nil", "existing", "t", "numbered", 0 + "none", "never", "simple", "nil", "existing", "t", "numbered", 0 }; static enum backup_type backup_types[] = { - simple, simple, numbered_existing, + none, simple, simple, numbered_existing, numbered_existing, numbered, numbered }; Modified: head/usr.bin/patch/patch.1 ============================================================================== --- head/usr.bin/patch/patch.1 Tue Jul 21 22:56:46 2015 (r285771) +++ head/usr.bin/patch/patch.1 Tue Jul 21 22:57:27 2015 (r285772) @@ -21,7 +21,7 @@ .\" .\" $OpenBSD: patch.1,v 1.27 2014/04/15 06:26:54 jmc Exp $ .\" $FreeBSD$ -.Dd June 15, 2014 +.Dd July 21, 2015 .Dt PATCH 1 .Os .Sh NAME @@ -39,7 +39,7 @@ .Op Fl o Ar out-file .Op Fl p Ar strip-count .Op Fl r Ar rej-name -.Op Fl V Cm t | nil | never +.Op Fl V Cm t | nil | never | none .Op Fl x Ar number .Op Fl z Ar backup-ext .Op Fl Fl posix @@ -296,8 +296,8 @@ Forces .Nm to interpret the patch file as a unified context diff (a unidiff). .It Xo -.Fl V Cm t | nil | never , -.Fl Fl version-control Cm t | nil | never +.Fl V Cm t | nil | never | none , +.Fl Fl version-control Cm t | nil | never | none .Xc Causes the next argument to be interpreted as a method for creating backup file names. @@ -328,6 +328,8 @@ Make numbered backups of files that alre simple backups of the others. .It Cm never , simple Always make simple backups. +.It Cm none +Do not make backups. .El .It Fl v , Fl Fl version Causes Modified: head/usr.bin/patch/patch.c ============================================================================== --- head/usr.bin/patch/patch.c Tue Jul 21 22:56:46 2015 (r285771) +++ head/usr.bin/patch/patch.c Tue Jul 21 22:57:27 2015 (r285772) @@ -109,6 +109,8 @@ static bool remove_empty_files = false; /* true if -R was specified on command line. */ static bool reverse_flag_specified = false; +static bool Vflag = false; + /* buffer holding the name of the rejected patch file. */ static char rejname[NAME_MAX + 1]; @@ -201,7 +203,7 @@ main(int argc, char *argv[]) Argv = argv; get_some_switches(); - if (backup_type == none) { + if (!Vflag) { if ((v = getenv("PATCH_VERSION_CONTROL")) == NULL) v = getenv("VERSION_CONTROL"); if (v != NULL || !posix) @@ -595,6 +597,7 @@ get_some_switches(void) break; case 'V': backup_type = get_version(optarg); + Vflag = true; break; #ifdef DEBUGGING case 'x': @@ -631,8 +634,8 @@ usage(void) fprintf(stderr, "usage: patch [-bCcEeflNnRstuv] [-B backup-prefix] [-D symbol] [-d directory]\n" " [-F max-fuzz] [-i patchfile] [-o out-file] [-p strip-count]\n" -" [-r rej-name] [-V t | nil | never] [-x number] [-z backup-ext]\n" -" [--posix] [origfile [patchfile]]\n" +" [-r rej-name] [-V t | nil | never | none] [-x number]\n" +" [-z backup-ext] [--posix] [origfile [patchfile]]\n" " patch Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DA3E9A765A; Tue, 21 Jul 2015 23:03:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B392102A; Tue, 21 Jul 2015 23:03:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LN3Mhj002080; Tue, 21 Jul 2015 23:03:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LN3Msj002079; Tue, 21 Jul 2015 23:03:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201507212303.t6LN3Msj002079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Jul 2015 23:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285773 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 21 Jul 2015 23:03:22 -0000 Author: markj Date: Tue Jul 21 23:03:21 2015 New Revision: 285773 URL: https://svnweb.freebsd.org/changeset/base/285773 Log: Remove some dead code from DDB's amd64 stack unwinder. The amd64 port copied some code from i386 to fetch function arguments and display them in backtraces. However, it was commented out and can't easily be implemented since the function arguments are passed in registers rather than on the stack in amd64. Remove it in preparation for some bug fixes in this area. Reviewed by: jhb Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D2857 Modified: head/sys/amd64/amd64/db_trace.c Modified: head/sys/amd64/amd64/db_trace.c ============================================================================== --- head/sys/amd64/amd64/db_trace.c Tue Jul 21 22:57:27 2015 (r285772) +++ head/sys/amd64/amd64/db_trace.c Tue Jul 21 23:03:21 2015 (r285773) @@ -188,9 +188,7 @@ db_ss(struct db_variable *vp, db_expr_t #define TRAP_INTERRUPT 5 static void db_nextframe(struct amd64_frame **, db_addr_t *, struct thread *); -static int db_numargs(struct amd64_frame *); -static void db_print_stack_entry(const char *, int, char **, long *, db_addr_t, - void *); +static void db_print_stack_entry(const char *, db_addr_t, void *); static void decode_syscall(int, struct thread *); static const char * watchtype_str(int type); @@ -198,62 +196,11 @@ int amd64_set_watch(int watchnum, unsig int access, struct dbreg *d); int amd64_clr_watch(int watchnum, struct dbreg *d); -/* - * Figure out how many arguments were passed into the frame at "fp". - */ -static int -db_numargs(fp) - struct amd64_frame *fp; -{ -#if 1 - return (0); /* regparm, needs dwarf2 info */ -#else - long *argp; - int inst; - int args; - - argp = (long *)db_get_value((long)&fp->f_retaddr, 8, FALSE); - /* - * XXX etext is wrong for LKMs. We should attempt to interpret - * the instruction at the return address in all cases. This - * may require better fault handling. - */ - if (argp < (long *)btext || argp >= (long *)etext) { - args = 5; - } else { - inst = db_get_value((long)argp, 4, FALSE); - if ((inst & 0xff) == 0x59) /* popl %ecx */ - args = 1; - else if ((inst & 0xffff) == 0xc483) /* addl $Ibs, %esp */ - args = ((inst >> 16) & 0xff) / 4; - else - args = 5; - } - return (args); -#endif -} - static void -db_print_stack_entry(name, narg, argnp, argp, callpc, frame) - const char *name; - int narg; - char **argnp; - long *argp; - db_addr_t callpc; - void *frame; +db_print_stack_entry(const char *name, db_addr_t callpc, void *frame) { - db_printf("%s(", name); -#if 0 - while (narg) { - if (argnp) - db_printf("%s=", *argnp++); - db_printf("%lr", (long)db_get_value((long)argp, 8, FALSE)); - argp++; - if (--narg != 0) - db_printf(","); - } -#endif - db_printf(") at "); + + db_printf("%s() at ", name); db_printsym(callpc, DB_STGY_PROC); if (frame != NULL) db_printf("/frame 0x%lx", (register_t)frame); @@ -348,7 +295,7 @@ db_nextframe(struct amd64_frame **fp, db return; } - db_print_stack_entry(name, 0, 0, 0, rip, &(*fp)->f_frame); + db_print_stack_entry(name, rip, &(*fp)->f_frame); /* * Point to base of trapframe which is just above the @@ -388,13 +335,9 @@ db_backtrace(struct thread *td, struct t struct amd64_frame *frame, db_addr_t pc, int count) { struct amd64_frame *actframe; -#define MAXNARG 16 - char *argnames[MAXNARG], **argnp = NULL; const char *name; - long *argp; db_expr_t offset; c_db_sym_t sym; - int narg; boolean_t first; if (count == -1) @@ -444,22 +387,13 @@ db_backtrace(struct thread *td, struct t * Don't try to walk back on a stack for a * process that hasn't actually been run yet. */ - db_print_stack_entry(name, 0, 0, 0, pc, - actframe); + db_print_stack_entry(name, pc, actframe); break; } first = FALSE; } - argp = &actframe->f_arg0; - narg = MAXNARG; - if (sym != NULL && db_sym_numargs(sym, &narg, argnames)) { - argnp = argnames; - } else { - narg = db_numargs(frame); - } - - db_print_stack_entry(name, narg, argnp, argp, pc, actframe); + db_print_stack_entry(name, pc, actframe); if (actframe != frame) { /* `frame' belongs to caller. */ @@ -473,7 +407,7 @@ db_backtrace(struct thread *td, struct t if (INKERNEL((long)pc) && !INKERNEL((long)frame)) { sym = db_search_symbol(pc, DB_STGY_ANY, &offset); db_symbol_values(sym, &name, NULL); - db_print_stack_entry(name, 0, 0, 0, pc, frame); + db_print_stack_entry(name, pc, frame); break; } if (!INKERNEL((long) frame)) { From owner-svn-src-head@freebsd.org Tue Jul 21 23:07:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A3CC9A775C; Tue, 21 Jul 2015 23:07:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51F531285; Tue, 21 Jul 2015 23:07:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LN7vvm002626; Tue, 21 Jul 2015 23:07:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LN7umu002624; Tue, 21 Jul 2015 23:07:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201507212307.t6LN7umu002624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Jul 2015 23:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285774 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 23:07:57 -0000 Author: markj Date: Tue Jul 21 23:07:55 2015 New Revision: 285774 URL: https://svnweb.freebsd.org/changeset/base/285774 Log: Don't return undefined symbols to a DDB symbol lookup. Undefined symbols have a value of zero, so it makes no sense to return such a symbol when performing a lookup by value. This occurs for example when unwinding the stack after calling a NULL function pointer, and we confusingly report the faulting function as uart_sab82532_class() on amd64. Convert db_print_loc_and_inst() to only attempt disassembly if we managed to find a symbol corresponding to the IP. Otherwise we may fault and re-enter the debugger. Reviewed by: jhb Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D2858 Modified: head/sys/ddb/db_examine.c head/sys/ddb/db_main.c Modified: head/sys/ddb/db_examine.c ============================================================================== --- head/sys/ddb/db_examine.c Tue Jul 21 23:03:21 2015 (r285773) +++ head/sys/ddb/db_examine.c Tue Jul 21 23:07:55 2015 (r285774) @@ -232,9 +232,13 @@ db_print_cmd(db_expr_t addr, bool have_a void db_print_loc_and_inst(db_addr_t loc) { + db_expr_t off; + db_printsym(loc, DB_STGY_PROC); - db_printf(":\t"); - (void) db_disasm(loc, true); + if (db_search_symbol(loc, DB_STGY_PROC, &off) != C_DB_SYM_NULL) { + db_printf(":\t"); + (void)db_disasm(loc, true); + } } /* Modified: head/sys/ddb/db_main.c ============================================================================== --- head/sys/ddb/db_main.c Tue Jul 21 23:03:21 2015 (r285773) +++ head/sys/ddb/db_main.c Tue Jul 21 23:07:55 2015 (r285774) @@ -110,7 +110,7 @@ X_db_search_symbol(db_symtab_t *symtab, diff = ~0UL; match = NULL; for (sym = (Elf_Sym*)symtab->start; (char*)sym < symtab->end; sym++) { - if (sym->st_name == 0) + if (sym->st_name == 0 || sym->st_shndx == SHN_UNDEF) continue; if (off < sym->st_value) continue; From owner-svn-src-head@freebsd.org Tue Jul 21 23:13:12 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6AD29A787C; Tue, 21 Jul 2015 23:13:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 913E918A9; Tue, 21 Jul 2015 23:13:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LNDCEF006761; Tue, 21 Jul 2015 23:13:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LNDCpr006757; Tue, 21 Jul 2015 23:13:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201507212313.t6LNDCpr006757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Jul 2015 23:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285775 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 21 Jul 2015 23:13:12 -0000 Author: markj Date: Tue Jul 21 23:13:11 2015 New Revision: 285775 URL: https://svnweb.freebsd.org/changeset/base/285775 Log: Improve stack unwinding on i386 and amd64 after an IP fault. If we can't find a symbol corresponding to the faulting instruction, assume that the previously-executed function is a call and attempt to find the calling function using the return address on the stack. Otherwise we end up associating the last stack frame with the current call, which is incorrect and causes the unwinder to skip printing of the calling function, resulting in a confusing backtrace. Reviewed by: jhb Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D2859 Modified: head/sys/amd64/amd64/db_trace.c head/sys/i386/i386/db_trace.c Modified: head/sys/amd64/amd64/db_trace.c ============================================================================== --- head/sys/amd64/amd64/db_trace.c Tue Jul 21 23:07:55 2015 (r285774) +++ head/sys/amd64/amd64/db_trace.c Tue Jul 21 23:13:11 2015 (r285775) @@ -200,7 +200,7 @@ static void db_print_stack_entry(const char *name, db_addr_t callpc, void *frame) { - db_printf("%s() at ", name); + db_printf("%s() at ", name != NULL ? name : "??"); db_printsym(callpc, DB_STGY_PROC); if (frame != NULL) db_printf("/frame 0x%lx", (register_t)frame); @@ -331,8 +331,8 @@ db_nextframe(struct amd64_frame **fp, db } static int -db_backtrace(struct thread *td, struct trapframe *tf, - struct amd64_frame *frame, db_addr_t pc, int count) +db_backtrace(struct thread *td, struct trapframe *tf, struct amd64_frame *frame, + db_addr_t pc, register_t sp, int count) { struct amd64_frame *actframe; const char *name; @@ -361,7 +361,20 @@ db_backtrace(struct thread *td, struct t */ actframe = frame; if (first) { - if (tf != NULL) { + first = FALSE; + if (sym == C_DB_SYM_NULL && sp != 0) { + /* + * If a symbol couldn't be found, we've probably + * jumped to a bogus location, so try and use + * the return address to find our caller. + */ + db_print_stack_entry(name, pc, NULL); + pc = db_get_value(sp, 8, FALSE); + if (db_search_symbol(pc, DB_STGY_PROC, + &offset) == C_DB_SYM_NULL) + break; + continue; + } else if (tf != NULL) { int instr; instr = db_get_value(pc, 4, FALSE); @@ -390,7 +403,6 @@ db_backtrace(struct thread *td, struct t db_print_stack_entry(name, pc, actframe); break; } - first = FALSE; } db_print_stack_entry(name, pc, actframe); @@ -429,7 +441,7 @@ db_trace_self(void) frame = (struct amd64_frame *)rbp; callpc = (db_addr_t)db_get_value((long)&frame->f_retaddr, 8, FALSE); frame = frame->f_frame; - db_backtrace(curthread, NULL, frame, callpc, -1); + db_backtrace(curthread, NULL, frame, callpc, 0, -1); } int @@ -439,7 +451,7 @@ db_trace_thread(struct thread *thr, int ctx = kdb_thr_ctx(thr); return (db_backtrace(thr, NULL, (struct amd64_frame *)ctx->pcb_rbp, - ctx->pcb_rip, count)); + ctx->pcb_rip, ctx->pcb_rsp, count)); } int Modified: head/sys/i386/i386/db_trace.c ============================================================================== --- head/sys/i386/i386/db_trace.c Tue Jul 21 23:07:55 2015 (r285774) +++ head/sys/i386/i386/db_trace.c Tue Jul 21 23:13:11 2015 (r285775) @@ -389,7 +389,7 @@ db_nextframe(struct i386_frame **fp, db_ static int db_backtrace(struct thread *td, struct trapframe *tf, struct i386_frame *frame, - db_addr_t pc, int count) + db_addr_t pc, register_t sp, int count) { struct i386_frame *actframe; #define MAXNARG 16 @@ -446,7 +446,21 @@ db_backtrace(struct thread *td, struct t */ actframe = frame; if (first) { - if (tf != NULL) { + first = FALSE; + if (sym == C_DB_SYM_NULL && sp != 0) { + /* + * If a symbol couldn't be found, we've probably + * jumped to a bogus location, so try and use + * the return address to find our caller. + */ + db_print_stack_entry(name, 0, 0, 0, pc, + NULL); + pc = db_get_value(sp, 4, FALSE); + if (db_search_symbol(pc, DB_STGY_PROC, + &offset) == C_DB_SYM_NULL) + break; + continue; + } else if (tf != NULL) { instr = db_get_value(pc, 4, FALSE); if ((instr & 0xffffff) == 0x00e58955) { /* pushl %ebp; movl %esp, %ebp */ @@ -474,7 +488,6 @@ db_backtrace(struct thread *td, struct t actframe); break; } - first = FALSE; } argp = &actframe->f_arg0; @@ -521,7 +534,7 @@ db_trace_self(void) frame = (struct i386_frame *)ebp; callpc = (db_addr_t)db_get_value((int)&frame->f_retaddr, 4, FALSE); frame = frame->f_frame; - db_backtrace(curthread, NULL, frame, callpc, -1); + db_backtrace(curthread, NULL, frame, callpc, 0, -1); } int @@ -531,7 +544,7 @@ db_trace_thread(struct thread *thr, int ctx = kdb_thr_ctx(thr); return (db_backtrace(thr, NULL, (struct i386_frame *)ctx->pcb_ebp, - ctx->pcb_eip, count)); + ctx->pcb_eip, ctx->pcb_esp, count)); } int From owner-svn-src-head@freebsd.org Tue Jul 21 23:22:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C17DC9A7AC3; Tue, 21 Jul 2015 23:22:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E0E01CED; Tue, 21 Jul 2015 23:22:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LNMOTC011255; Tue, 21 Jul 2015 23:22:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LNMOLb011251; Tue, 21 Jul 2015 23:22:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201507212322.t6LNMOLb011251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Jul 2015 23:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285776 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 21 Jul 2015 23:22:24 -0000 Author: markj Date: Tue Jul 21 23:22:23 2015 New Revision: 285776 URL: https://svnweb.freebsd.org/changeset/base/285776 Log: Let the unwinder handle faults during function prologues or epilogues. The i386 and amd64 DDB stack unwinders contain code to detect and handle the case where the first frame is not completely set up or torn down. This code was accidentally unused however, since db_backtrace() was never called with a non-NULL trap frame. This change fixes that. Also remove get_rsp() from the amd64 code. It appears to have come from i386, which needs to take into account whether the exception triggered a CPL switch, since SS:ESP is only pushed onto the stack if so. On amd64, SS:RSP is pushed regardless, so get_rsp() was doing the wrong thing for kernel-mode exceptions. As a result, we can also remove custom print functions for these registers. Reviewed by: jhb Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D2881 Modified: head/sys/amd64/amd64/db_trace.c head/sys/i386/i386/db_trace.c Modified: head/sys/amd64/amd64/db_trace.c ============================================================================== --- head/sys/amd64/amd64/db_trace.c Tue Jul 21 23:13:11 2015 (r285775) +++ head/sys/amd64/amd64/db_trace.c Tue Jul 21 23:22:23 2015 (r285776) @@ -61,8 +61,6 @@ static db_varfcn_t db_dr5; static db_varfcn_t db_dr6; static db_varfcn_t db_dr7; static db_varfcn_t db_frame; -static db_varfcn_t db_rsp; -static db_varfcn_t db_ss; CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); @@ -76,12 +74,12 @@ struct db_variable db_regs[] = { { "es", DB_OFFSET(tf_es), db_frame }, { "fs", DB_OFFSET(tf_fs), db_frame }, { "gs", DB_OFFSET(tf_gs), db_frame }, - { "ss", NULL, db_ss }, + { "ss", DB_OFFSET(tf_ss), db_frame }, { "rax", DB_OFFSET(tf_rax), db_frame }, { "rcx", DB_OFFSET(tf_rcx), db_frame }, { "rdx", DB_OFFSET(tf_rdx), db_frame }, { "rbx", DB_OFFSET(tf_rbx), db_frame }, - { "rsp", NULL, db_rsp }, + { "rsp", DB_OFFSET(tf_rsp), db_frame }, { "rbp", DB_OFFSET(tf_rbp), db_frame }, { "rsi", DB_OFFSET(tf_rsi), db_frame }, { "rdi", DB_OFFSET(tf_rdi), db_frame }, @@ -130,13 +128,6 @@ DB_DRX_FUNC(dr5) DB_DRX_FUNC(dr6) DB_DRX_FUNC(dr7) -static __inline long -get_rsp(struct trapframe *tf) -{ - return ((ISPL(tf->tf_cs)) ? tf->tf_rsp : - (db_expr_t)tf + offsetof(struct trapframe, tf_rsp)); -} - static int db_frame(struct db_variable *vp, db_expr_t *valuep, int op) { @@ -153,34 +144,6 @@ db_frame(struct db_variable *vp, db_expr return (1); } -static int -db_rsp(struct db_variable *vp, db_expr_t *valuep, int op) -{ - - if (kdb_frame == NULL) - return (0); - - if (op == DB_VAR_GET) - *valuep = get_rsp(kdb_frame); - else if (ISPL(kdb_frame->tf_cs)) - kdb_frame->tf_rsp = *valuep; - return (1); -} - -static int -db_ss(struct db_variable *vp, db_expr_t *valuep, int op) -{ - - if (kdb_frame == NULL) - return (0); - - if (op == DB_VAR_GET) - *valuep = (ISPL(kdb_frame->tf_cs)) ? kdb_frame->tf_ss : rss(); - else if (ISPL(kdb_frame->tf_cs)) - kdb_frame->tf_ss = *valuep; - return (1); -} - #define NORMAL 0 #define TRAP 1 #define INTERRUPT 2 @@ -304,7 +267,7 @@ db_nextframe(struct amd64_frame **fp, db tf = (struct trapframe *)((long)*fp + 16); if (INKERNEL((long) tf)) { - rsp = get_rsp(tf); + rsp = tf->tf_rsp; rip = tf->tf_rip; rbp = tf->tf_rbp; switch (frame_type) { @@ -380,20 +343,20 @@ db_backtrace(struct thread *td, struct t instr = db_get_value(pc, 4, FALSE); if ((instr & 0xffffffff) == 0xe5894855) { /* pushq %rbp; movq %rsp, %rbp */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } else if ((instr & 0xffffff) == 0xe58948) { /* movq %rsp, %rbp */ - actframe = (void *)get_rsp(tf); + actframe = (void *)tf->tf_rsp; if (tf->tf_rbp == 0) { /* Fake frame better. */ frame = actframe; } } else if ((instr & 0xff) == 0xc3) { /* ret */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } else if (offset == 0) { /* Probably an assembler symbol. */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } } else if (strcmp(name, "fork_trampoline") == 0) { /* @@ -448,9 +411,11 @@ int db_trace_thread(struct thread *thr, int count) { struct pcb *ctx; + struct trapframe *tf; ctx = kdb_thr_ctx(thr); - return (db_backtrace(thr, NULL, (struct amd64_frame *)ctx->pcb_rbp, + tf = thr == kdb_thread ? kdb_frame : NULL; + return (db_backtrace(thr, tf, (struct amd64_frame *)ctx->pcb_rbp, ctx->pcb_rip, ctx->pcb_rsp, count)); } Modified: head/sys/i386/i386/db_trace.c ============================================================================== --- head/sys/i386/i386/db_trace.c Tue Jul 21 23:13:11 2015 (r285775) +++ head/sys/i386/i386/db_trace.c Tue Jul 21 23:22:23 2015 (r285776) @@ -541,9 +541,11 @@ int db_trace_thread(struct thread *thr, int count) { struct pcb *ctx; + struct trapframe *tf; ctx = kdb_thr_ctx(thr); - return (db_backtrace(thr, NULL, (struct i386_frame *)ctx->pcb_ebp, + tf = thr == kdb_thread ? kdb_frame : NULL; + return (db_backtrace(thr, tf, (struct i386_frame *)ctx->pcb_ebp, ctx->pcb_eip, ctx->pcb_esp, count)); } From owner-svn-src-head@freebsd.org Tue Jul 21 23:42:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FFC09A7DB3; Tue, 21 Jul 2015 23:42:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CF39147D; Tue, 21 Jul 2015 23:42:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LNgGUY019191; Tue, 21 Jul 2015 23:42:16 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LNgGQs019190; Tue, 21 Jul 2015 23:42:16 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201507212342.t6LNgGQs019190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 21 Jul 2015 23:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285777 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 23:42:16 -0000 Author: delphij Date: Tue Jul 21 23:42:15 2015 New Revision: 285777 URL: https://svnweb.freebsd.org/changeset/base/285777 Log: Fix resource exhaustion due to sessions stuck in LAST_ACK state. Submitted by: Jonathan Looney (Juniper SIRT) Reviewed by: lstewart Security: CVE-2015-5358 Security: SA-15:13.tcp Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Tue Jul 21 23:22:23 2015 (r285776) +++ head/sys/netinet/tcp_output.c Tue Jul 21 23:42:15 2015 (r285777) @@ -400,7 +400,7 @@ after_sack_rexmit: flags &= ~TH_FIN; } - if (len < 0) { + if (len <= 0) { /* * If FIN has been sent but not acked, * but we haven't been called to retransmit, @@ -410,9 +410,16 @@ after_sack_rexmit: * to (closed) window, and set the persist timer * if it isn't already going. If the window didn't * close completely, just wait for an ACK. + * + * We also do a general check here to ensure that + * we will set the persist timer when we have data + * to send, but a 0-byte window. This makes sure + * the persist timer is set even if the packet + * hits one of the "goto send" lines below. */ len = 0; - if (sendwin == 0) { + if ((sendwin == 0) && (TCPS_HAVEESTABLISHED(tp->t_state)) && + (off < (int) sbavail(&so->so_snd))) { tcp_timer_activate(tp, TT_REXMT, 0); tp->t_rxtshift = 0; tp->snd_nxt = tp->snd_una; From owner-svn-src-head@freebsd.org Tue Jul 21 23:44:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A18369A7F15; Tue, 21 Jul 2015 23:44:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92C391C82; Tue, 21 Jul 2015 23:44:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LNiba9019492; Tue, 21 Jul 2015 23:44:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LNibE3019491; Tue, 21 Jul 2015 23:44:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201507212344.t6LNibE3019491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Jul 2015 23:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285781 - head/sys/cddl/dev/fbt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 21 Jul 2015 23:44:37 -0000 Author: markj Date: Tue Jul 21 23:44:36 2015 New Revision: 285781 URL: https://svnweb.freebsd.org/changeset/base/285781 Log: Remove checks for a NULL return value from M_WAITOK allocations. Modified: head/sys/cddl/dev/fbt/fbt.c Modified: head/sys/cddl/dev/fbt/fbt.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt.c Tue Jul 21 23:42:56 2015 (r285780) +++ head/sys/cddl/dev/fbt/fbt.c Tue Jul 21 23:44:36 2015 (r285781) @@ -334,9 +334,7 @@ fbt_ctfoff_init(modctl_t *lf, linker_ctf return (EINVAL); } - if ((ctfoff = malloc(sizeof(uint32_t) * lc->nsym, M_LINKER, M_WAITOK)) == NULL) - return (ENOMEM); - + ctfoff = malloc(sizeof(uint32_t) * lc->nsym, M_LINKER, M_WAITOK); *lc->ctfoffp = ctfoff; for (i = 0; i < lc->nsym; i++, ctfoff++, symp++) { @@ -515,8 +513,8 @@ fbt_typoff_init(linker_ctf_t *lc) ctf_typemax++; *lc->typlenp = ctf_typemax; - if ((xp = malloc(sizeof(uint32_t) * ctf_typemax, M_LINKER, M_ZERO | M_WAITOK)) == NULL) - return (ENOMEM); + xp = malloc(sizeof(uint32_t) * ctf_typemax, M_LINKER, + M_ZERO | M_WAITOK); *lc->typoffp = xp; @@ -838,11 +836,7 @@ ctf_decl_push(ctf_decl_t *cd, linker_ctf prec = CTF_PREC_BASE; } - if ((cdp = malloc(sizeof (ctf_decl_node_t), M_FBT, M_WAITOK)) == NULL) { - cd->cd_err = EAGAIN; - return; - } - + cdp = malloc(sizeof(*cdp), M_FBT, M_WAITOK); cdp->cd_type = type; cdp->cd_kind = kind; cdp->cd_n = n; From owner-svn-src-head@freebsd.org Tue Jul 21 23:57:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E2069A7399; Tue, 21 Jul 2015 23:57:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ED531252; Tue, 21 Jul 2015 23:57:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LNvd3k023795; Tue, 21 Jul 2015 23:57:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LNvd7K023794; Tue, 21 Jul 2015 23:57:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201507212357.t6LNvd7K023794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Jul 2015 23:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285782 - 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.20 Precedence: list List-Id: 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, 21 Jul 2015 23:57:39 -0000 Author: markj Date: Tue Jul 21 23:57:38 2015 New Revision: 285782 URL: https://svnweb.freebsd.org/changeset/base/285782 Log: Fix counter reads on platforms where sizeof(uint64_t) != sizeof(uint64_t *). In the kernel, structs such as tcpstat are manipulated as an array of counter_u64_t (uint64_t *), but made visible to userland as an array of uint64_t. kread_counters() was previously copying the counter array into user space and sequentially overwriting each counter with its value. This mostly affects IPsec counters, as other counters are exported via sysctl. PR: 201700 Tested by: Jason Unovitch MFC after: 1 week Modified: head/usr.bin/netstat/main.c Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Tue Jul 21 23:44:36 2015 (r285781) +++ head/usr.bin/netstat/main.c Tue Jul 21 23:57:38 2015 (r285782) @@ -776,19 +776,31 @@ kread_counter(u_long addr) int kread_counters(u_long addr, void *buf, size_t size) { - uint64_t *c = buf; + uint64_t *c; + u_long *counters; + size_t i, n; if (kvmd_init() < 0) return (-1); - if (kread(addr, buf, size) < 0) + if (size % sizeof(uint64_t) != 0) { + xo_warnx("kread_counters: invalid counter set size"); return (-1); + } - while (size != 0) { - *c = kvm_counter_u64_fetch(kvmd, *c); - size -= sizeof(*c); - c++; + n = size / sizeof(uint64_t); + if ((counters = malloc(n * sizeof(u_long))) == NULL) + xo_err(-1, "malloc"); + if (kread(addr, counters, n * sizeof(u_long)) < 0) { + free(counters); + return (-1); } + + c = buf; + for (i = 0; i < n; i++) + c[i] = kvm_counter_u64_fetch(kvmd, counters[i]); + + free(counters); return (0); } From owner-svn-src-head@freebsd.org Wed Jul 22 01:09:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F08E69A82D8; Wed, 22 Jul 2015 01:09:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D43FC1621; Wed, 22 Jul 2015 01:09:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6M194e5052552; Wed, 22 Jul 2015 01:09:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6M1934K052545; Wed, 22 Jul 2015 01:09:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201507220109.t6M1934K052545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 22 Jul 2015 01:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285783 - in head/sys: amd64/amd64 ddb i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 01:09:05 -0000 Author: jhb Date: Wed Jul 22 01:09:02 2015 New Revision: 285783 URL: https://svnweb.freebsd.org/changeset/base/285783 Log: Various changes to the registers displayed in DDB for x86. - Fix segment registers to only display the low 16 bits. - Remove unused handlers and entries for the debug registers. - Display xcr0 (if valid) in 'show sysregs'. - Add '0x' prefix to MSR values to match other values in 'show sysregs'. - MFamd64: Display various MSRs in 'show sysregs'. - Add a 'show dbregs' to display the value of debug registers. - Dynamically size the column width for register values to properly align columns on 64-bit platforms. - Display %gs for i386 in 'show registers'. Differential Revision: https://reviews.freebsd.org/D2784 Reviewed by: kib, markj MFC after: 2 weeks Modified: head/sys/amd64/amd64/db_trace.c head/sys/amd64/amd64/machdep.c head/sys/ddb/db_print.c head/sys/i386/i386/db_trace.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/db_trace.c ============================================================================== --- head/sys/amd64/amd64/db_trace.c Tue Jul 21 23:57:38 2015 (r285782) +++ head/sys/amd64/amd64/db_trace.c Wed Jul 22 01:09:02 2015 (r285783) @@ -52,15 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include -static db_varfcn_t db_dr0; -static db_varfcn_t db_dr1; -static db_varfcn_t db_dr2; -static db_varfcn_t db_dr3; -static db_varfcn_t db_dr4; -static db_varfcn_t db_dr5; -static db_varfcn_t db_dr6; -static db_varfcn_t db_dr7; static db_varfcn_t db_frame; +static db_varfcn_t db_frame_seg; CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); @@ -69,12 +62,12 @@ CTASSERT(sizeof(struct dbreg) == sizeof( */ #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { - { "cs", DB_OFFSET(tf_cs), db_frame }, - { "ds", DB_OFFSET(tf_ds), db_frame }, - { "es", DB_OFFSET(tf_es), db_frame }, - { "fs", DB_OFFSET(tf_fs), db_frame }, - { "gs", DB_OFFSET(tf_gs), db_frame }, - { "ss", DB_OFFSET(tf_ss), db_frame }, + { "cs", DB_OFFSET(tf_cs), db_frame_seg }, + { "ds", DB_OFFSET(tf_ds), db_frame_seg }, + { "es", DB_OFFSET(tf_es), db_frame_seg }, + { "fs", DB_OFFSET(tf_fs), db_frame_seg }, + { "gs", DB_OFFSET(tf_gs), db_frame_seg }, + { "ss", DB_OFFSET(tf_ss), db_frame_seg }, { "rax", DB_OFFSET(tf_rax), db_frame }, { "rcx", DB_OFFSET(tf_rcx), db_frame }, { "rdx", DB_OFFSET(tf_rdx), db_frame }, @@ -93,40 +86,24 @@ struct db_variable db_regs[] = { { "r15", DB_OFFSET(tf_r15), db_frame }, { "rip", DB_OFFSET(tf_rip), db_frame }, { "rflags", DB_OFFSET(tf_rflags), db_frame }, -#define DB_N_SHOW_REGS 24 /* Don't show registers after here. */ - { "dr0", NULL, db_dr0 }, - { "dr1", NULL, db_dr1 }, - { "dr2", NULL, db_dr2 }, - { "dr3", NULL, db_dr3 }, - { "dr4", NULL, db_dr4 }, - { "dr5", NULL, db_dr5 }, - { "dr6", NULL, db_dr6 }, - { "dr7", NULL, db_dr7 }, }; -struct db_variable *db_eregs = db_regs + DB_N_SHOW_REGS; +struct db_variable *db_eregs = db_regs + nitems(db_regs); -#define DB_DRX_FUNC(reg) \ -static int \ -db_ ## reg (vp, valuep, op) \ - struct db_variable *vp; \ - db_expr_t * valuep; \ - int op; \ -{ \ - if (op == DB_VAR_GET) \ - *valuep = r ## reg (); \ - else \ - load_ ## reg (*valuep); \ - return (1); \ -} - -DB_DRX_FUNC(dr0) -DB_DRX_FUNC(dr1) -DB_DRX_FUNC(dr2) -DB_DRX_FUNC(dr3) -DB_DRX_FUNC(dr4) -DB_DRX_FUNC(dr5) -DB_DRX_FUNC(dr6) -DB_DRX_FUNC(dr7) +static int +db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) +{ + uint16_t *reg; + + if (kdb_frame == NULL) + return (0); + + reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + if (op == DB_VAR_GET) + *valuep = *reg; + else + *reg = *valuep; + return (1); +} static int db_frame(struct db_variable *vp, db_expr_t *valuep, int op) Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Jul 21 23:57:38 2015 (r285782) +++ head/sys/amd64/amd64/machdep.c Wed Jul 22 01:09:02 2015 (r285783) @@ -878,11 +878,26 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%016lx\n", rcr2()); db_printf("cr3\t0x%016lx\n", rcr3()); db_printf("cr4\t0x%016lx\n", rcr4()); - db_printf("EFER\t%016lx\n", rdmsr(MSR_EFER)); - db_printf("FEATURES_CTL\t%016lx\n", rdmsr(MSR_IA32_FEATURE_CONTROL)); - db_printf("DEBUG_CTL\t%016lx\n", rdmsr(MSR_DEBUGCTLMSR)); - db_printf("PAT\t%016lx\n", rdmsr(MSR_PAT)); - db_printf("GSBASE\t%016lx\n", rdmsr(MSR_GSBASE)); + if (rcr4() & CR4_XSAVE) + db_printf("xcr0\t0x%016lx\n", rxcr(0)); + db_printf("EFER\t0x%016lx\n", rdmsr(MSR_EFER)); + if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) + db_printf("FEATURES_CTL\t%016lx\n", + rdmsr(MSR_IA32_FEATURE_CONTROL)); + db_printf("DEBUG_CTL\t0x%016lx\n", rdmsr(MSR_DEBUGCTLMSR)); + db_printf("PAT\t0x%016lx\n", rdmsr(MSR_PAT)); + db_printf("GSBASE\t0x%016lx\n", rdmsr(MSR_GSBASE)); +} + +DB_SHOW_COMMAND(dbregs, db_show_dbregs) +{ + + db_printf("dr0\t0x%016lx\n", rdr0()); + db_printf("dr1\t0x%016lx\n", rdr1()); + db_printf("dr2\t0x%016lx\n", rdr2()); + db_printf("dr3\t0x%016lx\n", rdr3()); + db_printf("dr6\t0x%016lx\n", rdr6()); + db_printf("dr7\t0x%016lx\n", rdr7()); } #endif Modified: head/sys/ddb/db_print.c ============================================================================== --- head/sys/ddb/db_print.c Tue Jul 21 23:57:38 2015 (r285782) +++ head/sys/ddb/db_print.c Wed Jul 22 01:09:02 2015 (r285783) @@ -56,7 +56,8 @@ db_show_regs(db_expr_t _1, bool _2, db_e for (regp = db_regs; regp < db_eregs; regp++) { if (!db_read_variable(regp, &value)) continue; - db_printf("%-12s%#10lr", regp->name, (unsigned long)value); + db_printf("%-12s%#*lr", regp->name, + (int)(sizeof(unsigned long) * 2 + 2), (unsigned long)value); db_find_xtrn_sym_and_offset((db_addr_t)value, &name, &offset); if (name != NULL && offset <= (unsigned long)db_maxoff && offset != value) { Modified: head/sys/i386/i386/db_trace.c ============================================================================== --- head/sys/i386/i386/db_trace.c Tue Jul 21 23:57:38 2015 (r285782) +++ head/sys/i386/i386/db_trace.c Wed Jul 22 01:09:02 2015 (r285783) @@ -48,16 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include -static db_varfcn_t db_dr0; -static db_varfcn_t db_dr1; -static db_varfcn_t db_dr2; -static db_varfcn_t db_dr3; -static db_varfcn_t db_dr4; -static db_varfcn_t db_dr5; -static db_varfcn_t db_dr6; -static db_varfcn_t db_dr7; static db_varfcn_t db_esp; static db_varfcn_t db_frame; +static db_varfcn_t db_frame_seg; +static db_varfcn_t db_gs; static db_varfcn_t db_ss; /* @@ -65,10 +59,11 @@ static db_varfcn_t db_ss; */ #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { - { "cs", DB_OFFSET(tf_cs), db_frame }, - { "ds", DB_OFFSET(tf_ds), db_frame }, - { "es", DB_OFFSET(tf_es), db_frame }, - { "fs", DB_OFFSET(tf_fs), db_frame }, + { "cs", DB_OFFSET(tf_cs), db_frame_seg }, + { "ds", DB_OFFSET(tf_ds), db_frame_seg }, + { "es", DB_OFFSET(tf_es), db_frame_seg }, + { "fs", DB_OFFSET(tf_fs), db_frame_seg }, + { "gs", NULL, db_gs }, { "ss", NULL, db_ss }, { "eax", DB_OFFSET(tf_eax), db_frame }, { "ecx", DB_OFFSET(tf_ecx), db_frame }, @@ -80,40 +75,8 @@ struct db_variable db_regs[] = { { "edi", DB_OFFSET(tf_edi), db_frame }, { "eip", DB_OFFSET(tf_eip), db_frame }, { "efl", DB_OFFSET(tf_eflags), db_frame }, -#define DB_N_SHOW_REGS 15 /* Don't show registers after here. */ - { "dr0", NULL, db_dr0 }, - { "dr1", NULL, db_dr1 }, - { "dr2", NULL, db_dr2 }, - { "dr3", NULL, db_dr3 }, - { "dr4", NULL, db_dr4 }, - { "dr5", NULL, db_dr5 }, - { "dr6", NULL, db_dr6 }, - { "dr7", NULL, db_dr7 }, }; -struct db_variable *db_eregs = db_regs + DB_N_SHOW_REGS; - -#define DB_DRX_FUNC(reg) \ -static int \ -db_ ## reg (vp, valuep, op) \ - struct db_variable *vp; \ - db_expr_t * valuep; \ - int op; \ -{ \ - if (op == DB_VAR_GET) \ - *valuep = r ## reg (); \ - else \ - load_ ## reg (*valuep); \ - return (1); \ -} - -DB_DRX_FUNC(dr0) -DB_DRX_FUNC(dr1) -DB_DRX_FUNC(dr2) -DB_DRX_FUNC(dr3) -DB_DRX_FUNC(dr4) -DB_DRX_FUNC(dr5) -DB_DRX_FUNC(dr6) -DB_DRX_FUNC(dr7) +struct db_variable *db_eregs = db_regs + nitems(db_regs); static __inline int get_esp(struct trapframe *tf) @@ -139,6 +102,22 @@ db_frame(struct db_variable *vp, db_expr } static int +db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) +{ + uint16_t *reg; + + if (kdb_frame == NULL) + return (0); + + reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + if (op == DB_VAR_GET) + *valuep = *reg; + else + *reg = *valuep; + return (1); +} + +static int db_esp(struct db_variable *vp, db_expr_t *valuep, int op) { @@ -153,6 +132,17 @@ db_esp(struct db_variable *vp, db_expr_t } static int +db_gs(struct db_variable *vp, db_expr_t *valuep, int op) +{ + + if (op == DB_VAR_GET) + *valuep = rgs(); + else + load_gs(*valuep); + return (1); +} + +static int db_ss(struct db_variable *vp, db_expr_t *valuep, int op) { Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Jul 21 23:57:38 2015 (r285782) +++ head/sys/i386/i386/machdep.c Wed Jul 22 01:09:02 2015 (r285783) @@ -1582,6 +1582,29 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%08x\n", rcr2()); db_printf("cr3\t0x%08x\n", rcr3()); db_printf("cr4\t0x%08x\n", rcr4()); + if (rcr4() & CR4_XSAVE) + db_printf("xcr0\t0x%016llx\n", rxcr(0)); + if (amd_feature & (AMDID_NX | AMDID_LM)) + db_printf("EFER\t0x%016llx\n", rdmsr(MSR_EFER)); + if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) + db_printf("FEATURES_CTL\t0x%016llx\n", + rdmsr(MSR_IA32_FEATURE_CONTROL)); + if ((cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD) && CPUID_TO_FAMILY(cpu_id) >= 6) + db_printf("DEBUG_CTL\t0x%016llx\n", rdmsr(MSR_DEBUGCTLMSR)); + if (cpu_feature & CPUID_PAT) + db_printf("PAT\t0x%016llx\n", rdmsr(MSR_PAT)); +} + +DB_SHOW_COMMAND(dbregs, db_show_dbregs) +{ + + db_printf("dr0\t0x%08x\n", rdr0()); + db_printf("dr1\t0x%08x\n", rdr1()); + db_printf("dr2\t0x%08x\n", rdr2()); + db_printf("dr3\t0x%08x\n", rdr3()); + db_printf("dr6\t0x%08x\n", rdr6()); + db_printf("dr7\t0x%08x\n", rdr7()); } #endif From owner-svn-src-head@freebsd.org Wed Jul 22 04:18:34 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4F469A707D; Wed, 22 Jul 2015 04:18:34 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C44FC1D60; Wed, 22 Jul 2015 04:18:34 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6M4IYLp030084; Wed, 22 Jul 2015 04:18:34 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6M4IYjD030083; Wed, 22 Jul 2015 04:18:34 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201507220418.t6M4IYjD030083@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, 22 Jul 2015 04:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285784 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 04:18:34 -0000 Author: loos Date: Wed Jul 22 04:18:33 2015 New Revision: 285784 URL: https://svnweb.freebsd.org/changeset/base/285784 Log: Cosmetic change. When printing the child's mapped pins, use the plural only when necessary. Reported by: Daniel O'Connor , Sulev-Madis Silber (ketas) Modified: head/sys/dev/gpio/gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Wed Jul 22 01:09:02 2015 (r285783) +++ head/sys/dev/gpio/gpiobus.c Wed Jul 22 04:18:33 2015 (r285784) @@ -394,9 +394,14 @@ gpiobus_print_child(device_t dev, device devi = GPIOBUS_IVAR(child); memset(pins, 0, sizeof(pins)); retval += bus_print_child_header(dev, child); - retval += printf(" at pin(s) "); - gpiobus_print_pins(devi, pins, sizeof(pins)); - retval += printf("%s", pins); + if (devi->npins > 0) { + if (devi->npins > 1) + retval += printf(" at pins "); + else + retval += printf(" at pin "); + gpiobus_print_pins(devi, pins, sizeof(pins)); + retval += printf("%s", pins); + } resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); retval += bus_print_child_footer(dev, child); From owner-svn-src-head@freebsd.org Wed Jul 22 04:26:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A93C19A721C; Wed, 22 Jul 2015 04:26:05 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com [IPv6:2a00:1450:4010:c04::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29B4F1127; Wed, 22 Jul 2015 04:26:05 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: by lbbyj8 with SMTP id yj8so128785564lbb.0; Tue, 21 Jul 2015 21:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CR8sEmwLaFP3G574isfleMIaIzVckovYp/D4aunNLbc=; b=YFE4LQIAc6bpsgaqx7zjIgoSCBPgkGgD1agB1z93rR2M7UaZ5WPxI53haGS8RyQ0nv ktN5dBNbTQsyhrV+OSCBehHKIiesaUeRZSuLxeiOYQLSBOhfdzFjC94SmMmdtSsBZi+b f/GTXxQdGEOSOQJwPx5nbbGhC+FiBfvmmGy0X5iRmaYhX6Nkhlcl56If4AGLpFqKj5DC gg0R/ZLU3+0fw/f6UXCSe56q10uv+SWZUK4wg4IccEF9WUFyRHhMgRo+k+PFn48YUSoL v2XFRgPhD5+GvuoW2/OMHsqHM7gcv4LhNBaa0wb9rAwGLSQuc73r2/3mocSZsx1cbAuk 86Ug== MIME-Version: 1.0 X-Received: by 10.152.10.97 with SMTP id h1mr391777lab.45.1437539162932; Tue, 21 Jul 2015 21:26:02 -0700 (PDT) Received: by 10.152.112.170 with HTTP; Tue, 21 Jul 2015 21:26:02 -0700 (PDT) In-Reply-To: <201507212033.t6LKXbTj041660@repo.freebsd.org> References: <201507212033.t6LKXbTj041660@repo.freebsd.org> Date: Wed, 22 Jul 2015 01:26:02 -0300 Message-ID: Subject: Re: svn commit: r285766 - in head/sys: conf dev/vt dev/vt/logo From: Luiz Otavio O Souza To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 04:26:05 -0000 On Tue, Jul 21, 2015 at 5:33 PM, Conrad E. Meyer wrote: > Author: cem > Date: Tue Jul 21 20:33:36 2015 > New Revision: 285766 > URL: https://svnweb.freebsd.org/changeset/base/285766 > > Log: > vt: Draw logos per CPU core > > This feature is inspired by another Unix-alike OS commonly found on > airplane headrests. > > A number of beasties[0] are drawn at top of framebuffer during boot, > based on the number of active SMP CPUs[1]. Console buffer output > continues to scroll in the screen area below beastie(s)[2]. > > After some time[3] has passed, the beasties are erased leaving the > entire terminal for use. > > Includes two 80x80 vga16 beastie graphics and an 80x80 vga16 orb > graphic. (The graphics are RLE compressed to save some space -- 3x 3200 > bytes uncompressed, or 4208 compressed.) > > [0]: The user may select the style of beastie with > > kern.vt.splash_cpu_style=(0|1|2) > > [1]: Or the number may be overridden with tunable kern.vt.splash_ncpu. > [2]: https://www.youtube.com/watch?v=UP2jizfr3_o > [3]: Configurable with kern.vt.splash_cpu_duration (seconds, def. 10). > > Differential Revision: https://reviews.freebsd.org/D2181 > Reviewed by: dumbbell, emaste > Approved by: markj (mentor) > MFC after: 2 weeks > > Added: > head/sys/dev/vt/logo/logo_beastie.c (contents, props changed) > head/sys/dev/vt/vt_cpulogos.c (contents, props changed) > Modified: > head/sys/conf/files > head/sys/dev/vt/vt.h > head/sys/dev/vt/vt_core.c > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Tue Jul 21 20:30:06 2015 (r285765) > +++ head/sys/conf/files Tue Jul 21 20:33:36 2015 (r285766) > @@ -2726,9 +2726,11 @@ dev/vt/hw/efifb/efifb.c optional vt_efi > dev/vt/hw/fb/vt_fb.c optional vt > dev/vt/hw/vga/vt_vga.c optional vt vt_vga > dev/vt/logo/logo_freebsd.c optional vt splash > +dev/vt/logo/logo_beastie.c optional vt splash > dev/vt/vt_buf.c optional vt > dev/vt/vt_consolectl.c optional vt > dev/vt/vt_core.c optional vt > +dev/vt/vt_cpulogos.c optional vt splash > dev/vt/vt_font.c optional vt > dev/vt/vt_sysmouse.c optional vt > dev/vte/if_vte.c optional vte pci [...] Hi, This seems to break kernels without 'device splash'. One example is the Raspberry Pi kernel: MAKE=make sh /usr/src/sys/conf/newvers.sh RPI-B cc -c -O -pipe -mfloat-abi=softfp -g -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/libfdt -I/usr/src/sys/gnu/dts/include -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -mcpu=arm1176jzf-s -funwind-tables -ffreestanding -fwrapv -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -mfpu=none -std=iso9899:1999 -Werror vers.c linking kernel.debug vt_core.o: In function `vtterm_cnprobe': /usr/src/sys/dev/vt/vt_core.c:1363: undefined reference to `vt_logo_sprite_height' vt_core.o: In function `vt_termsize': /usr/src/sys/dev/vt/vt_core.c:568: undefined reference to `vt_logo_sprite_height' vt_core.o: In function `vt_winsize': /usr/src/sys/dev/vt/vt_core.c:603: undefined reference to `vt_logo_sprite_height' vt_core.o: In function `vt_compute_drawable_area': /usr/src/sys/dev/vt/vt_core.c:642: undefined reference to `vt_logo_sprite_height' vt_core.o: In function `vt_mouse_event': /usr/src/sys/dev/vt/vt_core.c:1955: undefined reference to `vt_logo_sprite_height' vt_core.o:/usr/src/sys/dev/vt/vt_core.c:2632: more undefined references to `vt_logo_sprite_height' follow vt_core.o: In function `vt_flush': /usr/src/sys/dev/vt/vt_core.c:1213: undefined reference to `vtterm_draw_cpu_logos' /usr/src/sys/dev/vt/vt_core.c:1222: undefined reference to `vt_logo_sprite_height' vt_core.o: In function `vt_scrollmode_kbdevent': /usr/src/sys/dev/vt/vt_core.c:766: undefined reference to `vt_logo_sprite_height' *** [kernel.debug] Error code 1 make[2]: stopped in /usr/obj/arm.armv6/usr/src/sys/RPI-B 1 error Luiz From owner-svn-src-head@freebsd.org Wed Jul 22 04:33:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 787859A7483; Wed, 22 Jul 2015 04:33:30 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E5F71880; Wed, 22 Jul 2015 04:33:30 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by wicgb10 with SMTP id gb10so80229138wic.1; Tue, 21 Jul 2015 21:33:28 -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-type:content-disposition:in-reply-to:user-agent; bh=7TkvldLazH70cyUIWhYxtCjKvOEgqF4TtLBxqR0BpU8=; b=r0P9G1Ft4f8kPuJo+HpjfBaBocKwlXAx2Y8ySTMGY9MnLbdPc9HlovDSpJMY0/US5W hMOA0mYlfXN+iKe+vhJtcx1UOUUIgyuALc1mwEqikvXLsrQvz5CU0BfrlYNjGMTsZSfk aW4dDvH0qRengcVl2zgpYtwCnDB3IeO2UM0NFRCIOZ1CuCbMRdPNScGYflE9gamoU6a+ nqwbapAPFfAGKuxQ2OL++WGlZqPcR4Y7BcvLqq+uUsOQsc4j9d7iN/raltwEkycV7y3O 7hW6nq1VubhPffgQQAUEMfdbSR8YCDiLCnWMW9XwIVkjyHnvXEJYQc6cUvTdyEqvx29Q 2yqA== X-Received: by 10.180.211.98 with SMTP id nb2mr32079096wic.91.1437539608603; Tue, 21 Jul 2015 21:33:28 -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 r8sm14690846wiz.5.2015.07.21.21.33.26 (version=TLS1_2 cipher=AES128-SHA256 bits=128/128); Tue, 21 Jul 2015 21:33:26 -0700 (PDT) Date: Wed, 22 Jul 2015 06:33:24 +0200 From: Mateusz Guzik To: John Baldwin Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r285125 - in head/sys: kern sys Message-ID: <20150722043323.GA23614@dft-labs.eu> References: <201507040654.t646sGO7044196@repo.freebsd.org> <20150721083922.GB6736@dft-labs.eu> <3863130.vz23U50G0A@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <3863130.vz23U50G0A@ralph.baldwin.cx> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 04:33:30 -0000 On Tue, Jul 21, 2015 at 11:50:12AM -0700, John Baldwin wrote: > On Tuesday, July 21, 2015 10:39:22 AM Mateusz Guzik wrote: > > Cc'ing jhb@ who made relevant changes to rmlocks > > > > On Mon, Jul 20, 2015 at 11:21:30PM -0700, Adrian Chadd wrote: > > > this happend whilst doing 'sysctl -vmstat 1' in one window, 'top' in > > > another window, and 'kldunload uhci' as root: > > > > > > Unread portion of the kernel message buffer: > > > uhci5: detached > > > panic: sleepq_add: td 0xc75d06a0 to sleep on wchan 0xc0b3e8e4 with > > > sleeping prohibited > > > > > [..] > > > > > #10 0xc06a882c in kassert_panic (fmt=) at > > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_shutdown.c:634 > > > #11 0xc06f449b in sleepq_add (wchan=0xc0b3e8e4, wmesg= > > out>, flags=, queue=) at > > > /usr/home/adrian/work/freebsd/head/src/sys/kern/subr_sleepqueue.c:308 > > > #12 0xc06b167b in _sx_xlock_hard (sx=0xc0b3e8e4, tid= > > out>, opts=, file=0x0, line=18) at > > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sx.c:697 > > > #13 0xc06b0841 in _sx_xlock (sx=0xc0b3e8e4, opts= > > out>, file=0xc09f2d35 > > > "/usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c", > > > line=411) at sx.h:154 > > > #14 0xc06a4510 in _rm_rlock (rm=0xc0b3e8cc, tracker=0xeaa61ad0, > > > trylock=) at > > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c:411 > > > #15 0xc06a4e2d in _rm_rlock_debug (rm=0xc0b3e8cc, tracker=0xeaa61ad0, > > > trylock=0) at /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c:665 > > > #16 0xc06b5da4 in sysctl_root_handler_locked (oid=0xc0a6ee20, > > > arg1=, arg2=, req= > > optimized out>, tracker=0xeaa61ad0) at > > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:170 > > > #17 0xc06b5531 in sysctl_root (arg1=, arg2= > > optimized out>) at > > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1692 > > > #18 0xc06b5ac2 in userland_sysctl (td=, > > > name=, namelen=2, old=, > > > oldlenp=, inkernel=, > > > new=, newlen=, retval=0x12, > > > flags=) at > > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1797 > > > #19 0xc06b5908 in sys___sysctl (uap=0xeaa61ca8) at > > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1724 > > > #20 0xc096aaee in syscall (frame=) at subr_syscall.c:133 > > > #21 0xc0955c5c in Xint0x80_syscall () at > > > /usr/home/adrian/work/freebsd/head/src/sys/i386/i386/exception.s:278 > > > > rmlock(9) states: > > Sleepable read-mostly locks are created by passing RM_SLEEPABLE to > > rm_init_flags(). Unlike normal read-mostly locks, sleepable read-mostly > > locks follow the same lock ordering rules as sx(9) locks. Sleepable > > read-mostly locks do not propagate priority to writers, but they do > > propagate priority to readers. Writers are permitted to sleep while > > holding a read-mostly lock, but readers are not. Unlike other sleepable > > locks such as sx(9) locks, readers must use try operations on other > > sleepable locks to avoid sleeping. > > > > May be that's my bad English, but I read that: > > rm_rlock(...); > > /* can't sleep here */ > > rm_runlock(...); > > That is correct. > > > Turns out it's the rm_rlock itself which must not sleep and you have to > > rm_try_rlock instead. > > Hmm, I think instead, the THREAD_NO_SLEEPING in rm_rlock() just needs to > be moved. Or rather, rm_rlock_hard() needs to do THREAD_SLEEPING_OK > around the sx_xlock and then THREAD_NO_SLEEPING afterwards. Something > like this: > > Index: kern/kern_rmlock.c > =================================================================== > --- kern/kern_rmlock.c (revision 284344) > +++ kern/kern_rmlock.c (working copy) > @@ -407,9 +407,11 @@ > return (0); > } > } else { > - if (rm->lock_object.lo_flags & LO_SLEEPABLE) > + if (rm->lock_object.lo_flags & LO_SLEEPABLE) { > + THREAD_SLEEPING_OK(); > sx_xlock(&rm->rm_lock_sx); > - else > + THREAD_NO_SLEEPING(); > + } else > mtx_lock(&rm->rm_lock_mtx); > } > Works for me, I was reluctant to do this myself, hence the "wrapper" approach. Thanks. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Wed Jul 22 05:05:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 594769A7977; Wed, 22 Jul 2015 05:05:02 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FCD614D0; Wed, 22 Jul 2015 05:05:02 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6M552YZ050319; Wed, 22 Jul 2015 05:05:02 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6M552aR050318; Wed, 22 Jul 2015 05:05:02 GMT (envelope-from whu@FreeBSD.org) Message-Id: <201507220505.t6M552aR050318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Wed, 22 Jul 2015 05:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285785 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 22 Jul 2015 05:05:02 -0000 Author: whu Date: Wed Jul 22 05:05:01 2015 New Revision: 285785 URL: https://svnweb.freebsd.org/changeset/base/285785 Log: Do not enable UDP checksum offloading when running on the Hyper-V on Windows Server 2012 and earlier hosts. Submitted by: whu Reviewed by: royger Approved by: royger MFC after: 3 days Relnotes: No Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D3086 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jul 22 04:18:33 2015 (r285784) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jul 22 05:05:01 2015 (r285785) @@ -343,7 +343,15 @@ netvsc_attach(device_t dev) IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO; ifp->if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO; - ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO; + /* + * Only enable UDP checksum offloading when it is on 2012R2 or + * later. UDP checksum offloading doesn't work on earlier + * Windows releases. + */ + if (hv_vmbus_protocal_version >= HV_VMBUS_VERSION_WIN8_1) + ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO; + else + ifp->if_hwassist = CSUM_TCP | CSUM_TSO; ret = hv_rf_on_device_add(device_ctx, &device_info); if (ret != 0) { @@ -1108,7 +1116,17 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP); } else { ifp->if_capenable |= IFCAP_TXCSUM; - ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); + /* + * Only enable UDP checksum offloading on + * Windows Server 2012R2 or later releases. + */ + if (hv_vmbus_protocal_version >= + HV_VMBUS_VERSION_WIN8_1) { + ifp->if_hwassist |= + (CSUM_TCP | CSUM_UDP); + } else { + ifp->if_hwassist |= CSUM_TCP; + } } } From owner-svn-src-head@freebsd.org Wed Jul 22 05:16:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 898739A7B36; Wed, 22 Jul 2015 05:16:02 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ie0-x22f.google.com (mail-ie0-x22f.google.com [IPv6:2607:f8b0:4001:c03::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5422C1A76; Wed, 22 Jul 2015 05:16:02 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by ietj16 with SMTP id j16so159189568iet.0; Tue, 21 Jul 2015 22:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ruWHtcDU9myjw7wz0kAWu/SCGblFgj/Vau+C2eyTt58=; b=eBaPedShBXeXk4EiO5gq8qmuyFVVNFeOtNHogJDyzVt9NhjBgIXNSWjFPIU4B0S9By kns1oSJTz4bZseckY8v3bmYuyNPE0Kxuc2a5xIVuywUBAtPPDOlIxa8IGGlERMh/0Tgq /lBe22XVVaYQ53/ReaXq0bKi8jsmnRkbb1k0kPq2HI6vQKb7LQESSoc+yDG4QzTe+X6G H9Arrsw3Mh4jPZ5OlOf4ErFqO8FR4ttMYS7cIeIQDMWGU++aJQC/ehoqyHfLXIhmFI0e WU8XbKY6p82udR5MOs2Llin6tnfolFbm/vfDITCobdlN3Cd7suVwDgWmPtQ7sWzsT55l CjMQ== MIME-Version: 1.0 X-Received: by 10.107.27.195 with SMTP id b186mr885818iob.140.1437542161819; Tue, 21 Jul 2015 22:16:01 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Tue, 21 Jul 2015 22:16:01 -0700 (PDT) In-Reply-To: <20150722043323.GA23614@dft-labs.eu> References: <201507040654.t646sGO7044196@repo.freebsd.org> <20150721083922.GB6736@dft-labs.eu> <3863130.vz23U50G0A@ralph.baldwin.cx> <20150722043323.GA23614@dft-labs.eu> Date: Tue, 21 Jul 2015 22:16:01 -0700 Message-ID: Subject: Re: svn commit: r285125 - in head/sys: kern sys From: Adrian Chadd To: Mateusz Guzik Cc: John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 05:16:02 -0000 Hi, Test it out and then give me a patch. I'll go sacrifice this laptop to the testing gods. Thanks! -a On 21 July 2015 at 21:33, Mateusz Guzik wrote: > On Tue, Jul 21, 2015 at 11:50:12AM -0700, John Baldwin wrote: >> On Tuesday, July 21, 2015 10:39:22 AM Mateusz Guzik wrote: >> > Cc'ing jhb@ who made relevant changes to rmlocks >> > >> > On Mon, Jul 20, 2015 at 11:21:30PM -0700, Adrian Chadd wrote: >> > > this happend whilst doing 'sysctl -vmstat 1' in one window, 'top' in >> > > another window, and 'kldunload uhci' as root: >> > > >> > > Unread portion of the kernel message buffer: >> > > uhci5: detached >> > > panic: sleepq_add: td 0xc75d06a0 to sleep on wchan 0xc0b3e8e4 with >> > > sleeping prohibited >> > > >> > [..] >> > >> > > #10 0xc06a882c in kassert_panic (fmt=) at >> > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_shutdown.c:634 >> > > #11 0xc06f449b in sleepq_add (wchan=0xc0b3e8e4, wmesg=> > > out>, flags=, queue=) at >> > > /usr/home/adrian/work/freebsd/head/src/sys/kern/subr_sleepqueue.c:308 >> > > #12 0xc06b167b in _sx_xlock_hard (sx=0xc0b3e8e4, tid=> > > out>, opts=, file=0x0, line=18) at >> > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sx.c:697 >> > > #13 0xc06b0841 in _sx_xlock (sx=0xc0b3e8e4, opts=> > > out>, file=0xc09f2d35 >> > > "/usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c", >> > > line=411) at sx.h:154 >> > > #14 0xc06a4510 in _rm_rlock (rm=0xc0b3e8cc, tracker=0xeaa61ad0, >> > > trylock=) at >> > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c:411 >> > > #15 0xc06a4e2d in _rm_rlock_debug (rm=0xc0b3e8cc, tracker=0xeaa61ad0, >> > > trylock=0) at /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_rmlock.c:665 >> > > #16 0xc06b5da4 in sysctl_root_handler_locked (oid=0xc0a6ee20, >> > > arg1=, arg2=, req=> > > optimized out>, tracker=0xeaa61ad0) at >> > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:170 >> > > #17 0xc06b5531 in sysctl_root (arg1=, arg2=> > > optimized out>) at >> > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1692 >> > > #18 0xc06b5ac2 in userland_sysctl (td=, >> > > name=, namelen=2, old=, >> > > oldlenp=, inkernel=, >> > > new=, newlen=, retval=0x12, >> > > flags=) at >> > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1797 >> > > #19 0xc06b5908 in sys___sysctl (uap=0xeaa61ca8) at >> > > /usr/home/adrian/work/freebsd/head/src/sys/kern/kern_sysctl.c:1724 >> > > #20 0xc096aaee in syscall (frame=) at subr_syscall.c:133 >> > > #21 0xc0955c5c in Xint0x80_syscall () at >> > > /usr/home/adrian/work/freebsd/head/src/sys/i386/i386/exception.s:278 >> > >> > rmlock(9) states: >> > Sleepable read-mostly locks are created by passing RM_SLEEPABLE to >> > rm_init_flags(). Unlike normal read-mostly locks, sleepable read-mostly >> > locks follow the same lock ordering rules as sx(9) locks. Sleepable >> > read-mostly locks do not propagate priority to writers, but they do >> > propagate priority to readers. Writers are permitted to sleep while >> > holding a read-mostly lock, but readers are not. Unlike other sleepable >> > locks such as sx(9) locks, readers must use try operations on other >> > sleepable locks to avoid sleeping. >> > >> > May be that's my bad English, but I read that: >> > rm_rlock(...); >> > /* can't sleep here */ >> > rm_runlock(...); >> >> That is correct. >> >> > Turns out it's the rm_rlock itself which must not sleep and you have to >> > rm_try_rlock instead. >> >> Hmm, I think instead, the THREAD_NO_SLEEPING in rm_rlock() just needs to >> be moved. Or rather, rm_rlock_hard() needs to do THREAD_SLEEPING_OK >> around the sx_xlock and then THREAD_NO_SLEEPING afterwards. Something >> like this: >> >> Index: kern/kern_rmlock.c >> =================================================================== >> --- kern/kern_rmlock.c (revision 284344) >> +++ kern/kern_rmlock.c (working copy) >> @@ -407,9 +407,11 @@ >> return (0); >> } >> } else { >> - if (rm->lock_object.lo_flags & LO_SLEEPABLE) >> + if (rm->lock_object.lo_flags & LO_SLEEPABLE) { >> + THREAD_SLEEPING_OK(); >> sx_xlock(&rm->rm_lock_sx); >> - else >> + THREAD_NO_SLEEPING(); >> + } else >> mtx_lock(&rm->rm_lock_mtx); >> } >> > > Works for me, I was reluctant to do this myself, hence the "wrapper" > approach. > > Thanks. > > -- > Mateusz Guzik From owner-svn-src-head@freebsd.org Wed Jul 22 07:32:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 649F69A8034; Wed, 22 Jul 2015 07:32:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30C801659; Wed, 22 Jul 2015 07:32:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6M7Wppt010341; Wed, 22 Jul 2015 07:32:51 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6M7WoLr010338; Wed, 22 Jul 2015 07:32:50 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201507220732.t6M7WoLr010338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 22 Jul 2015 07:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285786 - in head/sys/modules: . cloudabi cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 07:32:51 -0000 Author: ed Date: Wed Jul 22 07:32:49 2015 New Revision: 285786 URL: https://svnweb.freebsd.org/changeset/base/285786 Log: Add Makefiles for CloudABI kernel modules. Place all of the machine/pointer size independent code in a kernel module called 'cloudabi'. All of the 64-bit specific code goes in a separate module called 'cloudabi64'. The latter is only enabled on amd64, as it is the only architecture supported. Added: head/sys/modules/cloudabi/ head/sys/modules/cloudabi/Makefile (contents, props changed) head/sys/modules/cloudabi64/ head/sys/modules/cloudabi64/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Jul 22 05:05:01 2015 (r285785) +++ head/sys/modules/Makefile Wed Jul 22 07:32:49 2015 (r285786) @@ -72,6 +72,8 @@ SUBDIR= \ ${_ce} \ ${_cfi} \ ${_ciss} \ + cloudabi \ + ${_cloudabi64} \ ${_cm} \ ${_cmx} \ ${_coff} \ @@ -616,6 +618,7 @@ _x86bios= x86bios .endif .if ${MACHINE_CPUARCH} == "amd64" +_cloudabi64= cloudabi64 _ixl= ixl _ixlv= ixlv _linux64= linux64 Added: head/sys/modules/cloudabi/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/cloudabi/Makefile Wed Jul 22 07:32:49 2015 (r285786) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../compat/cloudabi + +KMOD= cloudabi +SRCS= cloudabi_clock.c cloudabi_errno.c cloudabi_fd.c cloudabi_file.c \ + cloudabi_futex.c cloudabi_mem.c cloudabi_proc.c cloudabi_random.c \ + cloudabi_sock.c cloudabi_thread.c vnode_if.h + +.include Added: head/sys/modules/cloudabi64/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/cloudabi64/Makefile Wed Jul 22 07:32:49 2015 (r285786) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../compat/cloudabi64 +.PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/cloudabi64 + +KMOD= cloudabi64 +SRCS= cloudabi64_fd.c cloudabi64_poll.c cloudabi64_sock.c \ + cloudabi64_syscalls.c cloudabi64_sysent.c cloudabi64_sysvec.c \ + cloudabi64_thread.c + +.include From owner-svn-src-head@freebsd.org Wed Jul 22 09:12:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 300D59A7B81; Wed, 22 Jul 2015 09:12:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1482911DD; Wed, 22 Jul 2015 09:12:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6M9Cfme050534; Wed, 22 Jul 2015 09:12:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6M9Cfg4050531; Wed, 22 Jul 2015 09:12:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507220912.t6M9Cfg4050531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 22 Jul 2015 09:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285787 - in head/sys/i386: i386 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 09:12:42 -0000 Author: kib Date: Wed Jul 22 09:12:40 2015 New Revision: 285787 URL: https://svnweb.freebsd.org/changeset/base/285787 Log: Remove duplicate and useless declarations. Submitted by: bde Modified: head/sys/i386/i386/mp_machdep.c head/sys/i386/include/smp.h Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Wed Jul 22 07:32:49 2015 (r285786) +++ head/sys/i386/i386/mp_machdep.c Wed Jul 22 09:12:40 2015 (r285787) @@ -144,7 +144,6 @@ volatile int smp_tlb_wait; static void install_ap_tramp(void); static int start_all_aps(void); static int start_ap(int apic_id); -static void release_aps(void *dummy); static u_int boot_address; Modified: head/sys/i386/include/smp.h ============================================================================== --- head/sys/i386/include/smp.h Wed Jul 22 07:32:49 2015 (r285786) +++ head/sys/i386/include/smp.h Wed Jul 22 09:12:40 2015 (r285787) @@ -39,7 +39,6 @@ extern int cpu_apic_ids[]; extern int bootAP; extern void *dpcpu; extern char *bootSTK; -extern int bootAP; extern void *bootstacks[]; extern volatile u_int cpu_ipi_pending[]; extern volatile int aps_ready; From owner-svn-src-head@freebsd.org Wed Jul 22 09:29:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AC449A7F87; Wed, 22 Jul 2015 09:29:52 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFF201A80; Wed, 22 Jul 2015 09:29:51 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6M9TpmU054852; Wed, 22 Jul 2015 09:29:51 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6M9TpLW054851; Wed, 22 Jul 2015 09:29:51 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201507220929.t6M9TpLW054851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 22 Jul 2015 09:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285788 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 09:29:52 -0000 Author: rrs Date: Wed Jul 22 09:29:50 2015 New Revision: 285788 URL: https://svnweb.freebsd.org/changeset/base/285788 Log: Fix inverted logic bug that David Wolfskill found (thanks David!) MFC after: 3 Weeks Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Wed Jul 22 09:12:40 2015 (r285787) +++ head/sys/netinet6/udp6_usrreq.c Wed Jul 22 09:29:50 2015 (r285788) @@ -403,7 +403,7 @@ udp6_input(struct mbuf **mp, int *offp, INP_RLOCK(last); INP_INFO_RUNLOCK(pcbinfo); UDP_PROBE(receive, NULL, last, ip6, last, uh); - if (udp6_append(last, m, off, &fromsa)) + if (udp6_append(last, m, off, &fromsa) == 0) INP_RUNLOCK(last); inp_lost: return (IPPROTO_DONE); From owner-svn-src-head@freebsd.org Wed Jul 22 09:46:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B6BE9A6331; Wed, 22 Jul 2015 09:46:24 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 175181173; Wed, 22 Jul 2015 09:46:24 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6M9kNKX062817; Wed, 22 Jul 2015 09:46:23 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6M9kN3c062812; Wed, 22 Jul 2015 09:46:23 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201507220946.t6M9kN3c062812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 22 Jul 2015 09:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285789 - 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.20 Precedence: list List-Id: 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, 22 Jul 2015 09:46:24 -0000 Author: zbb Date: Wed Jul 22 09:46:22 2015 New Revision: 285789 URL: https://svnweb.freebsd.org/changeset/base/285789 Log: Introduce support for MSI-X interrupts in AHCI - Allocate resources for MSI-X table and PBA if necessary - Add function ahci_free_mem() to free all resources Reviewed by: jhb, mav Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3009 Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed Jul 22 09:29:50 2015 (r285788) +++ head/sys/dev/ahci/ahci.c Wed Jul 22 09:46:22 2015 (r285789) @@ -181,12 +181,12 @@ ahci_attach(device_t dev) ctlr->sc_iomem.rm_type = RMAN_ARRAY; ctlr->sc_iomem.rm_descr = "I/O memory addresses"; if ((error = rman_init(&ctlr->sc_iomem)) != 0) { - bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); + ahci_free_mem(dev); return (error); } if ((error = rman_manage_region(&ctlr->sc_iomem, rman_get_start(ctlr->r_mem), rman_get_end(ctlr->r_mem))) != 0) { - bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); + ahci_free_mem(dev); rman_fini(&ctlr->sc_iomem); return (error); } @@ -250,8 +250,7 @@ ahci_attach(device_t dev) BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED, BUS_SPACE_MAXSIZE, 0, NULL, NULL, &ctlr->dma_tag)) { - bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, - ctlr->r_mem); + ahci_free_mem(dev); rman_fini(&ctlr->sc_iomem); return (ENXIO); } @@ -261,8 +260,7 @@ ahci_attach(device_t dev) /* Setup interrupts. */ if ((error = ahci_setup_interrupt(dev)) != 0) { bus_dma_tag_destroy(ctlr->dma_tag); - bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, - ctlr->r_mem); + ahci_free_mem(dev); rman_fini(&ctlr->sc_iomem); return (error); } @@ -367,9 +365,26 @@ ahci_detach(device_t dev) bus_dma_tag_destroy(ctlr->dma_tag); /* Free memory. */ rman_fini(&ctlr->sc_iomem); + ahci_free_mem(dev); + return (0); +} + +void +ahci_free_mem(device_t dev) +{ + struct ahci_controller *ctlr = device_get_softc(dev); + + /* Release memory resources */ if (ctlr->r_mem) bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); - return (0); + if (ctlr->r_msix_table) + bus_release_resource(dev, SYS_RES_MEMORY, + ctlr->r_msix_tab_rid, ctlr->r_msix_table); + if (ctlr->r_msix_pba) + bus_release_resource(dev, SYS_RES_MEMORY, + ctlr->r_msix_pba_rid, ctlr->r_msix_pba); + + ctlr->r_msix_pba = ctlr->r_mem = ctlr->r_msix_table = NULL; } int Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Wed Jul 22 09:29:50 2015 (r285788) +++ head/sys/dev/ahci/ahci.h Wed Jul 22 09:46:22 2015 (r285789) @@ -482,11 +482,15 @@ struct ahci_controller { device_t dev; bus_dma_tag_t dma_tag; int r_rid; + int r_msix_tab_rid; + int r_msix_pba_rid; uint16_t vendorid; /* Vendor ID from the bus */ uint16_t deviceid; /* Device ID from the bus */ uint16_t subvendorid; /* Subvendor ID from the bus */ uint16_t subdeviceid; /* Subdevice ID from the bus */ struct resource *r_mem; + struct resource *r_msix_table; + struct resource *r_msix_pba; struct rman sc_iomem; struct ahci_controller_irq { struct ahci_controller *ctlr; @@ -621,3 +625,4 @@ int ahci_child_location_str(device_t dev bus_dma_tag_t ahci_get_dma_tag(device_t dev, device_t child); int ahci_ctlr_reset(device_t dev); int ahci_ctlr_setup(device_t dev); +void ahci_free_mem(device_t dev); Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Wed Jul 22 09:29:50 2015 (r285788) +++ head/sys/dev/ahci/ahci_pci.c Wed Jul 22 09:46:22 2015 (r285789) @@ -374,12 +374,39 @@ ahci_ata_probe(device_t dev) } static int +ahci_pci_read_msix_bars(device_t dev, uint8_t *table_bar, uint8_t *pba_bar) +{ + int cap_offset = 0, ret; + uint32_t val; + + if ((table_bar == NULL) || (pba_bar == NULL)) + return (EINVAL); + + ret = pci_find_cap(dev, PCIY_MSIX, &cap_offset); + if (ret != 0) + return (EINVAL); + + val = pci_read_config(dev, cap_offset + PCIR_MSIX_TABLE, 4); + *table_bar = PCIR_BAR(val & PCIM_MSIX_BIR_MASK); + + val = pci_read_config(dev, cap_offset + PCIR_MSIX_PBA, 4); + *pba_bar = PCIR_BAR(val & PCIM_MSIX_BIR_MASK); + + return (0); +} + +static int ahci_pci_attach(device_t dev) { struct ahci_controller *ctlr = device_get_softc(dev); int error, i; uint32_t devid = pci_get_devid(dev); uint8_t revid = pci_get_revid(dev); + int msi_count, msix_count; + uint8_t table_bar = 0, pba_bar = 0; + + msi_count = pci_msi_count(dev); + msix_count = pci_msix_count(dev); i = 0; while (ahci_ids[i].id != 0 && @@ -406,10 +433,57 @@ ahci_pci_attach(device_t dev) if (!(ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &ctlr->r_rid, RF_ACTIVE))) return ENXIO; + + /* Read MSI-x BAR IDs if supported */ + if (msix_count > 0) { + error = ahci_pci_read_msix_bars(dev, &table_bar, &pba_bar); + if (error == 0) { + ctlr->r_msix_tab_rid = table_bar; + ctlr->r_msix_pba_rid = pba_bar; + } else { + /* Failed to read BARs, disable MSI-x */ + msix_count = 0; + } + } + + /* Allocate resources for MSI-x table and PBA */ + if (msix_count > 0) { + /* + * Allocate new MSI-x table only if not + * allocated before. + */ + ctlr->r_msix_table = NULL; + if (ctlr->r_msix_tab_rid != ctlr->r_rid) { + /* Separate BAR for MSI-x */ + ctlr->r_msix_table = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &ctlr->r_msix_tab_rid, RF_ACTIVE); + if (ctlr->r_msix_table == NULL) { + ahci_free_mem(dev); + return (ENXIO); + } + } + + /* + * Allocate new PBA table only if not + * allocated before. + */ + ctlr->r_msix_pba = NULL; + if ((ctlr->r_msix_pba_rid != ctlr->r_msix_tab_rid) && + (ctlr->r_msix_pba_rid != ctlr->r_rid)) { + /* Separate BAR for PBA */ + ctlr->r_msix_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &ctlr->r_msix_pba_rid, RF_ACTIVE); + if (ctlr->r_msix_pba == NULL) { + ahci_free_mem(dev); + return (ENXIO); + } + } + } + pci_enable_busmaster(dev); /* Reset controller */ if ((error = ahci_pci_ctlr_reset(dev)) != 0) { - bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); + ahci_free_mem(dev); return (error); }; @@ -426,24 +500,51 @@ ahci_pci_attach(device_t dev) resource_int_value(device_get_name(dev), device_get_unit(dev), "msi", &ctlr->msi); ctlr->numirqs = 1; + if (msi_count == 0 && msix_count == 0) + ctlr->msi = 0; if (ctlr->msi < 0) ctlr->msi = 0; - else if (ctlr->msi == 1) - ctlr->msi = min(1, pci_msi_count(dev)); - else if (ctlr->msi > 1) { + else if (ctlr->msi == 1) { + msi_count = min(1, msi_count); + msix_count = min(1, msix_count); + } else if (ctlr->msi > 1) ctlr->msi = 2; - ctlr->numirqs = pci_msi_count(dev); - } - /* Allocate MSI if needed/present. */ - if (ctlr->msi && pci_alloc_msi(dev, &ctlr->numirqs) != 0) { - ctlr->msi = 0; - ctlr->numirqs = 1; + + /* Allocate MSI/MSI-x if needed/present. */ + if (ctlr->msi > 0) { + error = ENXIO; + + /* Try to allocate MSI-x first */ + if (msix_count > 0) { + error = pci_alloc_msix(dev, &msix_count); + if (error == 0) + ctlr->numirqs = msix_count; + } + + /* + * Try to allocate MSI if msi_count is greater than 0 + * and if MSI-x allocation failed. + */ + if ((error != 0) && (msi_count > 0)) { + error = pci_alloc_msi(dev, &msi_count); + if (error == 0) + ctlr->numirqs = msi_count; + } + + /* Both MSI and MSI-x allocations failed */ + if (error != 0) { + ctlr->msi = 0; + device_printf(dev, "Failed to allocate MSI/MSI-x, " + "falling back to INTx\n"); + } } error = ahci_attach(dev); - if (error != 0) - if (ctlr->msi) + if (error != 0) { + if (ctlr->msi > 0) pci_release_msi(dev); + ahci_free_mem(dev); + } return error; } From owner-svn-src-head@freebsd.org Wed Jul 22 10:04:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A21969A68A2; Wed, 22 Jul 2015 10:04:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 927041DD8; Wed, 22 Jul 2015 10:04:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MA4tcd070874; Wed, 22 Jul 2015 10:04:55 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MA4sqv070871; Wed, 22 Jul 2015 10:04:54 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201507221004.t6MA4sqv070871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 22 Jul 2015 10:04:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285790 - in head/sys: compat/cloudabi64 contrib/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 10:04:55 -0000 Author: ed Date: Wed Jul 22 10:04:53 2015 New Revision: 285790 URL: https://svnweb.freebsd.org/changeset/base/285790 Log: Import upstream changes to the system call definitions. Support has been added for providing the scope of a futex operation, whether the futex is local to the process or shared between processes. Modified: head/sys/compat/cloudabi64/syscalls.master head/sys/contrib/cloudabi/syscalldefs_md.h head/sys/contrib/cloudabi/syscalldefs_mi.h Modified: head/sys/compat/cloudabi64/syscalls.master ============================================================================== --- head/sys/compat/cloudabi64/syscalls.master Wed Jul 22 09:46:22 2015 (r285789) +++ head/sys/compat/cloudabi64/syscalls.master Wed Jul 22 10:04:53 2015 (r285790) @@ -21,6 +21,7 @@ 2 AUE_NULL STD { void cloudabi_sys_condvar_signal( \ cloudabi_condvar_t *condvar, \ + cloudabi_futexscope_t scope, \ cloudabi_nthreads_t nwaiters); } 3 AUE_NULL STD { void cloudabi_sys_fd_close( \ @@ -130,7 +131,8 @@ cloudabi_ulflags_t flag); } 31 AUE_NULL STD { void cloudabi_sys_lock_unlock( \ - cloudabi_lock_t *lock); } + cloudabi_lock_t *lock, \ + cloudabi_futexscope_t scope); } 32 AUE_NULL STD { void cloudabi_sys_mem_advise( \ void *addr, size_t len, \ @@ -206,6 +208,7 @@ 53 AUE_NULL STD { cloudabi_tid_t cloudabi64_sys_thread_create( \ cloudabi64_threadattr_t *attr); } 54 AUE_NULL STD { void cloudabi_sys_thread_exit( \ - cloudabi_lock_t *lock); } + cloudabi_lock_t *lock, \ + cloudabi_futexscope_t scope); } 55 AUE_NULL STD { void cloudabi_sys_thread_tcb_set(void *tcb); } 56 AUE_NULL STD { void cloudabi_sys_thread_yield(); } Modified: head/sys/contrib/cloudabi/syscalldefs_md.h ============================================================================== --- head/sys/contrib/cloudabi/syscalldefs_md.h Wed Jul 22 09:46:22 2015 (r285789) +++ head/sys/contrib/cloudabi/syscalldefs_md.h Wed Jul 22 10:04:53 2015 (r285790) @@ -193,6 +193,8 @@ typedef struct { struct { MEMBER(PTR(_Atomic(cloudabi_condvar_t))) condvar; MEMBER(PTR(_Atomic(cloudabi_lock_t))) lock; + MEMBER(cloudabi_futexscope_t) condvar_scope; + MEMBER(cloudabi_futexscope_t) lock_scope; } condvar; // CLOUDABI_EVENTTYPE_FD_READ and CLOUDABI_EVENTTYPE_FD_WRITE: @@ -206,6 +208,7 @@ typedef struct { // and acquire a read or write lock. struct { MEMBER(PTR(_Atomic(cloudabi_lock_t))) lock; + MEMBER(cloudabi_futexscope_t) lock_scope; } lock; // CLOUDABI_EVENTTYPE_PROC_TERMINATE: Wait for a process to terminate. @@ -223,8 +226,11 @@ ASSERT_OFFSET(subscription_t, clock.time ASSERT_OFFSET(subscription_t, clock.precision, 40, 40); ASSERT_OFFSET(subscription_t, condvar.condvar, 16, 16); ASSERT_OFFSET(subscription_t, condvar.lock, 20, 24); +ASSERT_OFFSET(subscription_t, condvar.condvar_scope, 24, 32); +ASSERT_OFFSET(subscription_t, condvar.lock_scope, 25, 33); ASSERT_OFFSET(subscription_t, fd_readwrite.fd, 16, 16); ASSERT_OFFSET(subscription_t, lock.lock, 16, 16); +ASSERT_OFFSET(subscription_t, lock.lock_scope, 20, 24); ASSERT_OFFSET(subscription_t, proc_terminate.fd, 16, 16); ASSERT_SIZE(subscription_t, 48, 48); Modified: head/sys/contrib/cloudabi/syscalldefs_mi.h ============================================================================== --- head/sys/contrib/cloudabi/syscalldefs_mi.h Wed Jul 22 09:46:22 2015 (r285789) +++ head/sys/contrib/cloudabi/syscalldefs_mi.h Wed Jul 22 10:04:53 2015 (r285790) @@ -189,6 +189,10 @@ #define CLOUDABI_FILETYPE_SOCKET_STREAM 0x82 #define CLOUDABI_FILETYPE_SYMBOLIC_LINK 0x90 +// Futex object scopes. +#define CLOUDABI_FUTEXSCOPE_GLOBAL 1 +#define CLOUDABI_FUTEXSCOPE_PROCESS_LOCAL 2 + // Read-write lock related constants. #define CLOUDABI_LOCK_UNLOCKED 0 // Lock is unlocked. #define CLOUDABI_LOCK_WRLOCKED 0x40000000 // Lock is write locked. @@ -350,6 +354,7 @@ typedef int64_t cloudabi_filedelta_t; typedef uint64_t cloudabi_filesize_t; // ftruncate(), struct stat::st_size. typedef uint8_t cloudabi_filetype_t; // struct stat::st_mode. typedef uint16_t cloudabi_fsflags_t; // file_stat_put(). +typedef uint8_t cloudabi_futexscope_t; // Scope of lock or condition variable. typedef uint64_t cloudabi_inode_t; // struct stat::st_ino. typedef uint32_t cloudabi_linkcount_t; // struct stat::st_nlink. typedef uint32_t cloudabi_lock_t; // pthread_{mutex,rwlock}_*(). From owner-svn-src-head@freebsd.org Wed Jul 22 10:05:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F22B9A694F; Wed, 22 Jul 2015 10:05:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F95D1F77; Wed, 22 Jul 2015 10:05:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MA5nfT070972; Wed, 22 Jul 2015 10:05:49 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MA5lO1070967; Wed, 22 Jul 2015 10:05:47 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201507221005.t6MA5lO1070967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 22 Jul 2015 10:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285791 - head/sys/compat/cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 10:05:49 -0000 Author: ed Date: Wed Jul 22 10:05:46 2015 New Revision: 285791 URL: https://svnweb.freebsd.org/changeset/base/285791 Log: Regenerate system call table. Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_syscall.h head/sys/compat/cloudabi64/cloudabi64_syscalls.c head/sys/compat/cloudabi64/cloudabi64_sysent.c head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h Wed Jul 22 10:04:53 2015 (r285790) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h Wed Jul 22 10:05:46 2015 (r285791) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285540 2015-07-14 15:11:50Z ed + * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285790 2015-07-22 10:04:53Z ed */ #ifndef _CLOUDABI64_SYSPROTO_H_ @@ -43,6 +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_futexscope_t)]; cloudabi_futexscope_t scope; char scope_r_[PADR_(cloudabi_futexscope_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 { @@ -193,6 +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_futexscope_t)]; cloudabi_futexscope_t scope; char scope_r_[PADR_(cloudabi_futexscope_t)]; }; struct cloudabi_sys_mem_advise_args { char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; @@ -300,6 +302,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_futexscope_t)]; cloudabi_futexscope_t scope; char scope_r_[PADR_(cloudabi_futexscope_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 Wed Jul 22 10:04:53 2015 (r285790) +++ head/sys/compat/cloudabi64/cloudabi64_syscall.h Wed Jul 22 10:05:46 2015 (r285791) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285540 2015-07-14 15:11:50Z ed + * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285790 2015-07-22 10:04:53Z 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 Wed Jul 22 10:04:53 2015 (r285790) +++ head/sys/compat/cloudabi64/cloudabi64_syscalls.c Wed Jul 22 10:05:46 2015 (r285791) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285540 2015-07-14 15:11:50Z ed + * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285790 2015-07-22 10:04:53Z ed */ const char *cloudabi64_syscallnames[] = { Modified: head/sys/compat/cloudabi64/cloudabi64_sysent.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sysent.c Wed Jul 22 10:04:53 2015 (r285790) +++ head/sys/compat/cloudabi64/cloudabi64_sysent.c Wed Jul 22 10:05:46 2015 (r285791) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285540 2015-07-14 15:11:50Z ed + * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285790 2015-07-22 10:04:53Z ed */ #include Modified: head/sys/compat/cloudabi64/cloudabi64_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Wed Jul 22 10:04:53 2015 (r285790) +++ head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Wed Jul 22 10:05:46 2015 (r285791) @@ -30,8 +30,9 @@ 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->nwaiters; /* cloudabi_nthreads_t */ - *n_args = 2; + iarg[1] = p->scope; /* cloudabi_futexscope_t */ + iarg[2] = p->nwaiters; /* cloudabi_nthreads_t */ + *n_args = 3; break; } /* cloudabi_sys_fd_close */ @@ -296,7 +297,8 @@ 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 * */ - *n_args = 1; + iarg[1] = p->scope; /* cloudabi_futexscope_t */ + *n_args = 2; break; } /* cloudabi_sys_mem_advise */ @@ -493,7 +495,8 @@ 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 * */ - *n_args = 1; + iarg[1] = p->scope; /* cloudabi_futexscope_t */ + *n_args = 2; break; } /* cloudabi_sys_thread_tcb_set */ @@ -548,6 +551,9 @@ systrace_entry_setargdesc(int sysnum, in p = "cloudabi_condvar_t *"; break; case 1: + p = "cloudabi_futexscope_t"; + break; + case 2: p = "cloudabi_nthreads_t"; break; default: @@ -1026,6 +1032,9 @@ systrace_entry_setargdesc(int sysnum, in case 0: p = "cloudabi_lock_t *"; break; + case 1: + p = "cloudabi_futexscope_t"; + break; default: break; }; @@ -1363,6 +1372,9 @@ systrace_entry_setargdesc(int sysnum, in case 0: p = "cloudabi_lock_t *"; break; + case 1: + p = "cloudabi_futexscope_t"; + break; default: break; }; From owner-svn-src-head@freebsd.org Wed Jul 22 11:30:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BF609A7D6F; Wed, 22 Jul 2015 11:30:40 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82E121EEE; Wed, 22 Jul 2015 11:30:40 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MBUeUf007262; Wed, 22 Jul 2015 11:30:40 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MBUcI0007255; Wed, 22 Jul 2015 11:30:38 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201507221130.t6MBUcI0007255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 22 Jul 2015 11:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285792 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 11:30:40 -0000 Author: rrs Date: Wed Jul 22 11:30:37 2015 New Revision: 285792 URL: https://svnweb.freebsd.org/changeset/base/285792 Log: Fix several problems with Stream Reset. 1) We were not handling (or sending) the IN_PROGRESS case if the other side (or our side) was not able to reset (awaiting more data). 2) We would improperly send a stream-reset when we should not. Not waiting until the TSN had been assigned when data was inqueue. Reviewed by: tuexen Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Jul 22 10:05:46 2015 (r285791) +++ head/sys/netinet/sctp_indata.c Wed Jul 22 11:30:37 2015 (r285792) @@ -1886,6 +1886,7 @@ finish_express_del: sctp_reset_in_stream(stcb, liste->number_entries, liste->list_of_streams); TAILQ_REMOVE(&asoc->resetHead, liste, next_resp); + sctp_send_deferred_reset_response(stcb, liste, SCTP_STREAM_RESET_RESULT_PERFORMED); SCTP_FREE(liste, SCTP_M_STRESET); /* sa_ignore FREED_MEMORY */ liste = TAILQ_FIRST(&asoc->resetHead); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Jul 22 10:05:46 2015 (r285791) +++ head/sys/netinet/sctp_input.c Wed Jul 22 11:30:37 2015 (r285792) @@ -357,14 +357,17 @@ sctp_process_init(struct sctp_init_chunk sctp_free_a_strmoq(stcb, sp, SCTP_SO_NOT_LOCKED); /* sa_ignore FREED_MEMORY */ } + outs->state = SCTP_STREAM_CLOSED; } } /* cut back the count */ asoc->pre_open_streams = newcnt; } SCTP_TCB_SEND_UNLOCK(stcb); - asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams; - + asoc->streamoutcnt = asoc->pre_open_streams; + for (i = 0; i < asoc->streamoutcnt; i++) { + asoc->strmout[i].state = SCTP_STREAM_OPEN; + } /* EY - nr_sack: initialize highest tsn in nr_mapping_array */ asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) { @@ -3506,6 +3509,28 @@ sctp_reset_out_streams(struct sctp_tcb * sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_SEND, stcb, number_entries, (void *)list, SCTP_SO_NOT_LOCKED); } +static void +sctp_reset_clear_pending(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t * list) +{ + uint32_t i; + uint16_t temp; + + if (number_entries > 0) { + for (i = 0; i < number_entries; i++) { + temp = ntohs(list[i]); + if (temp >= stcb->asoc.streamoutcnt) { + /* no such stream */ + continue; + } + stcb->asoc.strmout[temp].state = SCTP_STREAM_OPEN; + } + } else { + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + stcb->asoc.strmout[i].state = SCTP_STREAM_OPEN; + } + } +} + struct sctp_stream_reset_request * sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq, struct sctp_tmit_chunk **bchk) @@ -3604,6 +3629,8 @@ sctp_handle_stream_reset_response(struct type = ntohs(req_param->ph.param_type); lparm_len = ntohs(req_param->ph.param_length); if (type == SCTP_STR_RESET_OUT_REQUEST) { + int no_clear = 0; + req_out_param = (struct sctp_stream_reset_out_request *)req_param; number_entries = (lparm_len - sizeof(struct sctp_stream_reset_out_request)) / sizeof(uint16_t); asoc->stream_reset_out_is_outstanding = 0; @@ -3614,9 +3641,20 @@ sctp_handle_stream_reset_response(struct sctp_reset_out_streams(stcb, number_entries, req_out_param->list_of_streams); } else if (action == SCTP_STREAM_RESET_RESULT_DENIED) { sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_DENIED_OUT, stcb, number_entries, req_out_param->list_of_streams, SCTP_SO_NOT_LOCKED); + } else if (action == SCTP_STREAM_RESET_RESULT_IN_PROGRESS) { + /* + * Set it up so we don't stop + * retransmitting + */ + stcb->asoc.str_reset_seq_out--; + asoc->stream_reset_out_is_outstanding = 1; + no_clear = 1; } else { sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_FAILED_OUT, stcb, number_entries, req_out_param->list_of_streams, SCTP_SO_NOT_LOCKED); } + if (no_clear == 0) { + sctp_reset_clear_pending(stcb, number_entries, req_out_param->list_of_streams); + } } else if (type == SCTP_STR_RESET_IN_REQUEST) { req_in_param = (struct sctp_stream_reset_in_request *)req_param; number_entries = (lparm_len - sizeof(struct sctp_stream_reset_in_request)) / sizeof(uint16_t); @@ -3643,7 +3681,12 @@ sctp_handle_stream_reset_response(struct asoc->stream_reset_outstanding--; if (action == SCTP_STREAM_RESET_RESULT_PERFORMED) { /* Put the new streams into effect */ - stcb->asoc.streamoutcnt += num_stream; + int i; + + for (i = asoc->streamoutcnt; i < (asoc->streamoutcnt + num_stream); i++) { + asoc->strmout[i].state = SCTP_STREAM_OPEN; + } + asoc->streamoutcnt += num_stream; sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, 0); } else if (action == SCTP_STREAM_RESET_RESULT_DENIED) { sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, @@ -3720,6 +3763,9 @@ sctp_handle_stream_reset_response(struct } } } + if (asoc->stream_reset_outstanding == 0) { + sctp_send_stream_reset_out_if_possible(stcb); + } return (0); } @@ -3750,22 +3796,33 @@ sctp_handle_str_reset_request_in(struct } else if (stcb->asoc.stream_reset_out_is_outstanding == 0) { len = ntohs(req->ph.param_length); number_entries = ((len - sizeof(struct sctp_stream_reset_in_request)) / sizeof(uint16_t)); - for (i = 0; i < number_entries; i++) { - temp = ntohs(req->list_of_streams[i]); - req->list_of_streams[i] = temp; + if (number_entries) { + for (i = 0; i < number_entries; i++) { + temp = ntohs(req->list_of_streams[i]); + if (temp >= stcb->asoc.streamoutcnt) { + asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; + goto bad_boy; + } + req->list_of_streams[i] = temp; + } + for (i = 0; i < number_entries; i++) { + if (stcb->asoc.strmout[req->list_of_streams[i]].state == SCTP_STREAM_OPEN) { + stcb->asoc.strmout[req->list_of_streams[i]].state = SCTP_STREAM_RESET_PENDING; + } + } + } else { + /* Its all */ + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (stcb->asoc.strmout[i].state == SCTP_STREAM_OPEN) + stcb->asoc.strmout[i].state = SCTP_STREAM_RESET_PENDING; + } } asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED; - sctp_add_stream_reset_out(chk, number_entries, req->list_of_streams, - asoc->str_reset_seq_out, - seq, (asoc->sending_seq - 1)); - asoc->stream_reset_out_is_outstanding = 1; - asoc->str_reset = chk; - sctp_timer_start(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb, chk->whoTo); - stcb->asoc.stream_reset_outstanding++; } else { /* Can't do it, since we have sent one out */ asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_ERR_IN_PROGRESS; } +bad_boy: sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); asoc->str_reset_seq_in++; } else if (asoc->str_reset_seq_in - 1 == seq) { @@ -3775,6 +3832,7 @@ sctp_handle_str_reset_request_in(struct } else { sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_RESULT_ERR_BAD_SEQNO); } + sctp_send_stream_reset_out_if_possible(stcb); } static int @@ -3893,11 +3951,12 @@ sctp_handle_str_reset_request_out(struct sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); return; } + liste->seq = seq; liste->tsn = tsn; liste->number_entries = number_entries; memcpy(&liste->list_of_streams, req->list_of_streams, number_entries * sizeof(uint16_t)); TAILQ_INSERT_TAIL(&asoc->resetHead, liste, next_resp); - asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED; + asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_IN_PROGRESS; } sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); asoc->str_reset_seq_in++; @@ -4034,7 +4093,7 @@ sctp_handle_str_reset_add_out_strm(struc mychk += num_stream; if (mychk < 0x10000) { stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED; - if (sctp_send_str_reset_req(stcb, 0, NULL, 0, 0, 0, 1, num_stream, 0, 1)) { + if (sctp_send_str_reset_req(stcb, 0, NULL, 0, 0, 1, num_stream, 0, 1)) { stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; } } else { Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Jul 22 10:05:46 2015 (r285791) +++ head/sys/netinet/sctp_output.c Wed Jul 22 11:30:37 2015 (r285792) @@ -7162,6 +7162,10 @@ one_more_time: } atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&strq->outqueue, sp, next); + if (strq->state == SCTP_STREAM_RESET_PENDING && + TAILQ_EMPTY(&strq->outqueue)) { + stcb->asoc.trigger_reset = 1; + } stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up); if (sp->net) { sctp_free_remote_addr(sp->net); @@ -7560,6 +7564,10 @@ dont_do_it: send_lock_up = 1; } TAILQ_REMOVE(&strq->outqueue, sp, next); + if (strq->state == SCTP_STREAM_RESET_PENDING && + TAILQ_EMPTY(&strq->outqueue)) { + stcb->asoc.trigger_reset = 1; + } stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up); if (sp->net) { sctp_free_remote_addr(sp->net); @@ -7787,7 +7795,7 @@ sctp_med_chunk_output(struct sctp_inpcb #endif SCTP_TCB_LOCK_ASSERT(stcb); hbflag = 0; - if ((control_only) || (asoc->stream_reset_outstanding)) + if (control_only) no_data_chunks = 1; else no_data_chunks = 0; @@ -9856,7 +9864,9 @@ sctp_chunk_output(struct sctp_inpcb *inp unsigned int tot_frs = 0; asoc = &stcb->asoc; +do_it_again: /* The Nagle algorithm is only applied when handling a send call. */ + stcb->asoc.trigger_reset = 0; if (from_where == SCTP_OUTPUT_FROM_USR_SEND) { if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NODELAY)) { nagle_on = 0; @@ -10092,6 +10102,12 @@ sctp_chunk_output(struct sctp_inpcb *inp */ if (stcb->asoc.ecn_echo_cnt_onq) sctp_fix_ecn_echo(asoc); + + if (stcb->asoc.trigger_reset) { + if (sctp_send_stream_reset_out_if_possible(stcb) == 0) { + goto do_it_again; + } + } return; } @@ -11494,30 +11510,58 @@ sctp_send_cwr(struct sctp_tcb *stcb, str asoc->ctrl_queue_cnt++; } -void -sctp_add_stream_reset_out(struct sctp_tmit_chunk *chk, - int number_entries, uint16_t * list, +static int +sctp_add_stream_reset_out(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk, uint32_t seq, uint32_t resp_seq, uint32_t last_sent) { uint16_t len, old_len, i; struct sctp_stream_reset_out_request *req_out; struct sctp_chunkhdr *ch; + int at; + int number_entries = 0; ch = mtod(chk->data, struct sctp_chunkhdr *); old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); - /* get to new offset for the param. */ req_out = (struct sctp_stream_reset_out_request *)((caddr_t)ch + len); /* now how long will this param be? */ + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if ((stcb->asoc.strmout[i].state == SCTP_STREAM_RESET_PENDING) && + (TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue))) { + number_entries++; + } + } + if (number_entries == 0) { + return (0); + } + if (number_entries == stcb->asoc.streamoutcnt) { + number_entries = 0; + } + 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)); req_out->ph.param_type = htons(SCTP_STR_RESET_OUT_REQUEST); req_out->ph.param_length = htons(len); req_out->request_seq = htonl(seq); req_out->response_seq = htonl(resp_seq); req_out->send_reset_at_tsn = htonl(last_sent); + at = 0; if (number_entries) { - for (i = 0; i < number_entries; i++) { - req_out->list_of_streams[i] = htons(list[i]); + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if ((stcb->asoc.strmout[i].state == SCTP_STREAM_RESET_PENDING) && + (TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue))) { + req_out->list_of_streams[at] = htons(i); + at++; + stcb->asoc.strmout[i].state = SCTP_STREAM_RESET_IN_FLIGHT; + if (at >= number_entries) { + break; + } + } + } + } else { + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + stcb->asoc.strmout[i].state = SCTP_STREAM_RESET_IN_FLIGHT; } } if (SCTP_SIZE32(len) > len) { @@ -11534,7 +11578,7 @@ sctp_add_stream_reset_out(struct sctp_tm chk->book_size_scale = 0; chk->send_size = SCTP_SIZE32(chk->book_size); SCTP_BUF_LEN(chk->data) = chk->send_size; - return; + return (1); } static void @@ -11636,6 +11680,68 @@ sctp_add_stream_reset_result(struct sctp } void +sctp_send_deferred_reset_response(struct sctp_tcb *stcb, + struct sctp_stream_reset_list *ent, + int response) +{ + struct sctp_association *asoc; + struct sctp_tmit_chunk *chk; + struct sctp_chunkhdr *ch; + + asoc = &stcb->asoc; + + /* + * Reset our last reset action to the new one IP -> response + * (PERFORMED probably). This assures that if we fail to send, a + * retran from the peer will get the new response. + */ + asoc->last_reset_action[0] = response; + if (asoc->stream_reset_outstanding) { + return; + } + sctp_alloc_a_chunk(stcb, chk); + if (chk == NULL) { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); + return; + } + chk->copy_by_ref = 0; + chk->rec.chunk_id.id = SCTP_STREAM_RESET; + chk->rec.chunk_id.can_take_data = 0; + chk->flags = 0; + chk->asoc = &stcb->asoc; + chk->book_size = sizeof(struct sctp_chunkhdr); + chk->send_size = SCTP_SIZE32(chk->book_size); + chk->book_size_scale = 0; + chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); + if (chk->data == NULL) { + sctp_free_a_chunk(stcb, chk, SCTP_SO_LOCKED); + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); + return; + } + SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); + sctp_add_stream_reset_result(chk, ent->seq, response); + /* setup chunk parameters */ + chk->sent = SCTP_DATAGRAM_UNSENT; + chk->snd_count = 0; + if (stcb->asoc.alternate) { + chk->whoTo = stcb->asoc.alternate; + } else { + chk->whoTo = stcb->asoc.primary_destination; + } + ch = mtod(chk->data, struct sctp_chunkhdr *); + ch->chunk_type = SCTP_STREAM_RESET; + ch->chunk_flags = 0; + ch->chunk_length = htons(chk->book_size); + atomic_add_int(&chk->whoTo->ref_count, 1); + SCTP_BUF_LEN(chk->data) = chk->send_size; + /* insert the chunk for sending */ + TAILQ_INSERT_TAIL(&asoc->control_send_queue, + chk, + sctp_next); + asoc->ctrl_queue_cnt++; +} + +void sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk, uint32_t resp_seq, uint32_t result, uint32_t send_una, uint32_t recv_next) @@ -11733,19 +11839,85 @@ sctp_add_an_in_stream(struct sctp_tmit_c } int +sctp_send_stream_reset_out_if_possible(struct sctp_tcb *stcb) +{ + struct sctp_association *asoc; + struct sctp_tmit_chunk *chk; + struct sctp_chunkhdr *ch; + uint32_t seq; + + asoc = &stcb->asoc; + if (asoc->stream_reset_outstanding) { + return (EALREADY); + } + sctp_alloc_a_chunk(stcb, chk); + if (chk == NULL) { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); + return (ENOMEM); + } + chk->copy_by_ref = 0; + chk->rec.chunk_id.id = SCTP_STREAM_RESET; + chk->rec.chunk_id.can_take_data = 0; + chk->flags = 0; + chk->asoc = &stcb->asoc; + chk->book_size = sizeof(struct sctp_chunkhdr); + chk->send_size = SCTP_SIZE32(chk->book_size); + chk->book_size_scale = 0; + chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); + if (chk->data == NULL) { + sctp_free_a_chunk(stcb, chk, SCTP_SO_LOCKED); + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); + return (ENOMEM); + } + SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); + + /* setup chunk parameters */ + chk->sent = SCTP_DATAGRAM_UNSENT; + chk->snd_count = 0; + if (stcb->asoc.alternate) { + chk->whoTo = stcb->asoc.alternate; + } else { + chk->whoTo = stcb->asoc.primary_destination; + } + ch = mtod(chk->data, struct sctp_chunkhdr *); + ch->chunk_type = SCTP_STREAM_RESET; + ch->chunk_flags = 0; + ch->chunk_length = htons(chk->book_size); + atomic_add_int(&chk->whoTo->ref_count, 1); + SCTP_BUF_LEN(chk->data) = chk->send_size; + seq = stcb->asoc.str_reset_seq_out; + if (sctp_add_stream_reset_out(stcb, chk, seq, (stcb->asoc.str_reset_seq_in - 1), (stcb->asoc.sending_seq - 1))) { + seq++; + asoc->stream_reset_outstanding++; + } else { + m_freem(chk->data); + chk->data = NULL; + sctp_free_a_chunk(stcb, chk, SCTP_SO_LOCKED); + return (ENOENT); + } + asoc->str_reset = chk; + /* insert the chunk for sending */ + TAILQ_INSERT_TAIL(&asoc->control_send_queue, + chk, + sctp_next); + asoc->ctrl_queue_cnt++; + sctp_timer_start(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb, chk->whoTo); + return (0); +} + +int sctp_send_str_reset_req(struct sctp_tcb *stcb, uint16_t number_entries, uint16_t * list, - uint8_t send_out_req, uint8_t send_in_req, uint8_t send_tsn_req, uint8_t add_stream, uint16_t adding_o, uint16_t adding_i, uint8_t peer_asked) { - struct sctp_association *asoc; struct sctp_tmit_chunk *chk; struct sctp_chunkhdr *ch; + int can_send_out_req = 0; uint32_t seq; asoc = &stcb->asoc; @@ -11756,16 +11928,18 @@ sctp_send_str_reset_req(struct sctp_tcb SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EBUSY); return (EBUSY); } - if ((send_out_req == 0) && (send_in_req == 0) && (send_tsn_req == 0) && + if ((send_in_req == 0) && (send_tsn_req == 0) && (add_stream == 0)) { /* nothing to do */ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); } - if (send_tsn_req && (send_out_req || send_in_req)) { + if (send_tsn_req && send_in_req) { /* error, can't do that */ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); + } else if (send_in_req) { + can_send_out_req = 1; } if (number_entries > (MCLBYTES - SCTP_MIN_OVERHEAD - @@ -11813,12 +11987,14 @@ sctp_send_str_reset_req(struct sctp_tcb SCTP_BUF_LEN(chk->data) = chk->send_size; seq = stcb->asoc.str_reset_seq_out; - if (send_out_req) { - sctp_add_stream_reset_out(chk, number_entries, list, - seq, (stcb->asoc.str_reset_seq_in - 1), (stcb->asoc.sending_seq - 1)); - asoc->stream_reset_out_is_outstanding = 1; - seq++; - asoc->stream_reset_outstanding++; + if (can_send_out_req) { + int ret; + + ret = sctp_add_stream_reset_out(stcb, chk, seq, (stcb->asoc.str_reset_seq_in - 1), (stcb->asoc.sending_seq - 1)); + if (ret) { + seq++; + asoc->stream_reset_outstanding++; + } } if ((add_stream & 1) && ((stcb->asoc.strm_realoutsize - stcb->asoc.streamoutcnt) < adding_o)) { @@ -11858,6 +12034,7 @@ sctp_send_str_reset_req(struct sctp_tcb stcb->asoc.strmout[i].next_sequence_send = oldstream[i].next_sequence_send; stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; stcb->asoc.strmout[i].stream_no = i; + stcb->asoc.strmout[i].state = oldstream[i].state; stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], &oldstream[i]); /* now anything on those queues? */ TAILQ_FOREACH_SAFE(sp, &oldstream[i].outqueue, next, nsp) { @@ -11890,6 +12067,7 @@ sctp_send_str_reset_req(struct sctp_tcb stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); + stcb->asoc.strmout[i].state = SCTP_STREAM_CLOSED; } stcb->asoc.strm_realoutsize = stcb->asoc.streamoutcnt + adding_o; SCTP_FREE(oldstream, SCTP_M_STRMO); @@ -12499,12 +12677,24 @@ sctp_lower_sosend(struct socket *so, SCTP_ASOC_CREATE_UNLOCK(inp); create_lock_applied = 0; } - if (asoc->stream_reset_outstanding) { + /* Is the stream no. valid? */ + if (srcv->sinfo_stream >= asoc->streamoutcnt) { + /* Invalid stream number */ + SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); + error = EINVAL; + goto out_unlocked; + } + if ((asoc->strmout[srcv->sinfo_stream].state != SCTP_STREAM_OPEN) && + (asoc->strmout[srcv->sinfo_stream].state != SCTP_STREAM_OPENING)) { /* * Can't queue any data while stream reset is underway. */ - SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EAGAIN); - error = EAGAIN; + if (asoc->strmout[srcv->sinfo_stream].state > SCTP_STREAM_OPEN) { + error = EAGAIN; + } else { + error = EINVAL; + } + SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, error); goto out_unlocked; } if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || @@ -12643,13 +12833,6 @@ sctp_lower_sosend(struct socket *so, SCTP_TCB_UNLOCK(stcb); hold_tcblock = 0; } - /* Is the stream no. valid? */ - if (srcv->sinfo_stream >= asoc->streamoutcnt) { - /* Invalid stream number */ - SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); - error = EINVAL; - goto out_unlocked; - } if (asoc->strmout == NULL) { /* huh? software error */ SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EFAULT); @@ -12945,7 +13128,7 @@ skip_preblock: /*- * Ok, Nagle is set on and we have data outstanding. * Don't send anything and let SACKs drive out the - * data unless wen have a "full" segment to send. + * data unless we have a "full" segment to send. */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_NAGLE_LOGGING_ENABLE) { sctp_log_nagle_event(stcb, SCTP_NAGLE_APPLIED); Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Wed Jul 22 10:05:46 2015 (r285791) +++ head/sys/netinet/sctp_output.h Wed Jul 22 11:30:37 2015 (r285792) @@ -170,18 +170,21 @@ void sctp_send_cwr(struct sctp_tcb *, st void -sctp_add_stream_reset_out(struct sctp_tmit_chunk *, - int, uint16_t *, uint32_t, uint32_t, uint32_t); + sctp_add_stream_reset_result(struct sctp_tmit_chunk *, uint32_t, uint32_t); void - sctp_add_stream_reset_result(struct sctp_tmit_chunk *, uint32_t, uint32_t); +sctp_send_deferred_reset_response(struct sctp_tcb *, + struct sctp_stream_reset_list *, + int); void sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *, uint32_t, uint32_t, uint32_t, uint32_t); +int + sctp_send_stream_reset_out_if_possible(struct sctp_tcb *); int -sctp_send_str_reset_req(struct sctp_tcb *, uint16_t, uint16_t *, uint8_t, +sctp_send_str_reset_req(struct sctp_tcb *, uint16_t, uint16_t *, uint8_t, uint8_t, uint8_t, uint16_t, uint16_t, uint8_t); void Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Wed Jul 22 10:05:46 2015 (r285791) +++ head/sys/netinet/sctp_structs.h Wed Jul 22 11:30:37 2015 (r285792) @@ -76,6 +76,7 @@ TAILQ_HEAD(sctpnetlisthead, sctp_nets); struct sctp_stream_reset_list { TAILQ_ENTRY(sctp_stream_reset_list) next_resp; + uint32_t seq; uint32_t tsn; uint32_t number_entries; uint16_t list_of_streams[]; @@ -580,11 +581,20 @@ union scheduling_parameters { struct ss_fb fb; }; +/* States for outgoing streams */ +#define SCTP_STREAM_CLOSED 0x00 +#define SCTP_STREAM_OPENING 0x01 +#define SCTP_STREAM_OPEN 0x02 +#define SCTP_STREAM_RESET_PENDING 0x03 +#define SCTP_STREAM_RESET_IN_FLIGHT 0x04 + +#define SCTP_MAX_STREAMS_AT_ONCE_RESET 200 + /* This struct is used to track the traffic on outbound streams */ struct sctp_stream_out { struct sctp_streamhead outqueue; union scheduling_parameters ss_params; - uint32_t chunks_on_queues; + uint32_t chunks_on_queues; /* send queue and sent queue */ #if defined(SCTP_DETAILED_STR_STATS) uint32_t abandoned_unsent[SCTP_PR_SCTP_MAX + 1]; uint32_t abandoned_sent[SCTP_PR_SCTP_MAX + 1]; @@ -596,6 +606,7 @@ struct sctp_stream_out { uint16_t stream_no; uint16_t next_sequence_send; /* next one I expect to send out */ uint8_t last_msg_incomplete; + uint8_t state; }; /* used to keep track of the addresses yet to try to add/delete */ @@ -1148,7 +1159,7 @@ struct sctp_association { uint8_t hb_random_idx; uint8_t default_dscp; uint8_t asconf_del_pending; /* asconf delete last addr pending */ - + uint8_t trigger_reset; /* * This value, plus all other ack'd but above cum-ack is added * together to cross check against the bit that we have yet to Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Jul 22 10:05:46 2015 (r285791) +++ head/sys/netinet/sctp_usrreq.c Wed Jul 22 11:30:37 2015 (r285792) @@ -4620,18 +4620,24 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_UNLOCK(stcb); break; } - if (stcb->asoc.stream_reset_outstanding) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY); - error = EALREADY; - SCTP_TCB_UNLOCK(stcb); - break; - } if (strrst->srs_flags & SCTP_STREAM_RESET_INCOMING) { send_in = 1; + if (stcb->asoc.stream_reset_outstanding) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY); + error = EALREADY; + SCTP_TCB_UNLOCK(stcb); + break; + } } if (strrst->srs_flags & SCTP_STREAM_RESET_OUTGOING) { send_out = 1; } + if ((strrst->srs_number_streams > SCTP_MAX_STREAMS_AT_ONCE_RESET) && send_in) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM); + error = ENOMEM; + SCTP_TCB_UNLOCK(stcb); + break; + } if ((send_in == 0) && (send_out == 0)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; @@ -4656,11 +4662,38 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_UNLOCK(stcb); break; } - error = sctp_send_str_reset_req(stcb, strrst->srs_number_streams, - strrst->srs_stream_list, - send_out, send_in, 0, 0, 0, 0, 0); + if (send_out) { + int cnt; + uint16_t strm; + + if (strrst->srs_number_streams) { + for (i = 0, cnt = 0; i < strrst->srs_number_streams; i++) { + strm = strrst->srs_stream_list[i]; + if (stcb->asoc.strmout[strm].state == SCTP_STREAM_OPEN) { + stcb->asoc.strmout[strm].state = SCTP_STREAM_RESET_PENDING; + cnt++; + } + } + } else { + /* Its all */ + for (i = 0, cnt = 0; i < stcb->asoc.streamoutcnt; i++) { + if (stcb->asoc.strmout[i].state == SCTP_STREAM_OPEN) { + stcb->asoc.strmout[i].state = SCTP_STREAM_RESET_PENDING; + cnt++; + } + } + } + } + if (send_in) { + error = sctp_send_str_reset_req(stcb, strrst->srs_number_streams, + strrst->srs_stream_list, + send_in, 0, 0, 0, 0, 0); + } else + error = sctp_send_stream_reset_out_if_possible(stcb); + + if (!error) + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED); - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED); SCTP_TCB_UNLOCK(stcb); break; } @@ -4730,7 +4763,7 @@ sctp_setopt(struct socket *so, int optna goto skip_stuff; } } - error = sctp_send_str_reset_req(stcb, 0, NULL, 0, 0, 0, addstream, add_o_strmcnt, add_i_strmcnt, 0); + error = sctp_send_str_reset_req(stcb, 0, NULL, 0, 0, addstream, add_o_strmcnt, add_i_strmcnt, 0); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED); skip_stuff: SCTP_TCB_UNLOCK(stcb); @@ -4738,6 +4771,7 @@ sctp_setopt(struct socket *so, int optna } case SCTP_RESET_ASSOC: { + int i; uint32_t *value; SCTP_CHECK_AND_CAST(value, optval, uint32_t, optsize); @@ -4762,7 +4796,25 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_UNLOCK(stcb); break; } - error = sctp_send_str_reset_req(stcb, 0, NULL, 0, 0, 1, 0, 0, 0, 0); + /* + * Is there any data pending in the send or sent + * queues? + */ + if (!TAILQ_EMPTY(&stcb->asoc.send_queue) || + !TAILQ_EMPTY(&stcb->asoc.sent_queue)) { + busy_out: + error = EBUSY; + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + SCTP_TCB_UNLOCK(stcb); + break; + } + /* Do any streams have data queued? */ + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + goto busy_out; + } + } + error = sctp_send_str_reset_req(stcb, 0, NULL, 0, 1, 0, 0, 0, 0); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED); SCTP_TCB_UNLOCK(stcb); break; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Jul 22 10:05:46 2015 (r285791) +++ head/sys/netinet/sctputil.c Wed Jul 22 11:30:37 2015 (r285792) @@ -1089,6 +1089,7 @@ sctp_init_asoc(struct sctp_inpcb *inp, s #endif asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; + asoc->strmout[i].state = SCTP_STREAM_OPENING; asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i], NULL); } asoc->ss_functions.sctp_ss_init(stcb, asoc, 0); @@ -6855,7 +6856,7 @@ sctp_log_trace(uint32_t subsys, const ch #endif static void -sctp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *ignored, +sctp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *inp, const struct sockaddr *sa SCTP_UNUSED, void *ctx SCTP_UNUSED) { struct ip *iph; From owner-svn-src-head@freebsd.org Wed Jul 22 14:10:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDE2E9A781F; Wed, 22 Jul 2015 14:10:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A3191F77; Wed, 22 Jul 2015 14:10:16 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by oigd21 with SMTP id d21so102016723oig.1; Wed, 22 Jul 2015 07:10:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=/O2EHQqC4TfPl0987VIKCbzxD373dzjPkjhHRjB6lYI=; b=NmAkWwpaK/VvnHpUciaBPSfEuXSk/XCIRQqAhcfX90EQSs6rUSktuRGZNFxhmQ0ega 8j4wUxOeBc9+NB290wcIzyn2WDVqAB+F1vcrMmduJWZk6QBedE8puAEDjEKLuWX0zBmn WNmcZmCslemoR0tAzZWuHlv05efHP5GhIGKhRWZ3xtM4d7Qiuw74urjmNGh9NeCtci11 JxaqFavBoc49tq43gfTv46og9fn5/23AJ7PifaMl0uD5f0j2KnXwnco+kzP7S/kqJmnS yUtKuUikR7yPc2082BX41G9hJSrNtWJYy5W32ulxz8ysapWwyyVLuJlZjMllmKaAgvyh GmrA== X-Received: by 10.182.133.3 with SMTP id oy3mr2856011obb.86.1437574210663; Wed, 22 Jul 2015 07:10:10 -0700 (PDT) Received: from mail-ob0-f174.google.com (mail-ob0-f174.google.com. [209.85.214.174]) by smtp.gmail.com with ESMTPSA id p184sm828580oig.10.2015.07.22.07.10.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 07:10:10 -0700 (PDT) Received: by obnw1 with SMTP id w1so134605388obn.3; Wed, 22 Jul 2015 07:10:10 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.175.82 with SMTP id y79mr2684342oie.22.1437574209996; Wed, 22 Jul 2015 07:10:09 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.76.58.17 with HTTP; Wed, 22 Jul 2015 07:10:09 -0700 (PDT) In-Reply-To: References: <201507212033.t6LKXbTj041660@repo.freebsd.org> Date: Wed, 22 Jul 2015 07:10:09 -0700 Message-ID: Subject: Re: svn commit: r285766 - in head/sys: conf dev/vt dev/vt/logo From: Conrad Meyer To: Luiz Otavio O Souza Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 14:10:17 -0000 On Tue, Jul 21, 2015 at 9:26 PM, Luiz Otavio O Souza wrote: > This seems to break kernels without 'device splash'. > > ... > linking kernel.debug > vt_core.o: In function `vtterm_cnprobe': > /usr/src/sys/dev/vt/vt_core.c:1363: undefined reference to > `vt_logo_sprite_height' > vt_core.o: In function `vt_termsize': > /usr/src/sys/dev/vt/vt_core.c:568: undefined reference to > `vt_logo_sprite_height' > vt_core.o: In function `vt_winsize': > /usr/src/sys/dev/vt/vt_core.c:603: undefined reference to > `vt_logo_sprite_height' > vt_core.o: In function `vt_compute_drawable_area': > /usr/src/sys/dev/vt/vt_core.c:642: undefined reference to > `vt_logo_sprite_height' > vt_core.o: In function `vt_mouse_event': > /usr/src/sys/dev/vt/vt_core.c:1955: undefined reference to > `vt_logo_sprite_height' > vt_core.o:/usr/src/sys/dev/vt/vt_core.c:2632: more undefined > references to `vt_logo_sprite_height' follow > vt_core.o: In function `vt_flush': > /usr/src/sys/dev/vt/vt_core.c:1213: undefined reference to > `vtterm_draw_cpu_logos' > /usr/src/sys/dev/vt/vt_core.c:1222: undefined reference to > `vt_logo_sprite_height' > vt_core.o: In function `vt_scrollmode_kbdevent': > /usr/src/sys/dev/vt/vt_core.c:766: undefined reference to > `vt_logo_sprite_height' > *** [kernel.debug] Error code 1 Hi Luiz, This is addressed in https://reviews.freebsd.org/D3151 . Thanks, Conrad From owner-svn-src-head@freebsd.org Wed Jul 22 14:16:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CA019A795D for ; Wed, 22 Jul 2015 14:16:09 +0000 (UTC) (envelope-from cplfloyd@iwispr.net) Received: from mail.iwispr.net (mail.iwispr.net [38.110.43.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2010143F for ; Wed, 22 Jul 2015 14:16:08 +0000 (UTC) (envelope-from cplfloyd@iwispr.net) Received: from localhost (mailserver.local [127.0.0.1]) by mail.iwispr.net (Postfix) with ESMTP id E243F300267B for ; Wed, 22 Jul 2015 10:10:53 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iwispr.net; h= content-description:content-type:content-type:x-mailer :mime-version:date:date:subject:subject:to:from:from; s=dkim; t= 1437574251; x=1438438251; bh=s9XbYVX3Ifq35jpC9lhRDfw6AzPtEx8t7Sv WmLwG4pQ=; b=X0YAsuQKySbPd7HdG5EyFCslS3wHVUcmcvEA2xWoLsO9ivQ/ypA HLSHFvfPjwj0Amh8rNs9WfzQ/0H/ucmwWKcW6Rnyd5oOmKK+wVb4SMQEwSXsrAjM 60IMSEGGxWnwxry4sg5HXDc4FkSse/moZVMJgMvzO4xo3RtZCpDRJXOI= X-Virus-Scanned: Debian amavisd-new at mail.iwispr.net Received: from mail.iwispr.net ([127.0.0.1]) by localhost (mail.iwispr.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6NHePpr05ecY for ; Wed, 22 Jul 2015 10:10:51 -0400 (EDT) Received: from 3V1-092-BHMD1R1 (unknown [64.123.184.2]) by mail.iwispr.net (Postfix) with ESMTPA id CA3E330026C9 for ; Wed, 22 Jul 2015 09:32:56 -0400 (EDT) From: cplfloyd@iwispr.net To: svn-src-head@freebsd.org Subject: =?UTF-8?Q?Cancelled._Quick_transfer_B9S847SPHS7A0?= Date: Wed, 22 Jul 2015 08:32:55 -0500 MIME-Version: 1.0 X-mailer: Thunderbird 6.5.0 Message-Id: <20150722141053.E243F300267B@mail.iwispr.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Description: Message text X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 14:16:09 -0000 Status message for svn-src-head@freebsd.org Date: 7:10 21-07-2015 Quick payment: B9S847SPHS7A0 State: Cancelled Please review the word document attached with this email to get more details about this transfer. From owner-svn-src-head@freebsd.org Wed Jul 22 14:52:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40CDF9A8038 for ; Wed, 22 Jul 2015 14:52:41 +0000 (UTC) (envelope-from romanc0y__lecfarm_com__gb@sandu.beget.ru) Received: from m2.sandu.beget.ru (m2.sandu.beget.ru [5.101.153.32]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 049451471 for ; Wed, 22 Jul 2015 14:52:40 +0000 (UTC) (envelope-from romanc0y__lecfarm_com__gb@sandu.beget.ru) Received: from romanc0y (Authenticated sender romanc0y@sandu.beget.ru) by sandu.beget.ru with local (Exim 4.76) (envelope-from ) id 1ZHvNn-00010a-5p for svn-src-head@freebsd.org; Wed, 22 Jul 2015 17:52:31 +0300 To: svn-src-head@freebsd.org Subject: Notice of appearance in Court #00257187 Date: Wed, 22 Jul 2015 17:52:31 +0300 From: "County Court" Reply-To: "County Court" Message-ID: X-Priority: 3 MIME-Version: 1.0 Precedence: bulk Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 List-Id: 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, 22 Jul 2015 14:52:41 -0000 Notice to Appear, This is to inform you to appear in the Court on the July 26 for your case hearing. Please, do not forget to bring all the documents related to the case. Note: The case will be heard by the judge in your absence if you do not come. The copy of Court Notice is attached to this email. Yours faithfully, Edward Rossi, Court Secretary. From owner-svn-src-head@freebsd.org Wed Jul 22 15:30:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18A4D9A87A5; Wed, 22 Jul 2015 15:30:11 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 098F01974; Wed, 22 Jul 2015 15:30:11 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MFUAWR001776; Wed, 22 Jul 2015 15:30:10 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MFUA5l001775; Wed, 22 Jul 2015 15:30:10 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201507221530.t6MFUA5l001775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 22 Jul 2015 15:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285794 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 15:30:11 -0000 Author: cem Date: Wed Jul 22 15:30:10 2015 New Revision: 285794 URL: https://svnweb.freebsd.org/changeset/base/285794 Log: vt: Unbreak build on no-splash configurations PR: 201751 Differential Revision: https://reviews.freebsd.org/D3151 Tested by: Andrey Fesenko Approved by: markj (mentor) MFC after: 1 week Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed Jul 22 15:05:45 2015 (r285793) +++ head/sys/dev/vt/vt_core.c Wed Jul 22 15:30:10 2015 (r285794) @@ -154,6 +154,10 @@ extern unsigned int vt_logo_width; extern unsigned int vt_logo_height; extern unsigned int vt_logo_depth; extern unsigned char vt_logo_image[]; +#ifndef DEV_SPLASH +#define vtterm_draw_cpu_logos(...) +const unsigned int vt_logo_sprite_height; +#endif /* Font. */ extern struct vt_font vt_font_default; From owner-svn-src-head@freebsd.org Wed Jul 22 15:31:56 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D889A88E8; Wed, 22 Jul 2015 15:31:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f49.google.com (mail-oi0-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7D1D1D01; Wed, 22 Jul 2015 15:31:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by oige126 with SMTP id e126so146106888oig.0; Wed, 22 Jul 2015 08:31:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=Uz3DfMUaE4E0jXT7IRWPxvY1dLhI/8lUCv25zkFkZi0=; b=UhxBVBHhrPy29J70HPDjBF3JtADT/JmEBw4nh4oTTXsTg8cuCr1TuKSqoMFeuIhY9G 1I6uGu//HixLMNlhwKOWNphAEOvly4BUXZlTPfLgjZRjmzy7IkhLjskmPYyAR7hQdrHQ lrc5zDE/kNfPmcT0teA37HjQ4wA4CcqL3g5U4pBOsJSaDHbVWciCfpilYVguefapswZW 3uPcAn3w2tm630hDfzyPJQTreTPp+j4K4tnpWNIy4SXymbnpAMyl+ZmfPBPJLn53U8FN ODkiHHOykpzcm/b6L6IWNzEFLWcWfok2xsRVe3nONZ1LozrpLYSuuzOEesS1iZrKGPRT Ol5g== X-Received: by 10.60.62.235 with SMTP id b11mr3412174oes.18.1437579109675; Wed, 22 Jul 2015 08:31:49 -0700 (PDT) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com. [209.85.218.42]) by smtp.gmail.com with ESMTPSA id r3sm942482oia.22.2015.07.22.08.31.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 08:31:49 -0700 (PDT) Received: by oige126 with SMTP id e126so146106710oig.0; Wed, 22 Jul 2015 08:31:49 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.178.241 with SMTP id db17mr3368241oec.36.1437579109206; Wed, 22 Jul 2015 08:31:49 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.76.58.17 with HTTP; Wed, 22 Jul 2015 08:31:49 -0700 (PDT) In-Reply-To: References: <201507212033.t6LKXbTj041660@repo.freebsd.org> Date: Wed, 22 Jul 2015 08:31:49 -0700 Message-ID: Subject: Re: svn commit: r285766 - in head/sys: conf dev/vt dev/vt/logo From: Conrad Meyer To: src-committers@freebsd.org Cc: Luiz Otavio O Souza , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 15:31:56 -0000 On Wed, Jul 22, 2015 at 7:10 AM, Conrad Meyer wrote: > On Tue, Jul 21, 2015 at 9:26 PM, Luiz Otavio O Souza wrote: >> This seems to break kernels without 'device splash'. >> >> ... >> linking kernel.debug >> vt_core.o: In function `vtterm_cnprobe': >> /usr/src/sys/dev/vt/vt_core.c:1363: undefined reference to >> `vt_logo_sprite_height' >> vt_core.o: In function `vt_termsize': >> /usr/src/sys/dev/vt/vt_core.c:568: undefined reference to >> `vt_logo_sprite_height' >> vt_core.o: In function `vt_winsize': >> /usr/src/sys/dev/vt/vt_core.c:603: undefined reference to >> `vt_logo_sprite_height' >> vt_core.o: In function `vt_compute_drawable_area': >> /usr/src/sys/dev/vt/vt_core.c:642: undefined reference to >> `vt_logo_sprite_height' >> vt_core.o: In function `vt_mouse_event': >> /usr/src/sys/dev/vt/vt_core.c:1955: undefined reference to >> `vt_logo_sprite_height' >> vt_core.o:/usr/src/sys/dev/vt/vt_core.c:2632: more undefined >> references to `vt_logo_sprite_height' follow >> vt_core.o: In function `vt_flush': >> /usr/src/sys/dev/vt/vt_core.c:1213: undefined reference to >> `vtterm_draw_cpu_logos' >> /usr/src/sys/dev/vt/vt_core.c:1222: undefined reference to >> `vt_logo_sprite_height' >> vt_core.o: In function `vt_scrollmode_kbdevent': >> /usr/src/sys/dev/vt/vt_core.c:766: undefined reference to >> `vt_logo_sprite_height' >> *** [kernel.debug] Error code 1 > > This is addressed in https://reviews.freebsd.org/D3151 . Committed in r285794. Thanks for your patience, and apologies for breaking the build. Best, Conrad From owner-svn-src-head@freebsd.org Wed Jul 22 16:10:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A56B9A8F49; Wed, 22 Jul 2015 16:10:30 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 301C11FC2; Wed, 22 Jul 2015 16:10:30 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MGAUD7017860; Wed, 22 Jul 2015 16:10:30 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MGAUa2017859; Wed, 22 Jul 2015 16:10:30 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201507221610.t6MGAUa2017859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Wed, 22 Jul 2015 16:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285796 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 16:10:30 -0000 Author: jimharris Date: Wed Jul 22 16:10:29 2015 New Revision: 285796 URL: https://svnweb.freebsd.org/changeset/base/285796 Log: nvmecontrol: read controller identify data before any log page operations MFC after: 3 days Sponsored by: Intel Modified: head/sbin/nvmecontrol/logpage.c Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Wed Jul 22 15:39:41 2015 (r285795) +++ head/sbin/nvmecontrol/logpage.c Wed Jul 22 16:10:29 2015 (r285796) @@ -298,6 +298,8 @@ logpage(int argc, char *argv[]) open_dev(argv[optind], &fd, 1, 1); } + read_controller_data(fd, &cdata); + /* * The log page attribtues indicate whether or not the controller * supports the SMART/Health information log page on a per @@ -307,7 +309,6 @@ logpage(int argc, char *argv[]) if (log_page != NVME_LOG_HEALTH_INFORMATION) errx(1, "log page %d valid only at controller level", log_page); - read_controller_data(fd, &cdata); if (cdata.lpa.ns_smart == 0) errx(1, "controller does not support per namespace " From owner-svn-src-head@freebsd.org Wed Jul 22 16:25:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D063B9A726B; Wed, 22 Jul 2015 16:25:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCAC919E5; Wed, 22 Jul 2015 16:25:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MGPGJ0025349; Wed, 22 Jul 2015 16:25:16 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MGP8ig025312; Wed, 22 Jul 2015 16:25:08 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201507221625.t6MGP8ig025312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 22 Jul 2015 16:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285797 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 16:25:17 -0000 Author: jkim Date: Wed Jul 22 16:25:07 2015 New Revision: 285797 URL: https://svnweb.freebsd.org/changeset/base/285797 Log: Merge ACPICA 20150717. Added: head/sys/contrib/dev/acpica/components/debugger/dbobject.c - copied, changed from r285728, vendor-sys/acpica/dist/source/components/debugger/dbobject.c head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c - copied, changed from r285728, vendor-sys/acpica/dist/source/components/dispatcher/dsdebug.c head/sys/contrib/dev/acpica/components/utilities/utnonansi.c - copied, changed from r285728, vendor-sys/acpica/dist/source/components/utilities/utnonansi.c Deleted: head/sys/contrib/dev/acpica/components/disassembler/dmobject.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/compiler/aslascii.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/aslnamesp.c head/sys/contrib/dev/acpica/compiler/asloffset.c head/sys/contrib/dev/acpica/compiler/aslopcodes.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslstubs.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/prparser.l head/sys/contrib/dev/acpica/compiler/prparser.y head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/components/debugger/dbcmds.c head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbutils.c head/sys/contrib/dev/acpica/components/debugger/dbxface.c head/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c head/sys/contrib/dev/acpica/components/disassembler/dmnames.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c head/sys/contrib/dev/acpica/components/dispatcher/dsargs.c head/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/executer/excreate.c head/sys/contrib/dev/acpica/components/executer/exdebug.c head/sys/contrib/dev/acpica/components/executer/exdump.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/namespace/nsparse.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/namespace/nsxfname.c head/sys/contrib/dev/acpica/components/parser/psargs.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/parser/psutils.c head/sys/contrib/dev/acpica/components/parser/psxface.c head/sys/contrib/dev/acpica/components/resources/rscreate.c head/sys/contrib/dev/acpica/components/utilities/utdebug.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/components/utilities/utinit.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/components/utilities/utstring.c head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acdispat.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/acinterp.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acparser.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acstruct.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/platform/acenvex.h head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/conf/files Wed Jul 22 16:25:07 2015 (r285797) @@ -284,6 +284,7 @@ contrib/dev/acpica/components/debugger/d contrib/dev/acpica/components/debugger/dbinput.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbmethod.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbnames.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbobject.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbstats.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbtest.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbutils.c optional acpi acpi_debug @@ -293,7 +294,6 @@ contrib/dev/acpica/components/disassembl contrib/dev/acpica/components/disassembler/dmdeferred.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmnames.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmopcode.c optional acpi acpi_debug -contrib/dev/acpica/components/disassembler/dmobject.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmresrc.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmresrcl.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmresrcl2.c optional acpi acpi_debug @@ -302,6 +302,7 @@ contrib/dev/acpica/components/disassembl contrib/dev/acpica/components/disassembler/dmwalk.c optional acpi acpi_debug contrib/dev/acpica/components/dispatcher/dsargs.c optional acpi contrib/dev/acpica/components/dispatcher/dscontrol.c optional acpi +contrib/dev/acpica/components/dispatcher/dsdebug.c optional acpi contrib/dev/acpica/components/dispatcher/dsfield.c optional acpi contrib/dev/acpica/components/dispatcher/dsinit.c optional acpi contrib/dev/acpica/components/dispatcher/dsmethod.c optional acpi @@ -437,6 +438,7 @@ contrib/dev/acpica/components/utilities/ contrib/dev/acpica/components/utilities/utmath.c optional acpi contrib/dev/acpica/components/utilities/utmisc.c optional acpi contrib/dev/acpica/components/utilities/utmutex.c optional acpi +contrib/dev/acpica/components/utilities/utnonansi.c optional acpi contrib/dev/acpica/components/utilities/utobject.c optional acpi contrib/dev/acpica/components/utilities/utosi.c optional acpi contrib/dev/acpica/components/utilities/utownerid.c optional acpi Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Wed Jul 22 16:25:07 2015 (r285797) @@ -20,10 +20,10 @@ fulldirs="common compiler components inc stripdirs="generate libraries tests tools" stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h \ acefi.h acefiex.h achaiku.h acintel.h aclinux.h aclinuxex.h \ - acmacosx.h acmsvc.h acnetbsd.h acos2.h acwin.h acwin64.h \ - new_table.txt osbsdtbl.c osefitbl.c osefixf.c osfreebsdtbl.c \ - oslinuxtbl.c osunixdir.c osunixmap.c oswindir.c oswintbl.c \ - oswinxf.c readme.txt utclib.c" + acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h acwin.h \ + acwin64.h acwinex.h new_table.txt osbsdtbl.c osefitbl.c \ + osefixf.c osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c \ + oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c" # include files to canonify src_headers="acapps.h acbuffer.h acclib.h accommon.h acconfig.h \ Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/changes.txt Wed Jul 22 16:25:07 2015 (r285797) @@ -1,4 +1,87 @@ ---------------------------------------- +17 July 2015. Summary of changes for version 20150717: + +1) ACPICA kernel-resident subsystem: + +Improved the partitioning between the Debugger and Disassembler +components. This allows the Debugger to be used standalone within kernel +code without the Disassembler (which is used for single stepping also). +This renames and moves one file, dmobject.c to dbobject.c. Lv Zheng. + +Debugger: Implemented a new command to trace the execution of control +methods (Trace). This is especially useful for the in-kernel version of +the debugger when file I/O may not be available for method trace output. +See the ACPICA reference for more information. Lv Zheng. + +Moved all C library prototypes (used for the local versions of these +functions when requested) to a new header, acclib.h +Cleaned up the use of non-ANSI C library functions. These functions are +implemented locally in ACPICA. Moved all such functions to a common +source file, utnonansi.c + +Debugger: Fixed a problem with the "!!" command (get last command +executed) where the debugger could enter an infinite loop and eventually +crash. + +Removed the use of local macros that were used for some of the standard C +library functions to automatically cast input parameters. This mostly +affected the is* functions where the input parameter is defined to be an +int. This required a few modifications to the main ACPICA source code to +provide casting for these functions and eliminate possible compiler +warnings for these parameters. + +Across the source code, added additional status/error checking to resolve +issues discovered by static source code analysis tools such as Coverity. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 100.9K Code, 24.5K Data, 125.4K Total + Debug Version: 197.8K Code, 81.5K Data, 279.3K Total + Previous Release: + Non-Debug Version: 100.6K Code, 27.6K Data, 128.2K Total + Debug Version: 196.2K Code, 81.0K Data, 277.2K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a regression where the device map file feature no longer +worked properly when used in conjunction with the disassembler. It only +worked properly with the compiler itself. + +iASL: Implemented a new warning for method LocalX variables that are set +but never used (similar to a C compiler such as gcc). This also applies +to ArgX variables that are not defined by the parent method, and are +instead (legally) used as local variables. + +iASL/Preprocessor: Finished the pass-through of line numbers from the +preprocessor to the compiler. This ensures that compiler errors/warnings +have the correct original line numbers and filenames, regardless of any +#include files. + +iASL/Preprocessor: Fixed a couple of issues with comment handling and the +pass-through of comments to the preprocessor output file (which becomes +the compiler input file). Also fixed a problem with // comments that +appear after a math expression. + +iASL: Added support for the TCPA server table to the table compiler and +template generator. (The client table was already previously supported) + +iASL/Preprocessor: Added a permanent #define of the symbol "__IASL__" to +identify the iASL compiler. + +Cleaned up the use of the macros NEGATIVE and POSITIVE which were defined +multiple times. The new names are ACPI_SIGN_NEGATIVE and +ACPI_SIGN_POSITIVE. + +AcpiHelp: Update to expand help messages for the iASL preprocessor +directives. + + +---------------------------------------- 19 June 2015. Summary of changes for version 20150619: Two regressions in version 20150616 have been addressed: Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/common/adisasm.c Wed Jul 22 16:25:07 2015 (r285797) @@ -187,6 +187,7 @@ AdInitialize ( AcpiGbl_RootTableList.CurrentTableCount = 0; AcpiGbl_RootTableList.Tables = LocalTables; + AcpiGbl_PreviousOp = NULL; return (Status); } @@ -796,8 +797,8 @@ AdStoreTable ( AcpiTbInitTableDescriptor (TableDesc, ACPI_PTR_TO_PHYSADDR (Table), ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, Table); - AcpiTbValidateTable (TableDesc); - return (AE_OK); + Status = AcpiTbValidateTable (TableDesc); + return (Status); } @@ -892,7 +893,7 @@ AdParseTable ( /* Create the root object */ - AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp (); + AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp (AmlStart); if (!AcpiGbl_ParseOpRoot) { return (AE_NO_MEMORY); Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Wed Jul 22 16:25:07 2015 (r285797) @@ -650,7 +650,7 @@ AcpiGetTagPathname ( /* Get the full pathname to the parent buffer */ - RequiredSize = AcpiNsGetPathnameLength (BufferNode); + RequiredSize = AcpiNsBuildNormalizedPath (BufferNode, NULL, 0, FALSE); if (!RequiredSize) { return (NULL); @@ -662,12 +662,8 @@ AcpiGetTagPathname ( return (NULL); } - Status = AcpiNsBuildExternalPath (BufferNode, RequiredSize, Pathname); - if (ACPI_FAILURE (Status)) - { - ACPI_FREE (Pathname); - return (NULL); - } + (void) AcpiNsBuildNormalizedPath (BufferNode, Pathname, + RequiredSize, FALSE); /* * Create the full path to the resource and tag by: remove the buffer name, Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/common/dmtable.c Wed Jul 22 16:25:07 2015 (r285797) @@ -368,7 +368,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableD {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi}, {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat}, {ACPI_SIG_STAO, NULL, AcpiDmDumpStao, DtCompileStao, TemplateStao}, - {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, TemplateTcpa}, + {ACPI_SIG_TCPA, NULL, AcpiDmDumpTcpa, DtCompileTcpa, TemplateTcpa}, {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, NULL, NULL, TemplateTpm2}, {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi}, {ACPI_SIG_VRTC, AcpiDmTableInfoVrtc, AcpiDmDumpVrtc, DtCompileVrtc, TemplateVrtc}, @@ -500,7 +500,11 @@ AcpiDmDumpDataTable ( if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS)) { Length = Table->Length; - AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs); + Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs); + if (ACPI_FAILURE (Status)) + { + return; + } } else if (ACPI_VALIDATE_RSDP_SIG (Table->Signature)) { @@ -561,7 +565,11 @@ AcpiDmDumpDataTable ( { /* Simple table, just walk the info table */ - AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo); + Status = AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo); + if (ACPI_FAILURE (Status)) + { + return; + } } } @@ -720,6 +728,7 @@ AcpiDmDumpTable ( const AH_TABLE *TableData; const char *Name; BOOLEAN LastOutputBlankLine = FALSE; + ACPI_STATUS Status; char RepairedName[8]; @@ -1114,8 +1123,13 @@ AcpiDmDumpTable ( /* Generic Address Structure */ AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure"); - AcpiDmDumpTable (TableLength, CurrentOffset, Target, + Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target, sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + AcpiOsPrintf ("\n"); LastOutputBlankLine = TRUE; break; @@ -1250,8 +1264,13 @@ AcpiDmDumpTable ( AcpiOsPrintf (STRING_FORMAT, "Hardware Error Notification Structure"); - AcpiDmDumpTable (TableLength, CurrentOffset, Target, + Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target, sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + AcpiOsPrintf ("\n"); LastOutputBlankLine = TRUE; break; @@ -1275,8 +1294,13 @@ AcpiDmDumpTable ( AcpiOsPrintf (STRING_FORMAT, "IORT Memory Access Properties"); - AcpiDmDumpTable (TableLength, CurrentOffset, Target, + Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target, sizeof (ACPI_IORT_MEMORY_ACCESS), AcpiDmTableInfoIortAcc); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + LastOutputBlankLine = TRUE; break; Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Wed Jul 22 16:25:07 2015 (r285797) @@ -208,11 +208,16 @@ AcpiDmDumpRsdp ( ACPI_TABLE_RSDP *Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table); UINT32 Length = sizeof (ACPI_RSDP_COMMON); UINT8 Checksum; + ACPI_STATUS Status; /* Dump the common ACPI 1.0 portion */ - AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1); + Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1); + if (ACPI_FAILURE (Status)) + { + return (Length); + } /* Validate the first checksum */ @@ -229,7 +234,11 @@ AcpiDmDumpRsdp ( if (Rsdp->Revision > 0) { Length = Rsdp->Length; - AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2); + Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2); + if (ACPI_FAILURE (Status)) + { + return (Length); + } /* Validate the extended checksum over entire RSDP */ @@ -347,37 +356,59 @@ void AcpiDmDumpFadt ( ACPI_TABLE_HEADER *Table) { + ACPI_STATUS Status; + /* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */ - AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1); + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1); + if (ACPI_FAILURE (Status)) + { + return; + } /* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */ if ((Table->Length > ACPI_FADT_V1_SIZE) && (Table->Length <= ACPI_FADT_V2_SIZE)) { - AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2); + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2); + if (ACPI_FAILURE (Status)) + { + return; + } } /* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */ else if (Table->Length > ACPI_FADT_V2_SIZE) { - AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3); + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3); + if (ACPI_FAILURE (Status)) + { + return; + } /* Check for FADT revision 5 fields and up (ACPI 5.0+) */ if (Table->Length > ACPI_FADT_V3_SIZE) { - AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5); + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5); + if (ACPI_FAILURE (Status)) + { + return; + } } /* Check for FADT revision 6 fields and up (ACPI 6.0+) */ if (Table->Length > ACPI_FADT_V3_SIZE) { - AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6); + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6); + if (ACPI_FAILURE (Status)) + { + return; + } } } @@ -1136,7 +1167,7 @@ AcpiDmDumpDrtm ( AcpiDmTableInfoDrtm1); if (ACPI_FAILURE (Status)) { - return; + return; } Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources); @@ -1164,13 +1195,9 @@ AcpiDmDumpDrtm ( DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset); AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, Offset, + (void) AcpiDmDumpTable (Table->Length, Offset, DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2); - if (ACPI_FAILURE (Status)) - { - return; - } } @@ -1794,6 +1821,10 @@ AcpiDmDumpIort ( Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), Length, AcpiDmTableInfoIort3a); + if (ACPI_FAILURE (Status)) + { + return; + } NodeOffset = IortSmmu->ContextInterruptOffset; for (i = 0; i < IortSmmu->ContextInterruptCount; i++) @@ -1801,6 +1832,10 @@ AcpiDmDumpIort ( Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 8, AcpiDmTableInfoIort3b); + if (ACPI_FAILURE (Status)) + { + return; + } NodeOffset += 8; } @@ -1810,6 +1845,10 @@ AcpiDmDumpIort ( Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 8, AcpiDmTableInfoIort3c); + if (ACPI_FAILURE (Status)) + { + return; + } NodeOffset += 8; } } @@ -1830,6 +1869,10 @@ AcpiDmDumpIort ( Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), Length, AcpiDmTableInfoIortMap); + if (ACPI_FAILURE (Status)) + { + return; + } NodeOffset += Length; } @@ -2004,6 +2047,10 @@ AcpiDmDumpIvrs ( Status = AcpiDmDumpTable (Table->Length, EntryOffset, DeviceEntry, EntryLength, InfoTable); + if (ACPI_FAILURE (Status)) + { + return; + } EntryOffset += EntryLength; DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry, @@ -2687,6 +2734,11 @@ AcpiDmDumpNfit ( Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset, &Interleave->LineOffset[i], sizeof (UINT32), AcpiDmTableInfoNfit2a); + if (ACPI_FAILURE (Status)) + { + return; + } + FieldOffset += sizeof (UINT32); } break; @@ -2715,6 +2767,11 @@ AcpiDmDumpNfit ( Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset, &Hint->HintAddress[i], sizeof (UINT64), AcpiDmTableInfoNfit6a); + if (ACPI_FAILURE (Status)) + { + return; + } + FieldOffset += sizeof (UINT64); } break; @@ -3126,7 +3183,7 @@ void AcpiDmDumpSlic ( ACPI_TABLE_HEADER *Table) { - AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table, + (void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table, Table->Length - sizeof (*Table), AcpiDmTableInfoSlic); } @@ -3358,6 +3415,77 @@ AcpiDmDumpStao ( /******************************************************************************* * + * FUNCTION: AcpiDmDumpTcpa + * + * PARAMETERS: Table - A TCPA table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a TCPA. + * + * NOTE: There are two versions of the table with the same signature: + * the client version and the server version. The common + * PlatformClass field is used to differentiate the two types of + * tables. + * + ******************************************************************************/ + +void +AcpiDmDumpTcpa ( + ACPI_TABLE_HEADER *Table) +{ + UINT32 Offset = sizeof (ACPI_TABLE_TCPA_HDR); + ACPI_TABLE_TCPA_HDR *CommonHeader = ACPI_CAST_PTR ( + ACPI_TABLE_TCPA_HDR, Table); + ACPI_TABLE_TCPA_HDR *SubTable = ACPI_ADD_PTR ( + ACPI_TABLE_TCPA_HDR, Table, Offset); + ACPI_STATUS Status; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, + 0, AcpiDmTableInfoTcpaHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* + * Examine the PlatformClass field to determine the table type. + * Either a client or server table. Only one. + */ + switch (CommonHeader->PlatformClass) + { + case ACPI_TCPA_CLIENT_TABLE: + + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + Table->Length - Offset, AcpiDmTableInfoTcpaClient); + break; + + case ACPI_TCPA_SERVER_TABLE: + + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + Table->Length - Offset, AcpiDmTableInfoTcpaServer); + break; + + default: + + AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n", + CommonHeader->PlatformClass); + Status = AE_ERROR; + break; + } + + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("\n**** Cannot disassemble TCPA table\n"); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpVrtc * * PARAMETERS: Table - A VRTC table @@ -3497,10 +3625,6 @@ AcpiDmDumpWpbt ( /* Dump the arguments buffer */ - AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength, + (void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength, AcpiDmTableInfoWpbt0); - if (ACPI_FAILURE (Status)) - { - return; - } } Modified: head/sys/contrib/dev/acpica/common/dmtbinfo.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/common/dmtbinfo.c Wed Jul 22 16:25:07 2015 (r285797) @@ -113,7 +113,7 @@ #define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f) #define ACPI_SRAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SRAT,f) #define ACPI_STAO_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_STAO,f) -#define ACPI_TCPA_CLIENT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,f) +#define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_HDR,f) #define ACPI_TPM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f) #define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f) #define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f) @@ -230,6 +230,8 @@ #define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f) #define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f) #define ACPI_SRAT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GICC_AFFINITY,f) +#define ACPI_TCPA_CLIENT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,f) +#define ACPI_TCPA_SERVER_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_SERVER,f) #define ACPI_VRTC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f) #define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f) @@ -2613,16 +2615,53 @@ ACPI_DMTABLE_INFO AcpiDmTableI * * TCPA - Trusted Computing Platform Alliance table (Client) * + * NOTE: There are two versions of the table with the same signature -- + * the client version and the server version. The common PlatformClass + * field is used to differentiate the two types of tables. + * ******************************************************************************/ -ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[] = +ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaHdr[] = +{ + {ACPI_DMT_UINT16, ACPI_TCPA_OFFSET (PlatformClass), "Platform Class", 0}, + ACPI_DMT_TERMINATOR +}; + +ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaClient[] = { - {ACPI_DMT_UINT16, ACPI_TCPA_CLIENT_OFFSET (PlatformClass), "Platform Class", 0}, {ACPI_DMT_UINT32, ACPI_TCPA_CLIENT_OFFSET (MinimumLogLength), "Min Event Log Length", 0}, {ACPI_DMT_UINT64, ACPI_TCPA_CLIENT_OFFSET (LogAddress), "Event Log Address", 0}, ACPI_DMT_TERMINATOR }; +ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaServer[] = +{ + {ACPI_DMT_UINT16, ACPI_TCPA_SERVER_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_TCPA_SERVER_OFFSET (MinimumLogLength), "Min Event Log Length", 0}, + {ACPI_DMT_UINT64, ACPI_TCPA_SERVER_OFFSET (LogAddress), "Event Log Address", 0}, + {ACPI_DMT_UINT16, ACPI_TCPA_SERVER_OFFSET (SpecRevision), "Specification Revision", 0}, + {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (DeviceFlags), "Device Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_TCPA_SERVER_OFFSET (DeviceFlags), "Pci Device", 0}, + {ACPI_DMT_FLAG1, ACPI_TCPA_SERVER_OFFSET (DeviceFlags), "Bus is Pnp", 0}, + {ACPI_DMT_FLAG2, ACPI_TCPA_SERVER_OFFSET (DeviceFlags), "Address Valid", 0}, + {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "Interrupt Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "Mode", 0}, + {ACPI_DMT_FLAG1, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "Polarity", 0}, + {ACPI_DMT_FLAG2, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "GPE SCI Triggered", 0}, + {ACPI_DMT_FLAG3, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "Global System Interrupt", 0}, + {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (GpeNumber), "Gpe Number", 0}, + {ACPI_DMT_UINT24, ACPI_TCPA_SERVER_OFFSET (Reserved2[0]), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_TCPA_SERVER_OFFSET (GlobalInterrupt), "Global Interrupt", 0}, + {ACPI_DMT_GAS, ACPI_TCPA_SERVER_OFFSET (Address), "Address", 0}, + {ACPI_DMT_UINT32, ACPI_TCPA_SERVER_OFFSET (Reserved3), "Reserved", 0}, + {ACPI_DMT_GAS, ACPI_TCPA_SERVER_OFFSET (ConfigAddress), "Configuration Address", 0}, + {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (Group), "Pci Group", 0}, + {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (Bus), "Pci Bus", 0}, + {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (Device), "Pci Device", 0}, + {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (Function), "Pci Function", 0}, + ACPI_DMT_TERMINATOR +}; + /******************************************************************************* * Modified: head/sys/contrib/dev/acpica/compiler/aslascii.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslascii.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/compiler/aslascii.c Wed Jul 22 16:25:07 2015 (r285797) @@ -177,6 +177,11 @@ FlCheckForAscii ( /* Open file in text mode so file offset is always accurate */ Handle = fopen (Filename, "rb"); + if (!Handle) + { + perror ("Could not open input file"); + return (AE_ERROR); + } Status.Line = 1; Status.Offset = 0; Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Jul 22 16:25:07 2015 (r285797) @@ -100,6 +100,10 @@ CmDoCompile ( Event = UtBeginEvent ("Preprocess input file"); if (Gbl_PreprocessFlag) { + /* Enter compiler name as a #define */ + + PrAddDefine (ASL_DEFINE, "", FALSE); + /* Preprocessor */ PrDoPreprocess (); Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldefine.h Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/compiler/asldefine.h Wed Jul 22 16:25:07 2015 (r285797) @@ -52,6 +52,7 @@ #define AML_DISASSEMBLER_NAME "AML/ASL+ Disassembler" #define ASL_INVOCATION_NAME "iasl" #define ASL_CREATOR_ID "INTL" +#define ASL_DEFINE "__IASL__" #define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.0" @@ -155,12 +156,6 @@ #define ACPI_COMPILER_RESERVED_NAME (ACPI_UINT32_MAX - 3) -/* String to Integer conversion */ - -#define NEGATIVE 1 -#define POSITIVE 0 - - /* Helper macros for resource tag creation */ #define RsCreateMultiBitField \ Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Wed Jul 22 16:25:07 2015 (r285797) @@ -546,6 +546,26 @@ FlOpenMiscOutputFiles ( char *Filename; + /* Create/Open a map file if requested */ + + if (Gbl_MapfileFlag) + { + Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_MAP); + if (!Filename) + { + AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME, + 0, 0, 0, 0, NULL, NULL); + return (AE_ERROR); + } + + /* Open the hex file, text mode (closed at compiler exit) */ + + FlOpenFile (ASL_FILE_MAP_OUTPUT, Filename, "w+t"); + + AslCompilerSignon (ASL_FILE_MAP_OUTPUT); + AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT); + } + /* All done for disassembler */ if (Gbl_FileType == ASL_INPUT_TYPE_ACPI_TABLE) @@ -812,26 +832,6 @@ FlOpenMiscOutputFiles ( AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT); } - /* Create/Open a map file if requested */ - - if (Gbl_MapfileFlag) - { - Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_MAP); - if (!Filename) - { - AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME, - 0, 0, 0, 0, NULL, NULL); - return (AE_ERROR); - } - - /* Open the hex file, text mode (closed at compiler exit) */ - - FlOpenFile (ASL_FILE_MAP_OUTPUT, Filename, "w+t"); - - AslCompilerSignon (ASL_FILE_MAP_OUTPUT); - AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT); - } - return (AE_OK); } Modified: head/sys/contrib/dev/acpica/compiler/asllookup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllookup.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/compiler/asllookup.c Wed Jul 22 16:25:07 2015 (r285797) @@ -119,8 +119,73 @@ LkIsObjectUsed ( { ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle); ACPI_NAMESPACE_NODE *Next; + ASL_METHOD_LOCAL *MethodLocals; + ASL_METHOD_LOCAL *MethodArgs; + UINT32 i; + if (Node->Type == ACPI_TYPE_METHOD) + { + if (!Node->Op || !Node->MethodLocals) + { + return (AE_OK); + } + + MethodLocals = (ASL_METHOD_LOCAL *) Node->MethodLocals; + MethodArgs = (ASL_METHOD_LOCAL *) Node->MethodArgs; + + /* + * Analysis of LocalX variables + */ + for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) + { + /* Warn for Locals that are set but never referenced */ + + if ((MethodLocals[i].Flags & ASL_LOCAL_INITIALIZED) && + (!(MethodLocals[i].Flags & ASL_LOCAL_REFERENCED))) + { + sprintf (MsgBuffer, "Local%u", i); + AslError (ASL_WARNING, ASL_MSG_LOCAL_NOT_USED, + MethodLocals[i].Op, MsgBuffer); + } + } + + /* + * Analysis of ArgX variables (standard method arguments, + * and remaining unused ArgX can also be used as locals) + */ + for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) + { + if (MethodArgs[i].Flags & ASL_ARG_IS_LOCAL) + { + /* Warn if ArgX is being used as a local, but not referenced */ + + if ((MethodArgs[i].Flags & ASL_ARG_INITIALIZED) && + (!(MethodArgs[i].Flags & ASL_ARG_REFERENCED))) + { + sprintf (MsgBuffer, "Arg%u", i); + AslError (ASL_WARNING, ASL_MSG_ARG_AS_LOCAL_NOT_USED, + MethodArgs[i].Op, MsgBuffer); + } + } + else + { + /* + * Remark if a normal method ArgX is not referenced. + * We ignore the predefined methods since often, not + * all arguments are needed or used. + */ + if ((Node->Name.Ascii[0] != '_') && + (!(MethodArgs[i].Flags & ASL_ARG_REFERENCED))) + { + sprintf (MsgBuffer, "Arg%u", i); + AslError (ASL_REMARK, ASL_MSG_ARG_NOT_USED, + MethodArgs[i].Op, MsgBuffer); + } + } + } + } + /* Referenced flag is set during the namespace xref */ if (Node->Flags & ANOBJ_IS_REFERENCED) Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.c Wed Jul 22 16:25:07 2015 (r285797) @@ -235,7 +235,11 @@ const char *AslComp /* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer", /* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency", /* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference within a method", -/* ASL_MSG_ILLEGAL_METHOD_REF */ "Illegal reference across two methods" +/* ASL_MSG_ILLEGAL_METHOD_REF */ "Illegal reference across two methods", +/* ASL_MSG_LOCAL_NOT_USED */ "Method Local is set but never used", +/* ASL_MSG_ARG_AS_LOCAL_NOT_USED */ "Method Argument (as a local) is set but never used", +/* ASL_MSG_ARG_NOT_USED */ "Method Argument is never used" + }; /* Table compiler */ Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Jul 22 16:25:07 2015 (r285797) @@ -238,6 +238,9 @@ typedef enum ASL_MSG_MISSING_DEPENDENCY, ASL_MSG_ILLEGAL_FORWARD_REF, ASL_MSG_ILLEGAL_METHOD_REF, + ASL_MSG_LOCAL_NOT_USED, + ASL_MSG_ARG_AS_LOCAL_NOT_USED, + ASL_MSG_ARG_NOT_USED, /* These messages are used by the Data Table compiler only */ Modified: head/sys/contrib/dev/acpica/compiler/aslmethod.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmethod.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/compiler/aslmethod.c Wed Jul 22 16:25:07 2015 (r285797) @@ -255,7 +255,7 @@ MtMethodAnalysisWalkBegin ( return (AE_ERROR); } - RegisterNumber = (Op->Asl.AmlOpcode & 0x000F); + RegisterNumber = (Op->Asl.AmlOpcode & 0x0007); /* * If the local is being used as a target, mark the local Modified: head/sys/contrib/dev/acpica/compiler/aslnamesp.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslnamesp.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/compiler/aslnamesp.c Wed Jul 22 16:25:07 2015 (r285797) @@ -409,7 +409,7 @@ NsDoOnePathname ( TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiNsHandleToPathname (Node, &TargetPath); + Status = AcpiNsHandleToPathname (Node, &TargetPath, FALSE); if (ACPI_FAILURE (Status)) { return (Status); Modified: head/sys/contrib/dev/acpica/compiler/asloffset.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloffset.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/compiler/asloffset.c Wed Jul 22 16:25:07 2015 (r285797) @@ -363,7 +363,7 @@ LsEmitOffsetTableEntry ( /* Get the full pathname to the namespace node */ TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiNsHandleToPathname (Node, &TargetPath); + Status = AcpiNsHandleToPathname (Node, &TargetPath, FALSE); if (ACPI_FAILURE (Status)) { return; Modified: head/sys/contrib/dev/acpica/compiler/aslopcodes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopcodes.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/compiler/aslopcodes.c Wed Jul 22 16:25:07 2015 (r285797) @@ -791,43 +791,6 @@ OpcEncodePldBuffer ( /******************************************************************************* * - * FUNCTION: OpcStrupr (strupr) - * - * PARAMETERS: SrcString - The source string to convert - * - * RETURN: None - * - * DESCRIPTION: Convert string to uppercase - * - * NOTE: This is not a POSIX function, so it appears here, not in utclib.c - * - ******************************************************************************/ - -static void -OpcStrupr ( - char *SrcString) -{ - char *String; - - - if (!SrcString) - { - return; - } - - /* Walk entire string, uppercasing the letters */ - - for (String = SrcString; *String; String++) - { - *String = (char) toupper ((int) *String); - } - - return; -} - - -/******************************************************************************* - * * FUNCTION: OpcFindName * * PARAMETERS: List - Array of char strings to be searched @@ -851,7 +814,7 @@ OpcFindName ( UINT32 i; - OpcStrupr (Name); + AcpiUtStrupr (Name); for (i = 0, Str = List[0]; Str; i++, Str = List[i]) { @@ -900,13 +863,6 @@ OpcDoPld ( return; } - Buffer = UtLocalCalloc (ACPI_PLD_BUFFER_SIZE); - if (!Buffer) - { - AslError(ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION, Op, NULL); - return; - } - memset (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); Node = Op->Asl.Child; Modified: head/sys/contrib/dev/acpica/compiler/aslopt.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopt.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/compiler/aslopt.c Wed Jul 22 16:25:07 2015 (r285797) @@ -655,7 +655,7 @@ OptOptimizeNamePath ( * format -- something we can easily manipulate */ TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiNsHandleToPathname (TargetNode, &TargetPath); + Status = AcpiNsHandleToPathname (TargetNode, &TargetPath, FALSE); if (ACPI_FAILURE (Status)) { AslCoreSubsystemError (Op, Status, "Getting Target NamePath", @@ -667,7 +667,7 @@ OptOptimizeNamePath ( /* CurrentPath is the path to this scope (where we are in the namespace) */ CurrentPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiNsHandleToPathname (CurrentNode, &CurrentPath); + Status = AcpiNsHandleToPathname (CurrentNode, &CurrentPath, FALSE); if (ACPI_FAILURE (Status)) { AslCoreSubsystemError (Op, Status, "Getting Current NamePath", Modified: head/sys/contrib/dev/acpica/compiler/asloptions.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloptions.c Wed Jul 22 16:10:29 2015 (r285796) +++ head/sys/contrib/dev/acpica/compiler/asloptions.c Wed Jul 22 16:25:07 2015 (r285797) @@ -286,6 +286,11 @@ AslDoOptions ( AcpiGbl_CstyleDisassembly = FALSE; break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jul 22 16:25:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 363889A7270; Wed, 22 Jul 2015 16:25:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2713D19E8; Wed, 22 Jul 2015 16:25:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MGPK4s025396; Wed, 22 Jul 2015 16:25:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MGPJYd025391; Wed, 22 Jul 2015 16:25:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201507221625.t6MGPJYd025391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 22 Jul 2015 16:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285798 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 16:25:20 -0000 Author: arybchik Date: Wed Jul 22 16:25:18 2015 New Revision: 285798 URL: https://svnweb.freebsd.org/changeset/base/285798 Log: sfxge: added fallbacks for pre 4.2.1 firmware support Driver must be able to start against older firmware that is missing recently added MCDI calls, otherwise firmware upgrade will not be possible. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D3145 Modified: head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_mac.c head/sys/dev/sfxge/common/hunt_nic.c Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Wed Jul 22 16:25:07 2015 (r285797) +++ head/sys/dev/sfxge/common/hunt_impl.h Wed Jul 22 16:25:18 2015 (r285798) @@ -695,6 +695,21 @@ hunt_tx_qstats_update( #define HUNT_MIN_PIO_ALLOC_SIZE (HUNT_PIOBUF_SIZE / 32) +#define HUNT_LEGACY_PF_PRIVILEGE_MASK \ + (MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_PTP | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_INSECURE_FILTERS | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_UNICAST | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_MULTICAST | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_BROADCAST | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS) + +#define HUNT_LEGACY_VF_PRIVILEGE_MASK 0 + typedef uint32_t efx_piobuf_handle_t; #define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t) -1) Modified: head/sys/dev/sfxge/common/hunt_mac.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mac.c Wed Jul 22 16:25:07 2015 (r285797) +++ head/sys/dev/sfxge/common/hunt_mac.c Wed Jul 22 16:25:18 2015 (r285798) @@ -150,8 +150,19 @@ hunt_mac_addr_set( { int rc; - if ((rc = efx_mcdi_vadapter_set_mac(enp)) != 0) - goto fail1; + if ((rc = efx_mcdi_vadapter_set_mac(enp)) != 0) { + if (rc != ENOTSUP) + goto fail1; + + /* Fallback for older firmware without Vadapter support */ + if ((rc = hunt_mac_reconfigure(enp)) != 0) + goto fail2; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, int, rc); Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Jul 22 16:25:07 2015 (r285797) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Jul 22 16:25:18 2015 (r285798) @@ -1239,8 +1239,19 @@ hunt_board_cfg( * the privilege mask to check for sufficient privileges, as that * can result in time-of-check/time-of-use bugs. */ - if ((rc = efx_mcdi_privilege_mask(enp, pf, vf, &mask)) != 0) - goto fail13; + if ((rc = efx_mcdi_privilege_mask(enp, pf, vf, &mask)) != 0) { + if (rc != ENOTSUP) + goto fail13; + + /* Fallback for old firmware without privilege mask support */ + if (EFX_PCI_FUNCTION_IS_PF(encp)) { + /* Assume PF has admin privilege */ + mask = HUNT_LEGACY_PF_PRIVILEGE_MASK; + } else { + /* VF is always unprivileged by default */ + mask = HUNT_LEGACY_VF_PRIVILEGE_MASK; + } + } encp->enc_privilege_mask = mask; From owner-svn-src-head@freebsd.org Wed Jul 22 16:26:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2175A9A72D9; Wed, 22 Jul 2015 16:26:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12C511CD9; Wed, 22 Jul 2015 16:26:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MGQHm2025530; Wed, 22 Jul 2015 16:26:17 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MGQH46025529; Wed, 22 Jul 2015 16:26:17 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201507221626.t6MGQH46025529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 22 Jul 2015 16:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285799 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 16:26:18 -0000 Author: jkim Date: Wed Jul 22 16:26:17 2015 New Revision: 285799 URL: https://svnweb.freebsd.org/changeset/base/285799 Log: Catch up with ACPICA 20150717. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Jul 22 16:25:18 2015 (r285798) +++ head/sys/dev/acpica/acpi.c Wed Jul 22 16:26:17 2015 (r285799) @@ -3664,7 +3664,7 @@ acpi_UserNotify(const char *subsystem, A handle_buf.Pointer = NULL; handle_buf.Length = ACPI_ALLOCATE_BUFFER; - status = AcpiNsHandleToPathname(h, &handle_buf); + status = AcpiNsHandleToPathname(h, &handle_buf, FALSE); if (ACPI_FAILURE(status)) return; snprintf(notify_buf, sizeof(notify_buf), "notify=0x%02x", notify); From owner-svn-src-head@freebsd.org Wed Jul 22 18:50:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FA179A80E2; Wed, 22 Jul 2015 18:50:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90A5611C8; Wed, 22 Jul 2015 18:50:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MIom5T087881; Wed, 22 Jul 2015 18:50:48 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MIomxP087880; Wed, 22 Jul 2015 18:50:48 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201507221850.t6MIomxP087880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 22 Jul 2015 18:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285801 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 18:50:48 -0000 Author: cem Date: Wed Jul 22 18:50:47 2015 New Revision: 285801 URL: https://svnweb.freebsd.org/changeset/base/285801 Log: vt_core.c: Use do/while to highlight missed semi-colon errors Also, fix some nearby #define whitespace while here. (Style cleanup for r285794.) Suggested by: jmg Differential Revision: https://reviews.freebsd.org/D3154 Approved by: markj (mentor) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed Jul 22 16:38:07 2015 (r285800) +++ head/sys/dev/vt/vt_core.c Wed Jul 22 18:50:47 2015 (r285801) @@ -110,8 +110,8 @@ const struct terminal_class vt_termclass #define VT_TIMERFREQ 25 /* Bell pitch/duration. */ -#define VT_BELLDURATION ((5 * hz + 99) / 100) -#define VT_BELLPITCH 800 +#define VT_BELLDURATION ((5 * hz + 99) / 100) +#define VT_BELLPITCH 800 #define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS + \ (vw)->vw_number) @@ -155,7 +155,7 @@ extern unsigned int vt_logo_height; extern unsigned int vt_logo_depth; extern unsigned char vt_logo_image[]; #ifndef DEV_SPLASH -#define vtterm_draw_cpu_logos(...) +#define vtterm_draw_cpu_logos(...) do {} while (0) const unsigned int vt_logo_sprite_height; #endif @@ -182,8 +182,8 @@ static void vt_resume_handler(void *priv SET_DECLARE(vt_drv_set, struct vt_driver); -#define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)) -#define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)) +#define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)) +#define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)) struct terminal vt_consterm; static struct vt_window vt_conswindow; From owner-svn-src-head@freebsd.org Wed Jul 22 19:58:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29AE39A8C10; Wed, 22 Jul 2015 19:58:22 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A29011A5; Wed, 22 Jul 2015 19:58:22 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MJwLrr015410; Wed, 22 Jul 2015 19:58:21 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MJwLEk015409; Wed, 22 Jul 2015 19:58:21 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201507221958.t6MJwLEk015409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 22 Jul 2015 19:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285803 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 19:58:22 -0000 Author: allanjude (doc committer) Date: Wed Jul 22 19:58:21 2015 New Revision: 285803 URL: https://svnweb.freebsd.org/changeset/base/285803 Log: Remove an excess space accidently introduced in the output in ls(1) by r285734 Spotted by: dim Approved by: eadler (mentor) Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3152 Modified: head/bin/ls/print.c Modified: head/bin/ls/print.c ============================================================================== --- head/bin/ls/print.c Wed Jul 22 19:55:32 2015 (r285802) +++ head/bin/ls/print.c Wed Jul 22 19:58:21 2015 (r285803) @@ -456,7 +456,7 @@ printtime(const char *field, time_t ftim snprintf(fmt, sizeof(fmt), "{d:%s/%%hs} ", field); xo_attr("value", "%ld", (long) ftime); xo_emit(fmt, longstring); - snprintf(fmt, sizeof(fmt), "{en:%s/%%ld} ", field); + snprintf(fmt, sizeof(fmt), "{en:%s/%%ld}", field); xo_emit(fmt, (long) ftime); } From owner-svn-src-head@freebsd.org Wed Jul 22 21:44:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7B729A80A7 for ; Wed, 22 Jul 2015 21:44:12 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B68E5169C for ; Wed, 22 Jul 2015 21:44:12 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by pdbnt7 with SMTP id nt7so73951911pdb.0 for ; Wed, 22 Jul 2015 14:44:06 -0700 (PDT) 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:in-reply-to:message-id :references:user-agent:mime-version:content-type; bh=UrLoZyPP65GC7dkOPpC5JNH+YPj/0pxILfRf+a79dEc=; b=VU1llVoEy8KtiVcWluDNdjq0ANqeLrSrQ2+4/EhV9PQ3N9+CWq4EIOnNYENf+RDqiO +SLeKCnIZdxcTNM5yzkp/1/PsVL6DcWDXJT+zU9/au0a5mTKygkw5r60lhdwr4NTbXRA 4/wq9vnhBXIadQ2EdFCJ37Z1XaMCnNnHang6qxv1DNHzxq4AhxM8l7u9YfieLcWeTg3C bVfKuK4DmMxRQRioMcIEYlGo9szWlUnKzflxA/7ptXnQ5D7sfscSsK+RNlL5evW6Upcf jyIjXQDSaTQb55wsNuX+ZxbUPdUEBhXt3RK/ZL0SkjYGAI46gDgCTIcywuk69lkkNLJ8 uWzQ== X-Gm-Message-State: ALoCoQkvwI/6s2lv/EWTe2W1zykH6ywp7WVfh8bc4o5WpE9U8WJ+TxYQPstMwD9LbfVZVh6pDpL6 X-Received: by 10.70.94.42 with SMTP id cz10mr10441572pdb.92.1437601446361; Wed, 22 Jul 2015 14:44:06 -0700 (PDT) Received: from rrcs-66-91-135-210.west.biz.rr.com (rrcs-66-91-135-210.west.biz.rr.com. [66.91.135.210]) by smtp.gmail.com with ESMTPSA id pu4sm5005841pdb.86.2015.07.22.14.44.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 14:44:05 -0700 (PDT) Date: Wed, 22 Jul 2015 11:42:13 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Mark Murray cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... In-Reply-To: <201506301700.t5UH0jPq001498@svn.freebsd.org> Message-ID: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) 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.20 Precedence: list List-Id: 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, 22 Jul 2015 21:44:13 -0000 On Tue, 30 Jun 2015, Mark Murray wrote: > Author: markm > Date: Tue Jun 30 17:00:45 2015 > New Revision: 284959 > URL: https://svnweb.freebsd.org/changeset/base/284959 > > Log: > Huge cleanup of random(4) code. > > * GENERAL > - Update copyright. > - Make kernel options for RANDOM_YARROW and RANDOM_DUMMY. Set > neither to ON, which means we want Fortuna > - If there is no 'device random' in the kernel, there will be NO > random(4) device in the kernel, and the KERN_ARND sysctl will > return nothing. With RANDOM_DUMMY there will be a random(4) that > always blocks. > - Repair kern.arandom (KERN_ARND sysctl). The old version went > through arc4random(9) and was a bit weird. > - Adjust arc4random stirring a bit - the existing code looks a little > suspect. > - Fix the nasty pre- and post-read overloading by providing explictit > functions to do these tasks. > - Redo read_random(9) so as to duplicate random(4)'s read internals. > This makes it a first-class citizen rather than a hack. > - Move stuff out of locked regions when it does not need to be > there. > - Trim RANDOM_DEBUG printfs. Some are excess to requirement, some > behind boot verbose. > - Use SYSINIT to sequence the startup. > - Fix init/deinit sysctl stuff. > - Make relevant sysctls also tunables. > - Add different harvesting "styles" to allow for different requirements > (direct, queue, fast). > - Add harvesting of FFS atime events. This needs to be checked for > weighing down the FS code. > - Add harvesting of slab allocator events. This needs to be checked for > weighing down the allocator code. Neither filesystem operations nor allocations are random events. They are trivially influenced by user code. A malicious attacker could create repeated patterns of allocations or filesystem activity through the syscall path to degrade your random sample source. Perhaps more importantly to me, this is an unacceptable performance burden for the allocator. At a minimum it should compile out by default. Great care has been taken to reduce the fast path of the allocator to the minimum number of cycles and even cache misses. Thanks, Jeff > - Fix the random(9) manpage. > - Loadable modules are not present for now. These will be re-engineered > when the dust settles. > - Use macros for locks. > - Fix comments. > > * src/share/man/... > - Update the man pages. > > * src/etc/... > - The startup/shutdown work is done in D2924. > > * src/UPDATING > - Add UPDATING announcement. > > * src/sys/dev/random/build.sh > - Add copyright. > - Add libz for unit tests. > > * src/sys/dev/random/dummy.c > - Remove; no longer needed. Functionality incorporated into randomdev.*. > > * live_entropy_sources.c live_entropy_sources.h > - Remove; content moved. > - move content to randomdev.[ch] and optimise. > > * src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h > - Remove; plugability is no longer used. Compile-time algorithm > selection is the way to go. > > * src/sys/dev/random/random_harvestq.c src/sys/dev/random/random_harvestq.h > - Add early (re)boot-time randomness caching. > > * src/sys/dev/random/randomdev_soft.c src/sys/dev/random/randomdev_soft.h > - Remove; no longer needed. > > * src/sys/dev/random/uint128.h > - Provide a fake uint128_t; if a real one ever arrived, we can use > that instead. All that is needed here is N=0, N++, N==0, and some > localised trickery is used to manufacture a 128-bit 0ULLL. > > * src/sys/dev/random/unit_test.c src/sys/dev/random/unit_test.h > - Improve unit tests; previously the testing human needed clairvoyance; > now the test will do a basic check of compressibility. Clairvoyant > talent is still a good idea. > - This is still a long way off a proper unit test. > > * src/sys/dev/random/fortuna.c src/sys/dev/random/fortuna.h > - Improve messy union to just uint128_t. > - Remove unneeded 'static struct fortuna_start_cache'. > - Tighten up up arithmetic. > - Provide a method to allow eternal junk to be introduced; harden > it against blatant by compress/hashing. > - Assert that locks are held correctly. > - Fix the nasty pre- and post-read overloading by providing explictit > functions to do these tasks. > - Turn into self-sufficient module (no longer requires randomdev_soft.[ch]) > > * src/sys/dev/random/yarrow.c src/sys/dev/random/yarrow.h > - Improve messy union to just uint128_t. > - Remove unneeded 'staic struct start_cache'. > - Tighten up up arithmetic. > - Provide a method to allow eternal junk to be introduced; harden > it against blatant by compress/hashing. > - Assert that locks are held correctly. > - Fix the nasty pre- and post-read overloading by providing explictit > functions to do these tasks. > - Turn into self-sufficient module (no longer requires randomdev_soft.[ch]) > - Fix some magic numbers elsewhere used as FAST and SLOW. > > Differential Revision: https://reviews.freebsd.org/D2025 > Reviewed by: vsevolod,delphij,rwatson,trasz,jmg > Approved by: so (delphij) > > Added: > head/sys/dev/random/randomdev_none.c (contents, props changed) > - copied, changed from r284956, head/sys/dev/random/randomdev_soft.h > Deleted: > head/sys/dev/random/dummy_rng.c > head/sys/dev/random/live_entropy_sources.c > head/sys/dev/random/live_entropy_sources.h > head/sys/dev/random/random_adaptors.c > head/sys/dev/random/random_adaptors.h > head/sys/dev/random/randomdev_soft.c > head/sys/dev/random/randomdev_soft.h > head/sys/modules/random/Makefile > Modified: > head/UPDATING > head/share/man/man4/random.4 > head/share/man/man9/random.9 > head/share/man/man9/random_harvest.9 > head/sys/conf/files > head/sys/conf/options > head/sys/dev/glxsb/glxsb.c > head/sys/dev/hifn/hifn7751.c > head/sys/dev/random/build.sh > head/sys/dev/random/fortuna.c > head/sys/dev/random/fortuna.h > head/sys/dev/random/hash.c > head/sys/dev/random/hash.h > head/sys/dev/random/ivy.c > head/sys/dev/random/nehemiah.c > head/sys/dev/random/random_harvestq.c > head/sys/dev/random/random_harvestq.h > head/sys/dev/random/randomdev.c > head/sys/dev/random/randomdev.h > head/sys/dev/random/uint128.h > head/sys/dev/random/unit_test.c > head/sys/dev/random/unit_test.h > head/sys/dev/random/yarrow.c > head/sys/dev/random/yarrow.h > head/sys/dev/rndtest/rndtest.c > head/sys/dev/safe/safe.c > head/sys/dev/syscons/scmouse.c > head/sys/dev/syscons/syscons.c > head/sys/dev/ubsec/ubsec.c > head/sys/dev/virtio/random/virtio_random.c > head/sys/dev/vt/vt_core.c > head/sys/dev/vt/vt_sysmouse.c > head/sys/fs/tmpfs/tmpfs_subr.c > head/sys/kern/kern_intr.c > head/sys/kern/kern_mib.c > head/sys/kern/subr_bus.c > head/sys/libkern/arc4random.c > head/sys/libkern/random.c > head/sys/mips/cavium/octeon_rnd.c > head/sys/mips/conf/AR71XX_BASE > head/sys/mips/conf/AR724X_BASE > head/sys/mips/conf/AR91XX_BASE > head/sys/mips/conf/AR933X_BASE > head/sys/mips/conf/AR934X_BASE > head/sys/mips/conf/PB92 > head/sys/mips/conf/QCA955X_BASE > head/sys/mips/conf/RT305X > head/sys/modules/Makefile > head/sys/modules/crypto/Makefile > head/sys/net/if_ethersubr.c > head/sys/net/if_tun.c > head/sys/netgraph/ng_iface.c > head/sys/sys/kernel.h > head/sys/sys/random.h > head/sys/ufs/ffs/ffs_inode.c > head/sys/vm/uma_core.c > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Tue Jun 30 16:26:13 2015 (r284958) > +++ head/UPDATING Tue Jun 30 17:00:45 2015 (r284959) > @@ -31,6 +31,41 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > +20150630: > + The default kernel entropy-processing algorithm is now > + Fortuna, replacing Yarrow. > + > + Assuming you have 'device random' in your kernel config > + file, the configurations allow a kernel option to override > + this default. You may choose *ONE* of: > + > + options RANDOM_YARROW # Legacy /dev/random algorithm. > + options RANDOM_DUMMY # Blocking-only driver. > + > + If you have neither, you get Fortuna. For most people, > + read no further, Fortuna will give a /dev/random that works > + like it always used to, and the difference will be irrelevant. > + > + If you remove 'device random', you get *NO* kernel-processed > + entopy at all. This may be acceptable to folks building > + embedded systems, but has complications. Carry on reading, > + and it is assumed you know what you need. > + > + *PLEASE* read random(4) and random(9) if you are in the > + habit of tweeking kernel configs, and/or if you are a member > + of the embedded community, wanting specific and not-usual > + behaviour from your security subsystems. > + > + NOTE!! If you use RANDOM_DUMMY and/or have no 'device > + random', you will NOT have a functioning /dev/random, and > + many cryptographic features will not work, including SSH. > + You may also find strange behaviour from the random(3) set > + of library functions, in particular sranddev(3), srandomdev(3) > + and arc4random(3). The reason for this is that the KERN_ARND > + sysctl only returns entropy if it thinks it has some to > + share, and with RANDOM_DUMMY or no 'device random' this > + will never happen. > + > 20150623: > An additional fix for the issue described in the 20150614 sendmail > entry below has been been committed in revision 284717. > > Modified: head/share/man/man4/random.4 > ============================================================================== > --- head/share/man/man4/random.4 Tue Jun 30 16:26:13 2015 (r284958) > +++ head/share/man/man4/random.4 Tue Jun 30 17:00:45 2015 (r284959) > @@ -1,4 +1,4 @@ > -.\" Copyright (c) 2001-2013 Mark R V Murray. All rights reserved. > +.\" Copyright (c) 2001-2015 Mark R V Murray. All rights reserved. > .\" > .\" Redistribution and use in source and binary forms, with or without > .\" modification, are permitted provided that the following conditions > @@ -23,7 +23,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd October 12, 2013 > +.Dd June 30, 2015 > .Dt RANDOM 4 > .Os > .Sh NAME > @@ -37,31 +37,32 @@ The > device > returns an endless supply of random bytes when read. > It also accepts and reads data > -as any ordinary (and willing) file, > -but discards data written to it. > -The device will probe for > -certain hardware entropy sources, > -and use these in preference to the fallback, > -which is a generator implemented in software. > +as any ordinary file. > .Pp > -The software generator will start in an > +The generator will start in an > .Em unseeded > state, and will block reads until > -it is (re)seeded. > +it is seeded for the first time. > This may cause trouble at system boot > when keys and the like > are generated from > -/dev/random > +.Xr random 4 > so steps should be taken to ensure a > -reseed as soon as possible. > -The > -.Xr sysctl 8 > -controlling the > -.Em seeded > -status (see below) may be used > -if security is not an issue > -or for convenience > -during setup or development. > +seeding as soon as possible. > +.Pp > +It is also possible > +to read random bytes > +by using the KERN_ARND sysctl. > +On the command line > +this could be done by > +.Pp > +.Dl "sysctl -x -B 16 kern.arandom" > +.Pp > +This sysctl will not return > +random bytes unless > +the > +.Xr random 4 > +is seeded. > .Pp > This initial seeding > of random number generators > @@ -90,101 +91,57 @@ To see the current settings of the softw > .Nm > device, use the command line: > .Pp > -.Dl sysctl kern.random > +.Dl "sysctl kern.random" > .Pp > which results in something like: > .Bd -literal -offset indent > -kern.random.adaptors: yarrow,dummy > -kern.random.active_adaptor: yarrow > -kern.random.yarrow.gengateinterval: 10 > -kern.random.yarrow.bins: 10 > -kern.random.yarrow.fastthresh: 96 > -kern.random.yarrow.slowthresh: 128 > -kern.random.yarrow.slowoverthresh: 2 > -kern.random.sys.seeded: 1 > -kern.random.sys.harvest.ethernet: 1 > -kern.random.sys.harvest.point_to_point: 1 > -kern.random.sys.harvest.interrupt: 1 > -kern.random.sys.harvest.swi: 1 > +kern.random.fortuna.minpoolsize: 64 > +kern.random.harvest.mask_symbolic: [HIGH_PERFORMANCE], ... ,CACHED > +kern.random.harvest.mask_bin: 00111111111 > +kern.random.harvest.mask: 511 > +kern.random.random_sources: 'Intel Secure Key RNG' > .Ed > .Pp > Other than > -.Dl kern.random.adaptors > -all settings are read/write. > -.Pp > -The > -.Va kern.random.sys.seeded > -variable indicates whether or not the > -.Nm > -device is in an acceptably secure state > -as a result of reseeding. > -If set to 0, > -the device will block (on read) > -until the next reseed > -as a result of entropy harvesting. > -A reseed will set the value to 1 (non-blocking). > -.Pp > -The > -.Va kern.random.sys.harvest.ethernet > -variable is used to select LAN traffic as an entropy source. > -A 0 (zero) value means that LAN traffic > -is not considered as an entropy source. > -Set the variable to 1 (one) > -if you wish to use LAN traffic for entropy harvesting. > +.Dl kern.random.fortuna.minpoolsize > +and > +.Dl kern.random.harvest.mask > +all settings are read-only. > .Pp > The > -.Va kern.random.sys.harvest.point_to_point > -variable is used to select serial line traffic as an entropy source. > -(Serial line traffic includes PPP, SLIP and all tun0 traffic.) > -A 0 (zero) value means such traffic > -is not considered as an entropy source. > -Set the variable to 1 (one) > -if you wish to use it for entropy harvesting. > +.Pa kern.random.fortuna.minpoolsize > +sysctl is used > +to set the seed threshhold. > +A smaller number gives a faster seed, > +but a less secure one. > +In practice, > +values between 64 and 256 > +are acceptable. > .Pp > The > -.Va kern.random.sys.harvest.interrupt > -variable is used to select hardware interrupts > +.Va kern.random.harvest.mask > +bitmask is used to select > +the possible entropy sources. > +A 0 (zero) value means > +the corresponding source > +is not considered > as an entropy source. > -A 0 (zero) value means hardware interrupts > -are not considered as an entropy source. > -Set the variable to 1 (one) > -if you wish to use them for entropy harvesting. > -All hardware interrupt harvesting is set up by the > -individual device drivers. > -.Pp > +Set the bit to 1 (one) > +if you wish to use > +that source. > The > -.Va kern.random.sys.harvest.swi > -variable is used to select software interrupts > -as an entropy source. > -A 0 (zero) value means software interrupts > -are not considered as an entropy source. > -Set the variable to 1 (one) > -if you wish to use them for entropy harvesting. > -.Pp > -The other variables are explained in the paper describing the > -.Em Yarrow > -algorithm at > -.Pa http://www.schneier.com/yarrow.html . > -.Pp > -These variables are all limited > -in terms of the values they may contain: > -.Bl -tag -width "kern.random.yarrow.gengateinterval" -compact -offset indent > -.It Va kern.random.yarrow.gengateinterval > -.Bq 4..64 > -.It Va kern.random.yarrow.bins > -.Bq 2..16 > -.It Va kern.random.yarrow.fastthresh > -.Bq 64..256 > -.It Va kern.random.yarrow.slowthresh > -.Bq 64..256 > -.It Va kern.random.yarrow.slowoverthresh > -.Bq 1..5 > -.El > -.Pp > -Internal > -.Xr sysctl 3 > -handlers force the above variables > -into the stated ranges. > +.Va kern.random.harvest.mask_bin > +and > +.Va kern.random.harvest.mask_symbolic > +sysctl > +can be used confirm > +that your choices are correct. > +Note that disabled items > +in the latter item > +are listed in square brackets. > +See > +.Xr random_harvest 9 > +for more on the harvesting of entropy. > .Sh RANDOMNESS > The use of randomness in the field of computing > is a rather subtle issue because randomness means > @@ -308,23 +265,36 @@ so its use is discouraged. > .Xr RAND_add 3 , > .Xr RAND_bytes 3 , > .Xr random 3 , > -.Xr sysctl 8 > +.Xr sysctl 8 , > +.Xr random 9 > +.Rs > +.%A Ferguson > +.%A Schneier > +.%A Kohno > +.%B Cryptography Engineering > +.%I Wiley > +.%O ISBN 978-0-470-47424-2 > +.Re > .Sh HISTORY > A > .Nm > device appeared in > .Fx 2.2 . > -The early version was taken from Theodore Ts'o's entropy driver for Linux. > The current software implementation, > introduced in > -.Fx 5.0 , > -is a complete rewrite by > +.Fx 10.0 , > +is by > .An Mark R V Murray , > and is an implementation of the > -.Em Yarrow > -algorithm by Bruce Schneier, > +.Em Fortuna > +algorithm by Ferguson > .Em et al . > -Significant infrastructure work was done by Arthur Mesh. > -.Pp > -The author gratefully acknowledges > -significant assistance from VIA Technologies, Inc. > +It replaces the previous > +.Em Yarrow > +implementation, > +introduced in > +.Fx 5.0 . > +The older > +.Em Yarrow > +algorithm remains available > +as a compile-time fallback. > > Modified: head/share/man/man9/random.9 > ============================================================================== > --- head/share/man/man9/random.9 Tue Jun 30 16:26:13 2015 (r284958) > +++ head/share/man/man9/random.9 Tue Jun 30 17:00:45 2015 (r284959) > @@ -1,4 +1,6 @@ > .\" > +.\" Copyright (c) 2015 > +.\" Mark R V Murray > .\" Copyright (c) 2000 > .\" The Regents of the University of California. All rights reserved. > .\" > @@ -26,7 +28,7 @@ > .\" > .\" $FreeBSD$ > .\" " > -.Dd September 25, 2000 > +.Dd June 30, 2015 > .Dt RANDOM 9 > .Os > .Sh NAME > @@ -53,11 +55,12 @@ > .Sh DESCRIPTION > The > .Fn random > -function will by default produce a sequence of numbers that can be duplicated > +function will by default produce > +a sequence of numbers > +that can be duplicated > by calling > .Fn srandom > -with > -.Ql 1 > +with some constant > as the > .Fa seed . > The > @@ -67,19 +70,28 @@ function may be called with any arbitrar > value to get slightly more unpredictable numbers. > It is important to remember that the > .Fn random > -function is entirely predictable, and is therefore not of use where > -knowledge of the sequence of numbers may be of benefit to an attacker. > +function is entirely predictable, > +and is therefore not of use where > +knowledge of the sequence of numbers > +may be of benefit to an attacker. > .Pp > The > .Fn arc4rand > -function will return very good quality random numbers, slightly better > -suited for security-related purposes. > +function will return very good quality random numbers, > +better suited > +for security-related purposes. > The random numbers from > .Fn arc4rand > -are seeded from the entropy device if it is available. > -Automatic reseeds happen after a certain timeinterval and after a > -certain number of bytes have been delivered. > -A forced reseed can be forced by passing a non-zero value in the > +are seeded from the entropy device > +if it is available. > +Automatic reseeds happen > +after a certain timeinterval > +and after a certain number of bytes > +have been delivered. > +A forced reseed > +can be forced > +by passing a non-zero > +value in the > .Fa reseed > argument. > .Pp > @@ -90,19 +102,24 @@ if it has been loaded. > If the entropy device is not loaded, then > the > .Fa buffer > -is filled with output generated by > -.Fn random . > +is ignored > +and zero is returned. > The > .Fa buffer > is filled with no more than > .Fa count > bytes. > -It is advised that > +It is strongly advised that > .Fn read_random > -is not used; instead use > +is not used; > +instead use > .Fn arc4rand > +unless it is > +necessary to know > +that no entropy > +has been returned. > .Pp > -All the bits generated by > +All the bits returned by > .Fn random , > .Fn arc4rand > and > @@ -120,32 +137,38 @@ to return a 32 bit pseudo-random integer > .Sh RETURN VALUES > The > .Fn random > -function > -uses a non-linear additive feedback random number generator employing a > -default table of size 31 long integers to return successive pseudo-random > +function uses > +a non-linear additive feedback random number generator > +employing a default table > +of size 31 > +containing long integers > +to return successive pseudo-random > numbers in the range from 0 to > .if t 2\u\s731\s10\d\(mi1. > .if n (2**31)\(mi1. > -The period of this random number generator is very large, approximately > +The period of this random number generator > +is very large, > +approximately > .if t 16\(mu(2\u\s731\s10\d\(mi1). > .if n 16*((2**31)\(mi1). > .Pp > The > .Fn arc4rand > -function uses the RC4 algorithm to generate successive pseudo-random > -bytes. > +function uses the RC4 algorithm > +to generate successive pseudo-random bytes. > The > .Fn arc4random > -function > -uses > +function uses > .Fn arc4rand > -to generate pseudo-random numbers in the range from 0 to > +to generate pseudo-random numbers > +in the range from 0 to > .if t 2\u\s732\s10\d\(mi1. > .if n (2**32)\(mi1. > .Pp > The > .Fn read_random > -function returns the number of bytes placed in > +function returns > +the number of bytes placed in > .Fa buffer . > .Sh AUTHORS > .An Dan Moschuk > > Modified: head/share/man/man9/random_harvest.9 > ============================================================================== > --- head/share/man/man9/random_harvest.9 Tue Jun 30 16:26:13 2015 (r284958) > +++ head/share/man/man9/random_harvest.9 Tue Jun 30 17:00:45 2015 (r284959) > @@ -1,5 +1,5 @@ > .\" > -.\" Copyright (c) 2002 Mark R V Murray > +.\" Copyright (c) 2002-2015 Mark R V Murray > .\" All rights reserved. > .\" > .\" Redistribution and use in source and binary forms, with or without > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd February 6, 2002 > +.Dd June 30, 2015 > .Dt RANDOM_HARVEST 9 > .Os > .Sh NAME > @@ -35,59 +35,93 @@ > .In sys/types.h > .In sys/random.h > .Ft void > -.Fo random_harvest > +.Fo random_harvest_direct > +.Fa "void *entropy" > +.Fa "u_int size" > +.Fa "u_int bits" > +.Fa "enum esource source" > +.Fc > +.Ft void > +.Fo random_harvest_fast > +.Fa "void *entropy" > +.Fa "u_int size" > +.Fa "u_int bits" > +.Fa "enum esource source" > +.Fc > +.Ft void > +.Fo random_harvest_queue > .Fa "void *entropy" > .Fa "u_int size" > .Fa "u_int bits" > -.Fa "u_int frac" > .Fa "enum esource source" > .Fc > .Sh DESCRIPTION > The > -.Fn random_harvest > -function is used by device drivers > +.Fn random_harvest_* > +functions are used by device drivers > and other kernel processes to pass data > that is considered (at least partially) stochastic > to the entropy device. > .Pp > -The caller should pass a pointer (to no more than 16 bytes) of > -the > +The caller should pass > +a pointer pointing to the > .Dq random > data in > .Fa entropy . > The argument > .Fa size > contains the number of bytes pointed to. > -The caller should > +The > +.Fa source > +is chosen from one of > +the values enumerated in > +.Pa sys/dev/random.h . > +and is used to indicate the source of the entropy. > +.Pp > +The > +.Fo random_harvest_direct > +.Fc > +variant is used > +for early harvesting > +before any multitasking > +is enabled. > +.Pp > +The > +.Fn random_harvest_fast > +variant is used > +by sources that > +should not take > +a performance hit > +from harvesting, > +as they are high-rate > +sources. > +Some entropy is sacrificed, > +but the hig rate of supply > +will compensate for this. > +.Pp > +The > +.Fn random_harvest_queue > +variant is used > +for general harvesting > +and is the default > +choice for most entropy sources > +such as interrupts > +or console events. > +.Pp > +The > +.Fa bits > +argument is only used > +by the deprecated Yarrow algorithm. > +For compatibility, > +the caller should > .Em "very conservatively" > estimate the number of random bits > in the sample, > and pass this in > -.Fa bits > -or > -.Fa frac . > -If the estimated number of bits per sample is an integer, then > -.Fa bits > -is used, and > -.Fa frac > -is 0. > -Otherwise, > -for low-entropy samples, > -.Dq fractional > -entropy can be supplied in > -.Fa frac . > -(This is considered to be > -.Fa frac / > -1024 bits of entropy.) > -The > -.Fa source > -is chosen from > -.Dv RANDOM_WRITE , RANDOM_KEYBOARD , RANDOM_MOUSE , RANDOM_NET > -and > -.Dv RANDOM_INTERRUPT , > -and is used to indicate the source of the entropy. > +.Fa bits . > .Pp > -Interrupt harvesting has been simplified > +Interrupt harvesting has been > +in part simplified simplified > for the kernel programmer. > If a device driver registers an interrupt handler > with > @@ -101,6 +135,7 @@ bit in the > .Fa flags > argument to have that interrupt source > be used for entropy harvesting. > +This should be done wherever practicable. > .Sh SEE ALSO > .Xr random 4 , > .Xr BUS_SETUP_INTR 9 > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Tue Jun 30 16:26:13 2015 (r284958) > +++ head/sys/conf/files Tue Jun 30 17:00:45 2015 (r284959) > @@ -528,14 +528,14 @@ crypto/des/des_ecb.c optional crypto | > crypto/des/des_setkey.c optional crypto | ipsec | netsmb > crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi > crypto/rijndael/rijndael-alg-fst.c optional crypto | geom_bde | \ > - ipsec | random | wlan_ccmp > -crypto/rijndael/rijndael-api-fst.c optional geom_bde | random > + ipsec | random random_yarrow | random !random_yarrow !random_dummy | wlan_ccmp > +crypto/rijndael/rijndael-api-fst.c optional geom_bde | random random_yarrow | random !random_yarrow !random_dummy > crypto/rijndael/rijndael-api.c optional crypto | ipsec | wlan_ccmp > crypto/sha1.c optional carp | crypto | ipsec | \ > netgraph_mppc_encryption | sctp > -crypto/sha2/sha2.c optional crypto | geom_bde | ipsec | random | \ > +crypto/sha2/sha2.c optional crypto | geom_bde | ipsec | random random_yarrow | random !random_yarrow !random_dummy | \ > sctp | zfs > -crypto/sha2/sha256c.c optional crypto | geom_bde | ipsec | random | \ > +crypto/sha2/sha256c.c optional crypto | geom_bde | ipsec | random random_yarrow | random !random_yarrow !random_dummy | \ > sctp | zfs > crypto/siphash/siphash.c optional inet | inet6 > crypto/siphash/siphash_test.c optional inet | inet6 > @@ -2139,15 +2139,12 @@ rt2860.fw optional rt2860fw | ralfw \ > compile-with "${NORMAL_FW}" \ > no-obj no-implicit-rule \ > clean "rt2860.fw" > -dev/random/randomdev.c standard > -dev/random/random_adaptors.c standard > -dev/random/dummy_rng.c standard > -dev/random/live_entropy_sources.c standard > -dev/random/random_harvestq.c standard > -dev/random/randomdev_soft.c optional random > -dev/random/yarrow.c optional random > -dev/random/fortuna.c optional random > -dev/random/hash.c optional random > +dev/random/randomdev_none.c optional !random > +dev/random/randomdev.c optional random > +dev/random/random_harvestq.c optional random random_yarrow | random !random_dummy > +dev/random/yarrow.c optional random random_yarrow > +dev/random/fortuna.c optional random !random_yarrow !random_dummy > +dev/random/hash.c optional random random_yarrow | random !random_dummy > dev/rc/rc.c optional rc > dev/re/if_re.c optional re > dev/rl/if_rl.c optional rl pci > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Tue Jun 30 16:26:13 2015 (r284958) > +++ head/sys/conf/options Tue Jun 30 17:00:45 2015 (r284959) > @@ -939,9 +939,16 @@ RACCT_DEFAULT_TO_DISABLED opt_global.h > RCTL opt_global.h > > # Random number generator(s) > +# The DEBUG option is in global.h as the random harvesting > +# puts probes all over the place, and it makes little sense > +# to pollute these headers with an extra include. > +# the DUMMY option is in global.h because it is used to > +# turn off harvesting all over the kernel. > +RANDOM_DEBUG opt_global.h > +# Which CSPRNG hashes we get. > +# These are mutually exclusive. With neither, Fortuna is selected. > +RANDOM_DUMMY opt_global.h > RANDOM_YARROW opt_random.h > -RANDOM_FORTUNA opt_random.h > -RANDOM_DEBUG opt_random.h > > # Intel em(4) driver > EM_MULTIQUEUE opt_em.h > > Modified: head/sys/dev/glxsb/glxsb.c > ============================================================================== > --- head/sys/dev/glxsb/glxsb.c Tue Jun 30 16:26:13 2015 (r284958) > +++ head/sys/dev/glxsb/glxsb.c Tue Jun 30 17:00:45 2015 (r284959) > @@ -476,7 +476,8 @@ glxsb_rnd(void *v) > if (status & SB_RNS_TRNG_VALID) { > value = bus_read_4(sc->sc_sr, SB_RANDOM_NUM); > /* feed with one uint32 */ > - random_harvest(&value, sizeof(value), 32/2, RANDOM_PURE_GLXSB); > + /* MarkM: FIX!! Check that this does not swamp the harvester! */ > + random_harvest_queue(&value, sizeof(value), 32/2, RANDOM_PURE_GLXSB); > } > > callout_reset(&sc->sc_rngco, sc->sc_rnghz, glxsb_rnd, sc); > > Modified: head/sys/dev/hifn/hifn7751.c > ============================================================================== > --- head/sys/dev/hifn/hifn7751.c Tue Jun 30 16:26:13 2015 (r284958) > +++ head/sys/dev/hifn/hifn7751.c Tue Jun 30 17:00:45 2015 (r284959) > @@ -258,7 +258,8 @@ hifn_partname(struct hifn_softc *sc) > static void > default_harvest(struct rndtest_state *rsp, void *buf, u_int count) > { > - random_harvest(buf, count, count*NBBY/2, RANDOM_PURE_HIFN); > + /* MarkM: FIX!! Check that this does not swamp the harvester! */ > + random_harvest_queue(buf, count, count*NBBY/2, RANDOM_PURE_HIFN); > } > > static u_int > > Modified: head/sys/dev/random/build.sh > ============================================================================== > --- head/sys/dev/random/build.sh Tue Jun 30 16:26:13 2015 (r284958) > +++ head/sys/dev/random/build.sh Tue Jun 30 17:00:45 2015 (r284959) > @@ -1,3 +1,29 @@ > +#!/bin/sh > +#- > +# Copyright (c) 2013-2015 Mark R V Murray > +# 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 > +# in this position and unchanged. > +# 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$ > # > # Basic script to build crude unit tests. > @@ -11,6 +37,7 @@ cc -g -O0 -pthread -DRANDOM_DEBUG -DRAND > ../../crypto/rijndael/rijndael-alg-fst.c \ > ../../crypto/sha2/sha2.c \ > ../../crypto/sha2/sha256c.c \ > + -lz \ > -o yunit_test > cc -g -O0 -pthread -DRANDOM_DEBUG -DRANDOM_FORTUNA \ > -I../.. -lstdthreads -Wall \ > @@ -21,4 +48,5 @@ cc -g -O0 -pthread -DRANDOM_DEBUG -DRAND > ../../crypto/rijndael/rijndael-alg-fst.c \ > ../../crypto/sha2/sha2.c \ > ../../crypto/sha2/sha256c.c \ > + -lz \ > -o funit_test > > Modified: head/sys/dev/random/fortuna.c > ============================================================================== > --- head/sys/dev/random/fortuna.c Tue Jun 30 16:26:13 2015 (r284958) > +++ head/sys/dev/random/fortuna.c Tue Jun 30 17:00:45 2015 (r284959) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2013-2014 Mark R V Murray > + * Copyright (c) 2013-2015 Mark R V Murray > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -25,25 +25,24 @@ > * > */ > > -/* This implementation of Fortuna is based on the descriptions found in > - * ISBN 0-471-22357-3 "Practical Cryptography" by Ferguson and Schneier > - * ("F&S"). > - * > - * The above book is superseded by ISBN 978-0-470-47424-2 "Cryptography > - * Engineering" by Ferguson, Schneier and Kohno ("FS&K"). The code has > - * not yet fully caught up with FS&K. > +/* > + * This implementation of Fortuna is based on the descriptions found in > + * ISBN 978-0-470-47424-2 "Cryptography Engineering" by Ferguson, Schneier > + * and Kohno ("FS&K"). > */ > > #include > __FBSDID("$FreeBSD$"); > > -#ifdef _KERNEL > -#include "opt_random.h" > +#include > > +#ifdef _KERNEL > #include > #include > +#include > #include > #include > +#include > #include > #include > #include > @@ -56,13 +55,10 @@ __FBSDID("$FreeBSD$"); > > #include > #include > -#include > #include > #include > #include > #else /* !_KERNEL */ > -#include > -#include > #include > #include > #include > @@ -79,351 +75,405 @@ __FBSDID("$FreeBSD$"); > #include > #endif /* _KERNEL */ > > -#if !defined(RANDOM_YARROW) && !defined(RANDOM_FORTUNA) > -#define RANDOM_YARROW > -#elif defined(RANDOM_YARROW) && defined(RANDOM_FORTUNA) > -#error "Must define either RANDOM_YARROW or RANDOM_FORTUNA" > -#endif > - > -#if defined(RANDOM_FORTUNA) > - > -#define NPOOLS 32 > -#define MINPOOLSIZE 64 > -#define DEFPOOLSIZE 256 > -#define MAXPOOLSIZE 65536 > - > -/* This algorithm (and code) presumes that KEYSIZE is twice as large as BLOCKSIZE */ > -CTASSERT(BLOCKSIZE == sizeof(uint128_t)); > -CTASSERT(KEYSIZE == 2*BLOCKSIZE); > - > -/* This is the beastie that needs protecting. It contains all of the > - * state that we are excited about. > - * Exactly one is instantiated. > +/* Defined in FS&K */ > +#define RANDOM_FORTUNA_NPOOLS 32 /* The number of accumulation pools */ > +#define RANDOM_FORTUNA_DEFPOOLSIZE 64 /* The default pool size/length for a (re)seed */ > +#define RANDOM_FORTUNA_MAX_READ (1 << 20) /* Max bytes in a single read */ > + > +/* > + * The allowable range of RANDOM_FORTUNA_DEFPOOLSIZE. The default value is above. > + * Making RANDOM_FORTUNA_DEFPOOLSIZE too large will mean a long time between reseeds, > + * and too small may compromise initial security but get faster reseeds. > + */ > +#define RANDOM_FORTUNA_MINPOOLSIZE 16 > +#define RANDOM_FORTUNA_MAXPOOLSIZE UINT_MAX > +CTASSERT(RANDOM_FORTUNA_MINPOOLSIZE <= RANDOM_FORTUNA_DEFPOOLSIZE); > +CTASSERT(RANDOM_FORTUNA_DEFPOOLSIZE <= RANDOM_FORTUNA_MAXPOOLSIZE); > + > +/* This algorithm (and code) presumes that RANDOM_KEYSIZE is twice as large as RANDOM_BLOCKSIZE */ > +CTASSERT(RANDOM_BLOCKSIZE == sizeof(uint128_t)); > +CTASSERT(RANDOM_KEYSIZE == 2*RANDOM_BLOCKSIZE); > + > +/* > + * This is the beastie that needs protecting. It contains all of the > + * state that we are excited about. Exactly one is instantiated. > */ > static struct fortuna_state { > - /* P_i */ > - struct pool { > - u_int length; > - struct randomdev_hash hash; > - } pool[NPOOLS]; > - > - /* ReseedCnt */ > - u_int reseedcount; > - > - /* C - 128 bits */ > - union { > - uint8_t byte[BLOCKSIZE]; > - uint128_t whole; > - } counter; > - > - /* K */ > - struct randomdev_key key; > - > - /* Extras */ > - u_int minpoolsize; > - > + struct fs_pool { /* P_i */ > + u_int fsp_length; /* Only the first one is used by Fortuna */ > + struct randomdev_hash fsp_hash; > + } fs_pool[RANDOM_FORTUNA_NPOOLS]; > + u_int fs_reseedcount; /* ReseedCnt */ > + uint128_t fs_counter; /* C */ > + struct randomdev_key fs_key; /* K */ > + u_int fs_minpoolsize; /* Extras */ > /* Extras for the OS */ > - > #ifdef _KERNEL > /* For use when 'pacing' the reseeds */ > - sbintime_t lasttime; > + sbintime_t fs_lasttime; > #endif > + /* Reseed lock */ > + mtx_t fs_mtx; > } fortuna_state; > > -/* The random_reseed_mtx mutex protects seeding and polling/blocking. */ > -static mtx_t random_reseed_mtx; > +#ifdef _KERNEL > +static struct sysctl_ctx_list random_clist; > +RANDOM_CHECK_UINT(fs_minpoolsize, RANDOM_FORTUNA_MINPOOLSIZE, RANDOM_FORTUNA_MAXPOOLSIZE); > +#else > +static uint8_t zero_region[RANDOM_ZERO_BLOCKSIZE]; > +#endif > > -static struct fortuna_start_cache { > - uint8_t junk[PAGE_SIZE]; > - size_t length; > - struct randomdev_hash hash; > -} fortuna_start_cache; > +static void random_fortuna_pre_read(void); > +static void random_fortuna_read(uint8_t *, u_int); > +static void random_fortuna_post_read(void); > +static void random_fortuna_write(uint8_t *, u_int); > +static void random_fortuna_reseed(void); > +static int random_fortuna_seeded(void); > +static void random_fortuna_process_event(struct harvest_event *); > > #ifdef _KERNEL > -static struct sysctl_ctx_list random_clist; > -RANDOM_CHECK_UINT(minpoolsize, MINPOOLSIZE, MAXPOOLSIZE); > +/* Interface to Adaptors system */ > +struct random_algorithm random_alg_context = { > + .ra_ident = "Fortuna", > + .ra_pre_read = random_fortuna_pre_read, > + .ra_read = random_fortuna_read, > + .ra_post_read = random_fortuna_post_read, > + .ra_write = random_fortuna_write, > + .ra_reseed = random_fortuna_reseed, > + .ra_seeded = random_fortuna_seeded, > + .ra_event_processor = random_fortuna_process_event, > + .ra_poolcount = RANDOM_FORTUNA_NPOOLS, > +}; > #endif > > -void > -random_fortuna_init_alg(void) > +/* ARGSUSED */ > +static void > +random_fortuna_init_alg(void *unused __unused) > { > int i; > #ifdef _KERNEL > struct sysctl_oid *random_fortuna_o; > #endif > > - memset(fortuna_start_cache.junk, 0, sizeof(fortuna_start_cache.junk)); > - fortuna_start_cache.length = 0U; > - randomdev_hash_init(&fortuna_start_cache.hash); > - > - /* Set up a lock for the reseed process */ > -#ifdef _KERNEL > - mtx_init(&random_reseed_mtx, "reseed mutex", NULL, MTX_DEF); > -#else /* !_KERNEL */ > - mtx_init(&random_reseed_mtx, mtx_plain); > -#endif /* _KERNEL */ > - > -#ifdef _KERNEL > - /* Fortuna parameters. Do not adjust these unless you have > + RANDOM_RESEED_INIT_LOCK(); > + /* > + * Fortuna parameters. Do not adjust these unless you have > * have a very good clue about what they do! > */ > + fortuna_state.fs_minpoolsize = RANDOM_FORTUNA_DEFPOOLSIZE; > +#ifdef _KERNEL > + fortuna_state.fs_lasttime = 0; > random_fortuna_o = SYSCTL_ADD_NODE(&random_clist, > SYSCTL_STATIC_CHILDREN(_kern_random), > OID_AUTO, "fortuna", CTLFLAG_RW, 0, > "Fortuna Parameters"); > - > SYSCTL_ADD_PROC(&random_clist, > SYSCTL_CHILDREN(random_fortuna_o), OID_AUTO, > - "minpoolsize", CTLTYPE_UINT|CTLFLAG_RW, > - &fortuna_state.minpoolsize, DEFPOOLSIZE, > - random_check_uint_minpoolsize, "IU", > - "Minimum pool size necessary to cause a reseed automatically"); > - > - fortuna_state.lasttime = 0U; > + "minpoolsize", CTLTYPE_UINT | CTLFLAG_RWTUN, > + &fortuna_state.fs_minpoolsize, RANDOM_FORTUNA_DEFPOOLSIZE, > + random_check_uint_fs_minpoolsize, "IU", > + "Minimum pool size necessary to cause a reseed"); > + KASSERT(fortuna_state.fs_minpoolsize > 0, ("random: Fortuna threshold must be > 0 at startup")); > #endif > > - fortuna_state.minpoolsize = DEFPOOLSIZE; > - > - /* F&S - InitializePRNG() */ > - > - /* F&S - P_i = \epsilon */ > - for (i = 0; i < NPOOLS; i++) { > - randomdev_hash_init(&fortuna_state.pool[i].hash); > - fortuna_state.pool[i].length = 0U; > + /*- > + * FS&K - InitializePRNG() > + * - P_i = \epsilon > + * - ReseedCNT = 0 > + */ > + for (i = 0; i < RANDOM_FORTUNA_NPOOLS; i++) { > + randomdev_hash_init(&fortuna_state.fs_pool[i].fsp_hash); > + fortuna_state.fs_pool[i].fsp_length = 0; > } > - > - /* F&S - ReseedCNT = 0 */ > - fortuna_state.reseedcount = 0U; > - > - /* F&S - InitializeGenerator() */ > - > - /* F&S - C = 0 */ > - uint128_clear(&fortuna_state.counter.whole); > - > - /* F&S - K = 0 */ > - memset(&fortuna_state.key, 0, sizeof(fortuna_state.key)); > + fortuna_state.fs_reseedcount = 0; > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@freebsd.org Wed Jul 22 21:59:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AF4E9A839D; Wed, 22 Jul 2015 21:59:24 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03BFE105E; Wed, 22 Jul 2015 21:59:24 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZI22q-000L2c-A3; Wed, 22 Jul 2015 22:59:20 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: Date: Wed, 22 Jul 2015 22:59:14 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> To: Jeff Roberson X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 21:59:24 -0000 > On 22 Jul 2015, at 22:42, Jeff Roberson = wrote: >=20 > On Tue, 30 Jun 2015, Mark Murray wrote: >=20 >> - Add harvesting of slab allocator events. This needs to be checked = for >> weighing down the allocator code. >=20 > Neither filesystem operations nor allocations are random events. They = are trivially influenced by user code. A malicious attacker could = create repeated patterns of allocations or filesystem activity through = the syscall path to degrade your random sample source. I=E2=80=99m not sure I accept that - Fortuna is very careful about using = non-reversible hashing in it=E2=80=99s accumulation, and countering such = degradation is one of the algorithm=E2=80=99s strong points. There is = perhaps risk of *no* entropy, but even the per-event timing jitter will = be providing this, if nothing else. > Perhaps more importantly to me, this is an unacceptable performance = burden for the allocator. At a minimum it should compile out by = default. Great care has been taken to reduce the fast path of the = allocator to the minimum number of cycles and even cache misses. As currently set up in etc/rc.d/* by default, there is a simple check at = each UMA harvesting opportunity, and no further action. I asked Robert = Watson if this was burdensome, and he said it was not. I=E2=80=99m willing to discuss optimising this, and have plans for some = micro-benchmarks. M --=20 Mark R V Murray PS: Please trim mail when responding - was it necessary to send me back = the whole commit message and diff? From owner-svn-src-head@freebsd.org Wed Jul 22 22:53:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92B0F9A8E04; Wed, 22 Jul 2015 22:53:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 834E11B5E; Wed, 22 Jul 2015 22:53:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MMrfLd089274; Wed, 22 Jul 2015 22:53:41 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MMrfrc089273; Wed, 22 Jul 2015 22:53:41 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201507222253.t6MMrfrc089273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 22 Jul 2015 22:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285804 - head/sbin/mount_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.20 Precedence: list List-Id: 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, 22 Jul 2015 22:53:41 -0000 Author: cem Date: Wed Jul 22 22:53:40 2015 New Revision: 285804 URL: https://svnweb.freebsd.org/changeset/base/285804 Log: mount_nfs: Be more clear on nmount(2) error with errmsg unset Differential Revision: https://reviews.freebsd.org/D3147 Reviewed by: rmacklem Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/mount_nfs/mount_nfs.c Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Wed Jul 22 19:58:21 2015 (r285803) +++ head/sbin/mount_nfs/mount_nfs.c Wed Jul 22 22:53:40 2015 (r285804) @@ -476,7 +476,8 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); if (nmount(iov, iovlen, 0)) - err(1, "%s, %s", mntpath, errmsg); + err(1, "nmount: %s%s%s", mntpath, errmsg[0] ? ", " : "", + errmsg); exit(0); } From owner-svn-src-head@freebsd.org Wed Jul 22 22:55:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7C259A8E37 for ; Wed, 22 Jul 2015 22:55:20 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) (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 8E6071CF3 for ; Wed, 22 Jul 2015 22:55:20 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by pdrg1 with SMTP id g1so145666443pdr.2 for ; Wed, 22 Jul 2015 15:55:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; bh=ocaaglV+Xc6WmwwjHeATgSoI/PgaPT+0pf/2qxftXOQ=; b=N3db+N3S87VDzax/EV3uzhnGhCtfkEPytGuPDkAT0FI6Op9DkLX9Xja7hfkvhfTWAZ CHbzjWxmQPy4BydYWsAHOQGZgb8juIlW1tceBnjLoY8NqLjDa6pcZVh5nfzj9S2TVyO5 DfWY/HKD23rxQQgW1dNrvZMTsGGsu9v9M2SZ2YCEfKxGd9Ab8xYMav4WuHqRPObRJBmi cZja6qSCHsmvohSGXikrvFLLMxLwFqxVoZEq47rpjGGnbLHndEEkky754Xy/tK0VzcPE pSPrYq4r6BpbnnsUg/mhjstQHtkEKDEAdrECspRLadklLKAJBi2SgvL0idi5hMRR6RCm XKMw== X-Gm-Message-State: ALoCoQn0NkOGEWajNonoP+oieZ+ZbsDIpUDJYG79trggxsuRmj2Gwn5I6bxkK1FqdZBCVt3mav2P X-Received: by 10.70.38.10 with SMTP id c10mr11041193pdk.72.1437605714376; Wed, 22 Jul 2015 15:55:14 -0700 (PDT) Received: from rrcs-66-91-135-210.west.biz.rr.com (rrcs-66-91-135-210.west.biz.rr.com. [66.91.135.210]) by smtp.gmail.com with ESMTPSA id i10sm5154257pdr.78.2015.07.22.15.55.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 15:55:13 -0700 (PDT) Date: Wed, 22 Jul 2015 12:53:21 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Mark R V Murray cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... In-Reply-To: Message-ID: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) 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.20 Precedence: list List-Id: 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, 22 Jul 2015 22:55:20 -0000 On Wed, 22 Jul 2015, Mark R V Murray wrote: > >> On 22 Jul 2015, at 22:42, Jeff Roberson wrote: >> >> On Tue, 30 Jun 2015, Mark Murray wrote: >> >>> - Add harvesting of slab allocator events. This needs to be checked for >>> weighing down the allocator code. >> >> Neither filesystem operations nor allocations are random events. They are trivially influenced by user code. A malicious attacker could create repeated patterns of allocations or filesystem activity through the syscall path to degrade your random sample source. > > I?m not sure I accept that - Fortuna is very careful about using > non-reversible hashing in it?s accumulation, and countering such > degradation is one of the algorithm?s strong points. There is perhaps > risk of *no* entropy, but even the per-event timing jitter will be > providing this, if nothing else. > >> Perhaps more importantly to me, this is an unacceptable performance burden for the allocator. At a minimum it should compile out by default. Great care has been taken to reduce the fast path of the allocator to the minimum number of cycles and even cache misses. > > As currently set up in etc/rc.d/* by default, there is a simple check at > each UMA harvesting opportunity, and no further action. I asked Robert > Watson if this was burdensome, and he said it was not. I find this burdensome. You can easily add a macro around the calls or hide them in an inline with a default to off. Even a function call that checks a global and does nothing else is a handful of new cache misses. A microbenchmark will not realize the full cost of this. You will instead get the dozen or so instructions of overhead which I still find objectionable. Kip's observations about packet cycle budgets in high-performance applications are accurate and this is something we have put great care into over time. Thanks, Jeff > > I?m willing to discuss optimising this, and have plans for some > micro-benchmarks. > > M > -- > Mark R V Murray > > PS: Please trim mail when responding - was it necessary to send me back the whole commit message and diff? > From owner-svn-src-head@freebsd.org Wed Jul 22 23:19:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3F559A752D; Wed, 22 Jul 2015 23:19:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B0921A26; Wed, 22 Jul 2015 23:19:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MNJsGm097736; Wed, 22 Jul 2015 23:19:54 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MNJsse097735; Wed, 22 Jul 2015 23:19:54 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201507222319.t6MNJsse097735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 22 Jul 2015 23:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285805 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 23:19:54 -0000 Author: cem Date: Wed Jul 22 23:19:53 2015 New Revision: 285805 URL: https://svnweb.freebsd.org/changeset/base/285805 Log: vt: Default to cpu logos off Apologies, this was how it was supposed to land. Mea culpa. Differential Revision: https://reviews.freebsd.org/D3157 Reviewed by: gnn, hiren Approved by: markj (mentor) MFC after: 1 week Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed Jul 22 22:53:40 2015 (r285804) +++ head/sys/dev/vt/vt_core.c Wed Jul 22 23:19:53 2015 (r285805) @@ -137,7 +137,7 @@ static VT_SYSCTL_INT(kbd_panic, 0, "Enab /* Used internally, not a tunable. */ int vt_draw_logo_cpus; -VT_SYSCTL_INT(splash_cpu, 1, "Show logo CPUs during boot"); +VT_SYSCTL_INT(splash_cpu, 0, "Show logo CPUs during boot"); VT_SYSCTL_INT(splash_ncpu, 0, "Override number of logos displayed " "(0 = do not override)"); VT_SYSCTL_INT(splash_cpu_style, 1, "Draw logo style " From owner-svn-src-head@freebsd.org Wed Jul 22 23:23:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5888D9A76DD; Wed, 22 Jul 2015 23:23:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4140F1EC1; Wed, 22 Jul 2015 23:23:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MNNDng001714; Wed, 22 Jul 2015 23:23:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MNNDHQ001713; Wed, 22 Jul 2015 23:23:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201507222323.t6MNNDHQ001713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 22 Jul 2015 23:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285806 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 23:23:13 -0000 Author: cem Date: Wed Jul 22 23:23:12 2015 New Revision: 285806 URL: https://svnweb.freebsd.org/changeset/base/285806 Log: vt: Change default CPU logo to Orb Differential Revision: https://reviews.freebsd.org/D3156 Approved by: markj (mentor) MFC after: 1 week Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed Jul 22 23:19:53 2015 (r285805) +++ head/sys/dev/vt/vt_core.c Wed Jul 22 23:23:12 2015 (r285806) @@ -140,7 +140,7 @@ int vt_draw_logo_cpus; VT_SYSCTL_INT(splash_cpu, 0, "Show logo CPUs during boot"); VT_SYSCTL_INT(splash_ncpu, 0, "Override number of logos displayed " "(0 = do not override)"); -VT_SYSCTL_INT(splash_cpu_style, 1, "Draw logo style " +VT_SYSCTL_INT(splash_cpu_style, 2, "Draw logo style " "(0=Beastie, 1=Alternate beastie, 2=Orb)"); VT_SYSCTL_INT(splash_cpu_duration, 10, "Hide logos after (seconds)"); From owner-svn-src-head@freebsd.org Wed Jul 22 23:30:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D10BB9A7797; Wed, 22 Jul 2015 23:30:55 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF2971174; Wed, 22 Jul 2015 23:30:55 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6MNUtJP004956; Wed, 22 Jul 2015 23:30:55 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6MNUt4M004955; Wed, 22 Jul 2015 23:30:55 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201507222330.t6MNUt4M004955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 22 Jul 2015 23:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285807 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 23:30:55 -0000 Author: cem Date: Wed Jul 22 23:30:54 2015 New Revision: 285807 URL: https://svnweb.freebsd.org/changeset/base/285807 Log: vt: cpu logos: Correct reversed 0/1 beastie descriptions Differential Revision: https://reviews.freebsd.org/D3158 Approved by: markj (mentor) Obtained from: Pavel Timofeev MFC after: 1 week Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed Jul 22 23:23:12 2015 (r285806) +++ head/sys/dev/vt/vt_core.c Wed Jul 22 23:30:54 2015 (r285807) @@ -141,7 +141,7 @@ VT_SYSCTL_INT(splash_cpu, 0, "Show logo VT_SYSCTL_INT(splash_ncpu, 0, "Override number of logos displayed " "(0 = do not override)"); VT_SYSCTL_INT(splash_cpu_style, 2, "Draw logo style " - "(0=Beastie, 1=Alternate beastie, 2=Orb)"); + "(0 = Alternate beastie, 1 = Beastie, 2 = Orb)"); VT_SYSCTL_INT(splash_cpu_duration, 10, "Hide logos after (seconds)"); static struct vt_device vt_consdev; From owner-svn-src-head@freebsd.org Wed Jul 22 23:53:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 442E09A7C83 for ; Wed, 22 Jul 2015 23:53:47 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) (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 0BBD51EF1 for ; Wed, 22 Jul 2015 23:53:46 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by pdjr16 with SMTP id r16so148935692pdj.3 for ; Wed, 22 Jul 2015 16:53:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=qIw2+5/WLrel1Z54NfZ3YQUtilQnDJTEs0pwmVkpTT4=; b=EJfgM1gSOuQSh9MM6bJNoCRNRIhZuoWaSv4tP1VX8aJaeKdkeHzZbStw5siXDexcw1 nwAgnWh/6IWYYhf+E9nZzQsGZQEzDS0dUTnTXp/iu0gCJpQUvybwD9DlQ57GZKOZYzEw 4datsGySJHX2SqtyPPPpJcFzXKcZQ9GUHeGi+lvlYeLJyjewhaE6cXP2+CZpvHOWUCr3 6Dqop8y0MNfDpFX6FY17Ot9fZ4vxx7p1PjCnQ7IYSi0iURSM7mCQ1I0Hy4yooSo7knGK IIYGFkl0j6dOcjqgm8ohk2MfNk4QvgVru3i0TeGqFHsVFTbGmDr9Vk5YdFVwKIYqjyeY 7BiQ== X-Gm-Message-State: ALoCoQlnL/sHIlzkGs2IPNCI6XQpOtzKonxn7HtVKeakotzchyoXezTePDAcy+y5qIT/OPzWBARq X-Received: by 10.70.126.133 with SMTP id my5mr11635493pdb.14.1437609226104; Wed, 22 Jul 2015 16:53:46 -0700 (PDT) Received: from [10.64.26.8] ([69.53.236.236]) by smtp.gmail.com with ESMTPSA id pd10sm5285872pdb.66.2015.07.22.16.53.43 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jul 2015 16:53:44 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: multipart/signed; boundary="Apple-Mail=_76E4302A-79D1-46EF-8931-F01E6A8CEF5D"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5 From: Warner Losh In-Reply-To: Date: Wed, 22 Jul 2015 17:53:42 -0600 Cc: Mark R V Murray , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> To: Jeff Roberson X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 23:53:47 -0000 --Apple-Mail=_76E4302A-79D1-46EF-8931-F01E6A8CEF5D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 22, 2015, at 4:53 PM, Jeff Roberson = wrote: >=20 > On Wed, 22 Jul 2015, Mark R V Murray wrote: >=20 >>=20 >>> On 22 Jul 2015, at 22:42, Jeff Roberson = wrote: >>>=20 >>> On Tue, 30 Jun 2015, Mark Murray wrote: >>>=20 >>>> - Add harvesting of slab allocator events. This needs to be checked = for >>>> weighing down the allocator code. >>>=20 >>> Neither filesystem operations nor allocations are random events. = They are trivially influenced by user code. A malicious attacker could = create repeated patterns of allocations or filesystem activity through = the syscall path to degrade your random sample source. >>=20 >> I?m not sure I accept that - Fortuna is very careful about using = non-reversible hashing in it?s accumulation, and countering such = degradation is one of the algorithm?s strong points. There is perhaps = risk of *no* entropy, but even the per-event timing jitter will be = providing this, if nothing else. I=E2=80=99m not sure I=E2=80=99m happy about this answer. Do you have = some research backing up such cavalier claims? >>> Perhaps more importantly to me, this is an unacceptable performance = burden for the allocator. At a minimum it should compile out by = default. Great care has been taken to reduce the fast path of the = allocator to the minimum number of cycles and even cache misses. >>=20 >> As currently set up in etc/rc.d/* by default, there is a simple check = at each UMA harvesting opportunity, and no further action. I asked = Robert Watson if this was burdensome, and he said it was not. >=20 > I find this burdensome. You can easily add a macro around the calls = or hide them in an inline with a default to off. Even a function call = that checks a global and does nothing else is a handful of new cache = misses. A microbenchmark will not realize the full cost of this. You = will instead get the dozen or so instructions of overhead which I still = find objectionable. >=20 > Kip's observations about packet cycle budgets in high-performance = applications are accurate and this is something we have put great care = into over time. A certain video streaming company will be pushing the envelope to get to = 100Gbps very soon. Even a few extra instructions on every packet / = allocation will be a killer. Especially if one is an almost guaranteed = cache miss. This most certainly will be burdensome. There absolutely = must be a way to turn this off at compile time. We don=E2=80=99t care = that much about entropy to leave performance on the table. Warner --Apple-Mail=_76E4302A-79D1-46EF-8931-F01E6A8CEF5D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJVsC0GAAoJEGwc0Sh9sBEABMoP/RS5nLpQWvFqcEvQxigQEJrz nckGYKi9B849tjPIgfQnHbgrSLaME8IacCVLIE44UO3d3pAUd/xchKbY26ZNuTuO 1oVzxHDYyJ1IUYWBU2PYFe2LE87UkX7xf/Xd8M6i/2h5vxVhzWgQXm9XiKbiOLJm TDUoMs8UIRmNlGgdc6a9fPTxrhUjfLH1Bf5tPa7htln0hfKqu7wshC4M7NyVf6Y5 ylDv6gwbUiU8qHYGLxss7A/9Q9u4T7ShG+YX2+R5+k+MkDM914MgEHA2HT7mTdGA K4vaudFO2Rzr5dWfO9kLTY/TjphNB56XhQdHsF4sIvvpsLGaZvSNsRsLdkzhZmhn fF6gM+zuaZktxNl+aBjpZ+l36MWCfZLrgW2wlJenlAFfxMVoRqTWTMTQPkmKk/tA ycPBXdkNUeUbCzvOzsQJ5jBf+B328tqMvuYCeGwiFgtWrTO477fWUCzU1Q73Rvs6 JH4M5t7SVb6tj26U11msxZWbq7j3ceCmNR2DKrxCKooTytSmKL/wun754+UWdzje q/QWpe5XvPlx949bZ89liWEDE+nqMn4RIQYh8Ep9Vz6pox3QIr+zKIEk+JrQWDVF phdmv0TB1C765Me6Yz3CX3iWrMd2S9IxWWr1NWnr9Nx+3lduxLNJTf/6RKqZxn6O crtholQuf7YtE61UsTC7 =5VD9 -----END PGP SIGNATURE----- --Apple-Mail=_76E4302A-79D1-46EF-8931-F01E6A8CEF5D-- From owner-svn-src-head@freebsd.org Thu Jul 23 02:20:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C52AC9A85CB; Thu, 23 Jul 2015 02:20:42 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A991E1678; Thu, 23 Jul 2015 02:20:42 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6N2Kg8q070820; Thu, 23 Jul 2015 02:20:42 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6N2KgG9070819; Thu, 23 Jul 2015 02:20:42 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201507230220.t6N2KgG9070819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jul 2015 02:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285808 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 02:20:43 -0000 Author: jeff Date: Thu Jul 23 02:20:41 2015 New Revision: 285808 URL: https://svnweb.freebsd.org/changeset/base/285808 Log: - Don't defeat the FIFO nature of the buffer cache by eliminating the most recently used buffer when we are under paging pressure. This is a perversion of the buffer and page replacement algorithms and recent improvements to the page daemon have rendered it unnecessary. In the event that low-memory deadlocks become an issue it would be possible to make a daemon or event handler that performs a similar action on the oldest buffers rather than the newest. Since the buf cache is analogous to the page cache and some minimum working set is desired another possibility is to simply shrink the minimum working set which has less downside now that file pages are not directly mapped. Sponsored by: EMC / Isilon Reviewed by: alc, kib (with some minor objection) Tested by: pho Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Jul 22 23:30:54 2015 (r285807) +++ head/sys/kern/vfs_bio.c Thu Jul 23 02:20:41 2015 (r285808) @@ -1563,15 +1563,6 @@ buf_dirty_count_severe(void) return(numdirtybuffers >= hidirtybuffers); } -static __noinline int -buf_vm_page_count_severe(void) -{ - - KFAIL_POINT_CODE(DEBUG_FP, buf_pressure, return 1); - - return vm_page_count_severe(); -} - /* * brelse: * @@ -1647,20 +1638,9 @@ brelse(struct buf *bp) * * We still allow the B_INVAL case to call vfs_vmio_release(), even * if B_DELWRI is set. - * - * If B_DELWRI is not set we may have to set B_RELBUF if we are low - * on pages to return pages to the VM page queues. */ if (bp->b_flags & B_DELWRI) bp->b_flags &= ~B_RELBUF; - else if (buf_vm_page_count_severe()) { - /* - * BKGRDINPROG can only be set with the buf and bufobj - * locks both held. We tolerate a race to clear it here. - */ - if (!(bp->b_vflags & BV_BKGRDINPROG)) - bp->b_flags |= B_RELBUF; - } /* * VMIO buffer rundown. It is not very necessary to keep a VMIO buffer @@ -1875,20 +1855,6 @@ bqrelse(struct buf *bp) if ((bp->b_flags & B_DELWRI) == 0 && (bp->b_xflags & BX_VNDIRTY)) panic("bqrelse: not dirty"); - /* - * BKGRDINPROG can only be set with the buf and bufobj - * locks both held. We tolerate a race to clear it here. - */ - if (buf_vm_page_count_severe() && - (bp->b_vflags & BV_BKGRDINPROG) == 0) { - /* - * We are too low on memory, we have to try to free - * the buffer (most importantly: the wired pages - * making up its backing store) *now*. - */ - brelse(bp); - return; - } qindex = QUEUE_CLEAN; } binsfree(bp, qindex); @@ -1934,8 +1900,6 @@ vfs_vmio_release(struct buf *bp) vm_page_free(m); } else if (bp->b_flags & B_DIRECT) vm_page_try_to_free(m); - else if (buf_vm_page_count_severe()) - vm_page_try_to_cache(m); vm_page_unlock(m); } if (obj != NULL) From owner-svn-src-head@freebsd.org Thu Jul 23 07:03:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5FA49A6D65; Thu, 23 Jul 2015 07:03:59 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62CB61505; Thu, 23 Jul 2015 07:03:59 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZIAXr-000LWe-JR; Thu, 23 Jul 2015 08:03:56 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: Date: Thu, 23 Jul 2015 08:03:49 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 07:03:59 -0000 > On 23 Jul 2015, at 00:53, Warner Losh wrote: >=20 >>>> Neither filesystem operations nor allocations are random events. = They are trivially influenced by user code. A malicious attacker could = create repeated patterns of allocations or filesystem activity through = the syscall path to degrade your random sample source. >>>=20 >>> I?m not sure I accept that - Fortuna is very careful about using = non-reversible hashing in it?s accumulation, and countering such = degradation is one of the algorithm?s strong points. There is perhaps = risk of *no* entropy, but even the per-event timing jitter will be = providing this, if nothing else. >=20 > I=E2=80=99m not sure I=E2=80=99m happy about this answer. Do you have = some research backing up such cavalier claims? It was not my intention to sound cavalier. Apologies. Fortuna was developed to account for many sources of entropy, good and = bad alike, and Jeff=E2=80=99s observation is an attack on that design. I = accept that the randomness of these events is poor, but they are = high-rate, and this product of high-rate*low entropy is what I seek. I = pulled out numbers with dtrace, and basic statistics showed that the = harvesting was not useless. I completely understand that under the right = circumstances these numbers might be lousy - please read the Fortuna = design document to understand why this doesn=E2=80=99t matter. *ALL* = entropy inputs to Fortuna are considered attackable, including the = dedicated hardware sources. I have also read cryptanalyses of Fortuna, not all of them to be sure, = and so far the design appears strong. The best attack that I have seen = (very academic) suggests an improvement which I may incorporate. >>>> Perhaps more importantly to me, this is an unacceptable performance = burden for the allocator. At a minimum it should compile out by = default. Great care has been taken to reduce the fast path of the = allocator to the minimum number of cycles and even cache misses. >>>=20 >>> As currently set up in etc/rc.d/* by default, there is a simple = check at each UMA harvesting opportunity, and no further action. I asked = Robert Watson if this was burdensome, and he said it was not. >>=20 >> I find this burdensome. You can easily add a macro around the calls = or hide them in an inline with a default to off. Even a function call = that checks a global and does nothing else is a handful of new cache = misses. A microbenchmark will not realize the full cost of this. You = will instead get the dozen or so instructions of overhead which I still = find objectionable. >>=20 >> Kip's observations about packet cycle budgets in high-performance = applications are accurate and this is something we have put great care = into over time. >=20 > A certain video streaming company will be pushing the envelope to get = to 100Gbps very soon. Even a few extra instructions on every packet / = allocation will be a killer. Especially if one is an almost guaranteed = cache miss. This most certainly will be burdensome. There absolutely = must be a way to turn this off at compile time. We don=E2=80=99t care = that much about entropy to leave performance on the table. OK - I=E2=80=99m sold! I=E2=80=99ll make a kernel option defaulting to = off. :-) M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Thu Jul 23 08:01:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC95A9A7BCF for ; Thu, 23 Jul 2015 08:01:38 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36A1B1004 for ; Thu, 23 Jul 2015 08:01:37 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by pacan13 with SMTP id an13so155094942pac.1 for ; Thu, 23 Jul 2015 01:01:34 -0700 (PDT) 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:in-reply-to:message-id :references:user-agent:mime-version:content-type; bh=ybk7SHl/xqETe0rp8B7UbhazlXPo2IjWWSzoU2ZPW0o=; b=YUPmonR21MbM+K1D1r5dOMazKQkhTl77y7KIOXk7jioTtdcrolAC4MWXugVW7NDjkC nofqTjSJVyLxGq3n3RiAn9Q25u7V3/5pJlbwxNhcaOr7K0UH75QLIA+NZ0o3GOmQLMTp X/6uhJuNtxBUNsn6bHv9uNymYrLbbSfO51jqYQAewVupGtMTw5X0XMFUOHYTDB2OqrIh xW0dZSa7sPsa5JzXMJ+x7+mRVyrwiSYDLBTMpsJMbbauqbfPORunymQoolvHizZDzn5p Sj/Mh3oYEGzs+QrtdT4kvLmKe9VXi70rTYzjVccP2Sg0WSBWE48GhXsfrKfwOnY3iS4C HO2g== X-Gm-Message-State: ALoCoQk8f5lDg07LZ+mWfqQ47Itr9/86ItxLVw9gJ2bzhBsyxELbmQpWH4LU0nNBX6akh+aDKW45 X-Received: by 10.66.132.16 with SMTP id oq16mr15946422pab.13.1437638494205; Thu, 23 Jul 2015 01:01:34 -0700 (PDT) Received: from rrcs-66-91-135-210.west.biz.rr.com (rrcs-66-91-135-210.west.biz.rr.com. [66.91.135.210]) by smtp.gmail.com with ESMTPSA id j9sm1816220pdl.65.2015.07.23.01.01.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jul 2015 01:01:33 -0700 (PDT) Date: Wed, 22 Jul 2015 21:59:39 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Mark R V Murray cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... In-Reply-To: Message-ID: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) 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.20 Precedence: list List-Id: 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, 23 Jul 2015 08:01:38 -0000 On Thu, 23 Jul 2015, Mark R V Murray wrote: > >> On 23 Jul 2015, at 00:53, Warner Losh wrote: >> >>>>> Neither filesystem operations nor allocations are random events. They are trivially influenced by user code. A malicious attacker could create repeated patterns of allocations or filesystem activity through the syscall path to degrade your random sample source. >>>> >>>> I?m not sure I accept that - Fortuna is very careful about using non-reversible hashing in it?s accumulation, and countering such degradation is one of the algorithm?s strong points. There is perhaps risk of *no* entropy, but even the per-event timing jitter will be providing this, if nothing else. >> >> I?m not sure I?m happy about this answer. Do you have some research backing up such cavalier claims? > > It was not my intention to sound cavalier. Apologies. > > Fortuna was developed to account for many sources of entropy, good and bad alike, and Jeff?s observation is an attack on that design. I accept that the randomness of these events is poor, but they are high-rate, and this product of high-rate*low entropy is what I seek. I pulled out numbers with dtrace, and basic statistics showed that the harvesting was not useless. I completely understand that under the right circumstances these numbers might be lousy - please read the Fortuna design document to understand why this doesn?t matter. *ALL* entropy inputs to Fortuna are considered attackable, including the dedicated hardware sources. > > I have also read cryptanalyses of Fortuna, not all of them to be sure, and so far the design appears strong. The best attack that I have seen (very academic) suggests an improvement which I may incorporate. > >>>>> Perhaps more importantly to me, this is an unacceptable performance burden for the allocator. At a minimum it should compile out by default. Great care has been taken to reduce the fast path of the allocator to the minimum number of cycles and even cache misses. >>>> >>>> As currently set up in etc/rc.d/* by default, there is a simple check at each UMA harvesting opportunity, and no further action. I asked Robert Watson if this was burdensome, and he said it was not. >>> >>> I find this burdensome. You can easily add a macro around the calls or hide them in an inline with a default to off. Even a function call that checks a global and does nothing else is a handful of new cache misses. A microbenchmark will not realize the full cost of this. You will instead get the dozen or so instructions of overhead which I still find objectionable. >>> >>> Kip's observations about packet cycle budgets in high-performance applications are accurate and this is something we have put great care into over time. >> >> A certain video streaming company will be pushing the envelope to get to 100Gbps very soon. Even a few extra instructions on every packet / allocation will be a killer. Especially if one is an almost guaranteed cache miss. This most certainly will be burdensome. There absolutely must be a way to turn this off at compile time. We don?t care that much about entropy to leave performance on the table. > > OK - I?m sold! I?ll make a kernel option defaulting to off. :-) There are other sources that occur less frequently than millions of times per-second that may still provide some usefull entropy while being less performance critical under normal conditions. For example, context switches, traps, etc. I could also imagine wiring up a pmc counter to something like cache misses or branch mispredicts that would be more difficult to game, especially if the counter was cycled irregularly. Thanks, Jeff > > M > -- > Mark R V Murray > > From owner-svn-src-head@freebsd.org Thu Jul 23 08:09:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70FEF9A7C11; Thu, 23 Jul 2015 08:09:10 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EB1D11EF; Thu, 23 Jul 2015 08:09:10 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZIBYx-000Laa-8q; Thu, 23 Jul 2015 09:09:07 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: Date: Thu, 23 Jul 2015 09:09:01 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> To: Jeff Roberson X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 08:09:10 -0000 > On 23 Jul 2015, at 08:59, Jeff Roberson = wrote: >=20 >>=20 >> OK - I?m sold! I?ll make a kernel option defaulting to off. :-) >=20 > There are other sources that occur less frequently than millions of = times per-second that may still provide some usefull entropy while being = less performance critical under normal conditions. I=E2=80=99m sure there are, and I=E2=80=99m keen to discover more! I=E2=80= =99m not exactly the worlds best kernel hacker, so I=E2=80=99ll be = requesting help. My own crappy benchmark is =E2=80=9Cmake world=E2=80=9D and for that, I = notice very little. For Video at Ludicrous Speed(=E2=84=A2), I=E2=80=99m = well prepared to accept otherwise! For crypto purposes, UMA is = brilliant, though (but that won=E2=80=99t stop me defaulting it to = =E2=80=9Ccompiled out=E2=80=9D). > For example, context switches, traps, etc. I could also imagine = wiring up a pmc counter to something like cache misses or branch = mispredicts that would be more difficult to game, especially if the = counter was cycled irregularly. Help requested here, please! If you could point out suitable harvesting = points, I=E2=80=99ll see if the numbers from them look good. Thanks! M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Thu Jul 23 11:11:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7639C9A8311; Thu, 23 Jul 2015 11:11:02 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 670CB104A; Thu, 23 Jul 2015 11:11:02 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6NBB2U7006662; Thu, 23 Jul 2015 11:11:02 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6NBB2Ki006645; Thu, 23 Jul 2015 11:11:02 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201507231111.t6NBB2Ki006645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 23 Jul 2015 11:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285810 - 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.20 Precedence: list List-Id: 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, 23 Jul 2015 11:11:02 -0000 Author: ed Date: Thu Jul 23 11:11:01 2015 New Revision: 285810 URL: https://svnweb.freebsd.org/changeset/base/285810 Log: Allow cap_rights_{set,clear,is_set} to be called with no arguments. In the CloudABI code I sometimes call into cap_rights_* without providing any arguments. Though one could argue that this doesn't make sense, in this specific case it's hard to avoid, as the rights that should be tested against are forwarded by a couple of wrapper macros. Modified: head/sys/sys/capsicum.h Modified: head/sys/sys/capsicum.h ============================================================================== --- head/sys/sys/capsicum.h Thu Jul 23 05:26:09 2015 (r285809) +++ head/sys/sys/capsicum.h Thu Jul 23 11:11:01 2015 (r285810) @@ -315,16 +315,16 @@ __BEGIN_DECLS __cap_rights_init(CAP_RIGHTS_VERSION, __VA_ARGS__, 0ULL) cap_rights_t *__cap_rights_init(int version, cap_rights_t *rights, ...); -#define cap_rights_set(rights, ...) \ - __cap_rights_set((rights), __VA_ARGS__, 0ULL) +#define cap_rights_set(...) \ + __cap_rights_set(__VA_ARGS__, 0ULL) cap_rights_t *__cap_rights_set(cap_rights_t *rights, ...); -#define cap_rights_clear(rights, ...) \ - __cap_rights_clear((rights), __VA_ARGS__, 0ULL) +#define cap_rights_clear(...) \ + __cap_rights_clear(__VA_ARGS__, 0ULL) cap_rights_t *__cap_rights_clear(cap_rights_t *rights, ...); -#define cap_rights_is_set(rights, ...) \ - __cap_rights_is_set((rights), __VA_ARGS__, 0ULL) +#define cap_rights_is_set(...) \ + __cap_rights_is_set(__VA_ARGS__, 0ULL) bool __cap_rights_is_set(const cap_rights_t *rights, ...); bool cap_rights_is_valid(const cap_rights_t *rights); From owner-svn-src-head@freebsd.org Thu Jul 23 13:51:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BA599A7EB9 for ; Thu, 23 Jul 2015 13:51:54 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm26-vm1.bullet.mail.gq1.yahoo.com (nm26-vm1.bullet.mail.gq1.yahoo.com [98.136.216.128]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0CA11EC4 for ; Thu, 23 Jul 2015 13:51:53 +0000 (UTC) (envelope-from scott4long@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1437659115; bh=OJI/NuHC6PPAE7x3/p9xfwtSON+2KahkYfNDgS/xv0M=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=AzhoahW8mN3pRtO5237k6wMjrZGKk+M22sCEhb0fo7JcHrZ/ty1bgaiWgAOB+tdWQsTJzuy6MYt/VdmjKAQK/NlHgDrwob+5+jcn1fxwqLat0UuzdbqL9YO8LTUXB0mLhKnkUzoU4Mcza5EfTdIA+g5J9n9bTox1FzGsamUg+Mdr6qz20mq9V1uhfrhWF+AJkMBJL6TZaQzf+Wnm5PpBI+XKnS9V/xq80tX5gx1+MXrsybF6ELZ0B2XUWRcTiRbg9IfXp+qTSQsnCvYeK8hsHjiE8xp8Bnpbze8IL2sPNkESkOm/3R6rr+gTss2d+LmVMPYhcMNNcJnX8O+wOvcGyg== Received: from [98.137.12.190] by nm26.bullet.mail.gq1.yahoo.com with NNFMP; 23 Jul 2015 13:45:15 -0000 Received: from [208.71.42.214] by tm11.bullet.mail.gq1.yahoo.com with NNFMP; 23 Jul 2015 13:45:15 -0000 Received: from [127.0.0.1] by smtp225.mail.gq1.yahoo.com with NNFMP; 23 Jul 2015 13:45:15 -0000 X-Yahoo-Newman-Id: 516106.92753.bm@smtp225.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: jS3AXXwVM1nW8NN.0U_0zheLyxxPzkF1nsiy0PfyzJgnexM Zg6x3IC7oYsjO7r.h.cZuYeNfoiSB45YZr3.p.W13c3z8Or9W2LHi_Cpwe6x kPFEdHo8JeEckUyFCQIaEWvVPdg16Ip5_m.OyOKxmYzHe_JuN0xWhK7aCwb6 xgR_R2Qf4P5X94UqJC5ZQb.XMBEVzH5tX8BWCnPRl_cj9TkCAw9OOCqfuqem F.xjiv81klUz4dstObk3QBn4M8pYnWwSNmg5RjzFtN3aVbIFlJ.EXCiXVWrH SFl6D_aR9Howmvopiip6YH4g.k_.pbcoi3aKRYTtl4h0A1bQihyTCtBqC94N NonrKi5DyOZm_gFoPoOUw5v6ChfURdNjtJvAMANxaFtYkwR1OpxcAPYeozkl vnf9iChui6K3tzkRGdL8ekiXfwPh9PzvKAbuRguqUYFQOG8H1L58JiTgYiJH Ya68FIyaL.UbwgifhZAvdTe5K.4iVM6PHH1cM0sc9t7EqPoFrrbaDQC8C2ZJ UkQIrUH7bMabNZNJBwQfH1I.8MP58fw-- X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... From: Scott Long In-Reply-To: Date: Thu, 23 Jul 2015 07:45:14 -0600 Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> To: Mark R V Murray X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 13:51:54 -0000 > On Jul 23, 2015, at 1:03 AM, Mark R V Murray = wrote: >=20 >=20 >> On 23 Jul 2015, at 00:53, Warner Losh wrote: >>=20 >>>>> Neither filesystem operations nor allocations are random events. = They are trivially influenced by user code. A malicious attacker could = create repeated patterns of allocations or filesystem activity through = the syscall path to degrade your random sample source. >>>>=20 >>>> I?m not sure I accept that - Fortuna is very careful about using = non-reversible hashing in it?s accumulation, and countering such = degradation is one of the algorithm?s strong points. There is perhaps = risk of *no* entropy, but even the per-event timing jitter will be = providing this, if nothing else. >>=20 >> I=E2=80=99m not sure I=E2=80=99m happy about this answer. Do you have = some research backing up such cavalier claims? >=20 > It was not my intention to sound cavalier. Apologies. >=20 > Fortuna was developed to account for many sources of entropy, good and = bad alike, and Jeff=E2=80=99s observation is an attack on that design. I = accept that the randomness of these events is poor, but they are = high-rate, and this product of high-rate*low entropy is what I seek. I = pulled out numbers with dtrace, and basic statistics showed that the = harvesting was not useless. I completely understand that under the right = circumstances these numbers might be lousy - please read the Fortuna = design document to understand why this doesn=E2=80=99t matter. *ALL* = entropy inputs to Fortuna are considered attackable, including the = dedicated hardware sources. >=20 > I have also read cryptanalyses of Fortuna, not all of them to be sure, = and so far the design appears strong. The best attack that I have seen = (very academic) suggests an improvement which I may incorporate. >=20 >>>>> Perhaps more importantly to me, this is an unacceptable = performance burden for the allocator. At a minimum it should compile = out by default. Great care has been taken to reduce the fast path of the = allocator to the minimum number of cycles and even cache misses. >>>>=20 >>>> As currently set up in etc/rc.d/* by default, there is a simple = check at each UMA harvesting opportunity, and no further action. I asked = Robert Watson if this was burdensome, and he said it was not. >>>=20 >>> I find this burdensome. You can easily add a macro around the calls = or hide them in an inline with a default to off. Even a function call = that checks a global and does nothing else is a handful of new cache = misses. A microbenchmark will not realize the full cost of this. You = will instead get the dozen or so instructions of overhead which I still = find objectionable. >>>=20 >>> Kip's observations about packet cycle budgets in high-performance = applications are accurate and this is something we have put great care = into over time. >>=20 >> A certain video streaming company will be pushing the envelope to get = to 100Gbps very soon. Even a few extra instructions on every packet / = allocation will be a killer. Especially if one is an almost guaranteed = cache miss. This most certainly will be burdensome. There absolutely = must be a way to turn this off at compile time. We don=E2=80=99t care = that much about entropy to leave performance on the table. >=20 > OK - I=E2=80=99m sold! I=E2=80=99ll make a kernel option defaulting to = off. :-) >=20 >=20 Hi Mark, Thanks for making this concession. I wanted to add a bit of historical = perspective. When Yarrow was introduced in the previous decade, it was = initially wired into nearly all interrupt sources. It turned out to be = so expensive to those sources, especially for high-speed sources at the = time like network and caching RAID drivers, that we then spent months = disabling it from those sources. In the end, a lot of code thrash = happened and the effectiveness of Yarrow was questionable. Fast forward to now with your recent work. If UMA becomes expensive for = high-speed use, everyone will go back to developing private per-driver = and per-subsystem allocators to avoid it. This will happen whether or = not the UMA collector is controllable at run-time; if it=E2=80=99s = enabled by default, benchmarks will be impacted and people will react. = That=E2=80=99ll be a huge step backwards for FreeBSD. I also strongly agree with Jeff=E2=80=99s point on the questionable = nature of this kind of fast-and-monotonic entropy collection, and Warner = and Kip=E2=80=99s point on the finite number of clock cycles available = for doing 100Gb networking. If really high quality entropy is desired, = won=E2=80=99t most serious people use a hardware source instead of a = software source? Not that I think that software entropy is useless, but = it=E2=80=99s a question of how much effort and tradeoffs are put into it = for what result. An academically beautiful entropy system that = hamstrings the OS from doing other essential things isn=E2=80=99t all = that interesting, IMO. Scott From owner-svn-src-head@freebsd.org Thu Jul 23 13:52:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E8AC9A7F54; Thu, 23 Jul 2015 13:52:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F34F5115B; Thu, 23 Jul 2015 13:52:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6NDqsIp075411; Thu, 23 Jul 2015 13:52:54 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6NDqsn5075410; Thu, 23 Jul 2015 13:52:54 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201507231352.t6NDqsn5075410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 23 Jul 2015 13:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285812 - head/sys/compat/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 13:52:55 -0000 Author: ed Date: Thu Jul 23 13:52:53 2015 New Revision: 285812 URL: https://svnweb.freebsd.org/changeset/base/285812 Log: Allow us to create UNIX sockets and socketpairs in CloudABI processes. Modified: head/sys/compat/cloudabi/cloudabi_fd.c Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Thu Jul 23 13:22:13 2015 (r285811) +++ head/sys/compat/cloudabi/cloudabi_fd.c Thu Jul 23 13:52:53 2015 (r285812) @@ -46,18 +46,51 @@ int cloudabi_sys_fd_create1(struct thread *td, struct cloudabi_sys_fd_create1_args *uap) { + struct socket_args socket_args = { + .domain = AF_UNIX, + }; - /* Not implemented. */ - return (ENOSYS); + switch (uap->type) { + case CLOUDABI_FILETYPE_SOCKET_DGRAM: + socket_args.type = SOCK_DGRAM; + return (sys_socket(td, &socket_args)); + case CLOUDABI_FILETYPE_SOCKET_SEQPACKET: + socket_args.type = SOCK_SEQPACKET; + return (sys_socket(td, &socket_args)); + case CLOUDABI_FILETYPE_SOCKET_STREAM: + socket_args.type = SOCK_STREAM; + return (sys_socket(td, &socket_args)); + default: + return (EINVAL); + } } int cloudabi_sys_fd_create2(struct thread *td, struct cloudabi_sys_fd_create2_args *uap) { + int fds[2]; + int error; - /* Not implemented. */ - return (ENOSYS); + switch (uap->type) { + case CLOUDABI_FILETYPE_SOCKET_DGRAM: + error = kern_socketpair(td, AF_UNIX, SOCK_DGRAM, 0, fds); + break; + case CLOUDABI_FILETYPE_SOCKET_SEQPACKET: + error = kern_socketpair(td, AF_UNIX, SOCK_SEQPACKET, 0, fds); + break; + case CLOUDABI_FILETYPE_SOCKET_STREAM: + error = kern_socketpair(td, AF_UNIX, SOCK_STREAM, 0, fds); + break; + default: + return (EINVAL); + } + + if (error == 0) { + td->td_retval[0] = fds[0]; + td->td_retval[1] = fds[1]; + } + return (0); } int From owner-svn-src-head@freebsd.org Thu Jul 23 15:35:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8683C9A848C; Thu, 23 Jul 2015 15:35:09 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A4741852; Thu, 23 Jul 2015 15:35:09 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6NFZ9R9018633; Thu, 23 Jul 2015 15:35:09 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6NFZ98w018632; Thu, 23 Jul 2015 15:35:09 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201507231535.t6NFZ98w018632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 23 Jul 2015 15:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285815 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 15:35:09 -0000 Author: jimharris Date: Thu Jul 23 15:35:08 2015 New Revision: 285815 URL: https://svnweb.freebsd.org/changeset/base/285815 Log: nvme: properly handle case where pci_alloc_msix does not alloc all vectors Reported by: Sean Kelly MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Jul 23 15:32:58 2015 (r285814) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jul 23 15:35:08 2015 (r285815) @@ -930,7 +930,8 @@ nvme_ctrlr_construct(struct nvme_control { union cap_lo_register cap_lo; union cap_hi_register cap_hi; - int i, num_vectors, per_cpu_io_queues, rid; + int i, per_cpu_io_queues, rid; + int num_vectors_requested, num_vectors_allocated; int status, timeout_period; ctrlr->dev = dev; @@ -988,7 +989,7 @@ nvme_ctrlr_construct(struct nvme_control } /* One vector per IO queue, plus one vector for admin queue. */ - num_vectors = ctrlr->num_io_queues + 1; + num_vectors_requested = ctrlr->num_io_queues + 1; /* * If we cannot even allocate 2 vectors (one for admin, one for @@ -997,15 +998,36 @@ nvme_ctrlr_construct(struct nvme_control if (pci_msix_count(dev) < 2) { ctrlr->msix_enabled = 0; goto intx; - } else if (pci_msix_count(dev) < num_vectors) { + } else if (pci_msix_count(dev) < num_vectors_requested) { ctrlr->per_cpu_io_queues = FALSE; ctrlr->num_io_queues = 1; - num_vectors = 2; /* one for admin, one for I/O */ + num_vectors_requested = 2; /* one for admin, one for I/O */ } - if (pci_alloc_msix(dev, &num_vectors) != 0) { + num_vectors_allocated = num_vectors_requested; + if (pci_alloc_msix(dev, &num_vectors_allocated) != 0) { ctrlr->msix_enabled = 0; goto intx; + } else if (num_vectors_allocated < num_vectors_requested) { + if (num_vectors_allocated < 2) { + pci_release_msi(dev); + ctrlr->msix_enabled = 0; + goto intx; + } else { + ctrlr->per_cpu_io_queues = FALSE; + ctrlr->num_io_queues = 1; + /* + * Release whatever vectors were allocated, and just + * reallocate the two needed for the admin and single + * I/O qpair. + */ + num_vectors_allocated = 2; + pci_release_msi(dev); + if (pci_alloc_msix(dev, &num_vectors_allocated) != 0) + panic("could not reallocate any vectors\n"); + if (num_vectors_allocated != 2) + panic("could not reallocate 2 vectors\n"); + } } /* @@ -1022,7 +1044,7 @@ nvme_ctrlr_construct(struct nvme_control * vendors wishing to import this driver into kernels based on * older versions of FreeBSD. */ - for (i = 0; i < num_vectors; i++) { + for (i = 0; i < num_vectors_allocated; i++) { rid = i + 1; ctrlr->msi_res[i] = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, &rid, RF_ACTIVE); From owner-svn-src-head@freebsd.org Thu Jul 23 15:50:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B95039A8A61; Thu, 23 Jul 2015 15:50:40 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F8DB1623; Thu, 23 Jul 2015 15:50:40 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6NFoeeo023423; Thu, 23 Jul 2015 15:50:40 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6NFoe4c023422; Thu, 23 Jul 2015 15:50:40 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201507231550.t6NFoe4c023422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 23 Jul 2015 15:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285816 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 15:50:40 -0000 Author: jimharris Date: Thu Jul 23 15:50:39 2015 New Revision: 285816 URL: https://svnweb.freebsd.org/changeset/base/285816 Log: nvme: ensure csts.rdy bit is cleared before returning from nvme_ctrlr_disable PR: 200458 MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Jul 23 15:35:08 2015 (r285815) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jul 23 15:50:39 2015 (r285816) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012-2014 Intel Corporation + * Copyright (C) 2012-2015 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -207,7 +207,7 @@ nvme_ctrlr_fail_req_task(void *arg, int } static int -nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr) +nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr, int desired_val) { int ms_waited; union cc_register cc; @@ -216,18 +216,19 @@ nvme_ctrlr_wait_for_ready(struct nvme_co cc.raw = nvme_mmio_read_4(ctrlr, cc); csts.raw = nvme_mmio_read_4(ctrlr, csts); - if (!cc.bits.en) { - nvme_printf(ctrlr, "%s called with cc.en = 0\n", __func__); + if (cc.bits.en != desired_val) { + nvme_printf(ctrlr, "%s called with desired_val = %d " + "but cc.en = %d\n", __func__, desired_val, cc.bits.en); return (ENXIO); } ms_waited = 0; - while (!csts.bits.rdy) { + while (csts.bits.rdy != desired_val) { DELAY(1000); if (ms_waited++ > ctrlr->ready_timeout_in_ms) { - nvme_printf(ctrlr, "controller did not become ready " - "within %d ms\n", ctrlr->ready_timeout_in_ms); + nvme_printf(ctrlr, "controller ready did not become %d " + "within %d ms\n", desired_val, ctrlr->ready_timeout_in_ms); return (ENXIO); } csts.raw = nvme_mmio_read_4(ctrlr, csts); @@ -246,11 +247,12 @@ nvme_ctrlr_disable(struct nvme_controlle csts.raw = nvme_mmio_read_4(ctrlr, csts); if (cc.bits.en == 1 && csts.bits.rdy == 0) - nvme_ctrlr_wait_for_ready(ctrlr); + nvme_ctrlr_wait_for_ready(ctrlr, 1); cc.bits.en = 0; nvme_mmio_write_4(ctrlr, cc, cc.raw); DELAY(5000); + nvme_ctrlr_wait_for_ready(ctrlr, 0); } static int @@ -267,7 +269,7 @@ nvme_ctrlr_enable(struct nvme_controller if (csts.bits.rdy == 1) return (0); else - return (nvme_ctrlr_wait_for_ready(ctrlr)); + return (nvme_ctrlr_wait_for_ready(ctrlr, 1)); } nvme_mmio_write_8(ctrlr, asq, ctrlr->adminq.cmd_bus_addr); @@ -295,7 +297,7 @@ nvme_ctrlr_enable(struct nvme_controller nvme_mmio_write_4(ctrlr, cc, cc.raw); DELAY(5000); - return (nvme_ctrlr_wait_for_ready(ctrlr)); + return (nvme_ctrlr_wait_for_ready(ctrlr, 1)); } int From owner-svn-src-head@freebsd.org Thu Jul 23 17:27:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABE399A98DD; Thu, 23 Jul 2015 17:27:11 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C7401442; Thu, 23 Jul 2015 17:27:11 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6NHRBBj064318; Thu, 23 Jul 2015 17:27:11 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6NHRB8K064317; Thu, 23 Jul 2015 17:27:11 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201507231727.t6NHRB8K064317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 23 Jul 2015 17:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285817 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 17:27:11 -0000 Author: brooks Date: Thu Jul 23 17:27:10 2015 New Revision: 285817 URL: https://svnweb.freebsd.org/changeset/base/285817 Log: Document the fact that tunables can be set in device.hints. Reviewed by: wblock MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D3153 Modified: head/share/man/man5/device.hints.5 Modified: head/share/man/man5/device.hints.5 ============================================================================== --- head/share/man/man5/device.hints.5 Thu Jul 23 15:50:39 2015 (r285816) +++ head/share/man/man5/device.hints.5 Thu Jul 23 17:27:10 2015 (r285817) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 11, 2009 +.Dd July 23, 2015 .Dt DEVICE.HINTS 5 .Os .Sh NAME @@ -41,9 +41,8 @@ passed to the kernel. It contains various variables to control the boot behavior of the kernel. These variables are typically -.Dq device hints . -.\" .Dq device hints , -.\" and other control variables. +.Dq device hints , +but can include any kernel tunable values. .Pp The file contains one variable per line. Lines starting with the @@ -152,12 +151,11 @@ The following example disables the ACPI .Bd -literal -offset indent hint.acpi.0.disabled="1" .Ed -.\" .Pp -.\" A control variable may look like: -.\" .Pp -.\" .Bd -literal -offset indent -.\" debug.acpi.layer="ACPI_RESOURCES" -.\" .Ed +.Pp +Setting a tunable variable: +.Bd -literal -offset indent +vm.pmap.pg_ps_enabled=1 +.Ed .Sh SEE ALSO .Xr kenv 1 , .Xr loader.conf 5 , From owner-svn-src-head@freebsd.org Thu Jul 23 17:30:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 951FD9A9953; Thu, 23 Jul 2015 17:30:16 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 78CF4169B; Thu, 23 Jul 2015 17:30:16 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 76F1115D0; Thu, 23 Jul 2015 17:30:16 +0000 (UTC) Date: Thu, 23 Jul 2015 17:30:16 +0000 From: Alexey Dokuchaev To: Scott Long Cc: Mark R V Murray , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Message-ID: <20150723173016.GA86452@FreeBSD.org> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 17:30:16 -0000 [ Guys, please teach your MUA to wrap messages over 72-76 boundary and trim excessive/irrelevant quoting, thank you. ] On Thu, Jul 23, 2015 at 07:45:14AM -0600, Scott Long via svn-src-all wrote: > > On Jul 23, 2015, at 1:03 AM, Mark R V Murray wrote: > > Fortuna was developed to account for many sources of entropy, good and > > bad alike, and Jeff's observation is an attack on that design. I accept > > that the randomness of these events is poor, but they are high-rate, and > > this product of high-rate*low entropy is what I seek. I pulled out > > numbers with dtrace, and basic statistics showed that the harvesting was > > not useless. I completely understand that under the right circumstances > > these numbers might be lousy - please read the Fortuna design document > > to understand why this doesn't matter. *ALL* entropy inputs to Fortuna > > are considered attackable, including the dedicated hardware sources. > > > > I have also read cryptanalyses of Fortuna, not all of them to be sure, > > and so far the design appears strong. The best attack that I have seen > > (very academic) suggests an improvement which I may incorporate. [...] Being not a crypto-guy by any means, I find this reasoning sound and fair. But read on... > Hi Mark, > > Thanks for making this concession. I wanted to add a bit of historical > perspective. When Yarrow was introduced in the previous decade, it was > initially wired into nearly all interrupt sources. It turned out to be > so expensive to those sources [that in] the end, a lot of code thrash > happened and the effectiveness of Yarrow was questionable. > > Fast forward to now with your recent work. If UMA becomes expensive for > high-speed use, everyone will go back to developing private per-driver > and per-subsystem allocators to avoid it. [...] That'll be a huge step > backwards for FreeBSD. > > I also strongly agree with Jeff's point on the questionable nature of > this kind of fast-and-monotonic entropy collection, and Warner and Kip's > point on the finite number of clock cycles available for doing 100Gb > networking. If really high quality entropy is desired, won't most > serious people use a hardware source instead of a software source? [...] > An academically beautiful entropy system that hamstrings the OS from > doing other essential things isn't all that interesting, IMO. So far it looks like this to me (having read no papers): 1) Fortuna attempts to get the most entropy from all available sources, trusting none of them. (Which is good.) 2) Some of them might/will cause unwanted performance loss under certain circumstances, which becomes a show-stopper (finite number of clock cycles available, etc.) for some use cases. If Fortuna is so flexible, why can't some of its sources be conditionally disabled (kernel option/boot.conf/systct) or down-weighted through some more sophisticated, self-adjusting configuration technique during runtime? How dynamic it is? Mark, is there a (algorithmically?) reliable way to tell how many bits of "good" entropy is being added to the pool, and then tune the harvesting strategy accordingly? Is there some sort of restricted, private API to get a clue about current entropy status? ./danfe From owner-svn-src-head@freebsd.org Thu Jul 23 18:11:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 181B49A90DA; Thu, 23 Jul 2015 18:11:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0851E1F74; Thu, 23 Jul 2015 18:11:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6NIBr7f085393; Thu, 23 Jul 2015 18:11:53 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6NIBrId085392; Thu, 23 Jul 2015 18:11:53 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201507231811.t6NIBrId085392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 23 Jul 2015 18:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285818 - head/release/doc/en_US.ISO8859-1/relnotes stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 18:11:54 -0000 Author: gjb Date: Thu Jul 23 18:11:52 2015 New Revision: 285818 URL: https://svnweb.freebsd.org/changeset/base/285818 Log: Refine the PAE_TABLES entry based on feedback from kib and jhb. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Changes in other areas also in this revision: Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jul 23 17:27:10 2015 (r285817) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jul 23 18:11:52 2015 (r285818) @@ -803,7 +803,16 @@ The PAE_TABLES kernel configuration option has been added for &os;/&arch.i386;, which instructs &man.pmap.9; - to use PAE format for page tables. + to use PAE format for page tables with + 32-bit physical addresses. Unlike the PAE + option, PAE_TABLES preserves kernel binary + interface (KBI) compatibility with + non-PAE kernels, allowing + non-PAE kernel modules and drivers to work + with a PAE_TABLES-enabled kernel. + Additionally, system limits are tuned for 4GB maximum + RAM, avoiding kernel virtual address space + (KVA) exhaustion. The SIFTR kernel configuration has been added, allowing building &man.siftr.4; From owner-svn-src-head@freebsd.org Thu Jul 23 19:13:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF4899A9B60; Thu, 23 Jul 2015 19:13:44 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B42181FBF; Thu, 23 Jul 2015 19:13:44 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6NJDiqI010840; Thu, 23 Jul 2015 19:13:44 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6NJDglX010830; Thu, 23 Jul 2015 19:13:42 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201507231913.t6NJDglX010830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jul 2015 19:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285819 - in head/sys: cam dev/nvme kern sys ufs/ffs vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 19:13:44 -0000 Author: jeff Date: Thu Jul 23 19:13:41 2015 New Revision: 285819 URL: https://svnweb.freebsd.org/changeset/base/285819 Log: Refactor unmapped buffer address handling. - Use pointer assignment rather than a combination of pointers and flags to switch buffers between unmapped and mapped. This eliminates multiple flags and generally simplifies the logic. - Eliminate b_saveaddr since it is only used with pager bufs which have their b_data re-initialized on each allocation. - Gather up some convenience routines in the buffer cache for manipulating buf space and buf malloc space. - Add an inline, buf_mapped(), to standardize checks around unmapped buffers. In collaboration with: mlaier Reviewed by: kib Tested by: pho (many small revisions ago) Sponsored by: EMC / Isilon Storage Division Modified: head/sys/cam/cam_periph.c head/sys/dev/nvme/nvme_ctrlr.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/sys/buf.h head/sys/ufs/ffs/ffs_rawread.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/vm/swap_pager.c head/sys/vm/vm_pager.c head/sys/vm/vnode_pager.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Thu Jul 23 18:11:52 2015 (r285818) +++ head/sys/cam/cam_periph.c Thu Jul 23 19:13:41 2015 (r285819) @@ -855,12 +855,12 @@ cam_periph_mapmem(union ccb *ccb, struct */ mapinfo->bp[i] = getpbuf(NULL); - /* save the buffer's data address */ - mapinfo->bp[i]->b_saveaddr = mapinfo->bp[i]->b_data; - /* put our pointer in the data slot */ mapinfo->bp[i]->b_data = *data_ptrs[i]; + /* save the user's data address */ + mapinfo->bp[i]->b_caller1 = *data_ptrs[i]; + /* set the transfer length, we know it's < MAXPHYS */ mapinfo->bp[i]->b_bufsize = lengths[i]; @@ -877,7 +877,7 @@ cam_periph_mapmem(union ccb *ccb, struct */ if (vmapbuf(mapinfo->bp[i], 1) < 0) { for (j = 0; j < i; ++j) { - *data_ptrs[j] = mapinfo->bp[j]->b_saveaddr; + *data_ptrs[j] = mapinfo->bp[j]->b_caller1; vunmapbuf(mapinfo->bp[j]); relpbuf(mapinfo->bp[j], NULL); } @@ -958,7 +958,7 @@ cam_periph_unmapmem(union ccb *ccb, stru for (i = 0; i < numbufs; i++) { /* Set the user's pointer back to the original value */ - *data_ptrs[i] = mapinfo->bp[i]->b_saveaddr; + *data_ptrs[i] = mapinfo->bp[i]->b_caller1; /* unmap the buffer */ vunmapbuf(mapinfo->bp[i]); Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Jul 23 18:11:52 2015 (r285818) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jul 23 19:13:41 2015 (r285819) @@ -840,7 +840,6 @@ nvme_ctrlr_passthrough_cmd(struct nvme_c */ PHOLD(curproc); buf = getpbuf(NULL); - buf->b_saveaddr = buf->b_data; buf->b_data = pt->buf; buf->b_bufsize = pt->len; buf->b_iocmd = pt->is_read ? BIO_READ : BIO_WRITE; Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Jul 23 18:11:52 2015 (r285818) +++ head/sys/kern/vfs_bio.c Thu Jul 23 19:13:41 2015 (r285819) @@ -137,12 +137,11 @@ SYSCTL_PROC(_vfs, OID_AUTO, bufspace, CT &bufspace, 0, sysctl_bufspace, "L", "Virtual memory used for buffers"); #else SYSCTL_LONG(_vfs, OID_AUTO, bufspace, CTLFLAG_RD, &bufspace, 0, - "Virtual memory used for buffers"); + "Physical memory used for buffers"); #endif -static long unmapped_bufspace; -SYSCTL_LONG(_vfs, OID_AUTO, unmapped_bufspace, CTLFLAG_RD, - &unmapped_bufspace, 0, - "Amount of unmapped buffers, inclusive in the bufspace"); +static long bufkvaspace; +SYSCTL_LONG(_vfs, OID_AUTO, bufkvaspace, CTLFLAG_RD, &bufkvaspace, 0, + "Kernel virtual memory used for buffers"); static long maxbufspace; SYSCTL_LONG(_vfs, OID_AUTO, maxbufspace, CTLFLAG_RD, &maxbufspace, 0, "Maximum allowed value of bufspace (including buf_daemon)"); @@ -454,15 +453,14 @@ bdirtyadd(void) * sufficient buffer space. Buffer space becomes recoverable when * bp's get placed back in the queues. */ - static __inline void bufspacewakeup(void) { int need_wakeup, on; /* - * If someone is waiting for BUF space, wake them up. Even - * though we haven't freed the kva space yet, the waiting + * If someone is waiting for bufspace, wake them up. Even + * though we may not have freed the kva space yet, the waiting * process will be able to now. */ rw_rlock(&nblock); @@ -482,6 +480,50 @@ bufspacewakeup(void) } /* + * bufspaceadjust: + * + * Adjust the reported bufspace for a KVA managed buffer, possibly + * waking any waiters. + */ +static void +bufspaceadjust(struct buf *bp, int bufsize) +{ + int diff; + + KASSERT((bp->b_flags & B_MALLOC) == 0, + ("bufspaceadjust: malloc buf %p", bp)); + diff = bufsize - bp->b_bufsize; + if (diff < 0) { + atomic_subtract_long(&bufspace, -diff); + bufspacewakeup(); + } else + atomic_add_long(&bufspace, diff); + bp->b_bufsize = bufsize; +} + +/* + * bufmallocadjust: + * + * Adjust the reported bufspace for a malloc managed buffer, possibly + * waking any waiters. + */ +static void +bufmallocadjust(struct buf *bp, int bufsize) +{ + int diff; + + KASSERT((bp->b_flags & B_MALLOC) != 0, + ("bufmallocadjust: non-malloc buf %p", bp)); + diff = bufsize - bp->b_bufsize; + if (diff < 0) { + atomic_subtract_long(&bufmallocspace, -diff); + bufspacewakeup(); + } else + atomic_add_long(&bufmallocspace, diff); + bp->b_bufsize = bufsize; +} + +/* * runningwakeup: * * Wake up processes that are waiting on asynchronous writes to fall @@ -817,6 +859,8 @@ bufinit(void) for (i = 0; i < BUFFER_QUEUES; i++) TAILQ_INIT(&bufqueues[i]); + unmapped_buf = (caddr_t)kva_alloc(MAXPHYS); + /* finally, initialize each buffer header and stick on empty q */ for (i = 0; i < nbuf; i++) { bp = &buf[i]; @@ -826,6 +870,7 @@ bufinit(void) bp->b_wcred = NOCRED; bp->b_qindex = QUEUE_EMPTY; bp->b_xflags = 0; + bp->b_data = bp->b_kvabase = unmapped_buf; LIST_INIT(&bp->b_dep); BUF_LOCKINIT(bp); TAILQ_INSERT_TAIL(&bufqueues[QUEUE_EMPTY], bp, b_freelist); @@ -900,7 +945,6 @@ bufinit(void) bogus_page = vm_page_alloc(NULL, 0, VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL | VM_ALLOC_WIRED); - unmapped_buf = (caddr_t)kva_alloc(MAXPHYS); } #ifdef INVARIANTS @@ -908,8 +952,6 @@ static inline void vfs_buf_check_mapped(struct buf *bp) { - KASSERT((bp->b_flags & B_UNMAPPED) == 0, - ("mapped buf %p %x", bp, bp->b_flags)); KASSERT(bp->b_kvabase != unmapped_buf, ("mapped buf: b_kvabase was not updated %p", bp)); KASSERT(bp->b_data != unmapped_buf, @@ -920,10 +962,6 @@ static inline void vfs_buf_check_unmapped(struct buf *bp) { - KASSERT((bp->b_flags & B_UNMAPPED) == B_UNMAPPED, - ("unmapped buf %p %x", bp, bp->b_flags)); - KASSERT(bp->b_kvabase == unmapped_buf, - ("unmapped buf: corrupted b_kvabase %p", bp)); KASSERT(bp->b_data == unmapped_buf, ("unmapped buf: corrupted b_data %p", bp)); } @@ -952,37 +990,6 @@ bpmap_qenter(struct buf *bp) } /* - * bfreekva() - free the kva allocation for a buffer. - * - * Since this call frees up buffer space, we call bufspacewakeup(). - */ -static void -bfreekva(struct buf *bp) -{ - - if (bp->b_kvasize == 0) - return; - - atomic_add_int(&buffreekvacnt, 1); - atomic_subtract_long(&bufspace, bp->b_kvasize); - if ((bp->b_flags & B_UNMAPPED) == 0) { - BUF_CHECK_MAPPED(bp); - vmem_free(buffer_arena, (vm_offset_t)bp->b_kvabase, - bp->b_kvasize); - } else { - BUF_CHECK_UNMAPPED(bp); - if ((bp->b_flags & B_KVAALLOC) != 0) { - vmem_free(buffer_arena, (vm_offset_t)bp->b_kvaalloc, - bp->b_kvasize); - } - atomic_subtract_long(&unmapped_bufspace, bp->b_kvasize); - bp->b_flags &= ~(B_UNMAPPED | B_KVAALLOC); - } - bp->b_kvasize = 0; - bufspacewakeup(); -} - -/* * binsfree: * * Insert the buffer into the appropriate free list. @@ -1104,6 +1111,75 @@ bremfreel(struct buf *bp) } /* + * bufkvafree: + * + * Free the kva allocation for a buffer. + * + */ +static void +bufkvafree(struct buf *bp) +{ + +#ifdef INVARIANTS + if (bp->b_kvasize == 0) { + KASSERT(bp->b_kvabase == unmapped_buf && + bp->b_data == unmapped_buf, + ("Leaked KVA space on %p", bp)); + } else if (buf_mapped(bp)) + BUF_CHECK_MAPPED(bp); + else + BUF_CHECK_UNMAPPED(bp); +#endif + if (bp->b_kvasize == 0) + return; + + vmem_free(buffer_arena, (vm_offset_t)bp->b_kvabase, bp->b_kvasize); + atomic_subtract_long(&bufkvaspace, bp->b_kvasize); + atomic_add_int(&buffreekvacnt, 1); + bp->b_data = bp->b_kvabase = unmapped_buf; + bp->b_kvasize = 0; +} + +/* + * bufkvaalloc: + * + * Allocate the buffer KVA and set b_kvasize and b_kvabase. + */ +static int +bufkvaalloc(struct buf *bp, int maxsize, int gbflags) +{ + vm_offset_t addr; + int error; + + KASSERT((gbflags & GB_UNMAPPED) == 0 || (gbflags & GB_KVAALLOC) != 0, + ("Invalid gbflags 0x%x in %s", gbflags, __func__)); + + bufkvafree(bp); + + addr = 0; + error = vmem_alloc(buffer_arena, maxsize, M_BESTFIT | M_NOWAIT, &addr); + if (error != 0) { + /* + * Buffer map is too fragmented. Request the caller + * to defragment the map. + */ + atomic_add_int(&bufdefragcnt, 1); + return (error); + } + bp->b_kvabase = (caddr_t)addr; + bp->b_kvasize = maxsize; + atomic_add_long(&bufkvaspace, bp->b_kvasize); + if ((gbflags & GB_UNMAPPED) != 0) { + bp->b_data = unmapped_buf; + BUF_CHECK_UNMAPPED(bp); + } else { + bp->b_data = bp->b_kvabase; + BUF_CHECK_MAPPED(bp); + } + return (0); +} + +/* * Attempt to initiate asynchronous I/O on read-ahead blocks. We must * clear BIO_ERROR and B_INVAL prior to initiating I/O . If B_CACHE is set, * the buffer is valid and we do not have to do anything. @@ -1715,7 +1791,8 @@ brelse(struct buf *bp) } VM_OBJECT_RUNLOCK(obj); - if ((bp->b_flags & (B_INVAL | B_UNMAPPED)) == 0) { + if ((bp->b_flags & B_INVAL) == 0 && + buf_mapped(bp)) { BUF_CHECK_MAPPED(bp); pmap_qenter( trunc_page((vm_offset_t)bp->b_data), @@ -1872,7 +1949,7 @@ vfs_vmio_release(struct buf *bp) vm_page_t m; int i; - if ((bp->b_flags & B_UNMAPPED) == 0) { + if (buf_mapped(bp)) { BUF_CHECK_MAPPED(bp); pmap_qremove(trunc_page((vm_offset_t)bp->b_data), bp->b_npages); } else @@ -1905,10 +1982,8 @@ vfs_vmio_release(struct buf *bp) if (obj != NULL) VM_OBJECT_WUNLOCK(obj); - if (bp->b_bufsize) { - bufspacewakeup(); - bp->b_bufsize = 0; - } + if (bp->b_bufsize) + bufspaceadjust(bp, 0); bp->b_npages = 0; bp->b_flags &= ~B_VMIO; if (bp->b_vp) @@ -1977,7 +2052,7 @@ vfs_bio_awrite(struct buf *bp) int gbflags; bo = &vp->v_bufobj; - gbflags = (bp->b_flags & B_UNMAPPED) != 0 ? GB_UNMAPPED : 0; + gbflags = (bp->b_data == unmapped_buf) ? GB_UNMAPPED : 0; /* * right now we support clustered writing only to regular files. If * we find a clusterable block we could be in the middle of a cluster @@ -2026,49 +2101,6 @@ vfs_bio_awrite(struct buf *bp) return (nwritten); } -static void -setbufkva(struct buf *bp, vm_offset_t addr, int maxsize, int gbflags) -{ - - KASSERT((bp->b_flags & (B_UNMAPPED | B_KVAALLOC)) == 0 && - bp->b_kvasize == 0, ("call bfreekva(%p)", bp)); - if ((gbflags & GB_UNMAPPED) == 0) { - bp->b_kvabase = (caddr_t)addr; - } else if ((gbflags & GB_KVAALLOC) != 0) { - KASSERT((gbflags & GB_UNMAPPED) != 0, - ("GB_KVAALLOC without GB_UNMAPPED")); - bp->b_kvaalloc = (caddr_t)addr; - bp->b_flags |= B_UNMAPPED | B_KVAALLOC; - atomic_add_long(&unmapped_bufspace, bp->b_kvasize); - } - bp->b_kvasize = maxsize; -} - -/* - * Allocate the buffer KVA and set b_kvasize. Also set b_kvabase if - * needed. - */ -static int -allocbufkva(struct buf *bp, int maxsize, int gbflags) -{ - vm_offset_t addr; - - bfreekva(bp); - addr = 0; - - if (vmem_alloc(buffer_arena, maxsize, M_BESTFIT | M_NOWAIT, &addr)) { - /* - * Buffer map is too fragmented. Request the caller - * to defragment the map. - */ - atomic_add_int(&bufdefragcnt, 1); - return (1); - } - setbufkva(bp, addr, maxsize, gbflags); - atomic_add_long(&bufspace, bp->b_kvasize); - return (0); -} - /* * Ask the bufdaemon for help, or act as bufdaemon itself, when a * locked vnode is supplied. @@ -2192,7 +2224,7 @@ getnewbuf_reuse_bp(struct buf *bp, int q if (bp->b_bufsize) allocbuf(bp, 0); - bp->b_flags &= B_UNMAPPED | B_KVAALLOC; + bp->b_flags = 0; bp->b_ioflags = 0; bp->b_xflags = 0; KASSERT((bp->b_flags & B_INFREECNT) == 0, @@ -2328,14 +2360,11 @@ restart: } /* * If we are defragging then we need a buffer with - * b_kvasize != 0. XXX this situation should no longer - * occur, if defrag is non-zero the buffer's b_kvasize - * should also be non-zero at this point. XXX + * b_kvasize != 0. This situation occurs when we + * have many unmapped bufs. */ - if (defrag && bp->b_kvasize == 0) { - printf("Warning: defrag empty buffer %p\n", bp); + if (defrag && bp->b_kvasize == 0) continue; - } /* * Start freeing the bp. This is somewhat involved. nbp @@ -2380,7 +2409,7 @@ restart: */ if (defrag) { bp->b_flags |= B_INVAL; - bfreekva(bp); + bufkvafree(bp); brelse(bp); defrag = 0; goto restart; @@ -2392,7 +2421,7 @@ restart: */ if (qindex == QUEUE_CLEAN && BUF_LOCKWAITERS(bp)) { bp->b_flags |= B_INVAL; - bfreekva(bp); + bufkvafree(bp); brelse(bp); goto restart; } @@ -2409,7 +2438,7 @@ restart: flushingbufs = 1; if (flushingbufs && bp->b_kvasize != 0) { bp->b_flags |= B_INVAL; - bfreekva(bp); + bufkvafree(bp); brelse(bp); goto restart; } @@ -2480,65 +2509,27 @@ restart: } else if ((gbflags & (GB_UNMAPPED | GB_KVAALLOC)) == GB_UNMAPPED) { mtx_assert(&bqclean, MA_NOTOWNED); - bfreekva(bp); - bp->b_flags |= B_UNMAPPED; - bp->b_kvabase = bp->b_data = unmapped_buf; - bp->b_kvasize = maxsize; - atomic_add_long(&bufspace, bp->b_kvasize); - atomic_add_long(&unmapped_bufspace, bp->b_kvasize); + bufkvafree(bp); atomic_add_int(&bufreusecnt, 1); } else { mtx_assert(&bqclean, MA_NOTOWNED); /* * We finally have a valid bp. We aren't quite out of the - * woods, we still have to reserve kva space. In order - * to keep fragmentation sane we only allocate kva in - * BKVASIZE chunks. + * woods, we still have to reserve kva space. In order to + * keep fragmentation sane we only allocate kva in BKVASIZE + * chunks. */ maxsize = (maxsize + BKVAMASK) & ~BKVAMASK; - if (maxsize != bp->b_kvasize || (bp->b_flags & (B_UNMAPPED | - B_KVAALLOC)) == B_UNMAPPED) { - if (allocbufkva(bp, maxsize, gbflags)) { - defrag = 1; - bp->b_flags |= B_INVAL; - brelse(bp); - goto restart; - } - atomic_add_int(&bufreusecnt, 1); - } else if ((bp->b_flags & B_KVAALLOC) != 0 && - (gbflags & (GB_UNMAPPED | GB_KVAALLOC)) == 0) { - /* - * If the reused buffer has KVA allocated, - * reassign b_kvaalloc to b_kvabase. - */ - bp->b_kvabase = bp->b_kvaalloc; - bp->b_flags &= ~B_KVAALLOC; - atomic_subtract_long(&unmapped_bufspace, - bp->b_kvasize); - atomic_add_int(&bufreusecnt, 1); - } else if ((bp->b_flags & (B_UNMAPPED | B_KVAALLOC)) == 0 && - (gbflags & (GB_UNMAPPED | GB_KVAALLOC)) == (GB_UNMAPPED | - GB_KVAALLOC)) { - /* - * The case of reused buffer already have KVA - * mapped, but the request is for unmapped - * buffer with KVA allocated. - */ - bp->b_kvaalloc = bp->b_kvabase; - bp->b_data = bp->b_kvabase = unmapped_buf; - bp->b_flags |= B_UNMAPPED | B_KVAALLOC; - atomic_add_long(&unmapped_bufspace, - bp->b_kvasize); - atomic_add_int(&bufreusecnt, 1); - } - if ((gbflags & GB_UNMAPPED) == 0) { - bp->b_saveaddr = bp->b_kvabase; - bp->b_data = bp->b_saveaddr; - bp->b_flags &= ~B_UNMAPPED; - BUF_CHECK_MAPPED(bp); + if (maxsize != bp->b_kvasize && + bufkvaalloc(bp, maxsize, gbflags)) { + defrag = 1; + bp->b_flags |= B_INVAL; + brelse(bp); + goto restart; } + atomic_add_int(&bufreusecnt, 1); } return (bp); } @@ -2968,9 +2959,9 @@ vfs_setdirty_locked_object(struct buf *b } /* - * Allocate the KVA mapping for an existing buffer. It handles the - * cases of both B_UNMAPPED buffer, and buffer with the preallocated - * KVA which is not mapped (B_KVAALLOC). + * Allocate the KVA mapping for an existing buffer. + * If an unmapped buffer is provided but a mapped buffer is requested, take + * also care to properly setup mappings between pages and KVA. */ static void bp_unmapped_get_kva(struct buf *bp, daddr_t blkno, int size, int gbflags) @@ -2979,25 +2970,22 @@ bp_unmapped_get_kva(struct buf *bp, dadd int bsize, maxsize, need_mapping, need_kva; off_t offset; - need_mapping = (bp->b_flags & B_UNMAPPED) != 0 && + need_mapping = bp->b_data == unmapped_buf && (gbflags & GB_UNMAPPED) == 0; - need_kva = (bp->b_flags & (B_KVAALLOC | B_UNMAPPED)) == B_UNMAPPED && + need_kva = bp->b_kvabase == unmapped_buf && + bp->b_data == unmapped_buf && (gbflags & GB_KVAALLOC) != 0; if (!need_mapping && !need_kva) return; BUF_CHECK_UNMAPPED(bp); - if (need_mapping && (bp->b_flags & B_KVAALLOC) != 0) { + if (need_mapping && bp->b_kvabase != unmapped_buf) { /* * Buffer is not mapped, but the KVA was already * reserved at the time of the instantiation. Use the * allocated space. */ - bp->b_flags &= ~B_KVAALLOC; - KASSERT(bp->b_kvaalloc != 0, ("kvaalloc == 0")); - bp->b_kvabase = bp->b_kvaalloc; - atomic_subtract_long(&unmapped_bufspace, bp->b_kvasize); goto has_addr; } @@ -3012,7 +3000,7 @@ bp_unmapped_get_kva(struct buf *bp, dadd maxsize = imax(maxsize, bsize); mapping_loop: - if (allocbufkva(bp, maxsize, gbflags)) { + if (bufkvaalloc(bp, maxsize, gbflags)) { /* * Request defragmentation. getnewbuf() returns us the * allocated space by the scratch buffer KVA. @@ -3025,31 +3013,31 @@ mapping_loop: * XXXKIB: defragmentation cannot * succeed, not sure what else to do. */ - panic("GB_NOWAIT_BD and B_UNMAPPED %p", bp); + panic("GB_NOWAIT_BD and GB_UNMAPPED %p", bp); } atomic_add_int(&mappingrestarts, 1); goto mapping_loop; } - KASSERT((scratch_bp->b_flags & B_KVAALLOC) != 0, - ("scratch bp !B_KVAALLOC %p", scratch_bp)); - setbufkva(bp, (vm_offset_t)scratch_bp->b_kvaalloc, - scratch_bp->b_kvasize, gbflags); + KASSERT(scratch_bp->b_kvabase != unmapped_buf, + ("scratch bp has no KVA %p", scratch_bp)); + /* Grab pointers. */ + bp->b_kvabase = scratch_bp->b_kvabase; + bp->b_kvasize = scratch_bp->b_kvasize; + bp->b_data = scratch_bp->b_data; /* Get rid of the scratch buffer. */ scratch_bp->b_kvasize = 0; scratch_bp->b_flags |= B_INVAL; - scratch_bp->b_flags &= ~(B_UNMAPPED | B_KVAALLOC); + scratch_bp->b_data = scratch_bp->b_kvabase = unmapped_buf; brelse(scratch_bp); } - if (!need_mapping) - return; - has_addr: - bp->b_saveaddr = bp->b_kvabase; - bp->b_data = bp->b_saveaddr; /* b_offset is handled by bpmap_qenter */ - bp->b_flags &= ~B_UNMAPPED; - BUF_CHECK_MAPPED(bp); - bpmap_qenter(bp); + if (need_mapping) { + /* b_offset is handled by bpmap_qenter. */ + bp->b_data = bp->b_kvabase; + BUF_CHECK_MAPPED(bp); + bpmap_qenter(bp); + } } /* @@ -3265,7 +3253,7 @@ loop: } else { maxsize = size; /* Do not allow non-VMIO notmapped buffers. */ - flags &= ~GB_UNMAPPED; + flags &= ~(GB_UNMAPPED | GB_KVAALLOC); } maxsize = imax(maxsize, bsize); @@ -3358,7 +3346,6 @@ geteblk(int size, int flags) return (bp); } - /* * This code constitutes the buffer memory from either anonymous system * memory (in the case of non-VMIO operations) or from an associated @@ -3382,7 +3369,7 @@ allocbuf(struct buf *bp, int size) BUF_ASSERT_HELD(bp); - if (bp->b_kvasize < size) + if (bp->b_kvasize != 0 && bp->b_kvasize < size) panic("allocbuf: buffer too small"); if ((bp->b_flags & B_VMIO) == 0) { @@ -3407,15 +3394,8 @@ allocbuf(struct buf *bp, int size) bp->b_bcount = size; } else { free(bp->b_data, M_BIOBUF); - if (bp->b_bufsize) { - atomic_subtract_long( - &bufmallocspace, - bp->b_bufsize); - bufspacewakeup(); - bp->b_bufsize = 0; - } - bp->b_saveaddr = bp->b_kvabase; - bp->b_data = bp->b_saveaddr; + bufmallocadjust(bp, 0); + bp->b_data = bp->b_kvabase; bp->b_bcount = 0; bp->b_flags &= ~B_MALLOC; } @@ -3434,33 +3414,28 @@ allocbuf(struct buf *bp, int size) * is probably extremely rare and not worth worrying * over. */ - if ( (bufmallocspace < maxbufmallocspace) && + if ((bufmallocspace < maxbufmallocspace) && (bp->b_bufsize == 0) && (mbsize <= PAGE_SIZE/2)) { bp->b_data = malloc(mbsize, M_BIOBUF, M_WAITOK); - bp->b_bufsize = mbsize; bp->b_bcount = size; bp->b_flags |= B_MALLOC; - atomic_add_long(&bufmallocspace, mbsize); + bufmallocadjust(bp, mbsize); return 1; } origbuf = NULL; origbufsize = 0; /* - * If the buffer is growing on its other-than-first allocation, - * then we revert to the page-allocation scheme. + * If the buffer is growing on its other-than-first + * allocation then we revert to the page-allocation + * scheme. */ if (bp->b_flags & B_MALLOC) { origbuf = bp->b_data; origbufsize = bp->b_bufsize; bp->b_data = bp->b_kvabase; - if (bp->b_bufsize) { - atomic_subtract_long(&bufmallocspace, - bp->b_bufsize); - bufspacewakeup(); - bp->b_bufsize = 0; - } + bufmallocadjust(bp, 0); bp->b_flags &= ~B_MALLOC; newbsize = round_page(newbsize); } @@ -3498,7 +3473,7 @@ allocbuf(struct buf *bp, int size) if (desiredpages < bp->b_npages) { vm_page_t m; - if ((bp->b_flags & B_UNMAPPED) == 0) { + if (buf_mapped(bp)) { BUF_CHECK_MAPPED(bp); pmap_qremove((vm_offset_t)trunc_page( (vm_offset_t)bp->b_data) + @@ -3611,18 +3586,18 @@ allocbuf(struct buf *bp, int size) VM_OBJECT_WUNLOCK(obj); /* - * Step 3, fixup the KVM pmap. + * Step 3, fixup the KVA pmap. */ - if ((bp->b_flags & B_UNMAPPED) == 0) + if (buf_mapped(bp)) bpmap_qenter(bp); else BUF_CHECK_UNMAPPED(bp); } } - if (newbsize < bp->b_bufsize) - bufspacewakeup(); - bp->b_bufsize = newbsize; /* actual buffer allocation */ - bp->b_bcount = size; /* requested buffer size */ + /* Record changes in allocation size. */ + if (bp->b_bufsize != newbsize) + bufspaceadjust(bp, newbsize); + bp->b_bcount = size; /* requested buffer size. */ return 1; } @@ -3919,7 +3894,7 @@ bufdone_finish(struct buf *bp) } vm_object_pip_wakeupn(obj, 0); VM_OBJECT_WUNLOCK(obj); - if (bogus && (bp->b_flags & B_UNMAPPED) == 0) { + if (bogus && buf_mapped(bp)) { BUF_CHECK_MAPPED(bp); pmap_qenter(trunc_page((vm_offset_t)bp->b_data), bp->b_pages, bp->b_npages); @@ -3966,7 +3941,7 @@ vfs_unbusy_pages(struct buf *bp) if (!m) panic("vfs_unbusy_pages: page missing\n"); bp->b_pages[i] = m; - if ((bp->b_flags & B_UNMAPPED) == 0) { + if (buf_mapped(bp)) { BUF_CHECK_MAPPED(bp); pmap_qenter(trunc_page((vm_offset_t)bp->b_data), bp->b_pages, bp->b_npages); @@ -4140,7 +4115,7 @@ vfs_busy_pages(struct buf *bp, int clear foff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK; } VM_OBJECT_WUNLOCK(obj); - if (bogus && (bp->b_flags & B_UNMAPPED) == 0) { + if (bogus && buf_mapped(bp)) { BUF_CHECK_MAPPED(bp); pmap_qenter(trunc_page((vm_offset_t)bp->b_data), bp->b_pages, bp->b_npages); @@ -4260,7 +4235,7 @@ vfs_bio_bzero_buf(struct buf *bp, int ba vm_page_t m; int i, n; - if ((bp->b_flags & B_UNMAPPED) == 0) { + if (buf_mapped(bp)) { BUF_CHECK_MAPPED(bp); bzero(bp->b_data + base, size); } else { @@ -4353,11 +4328,12 @@ vm_hold_free_pages(struct buf *bp, int n * be valid, a race or a smaller-file mapped into a larger space may * actually cause vmapbuf() to fail, so all callers of vmapbuf() MUST * check the return value. + * + * This function only works with pager buffers. */ int vmapbuf(struct buf *bp, int mapbuf) { - caddr_t kva; vm_prot_t prot; int pidx; @@ -4371,24 +4347,20 @@ vmapbuf(struct buf *bp, int mapbuf) btoc(MAXPHYS))) < 0) return (-1); bp->b_npages = pidx; + bp->b_offset = ((vm_offset_t)bp->b_data) & PAGE_MASK; if (mapbuf || !unmapped_buf_allowed) { - pmap_qenter((vm_offset_t)bp->b_saveaddr, bp->b_pages, pidx); - kva = bp->b_saveaddr; - bp->b_saveaddr = bp->b_data; - bp->b_data = kva + (((vm_offset_t)bp->b_data) & PAGE_MASK); - bp->b_flags &= ~B_UNMAPPED; - } else { - bp->b_flags |= B_UNMAPPED; - bp->b_offset = ((vm_offset_t)bp->b_data) & PAGE_MASK; - bp->b_saveaddr = bp->b_data; + pmap_qenter((vm_offset_t)bp->b_kvabase, bp->b_pages, pidx); + bp->b_data = bp->b_kvabase + bp->b_offset; + } else bp->b_data = unmapped_buf; - } return(0); } /* * Free the io map PTEs associated with this IO operation. * We also invalidate the TLB entries and restore the original b_addr. + * + * This function only works with pager buffers. */ void vunmapbuf(struct buf *bp) @@ -4396,13 +4368,11 @@ vunmapbuf(struct buf *bp) int npages; npages = bp->b_npages; - if (bp->b_flags & B_UNMAPPED) - bp->b_flags &= ~B_UNMAPPED; - else + if (buf_mapped(bp)) pmap_qremove(trunc_page((vm_offset_t)bp->b_data), npages); vm_page_unhold_pages(bp->b_pages, npages); - - bp->b_data = bp->b_saveaddr; + + bp->b_data = unmapped_buf; } void @@ -4543,7 +4513,7 @@ void bdata2bio(struct buf *bp, struct bio *bip) { - if ((bp->b_flags & B_UNMAPPED) != 0) { + if (!buf_mapped(bp)) { KASSERT(unmapped_buf_allowed, ("unmapped")); bip->bio_ma = bp->b_pages; bip->bio_ma_n = bp->b_npages; @@ -4586,6 +4556,8 @@ DB_SHOW_COMMAND(buffer, db_show_buffer) bp->b_error, bp->b_bufsize, bp->b_bcount, bp->b_resid, bp->b_bufobj, bp->b_data, (intmax_t)bp->b_blkno, (intmax_t)bp->b_lblkno, bp->b_dep.lh_first); + db_printf("b_kvabase = %p, b_kvasize = %d\n", + bp->b_kvabase, bp->b_kvasize); if (bp->b_npages) { int i; db_printf("b_npages = %d, pages(OBJ, IDX, PA): ", bp->b_npages); Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Thu Jul 23 18:11:52 2015 (r285818) +++ head/sys/kern/vfs_cluster.c Thu Jul 23 19:13:41 2015 (r285819) @@ -354,7 +354,6 @@ cluster_rbuild(struct vnode *vp, u_quad_ */ bp->b_flags = B_ASYNC | B_CLUSTER | B_VMIO; if ((gbflags & GB_UNMAPPED) != 0) { - bp->b_flags |= B_UNMAPPED; bp->b_data = unmapped_buf; } else { bp->b_data = (char *)((vm_offset_t)bp->b_data | @@ -517,9 +516,8 @@ clean_sbusy: if (bp->b_bufsize > bp->b_kvasize) panic("cluster_rbuild: b_bufsize(%ld) > b_kvasize(%d)\n", bp->b_bufsize, bp->b_kvasize); - bp->b_kvasize = bp->b_bufsize; - if ((bp->b_flags & B_UNMAPPED) == 0) { + if (buf_mapped(bp)) { pmap_qenter(trunc_page((vm_offset_t) bp->b_data), (vm_page_t *)bp->b_pages, bp->b_npages); } @@ -545,7 +543,7 @@ cluster_callback(bp) if (bp->b_ioflags & BIO_ERROR) error = bp->b_error; - if ((bp->b_flags & B_UNMAPPED) == 0) { + if (buf_mapped(bp)) { pmap_qremove(trunc_page((vm_offset_t) bp->b_data), bp->b_npages); } @@ -871,7 +869,6 @@ cluster_wbuild(struct vnode *vp, long si bp->b_data = (char *)((vm_offset_t)bp->b_data | ((vm_offset_t)tbp->b_data & PAGE_MASK)); } else { - bp->b_flags |= B_UNMAPPED; bp->b_data = unmapped_buf; } bp->b_flags |= B_CLUSTER | (tbp->b_flags & (B_VMIO | @@ -1004,7 +1001,7 @@ cluster_wbuild(struct vnode *vp, long si tbp, b_cluster.cluster_entry); } finishcluster: - if ((bp->b_flags & B_UNMAPPED) == 0) { + if (buf_mapped(bp)) { pmap_qenter(trunc_page((vm_offset_t) bp->b_data), (vm_page_t *)bp->b_pages, bp->b_npages); } @@ -1012,7 +1009,6 @@ cluster_wbuild(struct vnode *vp, long si panic( "cluster_wbuild: b_bufsize(%ld) > b_kvasize(%d)\n", bp->b_bufsize, bp->b_kvasize); - bp->b_kvasize = bp->b_bufsize; totalwritten += bp->b_bufsize; bp->b_dirtyoff = 0; bp->b_dirtyend = bp->b_bufsize; Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Thu Jul 23 18:11:52 2015 (r285818) +++ head/sys/sys/buf.h Thu Jul 23 19:13:41 2015 (r285819) @@ -112,17 +112,15 @@ struct buf { b_xflags_t b_xflags; /* extra flags */ struct lock b_lock; /* Buffer lock */ long b_bufsize; /* Allocated buffer size. */ - long b_runningbufspace; /* when I/O is running, pipelining */ - caddr_t b_kvabase; /* base kva for buffer */ - caddr_t b_kvaalloc; /* allocated kva for B_KVAALLOC */ + int b_runningbufspace; /* when I/O is running, pipelining */ int b_kvasize; /* size of kva for buffer */ - daddr_t b_lblkno; /* Logical block number. */ - struct vnode *b_vp; /* Device vnode. */ int b_dirtyoff; /* Offset in buffer of dirty region. */ int b_dirtyend; /* Offset of end of dirty region. */ + caddr_t b_kvabase; /* base kva for buffer */ + daddr_t b_lblkno; /* Logical block number. */ + struct vnode *b_vp; /* Device vnode. */ struct ucred *b_rcred; /* Read credentials reference. */ struct ucred *b_wcred; /* Write credentials reference. */ - void *b_saveaddr; /* Original b_addr for physio. */ union { TAILQ_ENTRY(buf) bu_freelist; /* (Q) */ struct { @@ -206,8 +204,8 @@ struct buf { #define B_PERSISTENT 0x00000100 /* Perm. ref'ed while EXT2FS mounted. */ #define B_DONE 0x00000200 /* I/O completed. */ #define B_EINTR 0x00000400 /* I/O was interrupted */ -#define B_UNMAPPED 0x00000800 /* KVA is not mapped. */ -#define B_KVAALLOC 0x00001000 /* But allocated. */ +#define B_00000800 0x00000800 /* Available flag. */ +#define B_00001000 0x00001000 /* Available flag. */ #define B_INVAL 0x00002000 /* Does not contain valid info. */ #define B_BARRIER 0x00004000 /* Write this and all preceeding first. */ #define B_NOCACHE 0x00008000 /* Do not cache block after use. */ @@ -231,7 +229,7 @@ struct buf { #define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34managed" \ "\33paging\32infreecnt\31nocopy\30b23\27relbuf\26dirty\25b20" \ "\24b19\23b18\22clusterok\21malloc\20nocache\17b14\16inval" \ - "\15kvaalloc\14unmapped\13eintr\12done\11persist\10delwri" \ + "\15b12\14b11\13eintr\12done\11persist\10delwri" \ "\7validsuspwrt\6cache\5deferred\4direct\3async\2needcommit\1age" /* @@ -374,15 +372,11 @@ struct buf_queue_head { }; /* - * This structure describes a clustered I/O. It is stored in the b_saveaddr - * field of the buffer on which I/O is done. At I/O completion, cluster - * callback uses the structure to parcel I/O's to individual buffers, and - * then free's this structure. + * This structure describes a clustered I/O. */ struct cluster_save { long bs_bcount; /* Saved b_bcount. */ long bs_bufsize; /* Saved b_bufsize. */ - void *bs_saveaddr; /* Saved b_addr. */ int bs_nchildren; /* Number of associated buffers. */ struct buf **bs_children; /* List of associated buffers. */ }; @@ -478,7 +472,14 @@ extern int cluster_pbuf_freecnt; /* Numb extern int vnode_pbuf_freecnt; /* Number of pbufs for vnode pager */ extern int vnode_async_pbuf_freecnt; /* Number of pbufs for vnode pager, asynchronous reads */ -extern caddr_t unmapped_buf; +extern caddr_t unmapped_buf; /* Data address for unmapped buffers. */ + +static inline int +buf_mapped(struct buf *bp) +{ + + return (bp->b_data != unmapped_buf); +} void runningbufwakeup(struct buf *); void waitrunningbufspace(void); Modified: head/sys/ufs/ffs/ffs_rawread.c ============================================================================== --- head/sys/ufs/ffs/ffs_rawread.c Thu Jul 23 18:11:52 2015 (r285818) +++ head/sys/ufs/ffs/ffs_rawread.c Thu Jul 23 19:13:41 2015 (r285819) @@ -62,8 +62,7 @@ static int ffs_rawread_readahead(struct off_t offset, size_t len, struct thread *td, - struct buf *bp, - caddr_t sa); + struct buf *bp); static int ffs_rawread_main(struct vnode *vp, struct uio *uio); @@ -190,8 +189,7 @@ ffs_rawread_readahead(struct vnode *vp, off_t offset, size_t len, struct thread *td, - struct buf *bp, - caddr_t sa) + struct buf *bp) { int error; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jul 23 21:32:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67DA89A8893; Thu, 23 Jul 2015 21:32:27 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E9C11167; Thu, 23 Jul 2015 21:32:27 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZIO6J-000MHx-N0; Thu, 23 Jul 2015 22:32:24 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: Date: Thu, 23 Jul 2015 22:32:17 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5E95F097-2C85-48C2-8E34-8EA46EDBE6A3@FreeBSD.org> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> To: Scott Long X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 21:32:27 -0000 > On 23 Jul 2015, at 14:45, Scott Long wrote: >=20 >> OK - I=E2=80=99m sold! I=E2=80=99ll make a kernel option defaulting = to off. :-) >>=20 >>=20 >=20 > Hi Mark, >=20 > Thanks for making this concession. I wanted to add a bit of = historical perspective. When Yarrow was introduced in the previous = decade, it was initially wired into nearly all interrupt sources. It = turned out to be so expensive to those sources, especially for = high-speed sources at the time like network and caching RAID drivers, = that we then spent months disabling it from those sources. In the end, = a lot of code thrash happened and the effectiveness of Yarrow was = questionable. OK. OUCH. I wish I=E2=80=99d known this earlier, or, if I *was* told, I = wish I=E2=80=99d paid a bit more attention. :-] In a nod towards efficiency, I have supplied graded (*_fast(), = *_queue(), *_direct()) harvesting types, but it would appear that these = are insufficient for your purposes. No problem, I=E2=80=99m glad we = could come to another compromise! > Fast forward to now with your recent work. If UMA becomes expensive = for high-speed use, everyone will go back to developing private = per-driver and per-subsystem allocators to avoid it. This will happen = whether or not the UMA collector is controllable at run-time; if it=E2=80=99= s enabled by default, benchmarks will be impacted and people will react. = That=E2=80=99ll be a huge step backwards for FreeBSD. Understood, and thanks. If you have any suitable benchmark code that I = could have, please, I=E2=80=99d be very grateful. > I also strongly agree with Jeff=E2=80=99s point on the questionable = nature of this kind of fast-and-monotonic entropy collection, and Warner = and Kip=E2=80=99s point on the finite number of clock cycles available = for doing 100Gb networking. If really high quality entropy is desired, = won=E2=80=99t most serious people use a hardware source instead of a = software source? Not that I think that software entropy is useless, but = it=E2=80=99s a question of how much effort and tradeoffs are put into it = for what result. An academically beautiful entropy system that = hamstrings the OS from doing other essential things isn=E2=80=99t all = that interesting, IMO. I am kinda hoping to be useful for everybody without being a nuisance. = Fortuna (and Yarrow) work best with diverse sources of entropy, and we = have declared our distrust in single sources (thanks Snowden!). Thus it = is good to mix as much as possible. Now your requirements may not be as = strong as the next fellow=E2=80=99s so disabling some sources would be a = reasonable idea. I trust this direction will work better for more folks? M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Thu Jul 23 21:36:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 514BC9A8990; Thu, 23 Jul 2015 21:36:16 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::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 1C3FB153D; Thu, 23 Jul 2015 21:36:16 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iecrl10 with SMTP id rl10so509806iec.1; Thu, 23 Jul 2015 14:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Zj4qR91ma5han7Y4JDC91v6J5AXzpZ4Zgfr2jsnU7jg=; b=QtZ/aZchpRNXw74669XJfegGf0ttKje9rc+xNr3vrgf5VTz485rPKZS1Bl8zTj2Ohx whBjmIwjN1ja141FTzk9HqlN2zsGoo1LEiv2P0CzXKApHDLI7PWDfeYkFgMhK1+04zAf Jz6Prs6CaDX6oIz66kiriCHfvFUWOh+WZPbKYygwAGwtOmuXrE5613woVUj3G2TrJFx6 CxT535oJY5tU0pBVhc9deW3T1c48PR1M9Oi21EVBvHM97Wl8IW4AIoM2op/r/G8OGL3G 3E0D0KPWsRWAeahJDAsWmeJtx+aE39og9x7xP/iNaCOvTLWNo03oFrMc+lRz58pyqZZb DZKQ== MIME-Version: 1.0 X-Received: by 10.107.129.215 with SMTP id l84mr15843764ioi.78.1437687375191; Thu, 23 Jul 2015 14:36:15 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Thu, 23 Jul 2015 14:36:15 -0700 (PDT) In-Reply-To: References: <201507040654.t646sGO7044196@repo.freebsd.org> <20150721083922.GB6736@dft-labs.eu> <3863130.vz23U50G0A@ralph.baldwin.cx> <20150722043323.GA23614@dft-labs.eu> Date: Thu, 23 Jul 2015 14:36:15 -0700 Message-ID: Subject: Re: svn commit: r285125 - in head/sys: kern sys From: Adrian Chadd To: Mateusz Guzik Cc: John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 21:36:16 -0000 Hi, I've had no warnings/panics after applying this patch. Can we get it into -head plz? -a From owner-svn-src-head@freebsd.org Thu Jul 23 21:42:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D5C09A8AA8; Thu, 23 Jul 2015 21:42:52 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F6EE1A5E; Thu, 23 Jul 2015 21:42:52 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZIOGN-000MIw-MP; Thu, 23 Jul 2015 22:42:48 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <20150723173016.GA86452@FreeBSD.org> Date: Thu, 23 Jul 2015 22:42:41 +0100 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Transfer-Encoding: quoted-printable Message-Id: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150723173016.GA86452@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 21:42:52 -0000 > On 23 Jul 2015, at 18:30, Alexey Dokuchaev wrote: >=20 > [ Guys, please teach your MUA to wrap messages over 72-76 boundary and = trim > excessive/irrelevant quoting, thank you. ] Oops sorry! > So far it looks like this to me (having read no papers): >=20 > 1) Fortuna attempts to get the most entropy from all available = sources, > trusting none of them. (Which is good.) Accurate. > 2) Some of them might/will cause unwanted performance loss under = certain > circumstances, which becomes a show-stopper (finite number of clock = cycles > available, etc.) for some use cases. Again accurate. > If Fortuna is so flexible, why can't some of its sources be = conditionally > disabled (kernel option/boot.conf/systct) or down-weighted through = some > more sophisticated, self-adjusting configuration technique during = runtime? This is already present, but some if these checks, while very cheap, are still too expensive in very high-performance areas of the code. > How dynamic it is? Mark, is there a (algorithmically?) reliable way = to > tell how many bits of "good" entropy is being added to the pool, and = then > tune the harvesting strategy accordingly? No. Not an absolute =E2=80=9Cno=E2=80=9D, but The Yarrow algorithm = required this, and it was never implemented satisfactorily by anyone due to its difficulty. Yarrow is now no longer supported by its authors due to this, amongst other problems. > Is there some sort of restricted, private API to get a clue about = current > entropy status? Sort of. By turning on the RANDOM_DEBUG option, Fortuna will = periodically print out the =E2=80=9Cmessage lengths=E2=80=9D of all 32 accumulation = pools. These are very vaguely indicative of the accumulated entropy. Pool[0] is used for reseeding; the rest are there for my interest and will be removed at = some point. M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Thu Jul 23 23:18:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBCB39A97F6; Thu, 23 Jul 2015 23:18:04 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3DB516BC; Thu, 23 Jul 2015 23:18:04 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6NNI4JG016986; Thu, 23 Jul 2015 23:18:04 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6NNI4QG016985; Thu, 23 Jul 2015 23:18:04 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201507232318.t6NNI4QG016985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Thu, 23 Jul 2015 23:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285829 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 23:18:04 -0000 Author: pluknet Date: Thu Jul 23 23:18:03 2015 New Revision: 285829 URL: https://svnweb.freebsd.org/changeset/base/285829 Log: Call ksem_get() with initialized 'rights'. ksem_get() consumes fget(), and it's mandatory there. Reported by: truckman Reviewed by: mjg Modified: head/sys/kern/uipc_sem.c Modified: head/sys/kern/uipc_sem.c ============================================================================== --- head/sys/kern/uipc_sem.c Thu Jul 23 20:59:48 2015 (r285828) +++ head/sys/kern/uipc_sem.c Thu Jul 23 23:18:03 2015 (r285829) @@ -651,12 +651,13 @@ struct ksem_close_args { int sys_ksem_close(struct thread *td, struct ksem_close_args *uap) { + cap_rights_t rights; struct ksem *ks; struct file *fp; int error; /* No capability rights required to close a semaphore. */ - error = ksem_get(td, uap->id, 0, &fp); + error = ksem_get(td, uap->id, cap_rights_init(&rights), &fp); if (error) return (error); ks = fp->f_data; @@ -872,12 +873,13 @@ struct ksem_destroy_args { int sys_ksem_destroy(struct thread *td, struct ksem_destroy_args *uap) { + cap_rights_t rights; struct file *fp; struct ksem *ks; int error; /* No capability rights required to close a semaphore. */ - error = ksem_get(td, uap->id, 0, &fp); + error = ksem_get(td, uap->id, cap_rights_init(&rights), &fp); if (error) return (error); ks = fp->f_data; From owner-svn-src-head@freebsd.org Fri Jul 24 01:25:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 793F49A829D; Fri, 24 Jul 2015 01:25:22 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3782C186B; Fri, 24 Jul 2015 01:25:21 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t6O1PJ7S081866 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Jul 2015 18:25:19 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t6O1PJ0m081865; Thu, 23 Jul 2015 18:25:19 -0700 (PDT) (envelope-from jmg) Date: Thu, 23 Jul 2015 18:25:19 -0700 From: John-Mark Gurney To: Scott Long Cc: Mark R V Murray , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Message-ID: <20150724012519.GE78154@funkthat.com> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Thu, 23 Jul 2015 18:25:20 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 01:25:22 -0000 Scott Long wrote this message on Thu, Jul 23, 2015 at 07:45 -0600: > > On Jul 23, 2015, at 1:03 AM, Mark R V Murray wrote: > > > > > >> On 23 Jul 2015, at 00:53, Warner Losh wrote: > >> > >>>>> Neither filesystem operations nor allocations are random events. They are trivially influenced by user code. A malicious attacker could create repeated patterns of allocations or filesystem activity through the syscall path to degrade your random sample source. > >>>> > >>>> I?m not sure I accept that - Fortuna is very careful about using non-reversible hashing in it?s accumulation, and countering such degradation is one of the algorithm?s strong points. There is perhaps risk of *no* entropy, but even the per-event timing jitter will be providing this, if nothing else. > >> > >> I???m not sure I???m happy about this answer. Do you have some research backing up such cavalier claims? > > > > It was not my intention to sound cavalier. Apologies. > > > > Fortuna was developed to account for many sources of entropy, good and bad alike, and Jeff???s observation is an attack on that design. I accept that the randomness of these events is poor, but they are high-rate, and this product of high-rate*low entropy is what I seek. I pulled out numbers with dtrace, and basic statistics showed that the harvesting was not useless. I completely understand that under the right circumstances these numbers might be lousy - please read the Fortuna design document to understand why this doesn???t matter. *ALL* entropy inputs to Fortuna are considered attackable, including the dedicated hardware sources. > > > > I have also read cryptanalyses of Fortuna, not all of them to be sure, and so far the design appears strong. The best attack that I have seen (very academic) suggests an improvement which I may incorporate. > > > >>>>> Perhaps more importantly to me, this is an unacceptable performance burden for the allocator. At a minimum it should compile out by default. Great care has been taken to reduce the fast path of the allocator to the minimum number of cycles and even cache misses. > >>>> > >>>> As currently set up in etc/rc.d/* by default, there is a simple check at each UMA harvesting opportunity, and no further action. I asked Robert Watson if this was burdensome, and he said it was not. > >>> > >>> I find this burdensome. You can easily add a macro around the calls or hide them in an inline with a default to off. Even a function call that checks a global and does nothing else is a handful of new cache misses. A microbenchmark will not realize the full cost of this. You will instead get the dozen or so instructions of overhead which I still find objectionable. > >>> > >>> Kip's observations about packet cycle budgets in high-performance applications are accurate and this is something we have put great care into over time. > >> > >> A certain video streaming company will be pushing the envelope to get to 100Gbps very soon. Even a few extra instructions on every packet / allocation will be a killer. Especially if one is an almost guaranteed cache miss. This most certainly will be burdensome. There absolutely must be a way to turn this off at compile time. We don???t care that much about entropy to leave performance on the table. > > > > OK - I???m sold! I???ll make a kernel option defaulting to off. :-) > > > > > > Hi Mark, > > Thanks for making this concession. I wanted to add a bit of historical perspective. When Yarrow was introduced in the previous decade, it was initially wired into nearly all interrupt sources. It turned out to be so expensive to those sources, especially for high-speed sources at the time like network and caching RAID drivers, that we then spent months disabling it from those sources. In the end, a lot of code thrash happened and the effectiveness of Yarrow was questionable. > > Fast forward to now with your recent work. If UMA becomes expensive for high-speed use, everyone will go back to developing private per-driver and per-subsystem allocators to avoid it. This will happen whether or not the UMA collector is controllable at run-time; if it???s enabled by default, benchmarks will be impacted and people will react. That???ll be a huge step backwards for FreeBSD. > > I also strongly agree with Jeff???s point on the questionable nature of this kind of fast-and-monotonic entropy collection, and Warner and Kip???s point on the finite number of clock cycles available for doing 100Gb networking. If really high quality entropy is desired, won???t most serious people use a hardware source instead of a software source? Not that I think that software entropy is useless, but it???s a question of how much effort and tradeoffs are put into it for what result. An academically beautiful entropy system that hamstrings the OS from doing other essential things isn???t all that interesting, IMO. I would like to point out that the goal of collecting large amounts is starting to fall out of favor, and I happen to agree with the likes of djb[1] that we don't need an infinite amount of entropy collected by the system. If the attacker can read out our RNG state, then we are already screwed due to many other vulns. Many of the issues that FreeBSD sees with lack of entropy at start up is more of a problem on how systems are installed and provisioned. I don't believe that we currently store any entropy from the install process, yet this is one of the best places to get it, the user is banging on keyboard selecting options, etc. If an image is designed to be cloned (vm images or appliance images) we need to have a mechanism to ensure that before we start, we get the entropy from other sources, be it a hardware RNG or the console. I would like to see us scale back the entropy collection, and replace it with something like scan the zone once an hour or something similar. Or do something dtrace style, where we nop/jmp the collection after we feel that the system has collected enough. Heck, piping in mic data to /dev/random is a good way to seed the rng on many machines. [1] http://blog.cr.yp.to/20140205-entropy.html -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@freebsd.org Fri Jul 24 04:56:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47A839A8485; Fri, 24 Jul 2015 04:56:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29B4E1B2A; Fri, 24 Jul 2015 04:56:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6O4ulTX075736; Fri, 24 Jul 2015 04:56:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6O4ultr075735; Fri, 24 Jul 2015 04:56:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201507240456.t6O4ultr075735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 24 Jul 2015 04:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285833 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 04:56:47 -0000 Author: imp Date: Fri Jul 24 04:56:46 2015 New Revision: 285833 URL: https://svnweb.freebsd.org/changeset/base/285833 Log: Panic when a device is trying to recursively acquire rather than hang indefinitely. Improve error messages from other panics. Modified: head/sys/dev/gpio/gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Thu Jul 23 23:37:03 2015 (r285832) +++ head/sys/dev/gpio/gpiobus.c Fri Jul 24 04:56:46 2015 (r285833) @@ -564,6 +564,10 @@ gpiobus_acquire_bus(device_t busdev, dev GPIOBUS_ASSERT_UNLOCKED(sc); GPIOBUS_LOCK(sc); if (sc->sc_owner != NULL) { + if (sc->sc_owner == child) + panic("%s: %s still owns the bus.", + device_get_nameunit(busdev), + device_get_nameunit(child)); if (how == GPIOBUS_DONTWAIT) { GPIOBUS_UNLOCK(sc); return (EWOULDBLOCK); @@ -586,9 +590,14 @@ gpiobus_release_bus(device_t busdev, dev GPIOBUS_ASSERT_UNLOCKED(sc); GPIOBUS_LOCK(sc); if (sc->sc_owner == NULL) - panic("gpiobus: releasing unowned bus."); + panic("%s: %s releasing unowned bus.", + device_get_nameunit(busdev), + device_get_nameunit(child)); if (sc->sc_owner != child) - panic("gpiobus: you don't own the bus. game over."); + panic("%s: %s trying to release bus owned by %s", + device_get_nameunit(busdev), + device_get_nameunit(child), + device_get_nameunit(sc->sc_owner)); sc->sc_owner = NULL; wakeup(sc); GPIOBUS_UNLOCK(sc); From owner-svn-src-head@freebsd.org Fri Jul 24 06:20:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FDFA9A98DF for ; Fri, 24 Jul 2015 06:20:19 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) (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 4B97E1BF7 for ; Fri, 24 Jul 2015 06:20:17 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by wibxm9 with SMTP id xm9so13391003wib.1 for ; Thu, 23 Jul 2015 23:20:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:date:message-id:subject:from :to:cc:content-type; bh=zyE4hqSCoVH9iO6nqQbsp2zg89NWuoYsDX+zrXVitJw=; b=OuRVq8gnPQWfldkXlG9NYHz+V3Pm0iuDTZ0I+xpDNHZCQwRLDKObp7d3FekGZ8rHJ+ 1siCzuPeXt3quKjPoai9yBxK9IYVh2EHvwwXDNDemMK44xiVs7ipHM5xR5APlb1UKUOa NiIwlzY1kYvBDFCK3UQdWqRxjQ/5pctoJiHHm17JfNe7J2zaG3Ap1pDzebq1w36WgQma kMfo7fAK8jln5dKDyNxcnnzSSf6ArmcOSLKUHhjWTYgy5g4WoCWrSzCLtq9ALas0QSSv 2oSDuMmNMGcIWaugEwx9hGjk/ARV2Vj7H91Q79s9v7+nb9QrpA7Ygmj4qJFH+XJA7MT3 JxPA== X-Gm-Message-State: ALoCoQk61Cr4wMelzfryU2q9VWl3aLqoOBckzSESu8NGcMUq4X6uNiVe9X/nNo27Txe4S2BnJYVz MIME-Version: 1.0 X-Received: by 10.194.173.8 with SMTP id bg8mr22533629wjc.65.1437718808659; Thu, 23 Jul 2015 23:20:08 -0700 (PDT) Sender: sobomax@sippysoft.com Received: by 10.27.10.105 with HTTP; Thu, 23 Jul 2015 23:20:08 -0700 (PDT) Date: Thu, 23 Jul 2015 23:20:08 -0700 X-Google-Sender-Auth: Cnt33mp3ksW-oafazbnyVygvDkU Message-ID: Subject: Re: svn: head/sys: conf dev/vt dev/vt/logo From: Maxim Sobolev To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 06:20:19 -0000 Oh my! But in the past we've used to have splash so why not? I am just curious if someone if working on libvgl support in the vt? I think the graphics should go into loadable module, though. So it's easy to change or amend. -Max On Tue, Jul 21, 2015 at 1:33 PM, Conrad E. Meyer wrote: > Author: cem > Date: Tue Jul 21 20:33:36 2015 > New Revision: 285766 > URL: https://svnweb.freebsd.org/changeset/base/285766 > > Log: > vt: Draw logos per CPU core > > This feature is inspired by another Unix-alike OS commonly found on > airplane headrests. > > A number of beasties[0] are drawn at top of framebuffer during boot, > based on the number of active SMP CPUs[1]. Console buffer output > continues to scroll in the screen area below beastie(s)[2]. > > After some time[3] has passed, the beasties are erased leaving the > entire terminal for use. > > Includes two 80x80 vga16 beastie graphics and an 80x80 vga16 orb > graphic. (The graphics are RLE compressed to save some space -- 3x 3200 > bytes uncompressed, or 4208 compressed.) > > [0]: The user may select the style of beastie with > > kern.vt.splash_cpu_style=(0|1|2) > > [1]: Or the number may be overridden with tunable kern.vt.splash_ncpu. > [2]: https://www.youtube.com/watch?v=UP2jizfr3_o > [3]: Configurable with kern.vt.splash_cpu_duration (seconds, def. 10). > > Differential Revision: https://reviews.freebsd.org/D2181 > Reviewed by: dumbbell, emaste > Approved by: markj (mentor) > MFC after: 2 weeks > > Added: > head/sys/dev/vt/logo/logo_beastie.c (contents, props changed) > head/sys/dev/vt/vt_cpulogos.c (contents, props changed) > Modified: > head/sys/conf/files > head/sys/dev/vt/vt.h > head/sys/dev/vt/vt_core.c > > Modified: head/sys/conf/files > > ============================================================================== > --- head/sys/conf/files Tue Jul 21 20:30:06 2015 (r285765) > +++ head/sys/conf/files Tue Jul 21 20:33:36 2015 (r285766) > @@ -2726,9 +2726,11 @@ dev/vt/hw/efifb/efifb.c optional vt_efi > dev/vt/hw/fb/vt_fb.c optional vt > dev/vt/hw/vga/vt_vga.c optional vt vt_vga > dev/vt/logo/logo_freebsd.c optional vt splash > +dev/vt/logo/logo_beastie.c optional vt splash > dev/vt/vt_buf.c optional vt > dev/vt/vt_consolectl.c optional vt > dev/vt/vt_core.c optional vt > +dev/vt/vt_cpulogos.c optional vt splash > dev/vt/vt_font.c optional vt > dev/vt/vt_sysmouse.c optional vt > dev/vte/if_vte.c optional vte pci > > Added: head/sys/dev/vt/logo/logo_beastie.c > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/vt/logo/logo_beastie.c Tue Jul 21 20:33:36 2015 > (r285766) > @@ -0,0 +1,398 @@ > +/*- > + * Copyright (c) 2015 Conrad Meyer > + * Copyright (c) 2005 The FreeBSD Foundation > + * Copyright (c) 1996 Larry Ewing > + * Copyright (c) 1988 Kirk McKusick > + * > + * 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 > + > +const unsigned int vt_logo_sprite_width = 80; > +const unsigned int vt_logo_sprite_height = 80; > + > +const unsigned char vt_beastie_vga16[] = { > + 0x16, 0x00, 0x62, 0x16, 0x88, 0x03, 0x80, 0x16, 0x00, 0x23, 0x88, > 0x80, > + 0x00, 0x00, 0x08, 0x88, 0x16, 0x00, 0x21, 0x08, 0x16, 0x00, 0x06, > 0x88, > + 0x16, 0x00, 0x20, 0x80, 0x16, 0x00, 0x06, 0x08, 0x80, 0x16, 0x00, > 0x1e, > + 0x08, 0x16, 0x00, 0x08, 0x88, 0x16, 0x00, 0x1e, 0x08, 0x16, 0x00, > 0x06, > + 0x87, 0x00, 0x08, 0x16, 0x00, 0x1e, 0x80, 0x16, 0x00, 0x06, 0x77, > 0x80, > + 0x00, 0x80, 0x16, 0x00, 0x1d, 0x80, 0x16, 0x00, 0x06, 0x08, 0x00, > 0x00, > + 0x08, 0x16, 0x00, 0x1d, 0x80, 0x16, 0x00, 0x09, 0x08, 0x16, 0x00, > 0x1c, > + 0x08, 0x16, 0x00, 0x0a, 0x08, 0x16, 0x00, 0x1c, 0x08, 0x16, 0x00, > 0x0b, > + 0x80, 0x16, 0x00, 0x1b, 0x08, 0x16, 0x00, 0x0b, 0x80, 0x16, 0x00, > 0x1b, > + 0x08, 0x00, 0x08, 0x70, 0x16, 0x00, 0x03, 0x77, 0x70, 0x16, 0x00, > 0x03, > + 0x80, 0x16, 0x00, 0x1b, 0x08, 0x00, 0x87, 0x77, 0x00, 0x00, 0x07, > 0xff, > + 0xf7, 0x16, 0x00, 0x03, 0x80, 0x16, 0x00, 0x1b, 0x08, 0x08, 0x77, > 0xff, > + 0x00, 0x00, 0x7f, 0x77, 0xf7, 0x16, 0x00, 0x03, 0x80, 0x16, 0x00, > 0x1b, > + 0x08, 0x08, 0x70, 0x0f, 0x80, 0x00, 0xf7, 0x08, 0x7f, 0x70, 0x00, > 0x00, > + 0x80, 0x16, 0x00, 0x1b, 0x08, 0x08, 0x80, 0x07, 0x80, 0x00, 0xf8, > 0x00, > + 0x8f, 0x70, 0x00, 0x00, 0x80, 0x16, 0x00, 0x1b, 0x08, 0x08, 0x70, > 0x07, > + 0x88, 0x88, 0xf8, 0x00, 0x8f, 0x70, 0x00, 0x00, 0x80, 0x16, 0x00, > 0x1b, > + 0x08, 0x00, 0xf0, 0x06, 0x16, 0xe6, 0x03, 0x00, 0x8f, 0x16, 0x00, > 0x03, > + 0x80, 0x16, 0x00, 0x1b, 0x08, 0x00, 0x77, 0x16, 0x6e, 0x05, 0x77, > 0x16, > + 0x00, 0x03, 0x80, 0x16, 0x00, 0x1b, 0x08, 0x00, 0x06, 0x16, 0xe6, > 0x06, > + 0x16, 0x00, 0x03, 0x80, 0x16, 0x00, 0x1b, 0x08, 0x00, 0x16, 0x6e, > 0x07, > + 0x60, 0x00, 0x00, 0x08, 0x16, 0x00, 0x1b, 0x08, 0x80, 0x16, 0xe6, > 0x07, > + 0x60, 0x00, 0x00, 0x08, 0x16, 0x00, 0x1b, 0x08, 0x80, 0x16, 0x6e, > 0x05, > + 0x66, 0x66, 0x80, 0x08, 0x00, 0x00, 0x80, 0x16, 0x00, 0x1a, 0x08, > 0x80, > + 0x86, 0x16, 0xe6, 0x03, 0x16, 0x66, 0x03, 0x80, 0x08, 0x78, 0x00, > 0x80, > + 0x16, 0x00, 0x1a, 0x08, 0x80, 0x86, 0x16, 0x66, 0x05, 0x77, 0x70, > 0x00, > + 0x77, 0x00, 0x08, 0x16, 0x00, 0x1a, 0x08, 0x00, 0x87, 0x16, 0x66, > 0x04, > + 0x77, 0x77, 0x78, 0x00, 0x88, 0x00, 0x08, 0x16, 0x00, 0x1a, 0x08, > 0x00, > + 0x87, 0x76, 0x66, 0x66, 0x77, 0x77, 0xff, 0xf7, 0x16, 0x00, 0x03, > 0x08, > + 0x16, 0x00, 0x1a, 0x80, 0x08, 0xff, 0x16, 0x77, 0x04, 0x16, 0xff, > 0x03, > + 0x80, 0x16, 0x00, 0x03, 0x80, 0x16, 0x00, 0x19, 0x80, 0x07, 0xff, > 0x16, > + 0x77, 0x03, 0x7f, 0x16, 0xff, 0x03, 0x70, 0x16, 0x00, 0x03, 0x80, > 0x16, > + 0x00, 0x18, 0x08, 0x00, 0x8f, 0xff, 0xf7, 0x77, 0x77, 0x16, 0xff, > 0x04, > + 0xf0, 0x16, 0x00, 0x03, 0x08, 0x16, 0x00, 0x18, 0x80, 0x08, 0x7f, > 0x16, > + 0xff, 0x08, 0xf8, 0x16, 0x00, 0x04, 0x80, 0x16, 0x00, 0x16, 0x08, > 0x00, > + 0x08, 0x16, 0xff, 0x09, 0xf7, 0x16, 0x00, 0x04, 0x08, 0x16, 0x00, > 0x16, > + 0x08, 0x00, 0x08, 0x16, 0xff, 0x0a, 0x16, 0x00, 0x05, 0x80, 0x16, > 0x00, > + 0x15, 0x80, 0x00, 0x87, 0x16, 0xff, 0x0a, 0x80, 0x16, 0x00, 0x04, > 0x08, > + 0x16, 0x00, 0x14, 0x08, 0x00, 0x00, 0x87, 0x77, 0xff, 0xf7, 0x77, > 0x16, > + 0xff, 0x03, 0x16, 0x77, 0x03, 0x78, 0x16, 0x00, 0x04, 0x08, 0x16, > 0x00, > + 0x14, 0x08, 0x00, 0x00, 0x77, 0x7f, 0xff, 0xff, 0x7f, 0x16, 0xff, > 0x04, > + 0x77, 0x77, 0x78, 0x00, 0x80, 0x16, 0x00, 0x03, 0x80, 0x16, 0x00, > 0x13, > + 0x80, 0x00, 0x00, 0x7f, 0x16, 0xff, 0x09, 0xf7, 0x77, 0x00, 0x08, > 0x80, > + 0x00, 0x00, 0x80, 0x16, 0x00, 0x13, 0x80, 0x80, 0x08, 0x16, 0xff, > 0x0b, > + 0x77, 0x80, 0x00, 0x08, 0x00, 0x00, 0x08, 0x16, 0x00, 0x12, 0x08, > 0x00, > + 0x80, 0x07, 0x16, 0xff, 0x0c, 0x78, 0x00, 0x08, 0x80, 0x00, 0x08, > 0x16, > + 0x00, 0x12, 0x08, 0x08, 0x00, 0x8f, 0x16, 0xff, 0x0c, 0xf7, 0x08, > 0x80, > + 0x80, 0x00, 0x08, 0x16, 0x00, 0x12, 0x16, 0x08, 0x03, 0x7f, 0x16, > 0xff, > + 0x0c, 0xf7, 0x08, 0x80, 0x80, 0x00, 0x00, 0x80, 0x16, 0x00, 0x11, > 0x80, > + 0x08, 0x07, 0x16, 0xff, 0x0e, 0x80, 0x00, 0x08, 0x00, 0x00, 0x80, > 0x16, > + 0x00, 0x11, 0x80, 0x80, 0x0f, 0x16, 0xff, 0x0e, 0x70, 0x00, 0x08, > 0x00, > + 0x00, 0x80, 0x16, 0x00, 0x10, 0x08, 0x00, 0x80, 0x8f, 0x16, 0xff, > 0x0e, > + 0x70, 0x00, 0x08, 0x00, 0x00, 0x80, 0x16, 0x00, 0x10, 0x08, 0x08, > 0x00, > + 0x7f, 0x16, 0xff, 0x0e, 0x70, 0x00, 0x08, 0x00, 0x00, 0x08, 0x16, > 0x00, > + 0x10, 0x80, 0x08, 0x00, 0x16, 0xff, 0x05, 0x7f, 0x16, 0xff, 0x09, > 0xf0, > + 0x00, 0x08, 0x00, 0x00, 0x08, 0x16, 0x00, 0x0f, 0x08, 0x00, 0x08, > 0x00, > + 0x16, 0xff, 0x05, 0x7f, 0x16, 0xff, 0x09, 0xf0, 0x00, 0x08, 0x00, > 0x00, > + 0x08, 0x16, 0x00, 0x0f, 0x08, 0x00, 0x08, 0x08, 0x16, 0xff, 0x05, > 0x7f, > + 0x16, 0xff, 0x09, 0xf0, 0x00, 0x08, 0x00, 0x00, 0x08, 0x16, 0x00, > 0x0f, > + 0x08, 0x00, 0x08, 0x08, 0x16, 0xff, 0x05, 0x7f, 0x16, 0xff, 0x09, > 0xf0, > + 0x00, 0x08, 0x00, 0x00, 0x08, 0x16, 0x00, 0x0f, 0x08, 0x00, 0x00, > 0x88, > + 0x16, 0xff, 0x05, 0x7f, 0x16, 0xff, 0x09, 0xf0, 0x00, 0x08, 0x00, > 0x00, > + 0x08, 0x16, 0x00, 0x0f, 0x08, 0x00, 0x00, 0x08, 0x16, 0xff, 0x05, > 0x7f, > + 0x16, 0xff, 0x09, 0xf0, 0x88, 0x88, 0x80, 0x00, 0x08, 0x16, 0x00, > 0x0f, > + 0x08, 0x06, 0xe6, 0x00, 0x8f, 0x16, 0xff, 0x04, 0x7f, 0x16, 0xff, > 0x09, > + 0xf8, 0x00, 0x00, 0x08, 0x80, 0x08, 0x16, 0x00, 0x10, 0x6e, 0x6e, > 0x60, > + 0x08, 0x16, 0xff, 0x04, 0x7f, 0x16, 0xff, 0x08, 0xe6, 0xe0, 0x16, > 0x00, > + 0x03, 0x88, 0x80, 0x16, 0x00, 0x0f, 0x06, 0x16, 0xe6, 0x03, 0x00, > 0x8f, > + 0x16, 0xff, 0x0b, 0xfe, 0x6e, 0x60, 0x16, 0x00, 0x04, 0x60, 0x16, > 0x00, > + 0x0f, 0x16, 0x6e, 0x04, 0x60, 0x08, 0x16, 0xff, 0x0b, 0xf6, 0xe6, > 0xe0, > + 0x16, 0x00, 0x03, 0x06, 0xe6, 0x16, 0x00, 0x0c, 0x06, 0x16, 0xe6, > 0x06, > + 0xe0, 0x00, 0x8f, 0x16, 0xff, 0x0a, 0xfe, 0x6e, 0x60, 0x16, 0x00, > 0x03, > + 0x0e, 0x6e, 0x16, 0x00, 0x0c, 0x16, 0x6e, 0x08, 0x00, 0x08, 0x16, > 0xff, > + 0x0a, 0x76, 0xe6, 0xe6, 0x16, 0x00, 0x03, 0xe6, 0xe6, 0x16, 0x00, > 0x0c, > + 0x16, 0xe6, 0x08, 0xe0, 0x00, 0x8f, 0x16, 0xff, 0x08, 0xf7, 0x7e, > 0x16, > + 0x6e, 0x07, 0x16, 0x00, 0x0c, 0x16, 0x6e, 0x08, 0x60, 0x00, 0x08, > 0x16, > + 0xff, 0x08, 0xf7, 0x76, 0x16, 0xe6, 0x07, 0xe0, 0x16, 0x00, 0x0b, > 0x16, > + 0xe6, 0x09, 0x00, 0x00, 0x0f, 0x16, 0xff, 0x07, 0xf7, 0x7e, 0x16, > 0x6e, > + 0x08, 0x16, 0x00, 0x0b, 0x16, 0x6e, 0x09, 0x60, 0x00, 0x0f, 0x16, > 0xff, > + 0x07, 0xf7, 0x76, 0x16, 0xe6, 0x08, 0xe0, 0x16, 0x00, 0x0a, 0x16, > 0xe6, > + 0x09, 0xe0, 0x00, 0x8f, 0x16, 0xff, 0x07, 0xf7, 0x8e, 0x16, 0x6e, > 0x09, > + 0x16, 0x00, 0x0a, 0x16, 0x6e, 0x0a, 0x88, 0x16, 0xff, 0x08, 0x78, > 0x86, > + 0x16, 0xe6, 0x0a, 0x16, 0x00, 0x09, 0x16, 0xe6, 0x0a, 0xef, 0x16, > 0xff, > + 0x07, 0xf7, 0x80, 0x06, 0x16, 0x6e, 0x0a, 0x16, 0x00, 0x09, 0x16, > 0x6e, > + 0x0b, 0x16, 0xff, 0x07, 0x78, 0x00, 0x06, 0x16, 0xe6, 0x09, 0xe0, > 0x16, > + 0x00, 0x09, 0x16, 0xe6, 0x0b, 0x7f, 0x16, 0xff, 0x05, 0x78, 0x80, > 0x00, > + 0x06, 0x16, 0x6e, 0x09, 0x16, 0x00, 0x09, 0x0e, 0x16, 0x6e, 0x0a, > 0x66, > + 0x67, 0x16, 0xff, 0x04, 0x78, 0x80, 0x00, 0x00, 0x86, 0x16, 0xe6, > 0x08, > + 0xe0, 0x16, 0x00, 0x09, 0x06, 0x16, 0xe6, 0x0b, 0x60, 0x16, 0x00, > 0x08, > + 0x86, 0x16, 0x6e, 0x06, 0x66, 0x60, 0x16, 0x00, 0x0a, 0x0e, 0x16, > 0x6e, > + 0x0a, 0x66, 0x60, 0x16, 0x00, 0x08, 0x86, 0x16, 0xe6, 0x06, 0x60, > 0x16, > + 0x00, 0x0c, 0x16, 0xe6, 0x0b, 0x60, 0x16, 0x00, 0x08, 0x86, 0x16, > 0x6e, > + 0x04, 0x66, 0x66, 0x16, 0x00, 0x0f, 0x16, 0x66, 0x03, 0x16, 0x6e, > 0x05, > + 0x66, 0x60, 0x00, 0x16, 0x88, 0x05, 0x80, 0x00, 0x06, 0x66, 0x16, > 0xe6, > + 0x03, 0x66, 0x16, 0x00, 0x12, 0x16, 0x66, 0x04, 0xe6, 0xe6, 0x66, > 0x88, > + 0x88, 0x16, 0x00, 0x05, 0x08, 0x88, 0x86, 0x66, 0x6e, 0x6e, 0x66, > 0x60, > + 0x16, 0x00, 0x14, 0x06, 0x16, 0x66, 0x04, 0x16, 0x00, 0x09, 0x06, > 0x16, > + 0x66, 0x04, 0x16, 0x00, 0x16, 0x06, 0x66, 0x66, 0x60, 0x16, 0x00, > 0x0a, > + 0x16, 0x66, 0x03, 0x60, 0x16, 0x00, 0x82 > +}; > + > +const unsigned char vt_beastie2_vga16[] = { > + 0x16, 0x00, 0x11, 0x04, 0x16, 0x00, 0x26, 0x04, 0x44, 0x16, 0x00, > 0x26, > + 0x44, 0x40, 0x16, 0x00, 0x25, 0x44, 0x44, 0x16, 0x00, 0x0b, 0x44, > 0x16, > + 0x00, 0x19, 0x04, 0x44, 0x40, 0x16, 0x00, 0x0b, 0x04, 0x40, 0x16, > 0x00, > + 0x18, 0x44, 0x44, 0x40, 0x16, 0x00, 0x0b, 0x04, 0x44, 0x16, 0x00, > 0x17, > + 0x04, 0x44, 0x44, 0x16, 0x00, 0x0d, 0x44, 0x40, 0x16, 0x00, 0x16, > 0x16, > + 0x44, 0x03, 0x16, 0x00, 0x03, 0x04, 0x04, 0x16, 0x00, 0x08, 0x44, > 0x44, > + 0x16, 0x00, 0x16, 0x16, 0x44, 0x03, 0x00, 0x04, 0x16, 0x44, 0x05, > 0x16, > + 0x00, 0x06, 0x44, 0x44, 0x16, 0x00, 0x15, 0x04, 0x44, 0x44, 0x40, > 0x40, > + 0x16, 0x44, 0x07, 0x40, 0x16, 0x00, 0x04, 0x44, 0x44, 0x40, 0x16, > 0x00, > + 0x14, 0x04, 0x16, 0x44, 0x06, 0x04, 0x04, 0x16, 0x44, 0x03, 0x04, > 0x16, > + 0x00, 0x03, 0x04, 0x44, 0x44, 0x40, 0x16, 0x00, 0x14, 0x04, 0x16, > 0x44, > + 0x07, 0x40, 0x16, 0x44, 0x04, 0x40, 0x00, 0x00, 0x16, 0x44, 0x03, > 0x40, > + 0x16, 0x00, 0x14, 0x04, 0x16, 0x44, 0x03, 0x84, 0x16, 0x44, 0x04, > 0x04, > + 0x16, 0x44, 0x04, 0x04, 0x16, 0x44, 0x04, 0x40, 0x16, 0x00, 0x14, > 0x04, > + 0x44, 0x44, 0x0f, 0xf8, 0x44, 0x48, 0x84, 0x16, 0x44, 0x0b, 0x40, > 0x16, > + 0x00, 0x14, 0x04, 0x44, 0x40, 0xff, 0xf8, 0x40, 0xff, 0xff, 0x16, > 0x44, > + 0x0b, 0x40, 0x16, 0x00, 0x14, 0x04, 0x44, 0x0f, 0xff, 0x74, 0x47, > 0xff, > + 0xff, 0x74, 0x16, 0x44, 0x0a, 0x40, 0x16, 0x00, 0x14, 0x04, 0x04, > 0xff, > + 0xff, 0x44, 0x7f, 0xff, 0xff, 0xf4, 0x16, 0x44, 0x0a, 0x16, 0x00, > 0x15, > + 0x04, 0x48, 0xff, 0xf7, 0x40, 0x16, 0xff, 0x03, 0xf6, 0x16, 0x44, > 0x0a, > + 0x16, 0x00, 0x16, 0x4f, 0xff, 0xf8, 0x47, 0x16, 0xff, 0x03, 0xf8, > 0x16, > + 0x44, 0x09, 0x40, 0x16, 0x00, 0x16, 0x07, 0x07, 0xf8, 0x0f, 0x16, > 0xff, > + 0x03, 0xf8, 0x16, 0x44, 0x08, 0x40, 0x40, 0x16, 0x00, 0x15, 0x04, > 0x77, > + 0x80, 0xf4, 0x78, 0x0f, 0xff, 0xff, 0xf8, 0x16, 0x44, 0x09, 0x16, > 0x00, > + 0x16, 0x04, 0x8f, 0x00, 0xf0, 0x8f, 0x88, 0xff, 0xff, 0xf8, 0x16, > 0x44, > + 0x08, 0x16, 0x00, 0x17, 0x04, 0x00, 0x00, 0x88, 0x0f, 0x00, 0xff, > 0xff, > + 0xf6, 0x16, 0x44, 0x07, 0x40, 0x16, 0x00, 0x17, 0x40, 0x00, 0x00, > 0x48, > + 0x07, 0x00, 0xff, 0xff, 0xf4, 0x16, 0x44, 0x06, 0x40, 0x16, 0x00, > 0x18, > + 0x44, 0x80, 0x08, 0x48, 0x00, 0x00, 0xff, 0xff, 0xf4, 0x16, 0x44, > 0x06, > + 0x16, 0x00, 0x18, 0x04, 0x44, 0x40, 0x04, 0x48, 0x00, 0x00, 0xff, > 0xff, > + 0x84, 0x16, 0x44, 0x06, 0x40, 0x16, 0x00, 0x17, 0x44, 0x44, 0x04, > 0x00, > + 0x48, 0x00, 0x07, 0xff, 0xff, 0x16, 0x44, 0x07, 0x40, 0x16, 0x00, > 0x17, > + 0x44, 0x40, 0x16, 0x44, 0x03, 0xf7, 0xff, 0xff, 0xf0, 0x16, 0x44, > 0x07, > + 0x40, 0x16, 0x00, 0x16, 0x04, 0x44, 0x40, 0x44, 0x44, 0x40, 0x0f, > 0xff, > + 0xf7, 0x00, 0x16, 0x44, 0x07, 0x40, 0x16, 0x00, 0x14, 0x6e, 0x00, > 0x04, > + 0x16, 0x44, 0x05, 0x40, 0x40, 0x16, 0x44, 0x08, 0x40, 0x40, 0x16, > 0x00, > + 0x14, 0x0e, 0xe0, 0x00, 0x44, 0x44, 0x04, 0x16, 0x44, 0x0d, 0x16, > 0x00, > + 0x15, 0x06, 0x66, 0x00, 0x16, 0x44, 0x03, 0x16, 0x40, 0x03, 0x16, > 0x44, > + 0x09, 0x04, 0x16, 0x00, 0x13, 0x60, 0x00, 0x00, 0x06, 0x60, 0x44, > 0x44, > + 0x04, 0x16, 0x44, 0x0c, 0x40, 0x16, 0x00, 0x13, 0x0e, 0xe0, 0x00, > 0x00, > + 0xe0, 0x04, 0x44, 0x40, 0x16, 0x44, 0x0b, 0x40, 0x40, 0x16, 0x00, > 0x13, > + 0x06, 0xee, 0x00, 0x00, 0xe0, 0x00, 0x04, 0x16, 0x44, 0x07, 0x40, > 0x40, > + 0x16, 0x44, 0x04, 0x16, 0x00, 0x14, 0x06, 0x06, 0xe6, 0x00, 0xe0, > 0x00, > + 0x00, 0x04, 0x04, 0x16, 0x44, 0x04, 0x40, 0x16, 0x44, 0x05, 0x16, > 0x00, > + 0x17, 0x6e, 0x6e, 0x60, 0x16, 0x00, 0x04, 0x16, 0x44, 0x03, 0x40, > 0x16, > + 0x44, 0x04, 0x40, 0x40, 0x16, 0x00, 0x13, 0x68, 0x60, 0x00, 0x00, > 0x06, > + 0xee, 0x60, 0x16, 0x00, 0x05, 0x40, 0x40, 0x16, 0x44, 0x03, 0x04, > 0x16, > + 0x00, 0x16, 0x0e, 0xe0, 0x00, 0x00, 0x6e, 0xe6, 0xe6, 0x04, 0x44, > 0x44, > + 0x00, 0x00, 0x16, 0x44, 0x04, 0x04, 0x44, 0x40, 0x40, 0x16, 0x00, > 0x15, > + 0x6e, 0x66, 0x6e, 0xe6, 0x66, 0xee, 0x04, 0x44, 0x44, 0x16, 0x00, > 0x03, > + 0x16, 0x40, 0x03, 0x44, 0x44, 0x40, 0x16, 0x00, 0x16, 0x06, 0x6e, > 0xee, > + 0x68, 0x00, 0x0e, 0x64, 0x44, 0x44, 0x16, 0x00, 0x03, 0x16, 0x44, > 0x06, > + 0x04, 0x16, 0x00, 0x1b, 0x60, 0x44, 0x40, 0x16, 0x00, 0x03, 0x16, > 0x44, > + 0x06, 0x40, 0x16, 0x00, 0x1a, 0x04, 0x44, 0x40, 0x16, 0x00, 0x03, > 0x04, > + 0x16, 0x44, 0x06, 0x04, 0x16, 0x00, 0x1a, 0x04, 0x16, 0x44, 0x05, > 0x04, > + 0x16, 0x44, 0x06, 0x40, 0x16, 0x00, 0x1a, 0x04, 0x16, 0x44, 0x04, > 0x04, > + 0x04, 0x44, 0x04, 0x16, 0x44, 0x03, 0x04, 0x40, 0x40, 0x16, 0x00, > 0x19, > + 0x04, 0x44, 0x44, 0x04, 0x40, 0x44, 0x04, 0x44, 0x44, 0x04, 0x44, > 0x40, > + 0x44, 0x44, 0x16, 0x00, 0x1b, 0x04, 0x40, 0x44, 0x04, 0x16, 0x44, > 0x04, > + 0x40, 0x40, 0x44, 0x44, 0x40, 0x40, 0x16, 0x00, 0x1a, 0x04, 0x16, > 0x44, > + 0x03, 0x40, 0x16, 0x44, 0x08, 0x16, 0x00, 0x1c, 0x04, 0x40, 0x44, > 0x04, > + 0x16, 0x44, 0x07, 0x40, 0x40, 0x16, 0x00, 0x1e, 0x16, 0x44, 0x09, > 0x16, > + 0x00, 0x1e, 0x04, 0x16, 0x44, 0x06, 0x40, 0x44, 0x44, 0x04, 0x16, > 0x00, > + 0x1d, 0x04, 0x16, 0x44, 0x06, 0x40, 0x44, 0x44, 0x40, 0x16, 0x00, > 0x1e, > + 0x16, 0x44, 0x06, 0x40, 0x44, 0x16, 0x00, 0x20, 0x04, 0x00, 0x16, > 0x44, > + 0x04, 0x04, 0x00, 0x04, 0x16, 0x00, 0x1f, 0x40, 0x16, 0x44, 0x05, > 0x00, > + 0x04, 0x16, 0x00, 0x1f, 0x04, 0x44, 0x00, 0x04, 0x04, 0x40, 0x40, > 0x04, > + 0x00, 0x40, 0x40, 0x16, 0x00, 0x1d, 0x04, 0x44, 0x44, 0x00, 0x40, > 0x06, > + 0x6e, 0x60, 0x04, 0x16, 0x00, 0x20, 0x16, 0x44, 0x04, 0x40, 0x6e, > 0xe6, > + 0x00, 0x40, 0x40, 0x16, 0x00, 0x1e, 0x16, 0x44, 0x05, 0x46, 0xee, > 0x60, > + 0x16, 0x00, 0x20, 0x16, 0x44, 0x05, 0x04, 0x6e, 0xee, 0x04, 0x04, > 0x16, > + 0x00, 0x1e, 0x04, 0x16, 0x44, 0x05, 0x06, 0x6e, 0xe0, 0x00, 0x04, > 0x16, > + 0x00, 0x1e, 0x16, 0x44, 0x06, 0x6e, 0x64, 0x04, 0x16, 0x00, 0x1f, > 0x04, > + 0x04, 0x00, 0x00, 0x16, 0x04, 0x04, 0x00, 0x04, 0x16, 0x00, 0x1e, > 0x04, > + 0x44, 0x04, 0x04, 0x16, 0x40, 0x04, 0x44, 0x40, 0x04, 0x16, 0x00, > 0x1d, > + 0x44, 0x84, 0x74, 0x86, 0x87, 0x84, 0x44, 0x04, 0x00, 0x44, 0x40, > 0x04, > + 0x16, 0x00, 0x1c, 0x87, 0xc7, 0x40, 0x77, 0x74, 0x04, 0x04, 0x80, > 0x00, > + 0x00, 0x44, 0x40, 0x16, 0x00, 0x1b, 0x7c, 0x7c, 0x84, 0x74, 0x84, > 0x44, > + 0x84, 0x48, 0x78, 0x40, 0x00, 0x00, 0x44, 0x44, 0x04, 0x16, 0x00, > 0x16, > + 0x40, 0x48, 0xc8, 0xc7, 0x44, 0x40, 0x84, 0x44, 0x76, 0x04, 0x48, > 0x78, > + 0x16, 0x00, 0x04, 0x04, 0x40, 0x44, 0x04, 0x16, 0x00, 0x10, 0x08, > 0x77, > + 0xff, 0x77, 0x84, 0x44, 0x04, 0x00, 0x00, 0x46, 0x48, 0x74, 0x04, > 0x44, > + 0x40, 0x80, 0x40, 0x16, 0x00, 0x04, 0x04, 0x16, 0x44, 0x05, 0x40, > 0x40, > + 0x16, 0x00, 0x0a, 0x87, 0x16, 0xff, 0x03, 0xf7, 0x70, 0x88, 0x77, > 0x77, > + 0x84, 0x04, 0x44, 0x40, 0x44, 0x04, 0x44, 0x44, 0x04, 0x16, 0x00, > 0x07, > + 0x04, 0x16, 0x44, 0x03, 0x04, 0x40, 0x16, 0x00, 0x08, 0x07, 0x88, > 0x16, > + 0xff, 0x03, 0x77, 0x87, 0x16, 0xff, 0x03, 0x77, 0x84, 0x04, 0x04, > 0x44, > + 0x44, 0x16, 0x40, 0x03, 0x80, 0x16, 0x00, 0x09, 0x04, 0x44, 0x44, > 0x40, > + 0x16, 0x00, 0x07, 0x0f, 0xff, 0x16, 0x88, 0x03, 0x80, 0x7f, 0x16, > 0xff, > + 0x03, 0xf7, 0x78, 0x16, 0x44, 0x03, 0x04, 0x04, 0x48, 0x87, 0x80, > 0x16, > + 0x00, 0x0b, 0x04, 0x44, 0x16, 0x00, 0x07, 0x08, 0x16, 0xff, 0x03, > 0x77, > + 0x88, 0x87, 0x16, 0xff, 0x03, 0x77, 0x77, 0x16, 0x04, 0x03, 0x40, > 0x48, > + 0x87, 0x77, 0x16, 0x00, 0x0d, 0x44, 0x40, 0x16, 0x00, 0x07, 0x88, > 0x77, > + 0xf7, 0x77, 0x8f, 0x77, 0x16, 0x88, 0x05, 0x80, 0x88, 0x88, 0x87, > 0x77, > + 0x77, 0x80, 0x16, 0x00, 0x0d, 0x44, 0x40, 0x16, 0x00, 0x0b, 0x07, > 0x16, > + 0xff, 0x03, 0x7f, 0x16, 0x77, 0x06, 0x78, 0x16, 0x00, 0x0a, 0x04, > 0x40, > + 0x16, 0x00, 0x03, 0x44, 0x40, 0x16, 0x00, 0x0c, 0x87, 0x7f, 0xff, > 0xff, > + 0x16, 0x77, 0x04, 0x88, 0x80, 0x16, 0x00, 0x0a, 0x04, 0x44, 0x44, > 0x00, > + 0x00, 0x04, 0x44, 0x40, 0x16, 0x00, 0x0e, 0x08, 0x08, 0x88, 0x08, > 0x16, > + 0x00, 0x0e, 0x16, 0x44, 0x06, 0x40, 0x16, 0x00, 0x20, 0x16, 0x44, > 0x06, > + 0x16, 0x00, 0x21, 0x16, 0x44, 0x05, 0x40, 0x16, 0x00, 0x22, 0x40, > 0x40, > + 0x16, 0x00, 0x08 > +}; > + > +const unsigned char vt_orb_vga16[] = { > + 0x16, 0x00, 0x52, 0x04, 0x04, 0x16, 0x00, 0x0c, 0x16, 0x80, 0x03, > 0x88, > + 0x88, 0x16, 0x80, 0x04, 0x16, 0x00, 0x0b, 0x40, 0x40, 0x16, 0x00, > 0x03, > + 0x04, 0x44, 0x6c, 0xcc, 0x64, 0x16, 0x00, 0x08, 0x08, 0x08, 0x88, > 0x77, > + 0x16, 0x7f, 0x04, 0x77, 0x78, 0x88, 0x80, 0x80, 0x16, 0x00, 0x07, > 0x04, > + 0x6c, 0x6c, 0x44, 0x40, 0x00, 0x00, 0x04, 0x46, 0x4c, 0x77, 0x7c, > 0xcc, > + 0x40, 0x16, 0x00, 0x04, 0x08, 0x08, 0x88, 0x7f, 0x16, 0xff, 0x08, > 0xf7, > + 0x78, 0x80, 0x80, 0x16, 0x00, 0x05, 0x4c, 0xc7, 0xc7, 0xcc, 0x44, > 0x44, > + 0x00, 0x00, 0x44, 0x44, 0x46, 0xcc, 0xf7, 0xfc, 0x7c, 0x60, 0x00, > 0x00, > + 0x08, 0x08, 0x87, 0x16, 0xff, 0x0c, 0xf7, 0x88, 0x08, 0x16, 0x00, > 0x03, > + 0x6c, 0x16, 0xf7, 0x03, 0xc6, 0x44, 0x44, 0x00, 0x00, 0x16, 0x44, > 0x03, > + 0xc7, 0x7f, 0xf7, 0x77, 0xc7, 0x60, 0x00, 0x80, 0x77, 0x16, 0xff, > 0x0e, > + 0xf7, 0x70, 0x80, 0x08, 0x67, 0xff, 0x7f, 0x7f, 0x7c, 0xc4, 0x44, > 0x44, > + 0x00, 0x00, 0x16, 0x44, 0x03, 0x4c, 0xc7, 0xff, 0xf7, 0xf7, 0x77, > 0x68, > + 0x8f, 0x16, 0xff, 0x09, 0x16, 0xf7, 0x03, 0x16, 0xff, 0x05, 0x88, > 0x67, > + 0xff, 0x7f, 0xff, 0xff, 0x7c, 0x64, 0x44, 0x44, 0x00, 0x00, 0x04, > 0x16, > + 0x44, 0x03, 0x6c, 0xcf, 0x16, 0x7f, 0x04, 0x16, 0xff, 0x0d, 0x16, > 0xf7, > + 0x03, 0xff, 0xff, 0x7e, 0x16, 0xff, 0x04, 0x7c, 0xc6, 0x16, 0x44, > 0x03, > + 0x00, 0x00, 0x04, 0x16, 0x44, 0x03, 0x46, 0xcc, 0x7c, 0xf7, 0x16, > 0xff, > + 0x0d, 0x16, 0x7f, 0x03, 0x7c, 0xc6, 0xcc, 0x7e, 0x16, 0xff, 0x04, > 0xf7, > + 0x7c, 0x6c, 0x16, 0x44, 0x03, 0x00, 0x00, 0x04, 0x16, 0x44, 0x03, > 0x4c, > + 0x4c, 0xcc, 0xcf, 0x16, 0xff, 0x0f, 0xf7, 0xc4, 0x44, 0x4c, 0x16, > 0xff, > + 0x04, 0xf7, 0x7c, 0xcc, 0xc4, 0x16, 0x44, 0x03, 0x00, 0x00, 0x04, > 0x16, > + 0x44, 0x04, 0x4c, 0xcc, 0x7f, 0x16, 0xff, 0x0e, 0xf7, 0xf7, 0x44, > 0x46, > + 0xcf, 0x16, 0xff, 0x03, 0xf7, 0xf7, 0x77, 0xcc, 0x16, 0x44, 0x03, > 0xc0, > + 0x16, 0x00, 0x03, 0x16, 0x44, 0x04, 0xc4, 0xc7, 0x16, 0xff, 0x10, > 0xf7, > + 0x44, 0x47, 0x16, 0xff, 0x05, 0x77, 0xcc, 0xc4, 0x44, 0x44, 0x46, > 0x40, > + 0x16, 0x00, 0x03, 0xc4, 0x16, 0x44, 0x03, 0x4c, 0xcf, 0x16, 0xff, > 0x11, > + 0x44, 0x6f, 0x16, 0xff, 0x04, 0x7f, 0x77, 0x7c, 0x16, 0x44, 0x03, > 0x4c, > + 0x40, 0x16, 0x00, 0x03, 0x46, 0x16, 0x44, 0x03, 0xcc, 0x16, 0xff, > 0x12, > + 0xc6, 0xcf, 0x16, 0xff, 0x04, 0xf7, 0x7c, 0xc4, 0x16, 0x44, 0x03, > 0x8c, > + 0x16, 0x00, 0x04, 0x0c, 0x44, 0x44, 0x64, 0x7f, 0x16, 0xff, 0x12, > 0x77, > + 0xcf, 0x16, 0xff, 0x04, 0x7f, 0xcc, 0x16, 0x44, 0x03, 0x48, 0xc4, > 0x16, > + 0x00, 0x04, 0x08, 0xc4, 0x44, 0x4c, 0x16, 0xff, 0x13, 0xfc, 0x7e, > 0x16, > + 0xff, 0x03, 0xf7, 0xfc, 0x64, 0x16, 0x44, 0x03, 0x4c, 0xc0, 0x16, > 0x00, > + 0x05, 0xc6, 0x44, 0xc7, 0x16, 0xff, 0x13, 0x7f, 0x77, 0x16, 0xff, > 0x03, > + 0xfc, 0xcc, 0x16, 0x44, 0x04, 0x67, 0x60, 0x16, 0x00, 0x05, 0x8c, > 0x84, > + 0x7f, 0x16, 0xff, 0x09, 0x7f, 0xef, 0xff, 0x16, 0xf7, 0x06, 0xff, > 0xff, > + 0x77, 0xff, 0xff, 0x7c, 0xcc, 0xc4, 0x16, 0x44, 0x03, 0x48, 0xc7, > 0x40, > + 0x16, 0x00, 0x05, 0x07, 0xc7, 0x16, 0xff, 0x0c, 0x7f, 0x7f, 0xef, > 0xef, > + 0xfe, 0xff, 0xff, 0x7f, 0x7f, 0x76, 0xcf, 0xc7, 0xcc, 0xcc, 0x16, > 0x44, > + 0x04, 0x8c, 0x76, 0x16, 0x00, 0x06, 0x06, 0x7f, 0x7f, 0x16, 0xff, > 0x08, > + 0x16, 0x7f, 0x03, 0xfe, 0xfe, 0x16, 0xf7, 0x07, 0xfc, 0x6c, 0x7c, > 0xcc, > + 0xc4, 0x16, 0x44, 0x04, 0x67, 0xc8, 0x16, 0x00, 0x07, 0x7f, 0x16, > 0xff, > + 0x08, 0x7f, 0xf7, 0xf7, 0xfe, 0x7f, 0x7f, 0x7e, 0x7e, 0x16, 0xf7, > 0x06, > + 0x8c, 0xcc, 0xcc, 0xc4, 0x16, 0x44, 0x03, 0x48, 0xc7, 0x60, 0x16, > 0x00, > + 0x06, 0x08, 0xff, 0xff, 0xf7, 0x16, 0xff, 0x06, 0x16, 0xf7, 0x03, > 0x77, > + 0xfc, 0xfc, 0xf7, 0x77, 0x77, 0x16, 0x7f, 0x05, 0xc8, 0xcc, 0xc4, > 0x16, > + 0x44, 0x04, 0x8c, 0x7c, 0x78, 0x16, 0x00, 0x06, 0x0f, 0x7f, 0xff, > 0x7f, > + 0x16, 0xff, 0x05, 0x7f, 0x7f, 0x77, 0x7e, 0x7e, 0xcf, 0xcf, 0xce, > 0x77, > + 0x16, 0x7c, 0x04, 0x16, 0x77, 0x03, 0x4c, 0x4c, 0x16, 0x44, 0x04, > 0xc7, > + 0x77, 0x77, 0x16, 0x00, 0x06, 0x8f, 0xff, 0xff, 0x7f, 0x7f, 0x16, > 0xff, > + 0x04, 0xf7, 0xf7, 0x7e, 0x77, 0x77, 0x7c, 0xec, 0xcc, 0xcc, 0x16, > 0xc6, > + 0x04, 0xcc, 0xc7, 0xc7, 0x76, 0x16, 0x44, 0x04, 0x48, 0xc7, 0xc7, > 0xf7, > + 0x80, 0x16, 0x00, 0x05, 0x7f, 0x7f, 0xf7, 0x7f, 0x16, 0xff, 0x04, > 0x7f, > + 0x7f, 0xcf, 0xc7, 0xce, 0xcc, 0xc6, 0x16, 0xc4, 0x03, 0x4c, 0x4c, > 0x44, > + 0x4c, 0x48, 0x66, 0xc8, 0xc7, 0x84, 0x16, 0x44, 0x03, 0x8c, 0x7c, > 0x67, > + 0x7f, 0x80, 0x16, 0x00, 0x04, 0x08, 0x7f, 0xff, 0x77, 0xf7, 0x16, > 0xff, > + 0x04, 0xfe, 0x77, 0x7c, 0xec, 0xec, 0xc6, 0x4c, 0x46, 0x4c, 0x4c, > 0x44, > + 0x44, 0x4c, 0x16, 0x44, 0x03, 0x64, 0x86, 0xc8, 0x64, 0x44, 0x44, > 0xc7, > + 0x7c, 0x87, 0x7f, 0x70, 0x16, 0x00, 0x04, 0x08, 0xf7, 0xff, 0xe7, > 0x7f, > + 0x16, 0xff, 0x03, 0xfe, 0xfc, 0xfc, 0xec, 0xcc, 0x16, 0x44, 0x0b, > 0x64, > + 0x46, 0x44, 0x8c, 0x86, 0x84, 0x44, 0x6c, 0x46, 0x8c, 0x77, 0xf8, > 0x16, > + 0x00, 0x04, 0x0f, 0x7f, 0xf7, 0xcf, 0x7f, 0x7f, 0xff, 0xff, 0xed, > 0xe7, > + 0xce, 0xcc, 0x64, 0x64, 0xc4, 0x16, 0x44, 0x0b, 0x46, 0x16, 0x48, > 0x03, > + 0x84, 0x84, 0x88, 0x88, 0x77, 0xf8, 0x16, 0x00, 0x04, 0x0f, 0xf7, > 0xfe, > + 0x7e, 0x7f, 0xff, 0xff, 0xef, 0x7e, 0xcc, 0xcc, 0x64, 0x16, 0x44, > 0x10, > + 0x48, 0x68, 0x68, 0x88, 0x48, 0x68, 0xc7, 0x7f, 0x16, 0x00, 0x04, > 0x7f, > + 0x7f, 0x7c, 0x7c, 0xfe, 0xff, 0xff, 0xf7, 0xec, 0x7c, 0x64, 0x4c, > 0x16, > + 0x44, 0x10, 0x84, 0x48, 0x48, 0x68, 0x88, 0x88, 0x67, 0xf7, 0x80, > 0x16, > + 0x00, 0x03, 0x7f, 0x7f, 0xc7, 0xce, 0x7f, 0xff, 0xff, 0xe7, 0xec, > 0x66, > + 0x4c, 0x16, 0x44, 0x11, 0x16, 0x48, 0x03, 0x88, 0x68, 0x68, 0x67, > 0x7f, > + 0x80, 0x16, 0x00, 0x03, 0xf7, 0x7f, 0xcc, 0xec, 0xfe, 0xff, 0xff, > 0x7e, > + 0xc6, 0x16, 0x44, 0x15, 0x04, 0x84, 0x88, 0x88, 0x6c, 0x7f, 0x70, > 0x00, > + 0x00, 0x08, 0x7f, 0x77, 0x6c, 0xc7, 0xef, 0xff, 0xf7, 0xec, 0xc4, > 0x64, > + 0x16, 0x44, 0x13, 0x04, 0x84, 0x04, 0x84, 0x84, 0x86, 0x7f, 0x70, > 0x00, > + 0x00, 0x08, 0xf7, 0x7c, 0xc6, 0xec, 0xe7, 0xef, 0xe7, 0xc6, 0x64, > 0x16, > + 0x44, 0x15, 0x04, 0x84, 0x06, 0x86, 0x46, 0x7f, 0x78, 0x00, 0x00, > 0x08, > + 0xf7, 0x7c, 0x6c, 0xcc, 0xe7, 0x77, 0xcc, 0xc6, 0xc4, 0x16, 0x44, > 0x13, > + 0x04, 0x04, 0x16, 0x40, 0x04, 0x46, 0x7f, 0xf0, 0x00, 0x00, 0x08, > 0xf7, > + 0xcc, 0x6c, 0x6e, 0xce, 0xce, 0xc6, 0x66, 0x64, 0x16, 0x44, 0x17, > 0x04, > + 0x04, 0x46, 0xcf, 0x78, 0x00, 0x00, 0x07, 0xf7, 0x74, 0x6c, 0x6c, > 0xcc, > + 0x16, 0xc6, 0x03, 0x64, 0x16, 0x44, 0x13, 0x04, 0x44, 0x40, 0x40, > 0x44, > + 0x40, 0x46, 0x7f, 0xf8, 0x00, 0x00, 0x08, 0xf7, 0xc6, 0x46, 0x66, > 0x6c, > + 0x6c, 0x66, 0x46, 0x46, 0x16, 0x44, 0x17, 0x04, 0x04, 0x44, 0xef, > 0x78, > + 0x00, 0x00, 0x07, 0xf7, 0xc6, 0x46, 0x4c, 0x16, 0x46, 0x03, 0x66, > 0x64, > + 0x16, 0x44, 0x15, 0x04, 0x04, 0x44, 0x44, 0x46, 0x7f, 0xf8, 0x00, > 0x00, > + 0x07, 0xf7, 0xc4, 0x16, 0x64, 0x07, 0x16, 0x44, 0x17, 0x04, 0x04, > 0x44, > + 0xff, 0x78, 0x00, 0x00, 0x08, 0xf7, 0xc4, 0x16, 0x46, 0x07, 0x16, > 0x44, > + 0x15, 0x04, 0x04, 0x44, 0x44, 0x4c, 0xef, 0xf8, 0x00, 0x00, 0x07, > 0xf7, > + 0xc4, 0x64, 0x16, 0x46, 0x06, 0x16, 0x44, 0x14, 0x40, 0x44, 0x44, > 0x04, > + 0x44, 0x4c, 0xff, 0x78, 0x00, 0x00, 0x08, 0xf7, 0x84, 0x46, 0x44, > 0x16, > + 0x64, 0x06, 0x16, 0x44, 0x14, 0x04, 0x04, 0x44, 0x44, 0x47, 0xef, > 0xf8, > + 0x00, 0x00, 0x08, 0xff, 0xc4, 0x44, 0x46, 0x44, 0x16, 0x46, 0x04, > 0x16, > + 0x44, 0x14, 0x04, 0x16, 0x44, 0x04, 0xce, 0xff, 0x78, 0x00, 0x00, > 0x08, > + 0xff, 0x84, 0x46, 0x44, 0x16, 0x64, 0x05, 0x66, 0x16, 0x44, 0x13, > 0x40, > + 0x40, 0x44, 0x44, 0x46, 0xcf, 0xef, 0x70, 0x16, 0x00, 0x03, 0xff, > 0xc4, > + 0x16, 0x44, 0x04, 0x16, 0x46, 0x04, 0x16, 0x44, 0x12, 0x40, 0x16, > 0x44, > + 0x04, 0x4c, 0xee, 0xff, 0x70, 0x16, 0x00, 0x03, 0x7f, 0x74, 0x44, > 0x44, > + 0x16, 0x64, 0x07, 0x16, 0x44, 0x12, 0x04, 0x04, 0x44, 0x44, 0x4e, > 0xef, > + 0xef, 0x70, 0x16, 0x00, 0x03, 0x7f, 0x76, 0x16, 0x44, 0x05, 0x16, > 0x46, > + 0x04, 0x16, 0x44, 0x11, 0x40, 0x16, 0x44, 0x04, 0xee, 0xfe, 0xff, > 0x80, > + 0x16, 0x00, 0x03, 0x8f, 0xf8, 0x16, 0x44, 0x03, 0x16, 0x64, 0x06, > 0x16, > + 0x44, 0x12, 0x40, 0x44, 0x44, 0x4c, 0xee, 0xef, 0xf7, 0x80, 0x16, > 0x00, > + 0x03, 0x8f, 0xfc, 0x16, 0x44, 0x06, 0x16, 0x46, 0x03, 0x16, 0x44, > 0x11, > + 0x04, 0x04, 0x44, 0x44, 0x6e, 0xef, 0xef, 0xf7, 0x16, 0x00, 0x04, > 0x07, > + 0xf7, 0x16, 0x44, 0x04, 0x16, 0x64, 0x03, 0x16, 0x46, 0x03, 0x16, > 0x44, > + 0x13, 0x46, 0xce, 0xee, 0xff, 0x77, 0x16, 0x00, 0x04, 0x08, 0xff, > 0x84, > + 0x16, 0x44, 0x05, 0x46, 0x44, 0x16, 0x64, 0x03, 0x16, 0x44, 0x0f, > 0x04, > + 0x44, 0x44, 0x4c, 0xec, 0xef, 0xef, 0xf8, 0x16, 0x00, 0x04, 0x08, > 0x7f, > + 0x74, 0x16, 0x44, 0x03, 0x46, 0x46, 0x44, 0x16, 0x46, 0x04, 0x16, > 0x44, > + 0x12, 0xcc, 0xec, 0xef, 0xff, 0x70, 0x16, 0x00, 0x05, 0x7f, 0xf4, > 0x16, > + 0x44, 0x05, 0x46, 0x44, 0x44, 0x16, 0x64, 0x03, 0x16, 0x44, 0x10, > 0x46, > + 0xc6, 0xcc, 0xf7, 0xf7, 0x70, 0x16, 0x00, 0x05, 0x8f, 0xf7, 0x04, > 0x16, > + 0x44, 0x05, 0x16, 0x46, 0x05, 0x16, 0x44, 0x10, 0xc4, 0xc6, 0xcc, > 0xfe, > + 0xf7, 0x16, 0x00, 0x06, 0x07, 0xff, 0x16, 0x44, 0x05, 0x46, 0x16, > 0x44, > + 0x03, 0x16, 0x64, 0x04, 0x16, 0x44, 0x0c, 0x46, 0x66, 0x66, 0x6c, > 0x67, > + 0x7f, 0x77, 0x16, 0x00, 0x06, 0x08, 0xff, 0x74, 0x04, 0x16, 0x44, > 0x04, > + 0x16, 0x46, 0x05, 0x4c, 0x46, 0x16, 0x44, 0x0c, 0x64, 0xc4, 0xc4, > 0xc6, > + 0xc7, 0x7f, 0x70, 0x16, 0x00, 0x07, 0x8f, 0xf6, 0x16, 0x44, 0x09, > 0x16, > + 0x64, 0x05, 0x16, 0x44, 0x08, 0x46, 0xc6, 0xc6, 0x66, 0x6c, 0x6c, > 0x77, > + 0x77, 0x80, 0x16, 0x00, 0x07, 0x87, 0xf7, 0x40, 0x16, 0x44, 0x05, > 0x16, > + 0x46, 0x09, 0x16, 0x44, 0x06, 0xc6, 0xc6, 0x66, 0x66, 0xc6, 0xc6, > 0xc7, > + 0x77, 0xf7, 0x16, 0x00, 0x08, 0x08, 0xff, 0xc4, 0x16, 0x44, 0x09, > 0x16, > + 0x64, 0x05, 0x66, 0x66, 0x64, 0x66, 0x6c, 0x16, 0x66, 0x03, 0xc6, > 0xc6, > + 0x6c, 0x6c, 0xc7, 0x77, 0x78, 0x16, 0x00, 0x09, 0x7f, 0xf6, 0x04, > 0x16, > + 0x44, 0x05, 0x16, 0x46, 0x08, 0x64, 0x64, 0x6c, 0x66, 0x66, 0x16, > 0xc6, > + 0x03, 0x66, 0x66, 0xc6, 0x6c, 0x77, 0x7f, 0x80, 0x16, 0x00, 0x09, > 0x07, > + 0xf7, 0x16, 0x44, 0x0a, 0x16, 0x64, 0x04, 0x66, 0xc6, 0x64, 0x64, > 0x16, > + 0x66, 0x04, 0xc6, 0xc6, 0x6c, 0xc7, 0xe7, 0x77, 0x16, 0x00, 0x0a, > 0x08, > + 0x7f, 0x74, 0x16, 0x44, 0x06, 0x16, 0x46, 0x03, 0x44, 0x16, 0x64, > 0x05, > + 0xc6, 0x66, 0x66, 0x16, 0xc6, 0x03, 0x66, 0x6c, 0x6c, 0xe7, 0x77, > 0x70, > + 0x16, 0x00, 0x0b, 0x87, 0xfc, 0x16, 0x44, 0x09, 0x64, 0x16, 0x46, > 0x03, > + 0x4c, 0x16, 0x46, 0x04, 0x16, 0x66, 0x03, 0xc6, 0xc6, 0xce, 0xde, > 0x77, > + 0x80, 0x16, 0x00, 0x0b, 0x08, 0x7f, 0xc4, 0x16, 0x44, 0x07, 0x64, > 0x44, > + 0x16, 0x64, 0x05, 0x16, 0x66, 0x03, 0x46, 0xc6, 0xc6, 0x66, 0x6c, > 0x77, > + 0xe7, 0x78, 0x16, 0x00, 0x0d, 0x87, 0xfc, 0x16, 0x44, 0x08, 0x64, > 0x44, > + 0x46, 0x46, 0x4c, 0x16, 0x46, 0x04, 0x16, 0x66, 0x03, 0xc6, 0xce, > 0x7e, > + 0xd7, 0x80, 0x16, 0x00, 0x0d, 0x08, 0x7f, 0xc4, 0x16, 0x44, 0x08, > 0x16, > + 0x64, 0x06, 0xc6, 0x66, 0x4c, 0x46, 0xc6, 0xce, 0x7c, 0x77, 0x78, > 0x16, > + 0x00, 0x0f, 0x87, 0xf7, 0x16, 0x44, 0x0a, 0x16, 0x46, 0x06, 0x66, > 0x66, > + 0x6c, 0xec, 0xe7, 0xe7, 0x16, 0x00, 0x11, 0x8f, 0x7c, 0x16, 0x44, > 0x07, > + 0x16, 0x64, 0x09, 0x6c, 0xec, 0xe7, 0xc7, 0x80, 0x16, 0x00, 0x11, > 0x08, > + 0x77, 0xc6, 0x16, 0x44, 0x09, 0x16, 0x46, 0x04, 0x4c, 0x6c, 0xec, > 0xee, > + 0xc7, 0x78, 0x16, 0x00, 0x13, 0x07, 0x77, 0xcc, 0x16, 0x44, 0x06, > 0x16, > + 0x64, 0x05, 0xc4, 0xc6, 0xce, 0xce, 0xec, 0x78, 0x16, 0x00, 0x15, > 0x88, > + 0x77, 0xc6, 0xc4, 0xc4, 0x16, 0x44, 0x07, 0xc6, 0xc6, 0x16, 0xec, > 0x03, > + 0x78, 0x80, 0x16, 0x00, 0x16, 0x88, 0x77, 0xcc, 0x16, 0x4c, 0x06, > 0x16, > + 0x6c, 0x03, 0xec, 0xec, 0xe6, 0xe8, 0x80, 0x16, 0x00, 0x18, 0x88, > 0x87, > + 0xcc, 0x16, 0xc6, 0x03, 0x16, 0xcc, 0x03, 0xe6, 0xec, 0xe6, 0xe6, > 0x78, > + 0x16, 0x00, 0x1c, 0x88, 0x87, 0x16, 0xcc, 0x06, 0xc6, 0x76, 0x88, > 0x16, > + 0x00, 0x1f, 0x80, 0x16, 0x88, 0x05, 0x80, 0x16, 0x00, 0x88 > +}; > > Modified: head/sys/dev/vt/vt.h > > ============================================================================== > --- head/sys/dev/vt/vt.h Tue Jul 21 20:30:06 2015 (r285765) > +++ head/sys/dev/vt/vt.h Tue Jul 21 20:33:36 2015 (r285766) > @@ -164,7 +164,12 @@ struct vt_device { > #define VD_PASTEBUFSZ(vd) ((vd)->vd_pastebuf.vpb_bufsz) > #define VD_PASTEBUFLEN(vd) ((vd)->vd_pastebuf.vpb_len) > > +#define VT_LOCK(vd) mtx_lock(&(vd)->vd_lock) > +#define VT_UNLOCK(vd) mtx_unlock(&(vd)->vd_lock) > +#define VT_LOCK_ASSERT(vd, what) mtx_assert(&(vd)->vd_lock, > what) > + > void vt_resume(struct vt_device *vd); > +void vt_resume_flush_timer(struct vt_device *vd, int ms); > void vt_suspend(struct vt_device *vd); > > /* > @@ -363,6 +368,7 @@ struct vt_driver { > * Utility macro to make early vt(4) instances work. > */ > > +extern struct terminal vt_consterm; > extern const struct terminal_class vt_termclass; > void vt_upgrade(struct vt_device *vd); > > @@ -427,10 +433,29 @@ void vt_mouse_state(int show); > #define VT_MOUSE_HIDE 0 > > /* Utilities. */ > +void vt_compute_drawable_area(struct vt_window *); > void vt_determine_colors(term_char_t c, int cursor, > term_color_t *fg, term_color_t *bg); > int vt_is_cursor_in_area(const struct vt_device *vd, > const term_rect_t *area); > +void vt_termsize(struct vt_device *, struct vt_font *, term_pos_t *); > +void vt_winsize(struct vt_device *, struct vt_font *, struct winsize *); > + > +/* Logos-on-boot. */ > +#define VT_LOGOS_DRAW_BEASTIE 0 > +#define VT_LOGOS_DRAW_ALT_BEASTIE 1 > +#define VT_LOGOS_DRAW_ORB 2 > + > +extern int vt_draw_logo_cpus; > +extern int vt_splash_cpu; > +extern int vt_splash_ncpu; > +extern int vt_splash_cpu_style; > +extern int vt_splash_cpu_duration; > + > +extern const unsigned int vt_logo_sprite_height; > +extern const unsigned int vt_logo_sprite_width; > + > +void vtterm_draw_cpu_logos(struct vt_device *); > > #endif /* !_DEV_VT_VT_H_ */ > > > Modified: head/sys/dev/vt/vt_core.c > > ============================================================================== > --- head/sys/dev/vt/vt_core.c Tue Jul 21 20:30:06 2015 (r285765) > +++ head/sys/dev/vt/vt_core.c Tue Jul 21 20:33:36 2015 (r285766) > @@ -113,10 +113,6 @@ const struct terminal_class vt_termclass > #define VT_BELLDURATION ((5 * hz + 99) / 100) > #define VT_BELLPITCH 800 > > -#define VT_LOCK(vd) mtx_lock(&(vd)->vd_lock) > -#define VT_UNLOCK(vd) mtx_unlock(&(vd)->vd_lock) > -#define VT_LOCK_ASSERT(vd, what) mtx_assert(&(vd)->vd_lock, > what) > - > #define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS > + \ > (vw)->vw_number) > > @@ -139,6 +135,15 @@ static VT_SYSCTL_INT(kbd_debug, 1, "Enab > static VT_SYSCTL_INT(kbd_panic, 0, "Enable request to panic. " > "See kbdmap(5) to configure."); > > +/* Used internally, not a tunable. */ > +int vt_draw_logo_cpus; > +VT_SYSCTL_INT(splash_cpu, 1, "Show logo CPUs during boot"); > +VT_SYSCTL_INT(splash_ncpu, 0, "Override number of logos displayed " > + "(0 = do not override)"); > +VT_SYSCTL_INT(splash_cpu_style, 1, "Draw logo style " > + "(0=Beastie, 1=Alternate beastie, 2=Orb)"); > +VT_SYSCTL_INT(splash_cpu_duration, 10, "Hide logos after (seconds)"); > + > static struct vt_device vt_consdev; > static unsigned int vt_unit = 0; > static MALLOC_DEFINE(M_VT, "vt", "vt device"); > @@ -176,7 +181,7 @@ SET_DECLARE(vt_drv_set, struct vt_driver > #define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)) > #define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)) > > -static struct terminal vt_consterm; > +struct terminal vt_consterm; > static struct vt_window vt_conswindow; > static struct vt_device vt_consdev = { > .vd_driver = NULL, > @@ -223,7 +228,7 @@ static struct vt_window vt_conswindow = > .vw_kbdmode = K_XLATE, > .vw_grabbed = 0, > }; > -static struct terminal vt_consterm = { > +struct terminal vt_consterm = { > .tm_class = &vt_termclass, > .tm_softc = &vt_conswindow, > .tm_flags = TF_CONS, > @@ -275,7 +280,7 @@ vt_schedule_flush(struct vt_device *vd, > callout_schedule(&vd->vd_timer, hz / (1000 / ms)); > } > > -static void > +void > vt_resume_flush_timer(struct vt_device *vd, int ms) > { > > @@ -548,11 +553,13 @@ vt_window_switch(struct vt_window *vw) > return (0); > } > > -static inline void > +void > vt_termsize(struct vt_device *vd, struct vt_font *vf, term_pos_t *size) > { > > size->tp_row = vd->vd_height; > + if (vt_draw_logo_cpus) > + size->tp_row -= vt_logo_sprite_height; > size->tp_col = vd->vd_width; > if (vf != NULL) { > size->tp_row /= vf->vf_height; > @@ -561,10 +568,33 @@ vt_termsize(struct vt_device *vd, struct > } > > static inline void > +vt_termrect(struct vt_device *vd, struct vt_font *vf, term_rect_t *rect) > +{ > + > + rect->tr_begin.tp_row = rect->tr_begin.tp_col = 0; > + if (vt_draw_logo_cpus) > + rect->tr_begin.tp_row = vt_logo_sprite_height; > + > + rect->tr_end.tp_row = vd->vd_height; > + rect->tr_end.tp_col = vd->vd_width; > + > + if (vf != NULL) { > + rect->tr_begin.tp_row = > + howmany(rect->tr_begin.tp_row, vf->vf_height); > + > + rect->tr_end.tp_row /= vf->vf_height; > + rect->tr_end.tp_col /= vf->vf_width; > + } > +} > + > +void > vt_winsize(struct vt_device *vd, struct vt_font *vf, struct winsize *size) > { > > - size->ws_row = size->ws_ypixel = vd->vd_height; > + size->ws_ypixel = vd->vd_height; > + if (vt_draw_logo_cpus) > + size->ws_ypixel -= vt_logo_sprite_height; > + size->ws_row = size->ws_ypixel; > size->ws_col = size->ws_xpixel = vd->vd_width; > if (vf != NULL) { > size->ws_row /= vf->vf_height; > @@ -572,17 +602,20 @@ vt_winsize(struct vt_device *vd, struct > } > } > > -static inline void > +void > vt_compute_drawable_area(struct vt_window *vw) > { > struct vt_device *vd; > struct vt_font *vf; > + vt_axis_t height; > > vd = vw->vw_device; > > if (vw->vw_font == NULL) { > vw->vw_draw_area.tr_begin.tp_col = 0; > vw->vw_draw_area.tr_begin.tp_row = 0; > + if (vt_draw_logo_cpus) > + vw->vw_draw_area.tr_begin.tp_row = > vt_logo_sprite_height; > vw->vw_draw_area.tr_end.tp_col = vd->vd_width; > vw->vw_draw_area.tr_end.tp_row = vd->vd_height; > return; > @@ -595,12 +628,17 @@ vt_compute_drawable_area(struct vt_windo > * the screen. > */ > > + height = vd->vd_height; > + if (vt_draw_logo_cpus) > + height -= vt_logo_sprite_height; > vw->vw_draw_area.tr_begin.tp_col = (vd->vd_width % vf->vf_width) / > 2; > - vw->vw_draw_area.tr_begin.tp_row = (vd->vd_height % vf->vf_height) > / 2; > + vw->vw_draw_area.tr_begin.tp_row = (height % vf->vf_height) / 2; > + if (vt_draw_logo_cpus) > + vw->vw_draw_area.tr_begin.tp_row += vt_logo_sprite_height; > vw->vw_draw_area.tr_end.tp_col = vw->vw_draw_area.tr_begin.tp_col + > vd->vd_width / vf->vf_width * vf->vf_width; > vw->vw_draw_area.tr_end.tp_row = vw->vw_draw_area.tr_begin.tp_row + > - vd->vd_height / vf->vf_height * vf->vf_height; > + height / vf->vf_height * vf->vf_height; > } > > static void > @@ -1111,7 +1149,6 @@ vt_flush(struct vt_device *vd) > struct vt_window *vw; > struct vt_font *vf; > term_rect_t tarea; > - term_pos_t size; > #ifndef SC_NO_CUTPASTE > int cursor_was_shown, cursor_moved; > #endif > @@ -1166,14 +1203,14 @@ vt_flush(struct vt_device *vd) > #endif > > vtbuf_undirty(&vw->vw_buf, &tarea); > - vt_termsize(vd, vf, &size); > > /* Force a full redraw when the screen contents are invalid. */ > if (vd->vd_flags & VDF_INVALID) { > - tarea.tr_begin.tp_row = tarea.tr_begin.tp_col = 0; > - tarea.tr_end = size; > - > vd->vd_flags &= ~VDF_INVALID; > + > + vt_termrect(vd, vf, &tarea); > + if (vt_draw_logo_cpus) > + vtterm_draw_cpu_logos(vd); > } > > if (tarea.tr_begin.tp_col < tarea.tr_end.tp_col) { > @@ -1318,7 +1355,8 @@ vtterm_cnprobe(struct terminal *tm, stru > > if (vtdbest != NULL) { > #ifdef DEV_SPLASH > - vtterm_splash(vd); > + if (!vt_splash_cpu) > + vtterm_splash(vd); > #endif > vd->vd_flags |= VDF_INITIALIZED; > } > > Added: head/sys/dev/vt/vt_cpulogos.c > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/vt/vt_cpulogos.c Tue Jul 21 20:33:36 2015 > (r285766) > @@ -0,0 +1,266 @@ > +/*- > + * Copyright (c) 2015 Conrad Meyer > + * 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 > + > +extern const unsigned char vt_beastie_vga16[]; > +extern const unsigned char vt_beastie2_vga16[]; > +extern const unsigned char vt_orb_vga16[]; > + > +static struct callout vt_splash_cpu_callout; > + > +static inline unsigned char > +vt_vga2bsd(unsigned char vga) > +{ > + static const unsigned char lut[8] = { > + 0, > + 4, /* 1 and 4 swap */ > + 2, > + 6, /* 3 and 6 swap */ > + 1, /* 4 and 1 swap */ > + 5, > + 3, /* 6 and 3 swap */ > + 7, > + }; > + unsigned int bright; > + > + bright = (vga & 0x8); > + return (lut[vga & 0x7] | bright); > +} > + > +static void > +vt_draw_2_vga16_px(struct vt_device *vd, vt_axis_t x, vt_axis_t y, > + unsigned char color) > +{ > + > + vd->vd_driver->vd_setpixel(vd, x, y, vt_vga2bsd(color >> 4)); > + vd->vd_driver->vd_setpixel(vd, x + 1, y, vt_vga2bsd(color & 0xf)); > +} > + > +static void > +vt_draw_1_logo(struct vt_device *vd, vt_axis_t top, vt_axis_t left) > +{ > + const unsigned char rle_sent = 0x16, *data; > + unsigned int xy, run, runcolor, i; > + > + switch (vt_splash_cpu_style) { > + case VT_LOGOS_DRAW_ALT_BEASTIE: > + data = vt_beastie2_vga16; > + break; > + case VT_LOGOS_DRAW_ORB: > + data = vt_orb_vga16; > + break; > + case VT_LOGOS_DRAW_BEASTIE: > + /* FALLTHROUGH */ > + default: > + data = vt_beastie_vga16; > + break; > + } > + > + /* Decode basic RLE (gets us to 30-40% of uncompressed data size): > */ > + for (i = 0, xy = 0; xy < vt_logo_sprite_height * > vt_logo_sprite_width;) { > + if (data[i] == rle_sent) { > + runcolor = data[i + 1]; > + run = data[i + 2]; > + > + for (; run; run--, xy += 2) > + vt_draw_2_vga16_px(vd, > + left + (xy % vt_logo_sprite_width), > + top + (xy / vt_logo_sprite_width), > + runcolor); > + > + i += 3; > + } else { > + vt_draw_2_vga16_px(vd, left + (xy % > vt_logo_sprite_width), > + top + (xy / vt_logo_sprite_width), data[i]); > + > + i++; > + xy += 2; > + } > + } > +} > + > +void > +vtterm_draw_cpu_logos(struct vt_device *vd) > +{ > + unsigned int ncpu, i; > + vt_axis_t left; > + > + if (vt_splash_ncpu) > + ncpu = vt_splash_ncpu; > + else { > + ncpu = mp_ncpus; > + if (ncpu < 1) > + ncpu = 1; > + } > + > + if (vd->vd_driver->vd_drawrect) > + vd->vd_driver->vd_drawrect(vd, 0, 0, vd->vd_width, > + vt_logo_sprite_height, 1, TC_BLACK); > + /* > + * Blank is okay because we only ever draw beasties on full screen > + * refreshes. > + */ > + else if (vd->vd_driver->vd_blank) > + vd->vd_driver->vd_blank(vd, TC_BLACK); > + > + ncpu = MIN(ncpu, vd->vd_width / vt_logo_sprite_width); > + for (i = 0, left = 0; i < ncpu; left += vt_logo_sprite_width, i++) > + vt_draw_1_logo(vd, 0, left); > +} > + > +static void > +vt_fini_logos(void *dummy __unused) > +{ > + struct vt_device *vd; > + struct vt_window *vw; > + struct terminal *tm; > + struct vt_font *vf; > + struct winsize wsz; > + term_pos_t size; > + > + if (!vt_draw_logo_cpus) > + return; > + if (!vty_enabled(VTY_VT)) > + return; > + if (!vt_splash_cpu) > + return; > + > + tm = &vt_consterm; > + vw = tm->tm_softc; > + if (vw == NULL) > + return; > + vd = vw->vw_device; > + if (vd == NULL) > + return; > + vf = vw->vw_font; > + if (vf == NULL) > + return; > + > + VT_LOCK(vd); > + if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0) > + goto out; > + > + vt_draw_logo_cpus = 0; > + VT_UNLOCK(vd); > + > + vt_termsize(vd, vf, &size); > + vt_winsize(vd, vf, &wsz); > + > + /* Resize screen buffer and terminal. */ > + terminal_mute(tm, 1); > + vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size); > + terminal_set_winsize_blank(tm, &wsz, 0, NULL); > + terminal_set_cursor(tm, &vw->vw_buf.vb_cursor); > + terminal_mute(tm, 0); > + > + VT_LOCK(vd); > + vt_compute_drawable_area(vw); > + > + if (vd->vd_curwindow == vw) { > + vd->vd_flags |= VDF_INVALID; > + vt_resume_flush_timer(vd, 0); > + } > + > +out: > + VT_UNLOCK(vd); > +} > + > +static void > +vt_init_logos(void *dummy) > +{ > + struct vt_device *vd; > + struct vt_window *vw; > + struct terminal *tm; > + struct vt_font *vf; > + struct winsize wsz; > + term_pos_t size; > + > + if (!vty_enabled(VTY_VT)) > + return; > + if (!vt_splash_cpu) > + return; > + > + tm = &vt_consterm; > + vw = tm->tm_softc; > + if (vw == NULL) > + return; > + vd = vw->vw_device; > + if (vd == NULL) > + return; > + vf = vw->vw_font; > + if (vf == NULL) > + return; > + > + VT_LOCK(vd); > + KASSERT((vd->vd_flags & VDF_INITIALIZED) != 0, > + ("vd %p not initialized", vd)); > + > + if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0) > + goto out; > + if (vd->vd_height <= vt_logo_sprite_height) > + goto out; > + > + vt_draw_logo_cpus = 1; > + VT_UNLOCK(vd); > + > + vt_termsize(vd, vf, &size); > + vt_winsize(vd, vf, &wsz); > + > + /* Resize screen buffer and terminal. */ > + terminal_mute(tm, 1); > + vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size); > + terminal_set_winsize_blank(tm, &wsz, 0, NULL); > + terminal_set_cursor(tm, &vw->vw_buf.vb_cursor); > + terminal_mute(tm, 0); > + > + VT_LOCK(vd); > + vt_compute_drawable_area(vw); > + > + if (vd->vd_curwindow == vw) { > + vd->vd_flags |= VDF_INVALID; > + vt_resume_flush_timer(vd, 0); > + } > + > + callout_init(&vt_splash_cpu_callout, 1); > + callout_reset(&vt_splash_cpu_callout, vt_splash_cpu_duration * hz, > + vt_fini_logos, NULL); > + > +out: > + VT_UNLOCK(vd); > +} > +SYSINIT(vt_logos, SI_SUB_CPU + 1, SI_ORDER_ANY, vt_init_logos, NULL); > > From owner-svn-src-head@freebsd.org Fri Jul 24 06:35:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30A4A9A9C12; Fri, 24 Jul 2015 06:35:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC54112A7; Fri, 24 Jul 2015 06:35:16 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id t6O6XnW7012694; Thu, 23 Jul 2015 23:33:53 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201507240633.t6O6XnW7012694@gw.catspoiler.org> Date: Thu, 23 Jul 2015 23:33:49 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r285829 - head/sys/kern To: pluknet@FreeBSD.org cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org In-Reply-To: <201507232318.t6NNI4QG016985@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 24 Jul 2015 06:35:17 -0000 On 23 Jul, Sergey Kandaurov wrote: > Author: pluknet > Date: Thu Jul 23 23:18:03 2015 > New Revision: 285829 > URL: https://svnweb.freebsd.org/changeset/base/285829 > > Log: > Call ksem_get() with initialized 'rights'. > > ksem_get() consumes fget(), and it's mandatory there. > > Reported by: truckman > Reviewed by: mjg Thanks! Things seem to be stable now. From owner-svn-src-head@freebsd.org Fri Jul 24 06:59:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB4CA9A7050; Fri, 24 Jul 2015 06:59:46 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96E7E1F9D; Fri, 24 Jul 2015 06:59:46 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZIWxJ-000MoX-84; Fri, 24 Jul 2015 07:59:41 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <20150724012519.GE78154@funkthat.com> Date: Fri, 24 Jul 2015 07:59:35 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150724012519.GE78154@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 06:59:47 -0000 > On 24 Jul 2015, at 02:25, John-Mark Gurney wrote: >=20 > I would like to point out that the goal of collecting large amounts > is starting to fall out of favor, and I happen to agree with the likes > of djb[1] that we don't need an infinite amount of entropy collected = by > the system. If the attacker can read out our RNG state, then we are > already screwed due to many other vulns. I=E2=80=99m working on a premise of =E2=80=9Ctools, not policy=E2=80=9D. = I=E2=80=99d like there to be enough harvesting points for the box owner to get the warm fuzzies. If they choose to use less, fine by me. > Many of the issues that FreeBSD sees with lack of entropy at start up > is more of a problem on how systems are installed and provisioned. I > don't believe that we currently store any entropy from the install > process, yet this is one of the best places to get it, the user is > banging on keyboard selecting options, etc. If an image is designed > to be cloned (vm images or appliance images) we need to have a > mechanism to ensure that before we start, we get the entropy from > other sources, be it a hardware RNG or the console. Getting an initial entropy bundle for first boot is high up on my TODO list. :-) Patches welcome! We need the usual /entropy (or /var/db/entropy/=E2=80=A6 or whatever) and crucially we need = /boot/entropy and the correct invocation in /boot/loader.conf. > I would like to see us scale back the entropy collection, and replace > it with something like scan the zone once an hour or something > similar. Or do something dtrace style, where we nop/jmp the > collection after we feel that the system has collected enough. Most of the current entropy gathering is just about invisible anyway. I think the above goes too far, but may be a useful way of enabling/disabling (say) UMA gathering on the fly. > Heck, piping in mic data to /dev/random is a good way to seed the > rng on many machines. Well, sure, but what if you don=E2=80=99t have microphone? I want lots of choices, in anticipation of only a subset being usable. M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Fri Jul 24 07:46:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 858559A7B0C; Fri, 24 Jul 2015 07:46:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 682331A8E; Fri, 24 Jul 2015 07:46:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6O7k3Yl056321; Fri, 24 Jul 2015 07:46:03 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6O7k2JF056316; Fri, 24 Jul 2015 07:46:02 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201507240746.t6O7k2JF056316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 24 Jul 2015 07:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285834 - head/sys/compat/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 07:46:04 -0000 Author: ed Date: Fri Jul 24 07:46:02 2015 New Revision: 285834 URL: https://svnweb.freebsd.org/changeset/base/285834 Log: Implement the basic system calls that operate on pathnames. Summary: Unlike FreeBSD, CloudABI does not use null terminated strings for its pathnames. Introduce a function called copyin_path() that can be used by all of the filesystem system calls that use pathnames. This change already implements the system calls that don't depend on any additional functionality (e.g., conversion of struct stat). Also implement the socket system calls that operate on pathnames, namely the ones used by the C library functions bindat() and connectat(). These don't receive a 'struct sockaddr_un', but just the pathname, meaning they could be implemented in such a way that they don't depend on the size of sun_path. For now, just use the existing interfaces. Add a missing #include to cloudabi_syscalldefs.h to get this code to build, as one of its macros depends on UINT64_C(). Test Plan: These implementations have already been tested in the CloudABI branch on GitHub. They pass all of the tests. Reviewers: kib, pjd Subscribers: imp Differential Revision: https://reviews.freebsd.org/D3097 Modified: head/sys/compat/cloudabi/cloudabi_file.c head/sys/compat/cloudabi/cloudabi_sock.c head/sys/compat/cloudabi/cloudabi_syscalldefs.h Modified: head/sys/compat/cloudabi/cloudabi_file.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_file.c Fri Jul 24 04:56:46 2015 (r285833) +++ head/sys/compat/cloudabi/cloudabi_file.c Fri Jul 24 07:46:02 2015 (r285834) @@ -28,11 +28,67 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include #include #include +static MALLOC_DEFINE(M_CLOUDABI_PATH, "cloudabipath", "CloudABI pathnames"); + +/* + * Copying pathnames from userspace to kernelspace. + * + * Unlike most operating systems, CloudABI doesn't use null-terminated + * pathname strings. Processes always pass pathnames to the kernel by + * providing a base pointer and a length. This has a couple of reasons: + * + * - It makes it easier to use CloudABI in combination with programming + * languages other than C, that may use non-null terminated strings. + * - It allows for calling system calls on individual components of the + * pathname without modifying the input string. + * + * The function below copies in pathname strings and null-terminates it. + * It also ensure that the string itself does not contain any null + * bytes. + * + * TODO(ed): Add an abstraction to vfs_lookup.c that allows us to pass + * in unterminated pathname strings, so we can do away with + * the copying. + */ + +static int +copyin_path(const char *uaddr, size_t len, char **result) +{ + char *buf; + int error; + + if (len >= PATH_MAX) + return (ENAMETOOLONG); + buf = malloc(len + 1, M_CLOUDABI_PATH, M_WAITOK); + error = copyin(uaddr, buf, len); + if (error != 0) { + free(buf, M_CLOUDABI_PATH); + return (error); + } + if (memchr(buf, '\0', len) != NULL) { + free(buf, M_CLOUDABI_PATH); + return (EINVAL); + } + buf[len] = '\0'; + *result = buf; + return (0); +} + +static void +cloudabi_freestr(char *buf) +{ + + free(buf, M_CLOUDABI_PATH); +} + int cloudabi_sys_file_advise(struct thread *td, struct cloudabi_sys_file_advise_args *uap) @@ -86,9 +142,24 @@ int cloudabi_sys_file_link(struct thread *td, struct cloudabi_sys_file_link_args *uap) { + char *path1, *path2; + int error; - /* Not implemented. */ - return (ENOSYS); + error = copyin_path(uap->path1, uap->path1len, &path1); + if (error != 0) + return (error); + error = copyin_path(uap->path2, uap->path2len, &path2); + if (error != 0) { + cloudabi_freestr(path1); + return (error); + } + + error = kern_linkat(td, uap->fd1, uap->fd2, path1, path2, + UIO_SYSSPACE, (uap->fd1 & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) != 0 ? + FOLLOW : NOFOLLOW); + cloudabi_freestr(path1); + cloudabi_freestr(path2); + return (error); } int @@ -113,18 +184,40 @@ int cloudabi_sys_file_readlink(struct thread *td, struct cloudabi_sys_file_readlink_args *uap) { + char *path; + int error; - /* Not implemented. */ - return (ENOSYS); + error = copyin_path(uap->path, uap->pathlen, &path); + if (error != 0) + return (error); + + error = kern_readlinkat(td, uap->fd, path, UIO_SYSSPACE, + uap->buf, UIO_USERSPACE, uap->bufsize); + cloudabi_freestr(path); + return (error); } int cloudabi_sys_file_rename(struct thread *td, struct cloudabi_sys_file_rename_args *uap) { + char *old, *new; + int error; - /* Not implemented. */ - return (ENOSYS); + error = copyin_path(uap->old, uap->oldlen, &old); + if (error != 0) + return (error); + error = copyin_path(uap->new, uap->newlen, &new); + if (error != 0) { + cloudabi_freestr(old); + return (error); + } + + error = kern_renameat(td, uap->oldfd, old, uap->newfd, new, + UIO_SYSSPACE); + cloudabi_freestr(old); + cloudabi_freestr(new); + return (error); } int @@ -167,16 +260,39 @@ int cloudabi_sys_file_symlink(struct thread *td, struct cloudabi_sys_file_symlink_args *uap) { + char *path1, *path2; + int error; - /* Not implemented. */ - return (ENOSYS); + error = copyin_path(uap->path1, uap->path1len, &path1); + if (error != 0) + return (error); + error = copyin_path(uap->path2, uap->path2len, &path2); + if (error != 0) { + cloudabi_freestr(path1); + return (error); + } + + error = kern_symlinkat(td, path1, uap->fd, path2, UIO_SYSSPACE); + cloudabi_freestr(path1); + cloudabi_freestr(path2); + return (error); } int cloudabi_sys_file_unlink(struct thread *td, struct cloudabi_sys_file_unlink_args *uap) { + char *path; + int error; - /* Not implemented. */ - return (ENOSYS); + error = copyin_path(uap->path, uap->pathlen, &path); + if (error != 0) + return (error); + + if (uap->flag & CLOUDABI_UNLINK_REMOVEDIR) + error = kern_rmdirat(td, uap->fd, path, UIO_SYSSPACE); + else + error = kern_unlinkat(td, uap->fd, path, UIO_SYSSPACE, 0); + cloudabi_freestr(path); + return (error); } Modified: head/sys/compat/cloudabi/cloudabi_sock.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_sock.c Fri Jul 24 04:56:46 2015 (r285833) +++ head/sys/compat/cloudabi/cloudabi_sock.c Fri Jul 24 07:46:02 2015 (r285834) @@ -26,12 +26,38 @@ #include __FBSDID("$FreeBSD$"); +#include #include +#include #include +#include +#include #include #include +/* Copies a pathname into a UNIX socket address structure. */ +static int +copyin_sockaddr_un(const char *path, size_t pathlen, struct sockaddr_un *sun) +{ + int error; + + /* Copy in pathname string if there's enough space. */ + if (pathlen >= sizeof(sun->sun_path)) + return (ENAMETOOLONG); + error = copyin(path, &sun->sun_path, pathlen); + if (error != 0) + return (error); + if (memchr(sun->sun_path, '\0', pathlen) != NULL) + return (EINVAL); + + /* Initialize the rest of the socket address. */ + sun->sun_path[pathlen] = '\0'; + sun->sun_family = AF_UNIX; + sun->sun_len = sizeof(*sun); + return (0); +} + int cloudabi_sys_sock_accept(struct thread *td, struct cloudabi_sys_sock_accept_args *uap) @@ -45,18 +71,26 @@ int cloudabi_sys_sock_bind(struct thread *td, struct cloudabi_sys_sock_bind_args *uap) { + struct sockaddr_un sun; + int error; - /* Not implemented. */ - return (ENOSYS); + error = copyin_sockaddr_un(uap->path, uap->pathlen, &sun); + if (error != 0) + return (error); + return (kern_bindat(td, uap->fd, uap->s, (struct sockaddr *)&sun)); } int cloudabi_sys_sock_connect(struct thread *td, struct cloudabi_sys_sock_connect_args *uap) { + struct sockaddr_un sun; + int error; - /* Not implemented. */ - return (ENOSYS); + error = copyin_sockaddr_un(uap->path, uap->pathlen, &sun); + if (error != 0) + return (error); + return (kern_connectat(td, uap->fd, uap->s, (struct sockaddr *)&sun)); } int Modified: head/sys/compat/cloudabi/cloudabi_syscalldefs.h ============================================================================== --- head/sys/compat/cloudabi/cloudabi_syscalldefs.h Fri Jul 24 04:56:46 2015 (r285833) +++ head/sys/compat/cloudabi/cloudabi_syscalldefs.h Fri Jul 24 07:46:02 2015 (r285834) @@ -29,6 +29,7 @@ #define _CLOUDABI_SYSCALLDEFS_H_ #include +#include #define alignas _Alignas #define alignof _Alignof From owner-svn-src-head@freebsd.org Fri Jul 24 09:10:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEF279A994F; Fri, 24 Jul 2015 09:10:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDD0E10F8; Fri, 24 Jul 2015 09:10:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6O9A46O096923; Fri, 24 Jul 2015 09:10:04 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6O9A4Cj096922; Fri, 24 Jul 2015 09:10:04 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201507240910.t6O9A4Cj096922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 24 Jul 2015 09:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285835 - head/usr.bin/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 09:10:05 -0000 Author: bapt Date: Fri Jul 24 09:10:03 2015 New Revision: 285835 URL: https://svnweb.freebsd.org/changeset/base/285835 Log: Fix man -k with mandocdb If apropos(1) and whatis(1) are not hardlinks to man(1) that means the system is using mandocdb, then man -k should spawn apropos(1) and/or whatis(1) directly Reported by: kevlo Tested by: kevlo Sponsored by: gandi.net Modified: head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.sh ============================================================================== --- head/usr.bin/man/man.sh Fri Jul 24 07:46:02 2015 (r285834) +++ head/usr.bin/man/man.sh Fri Jul 24 09:10:03 2015 (r285835) @@ -925,6 +925,8 @@ whatis_usage() { # Supported commands do_apropos() { + [ $(stat -f %i /usr/bin/man) -eq $(stat -f %i /usr/bin/apropos) ] && \ + exec apropos "$@" search_whatis apropos "$@" } @@ -960,6 +962,8 @@ do_manpath() { } do_whatis() { + [ $(stat -f %i /usr/bin/man) -eq $(stat -f %i /usr/bin/whatis) ] && \ + exec whatis "$@" search_whatis whatis "$@" } From owner-svn-src-head@freebsd.org Fri Jul 24 09:20:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB59D9A9C57; Fri, 24 Jul 2015 09:20:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB2481AC2; Fri, 24 Jul 2015 09:20:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6O9K34g001632; Fri, 24 Jul 2015 09:20:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6O9K35u001631; Fri, 24 Jul 2015 09:20:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201507240920.t6O9K35u001631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 24 Jul 2015 09:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285836 - head/usr.bin/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 09:20:03 -0000 Author: bapt Date: Fri Jul 24 09:20:02 2015 New Revision: 285836 URL: https://svnweb.freebsd.org/changeset/base/285836 Log: inode should be different to actually mean mandocdb is in used Sponsored by: gandi.net Modified: head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.sh ============================================================================== --- head/usr.bin/man/man.sh Fri Jul 24 09:10:03 2015 (r285835) +++ head/usr.bin/man/man.sh Fri Jul 24 09:20:02 2015 (r285836) @@ -925,7 +925,7 @@ whatis_usage() { # Supported commands do_apropos() { - [ $(stat -f %i /usr/bin/man) -eq $(stat -f %i /usr/bin/apropos) ] && \ + [ $(stat -f %i /usr/bin/man) -ne $(stat -f %i /usr/bin/apropos) ] && \ exec apropos "$@" search_whatis apropos "$@" } @@ -962,7 +962,7 @@ do_manpath() { } do_whatis() { - [ $(stat -f %i /usr/bin/man) -eq $(stat -f %i /usr/bin/whatis) ] && \ + [ $(stat -f %i /usr/bin/man) -ne $(stat -f %i /usr/bin/whatis) ] && \ exec whatis "$@" search_whatis whatis "$@" } From owner-svn-src-head@freebsd.org Fri Jul 24 14:09:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D5CD9A9DED; Fri, 24 Jul 2015 14:09:06 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D38A11F1; Fri, 24 Jul 2015 14:09:06 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OE95SI020029; Fri, 24 Jul 2015 14:09:05 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OE94PI020024; Fri, 24 Jul 2015 14:09:04 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201507241409.t6OE94PI020024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Fri, 24 Jul 2015 14:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285837 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 14:09:06 -0000 Author: rrs Date: Fri Jul 24 14:09:03 2015 New Revision: 285837 URL: https://svnweb.freebsd.org/changeset/base/285837 Log: Fix an issue with MAC OS locking and also optimize the case where we are sending back a stream-reset and a sack timer is running, in that case we should just send the SACK. MFC after: 3 weeks Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Fri Jul 24 09:20:02 2015 (r285836) +++ head/sys/netinet/sctp_input.c Fri Jul 24 14:09:03 2015 (r285837) @@ -3764,7 +3764,7 @@ sctp_handle_stream_reset_response(struct } } if (asoc->stream_reset_outstanding == 0) { - sctp_send_stream_reset_out_if_possible(stcb); + sctp_send_stream_reset_out_if_possible(stcb, SCTP_SO_NOT_LOCKED); } return (0); } @@ -3832,7 +3832,7 @@ bad_boy: } else { sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_RESULT_ERR_BAD_SEQNO); } - sctp_send_stream_reset_out_if_possible(stcb); + sctp_send_stream_reset_out_if_possible(stcb, SCTP_SO_NOT_LOCKED); } static int @@ -3957,6 +3957,7 @@ sctp_handle_str_reset_request_out(struct memcpy(&liste->list_of_streams, req->list_of_streams, number_entries * sizeof(uint16_t)); TAILQ_INSERT_TAIL(&asoc->resetHead, liste, next_resp); asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_IN_PROGRESS; + x } sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); asoc->str_reset_seq_in++; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Jul 24 09:20:02 2015 (r285836) +++ head/sys/netinet/sctp_output.c Fri Jul 24 14:09:03 2015 (r285837) @@ -10104,7 +10104,7 @@ do_it_again: sctp_fix_ecn_echo(asoc); if (stcb->asoc.trigger_reset) { - if (sctp_send_stream_reset_out_if_possible(stcb) == 0) { + if (sctp_send_stream_reset_out_if_possible(stcb, so_locked) == 0) { goto do_it_again; } } @@ -11839,7 +11839,7 @@ sctp_add_an_in_stream(struct sctp_tmit_c } int -sctp_send_stream_reset_out_if_possible(struct sctp_tcb *stcb) +sctp_send_stream_reset_out_if_possible(struct sctp_tcb *stcb, int so_locked) { struct sctp_association *asoc; struct sctp_tmit_chunk *chk; @@ -11865,7 +11865,7 @@ sctp_send_stream_reset_out_if_possible(s chk->book_size_scale = 0; chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk, SCTP_SO_LOCKED); + sctp_free_a_chunk(stcb, chk, so_locked); SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); return (ENOMEM); } @@ -11892,7 +11892,7 @@ sctp_send_stream_reset_out_if_possible(s } else { m_freem(chk->data); chk->data = NULL; - sctp_free_a_chunk(stcb, chk, SCTP_SO_LOCKED); + sctp_free_a_chunk(stcb, chk, so_locked); return (ENOENT); } asoc->str_reset = chk; @@ -11901,6 +11901,10 @@ sctp_send_stream_reset_out_if_possible(s chk, sctp_next); asoc->ctrl_queue_cnt++; + + if (stcb->asoc.send_sack) { + sctp_send_sack(stcb, so_locked); + } sctp_timer_start(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb, chk->whoTo); return (0); } @@ -12101,6 +12105,9 @@ skip_stuff: chk, sctp_next); asoc->ctrl_queue_cnt++; + if (stcb->asoc.send_sack) { + sctp_send_sack(stcb, SCTP_SO_LOCKED); + } sctp_timer_start(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb, chk->whoTo); return (0); } Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Fri Jul 24 09:20:02 2015 (r285836) +++ head/sys/netinet/sctp_output.h Fri Jul 24 14:09:03 2015 (r285837) @@ -181,7 +181,7 @@ void sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *, uint32_t, uint32_t, uint32_t, uint32_t); int - sctp_send_stream_reset_out_if_possible(struct sctp_tcb *); + sctp_send_stream_reset_out_if_possible(struct sctp_tcb *, int); int sctp_send_str_reset_req(struct sctp_tcb *, uint16_t, uint16_t *, Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Fri Jul 24 09:20:02 2015 (r285836) +++ head/sys/netinet/sctp_usrreq.c Fri Jul 24 14:09:03 2015 (r285837) @@ -4689,8 +4689,7 @@ sctp_setopt(struct socket *so, int optna strrst->srs_stream_list, send_in, 0, 0, 0, 0, 0); } else - error = sctp_send_stream_reset_out_if_possible(stcb); - + error = sctp_send_stream_reset_out_if_possible(stcb, SCTP_SO_LOCKED); if (!error) sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED); From owner-svn-src-head@freebsd.org Fri Jul 24 14:13:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E1029A92AB; Fri, 24 Jul 2015 14:13:44 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E8B61D5B; Fri, 24 Jul 2015 14:13:44 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OEDiw4024075; Fri, 24 Jul 2015 14:13:44 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OEDiYP024074; Fri, 24 Jul 2015 14:13:44 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201507241413.t6OEDiYP024074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Fri, 24 Jul 2015 14:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285838 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 14:13:44 -0000 Author: rrs Date: Fri Jul 24 14:13:43 2015 New Revision: 285838 URL: https://svnweb.freebsd.org/changeset/base/285838 Log: Fix silly syntax error emacs chugged in for me.. gesh. MFC after: 3 weeks Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Fri Jul 24 14:09:03 2015 (r285837) +++ head/sys/netinet/sctp_input.c Fri Jul 24 14:13:43 2015 (r285838) @@ -3957,7 +3957,6 @@ sctp_handle_str_reset_request_out(struct memcpy(&liste->list_of_streams, req->list_of_streams, number_entries * sizeof(uint16_t)); TAILQ_INSERT_TAIL(&asoc->resetHead, liste, next_resp); asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_IN_PROGRESS; - x } sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); asoc->str_reset_seq_in++; From owner-svn-src-head@freebsd.org Fri Jul 24 15:13:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 420539AA97A; Fri, 24 Jul 2015 15:13:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 317521DB7; Fri, 24 Jul 2015 15:13:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OFDOua050567; Fri, 24 Jul 2015 15:13:24 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OFDMjs050562; Fri, 24 Jul 2015 15:13:22 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201507241513.t6OFDMjs050562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Fri, 24 Jul 2015 15:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285839 - in head/sys: kern sparc64/include sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 15:13:24 -0000 Author: marius Date: Fri Jul 24 15:13:21 2015 New Revision: 285839 URL: https://svnweb.freebsd.org/changeset/base/285839 Log: o Revert the other functional half of r239864, i. e. the merge of r134227 from x86 to use smp_ipi_mtx spin lock not only for smp_rendezvous_cpus() but also for the MD cache invalidation, TLB demapping and remote register reading IPIs due to the following reasons: - The cross-IPI SMP deadlock x86 otherwise is subject to can't happen on sparc64. That's because on sparc64, spin locks don't disable interrupts completely but only raise the processor interrupt level to PIL_TICK. This means that IPIs still get delivered and direct dispatch IPIs such as the cache invalidation etc. IPIs in question are still executed. - In smp_rendezvous_cpus(), smp_ipi_mtx is held not only while sending an IPI_RENDEZVOUS, but until all CPUs have processed smp_rendezvous_action(). Consequently, smp_ipi_mtx may be locked for an extended amount of time as queued IPIs (as opposed to the direct ones) such as IPI_RENDEZVOUS are scheduled via a soft interrupt. Moreover, given that this soft interrupt is only delivered at PIL_RENDEZVOUS, processing of smp_rendezvous_action() on a target may be interrupted by f. e. a tick interrupt at PIL_TICK, in turn leading to the target in question trying to send an IPI by itself while IPI_RENDEZVOUS isn't fully handled, yet, and, thus, resulting in a deadlock. o As mentioned in the commit message of r245850, on least some sun4u platforms concurrent sending of IPIs by different CPUs is fatal. Therefore, hold the reintroduced MD ipi_mtx also while delivering cross-traps via MI helpers, i. e. ipi_{all_but_self,cpu,selected}(). o Akin to x86, let the last CPU to process cpu_mp_bootstrap() set smp_started instead of the BSP in cpu_mp_unleash(). This ensures that all APs actually are started, when smp_started is no longer 0. o In all MD and MI IPI helpers, check for smp_started == 1 rather than for smp_cpus > 1 or nothing at all. This avoids races during boot causing IPIs trying to be delivered to APs that in fact aren't up and running, yet. While at it, move setting of the cpu_ipi_{selected,single}() pointers to the appropriate delivery functions from mp_init() to cpu_mp_start() where it's better suited and allows to get rid of the global isjbus variable. o Given that now concurrent IPI delivery no longer is possible, also nuke the delays before completely disabling interrupts again in the CPU-specific cross-trap delivery functions, previously giving other CPUs a window for sending IPIs on their part. Actually, we now should be able to entirely get rid of completely disabling interrupts in these functions. Such a change needs more testing, though. o In {s,}tick_get_timecount_mp(), make the {s,}tick variable static. While not necessary for correctness, this avoids page faults when accessing the stack of a foreign CPU as {s,}tick now is locked into the TLBs as part of static kernel data. Hence, {s,}tick_get_timecount_mp() always execute as fast as possible, avoiding jitter. PR: 201245 MFC after: 3 days Modified: head/sys/kern/subr_witness.c head/sys/sparc64/include/smp.h head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/mp_machdep.c head/sys/sparc64/sparc64/tick.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Fri Jul 24 14:13:43 2015 (r285838) +++ head/sys/kern/subr_witness.c Fri Jul 24 15:13:21 2015 (r285839) @@ -661,6 +661,9 @@ static struct witness_order_list_entry o */ { "intrcnt", &lock_class_mtx_spin }, { "icu", &lock_class_mtx_spin }, +#if defined(SMP) && defined(__sparc64__) + { "ipi", &lock_class_mtx_spin }, +#endif #ifdef __i386__ { "allpmaps", &lock_class_mtx_spin }, { "descriptor tables", &lock_class_mtx_spin }, Modified: head/sys/sparc64/include/smp.h ============================================================================== --- head/sys/sparc64/include/smp.h Fri Jul 24 14:13:43 2015 (r285838) +++ head/sys/sparc64/include/smp.h Fri Jul 24 15:13:21 2015 (r285839) @@ -39,13 +39,15 @@ #ifndef LOCORE +#include #include +#include +#include #include #include #include #include -#include #include #define IDR_BUSY 0x0000000000000001ULL @@ -96,6 +98,7 @@ struct ipi_tlb_args { }; #define ita_va ita_start +struct pcb; struct pcpu; extern struct pcb stoppcbs[]; @@ -108,8 +111,9 @@ extern cpu_ipi_selected_t *cpu_ipi_selec typedef void cpu_ipi_single_t(u_int, u_long, u_long, u_long); extern cpu_ipi_single_t *cpu_ipi_single; -void mp_init(u_int cpu_impl); +void mp_init(void); +extern struct mtx ipi_mtx; extern struct ipi_cache_args ipi_cache_args; extern struct ipi_rd_args ipi_rd_args; extern struct ipi_tlb_args ipi_tlb_args; @@ -139,23 +143,37 @@ ipi_all_but_self(u_int ipi) { cpuset_t cpus; + if (__predict_false(smp_started == 0)) + return; cpus = all_cpus; + sched_pin(); CPU_CLR(PCPU_GET(cpuid), &cpus); + mtx_lock_spin(&ipi_mtx); cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_level, ipi); + mtx_unlock_spin(&ipi_mtx); + sched_unpin(); } static __inline void ipi_selected(cpuset_t cpus, u_int ipi) { + if (__predict_false(smp_started == 0 || CPU_EMPTY(&cpus))) + return; + mtx_lock_spin(&ipi_mtx); cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_level, ipi); + mtx_unlock_spin(&ipi_mtx); } static __inline void ipi_cpu(int cpu, u_int ipi) { + if (__predict_false(smp_started == 0)) + return; + mtx_lock_spin(&ipi_mtx); cpu_ipi_single(cpu, 0, (u_long)tl_ipi_level, ipi); + mtx_unlock_spin(&ipi_mtx); } #if defined(_MACHINE_PMAP_H_) && defined(_SYS_MUTEX_H_) @@ -165,11 +183,11 @@ ipi_dcache_page_inval(void *func, vm_pad { struct ipi_cache_args *ica; - if (smp_cpus == 1) + if (__predict_false(smp_started == 0)) return (NULL); sched_pin(); ica = &ipi_cache_args; - mtx_lock_spin(&smp_ipi_mtx); + mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; CPU_CLR(PCPU_GET(cpuid), &ica->ica_mask); ica->ica_pa = pa; @@ -182,11 +200,11 @@ ipi_icache_page_inval(void *func, vm_pad { struct ipi_cache_args *ica; - if (smp_cpus == 1) + if (__predict_false(smp_started == 0)) return (NULL); sched_pin(); ica = &ipi_cache_args; - mtx_lock_spin(&smp_ipi_mtx); + mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; CPU_CLR(PCPU_GET(cpuid), &ica->ica_mask); ica->ica_pa = pa; @@ -199,11 +217,11 @@ ipi_rd(u_int cpu, void *func, u_long *va { struct ipi_rd_args *ira; - if (smp_cpus == 1) + if (__predict_false(smp_started == 0)) return (NULL); sched_pin(); ira = &ipi_rd_args; - mtx_lock_spin(&smp_ipi_mtx); + mtx_lock_spin(&ipi_mtx); CPU_SETOF(cpu, &ira->ira_mask); ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); @@ -216,7 +234,7 @@ ipi_tlb_context_demap(struct pmap *pm) struct ipi_tlb_args *ita; cpuset_t cpus; - if (smp_cpus == 1) + if (__predict_false(smp_started == 0)) return (NULL); sched_pin(); cpus = pm->pm_active; @@ -227,7 +245,7 @@ ipi_tlb_context_demap(struct pmap *pm) return (NULL); } ita = &ipi_tlb_args; - mtx_lock_spin(&smp_ipi_mtx); + mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus; ita->ita_pmap = pm; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_context_demap, @@ -241,7 +259,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o struct ipi_tlb_args *ita; cpuset_t cpus; - if (smp_cpus == 1) + if (__predict_false(smp_started == 0)) return (NULL); sched_pin(); cpus = pm->pm_active; @@ -252,7 +270,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o return (NULL); } ita = &ipi_tlb_args; - mtx_lock_spin(&smp_ipi_mtx); + mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_va = va; @@ -266,7 +284,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ struct ipi_tlb_args *ita; cpuset_t cpus; - if (smp_cpus == 1) + if (__predict_false(smp_started == 0)) return (NULL); sched_pin(); cpus = pm->pm_active; @@ -277,7 +295,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ return (NULL); } ita = &ipi_tlb_args; - mtx_lock_spin(&smp_ipi_mtx); + mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_start = start; @@ -292,10 +310,10 @@ ipi_wait(void *cookie) { volatile cpuset_t *mask; - if ((mask = cookie) != NULL) { + if (__predict_false((mask = cookie) != NULL)) { while (!CPU_EMPTY(mask)) ; - mtx_unlock_spin(&smp_ipi_mtx); + mtx_unlock_spin(&ipi_mtx); sched_unpin(); } } Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Fri Jul 24 14:13:43 2015 (r285838) +++ head/sys/sparc64/sparc64/machdep.c Fri Jul 24 15:13:21 2015 (r285839) @@ -499,7 +499,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l } #ifdef SMP - mp_init(cpu_impl); + mp_init(); #endif /* Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Fri Jul 24 14:13:43 2015 (r285838) +++ head/sys/sparc64/sparc64/mp_machdep.c Fri Jul 24 15:13:21 2015 (r285839) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -113,12 +114,13 @@ struct ipi_rd_args ipi_rd_args; struct ipi_tlb_args ipi_tlb_args; struct pcb stoppcbs[MAXCPU]; +struct mtx ipi_mtx; + cpu_ipi_selected_t *cpu_ipi_selected; cpu_ipi_single_t *cpu_ipi_single; static vm_offset_t mp_tramp; static u_int cpuid_to_mid[MAXCPU]; -static int isjbus; static volatile cpuset_t shutdown_cpus; static void ap_count(phandle_t node, u_int mid, u_int cpu_impl); @@ -138,7 +140,7 @@ static cpu_ipi_single_t spitfire_ipi_sin SYSINIT(cpu_mp_unleash, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); void -mp_init(u_int cpu_impl) +mp_init(void) { struct tte *tp; int i; @@ -157,24 +159,6 @@ mp_init(u_int cpu_impl) } for (i = 0; i < PAGE_SIZE; i += sizeof(vm_offset_t)) flush(mp_tramp + i); - - /* - * On UP systems cpu_ipi_selected() can be called while - * cpu_mp_start() wasn't so initialize these here. - */ - if (cpu_impl == CPU_IMPL_ULTRASPARCIIIi || - cpu_impl == CPU_IMPL_ULTRASPARCIIIip) { - isjbus = 1; - cpu_ipi_selected = jalapeno_ipi_selected; - cpu_ipi_single = jalapeno_ipi_single; - } else if (cpu_impl == CPU_IMPL_SPARC64V || - cpu_impl >= CPU_IMPL_ULTRASPARCIII) { - cpu_ipi_selected = cheetah_ipi_selected; - cpu_ipi_single = cheetah_ipi_single; - } else { - cpu_ipi_selected = spitfire_ipi_selected; - cpu_ipi_single = spitfire_ipi_single; - } } static void @@ -219,7 +203,7 @@ foreach_ap(phandle_t node, void (*func)( * Probe for other CPUs. */ void -cpu_mp_setmaxid() +cpu_mp_setmaxid(void) { CPU_SETOF(curcpu, &all_cpus); @@ -277,6 +261,25 @@ sun4u_startcpu(phandle_t cpu, void *func void cpu_mp_start(void) { + u_int cpu_impl, isjbus; + + mtx_init(&ipi_mtx, "ipi", NULL, MTX_SPIN); + + isjbus = 0; + cpu_impl = PCPU_GET(impl); + if (cpu_impl == CPU_IMPL_ULTRASPARCIIIi || + cpu_impl == CPU_IMPL_ULTRASPARCIIIip) { + isjbus = 1; + cpu_ipi_selected = jalapeno_ipi_selected; + cpu_ipi_single = jalapeno_ipi_single; + } else if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) { + cpu_ipi_selected = cheetah_ipi_selected; + cpu_ipi_single = cheetah_ipi_single; + } else { + cpu_ipi_selected = spitfire_ipi_selected; + cpu_ipi_single = spitfire_ipi_single; + } intr_setup(PIL_AST, cpu_ipi_ast, -1, NULL, NULL); intr_setup(PIL_RENDEZVOUS, (ih_func_t *)smp_rendezvous_action, @@ -360,7 +363,7 @@ cpu_mp_announce(void) } static void -cpu_mp_unleash(void *v) +cpu_mp_unleash(void *v __unused) { volatile struct cpu_start_args *csa; struct pcpu *pc; @@ -407,7 +410,6 @@ cpu_mp_unleash(void *v) membar(StoreLoad); csa->csa_count = 0; - smp_started = 1; } void @@ -464,6 +466,9 @@ cpu_mp_bootstrap(struct pcpu *pc) while (csa->csa_count != 0) ; + if (smp_cpus == mp_ncpus) + atomic_store_rel_int(&smp_started, 1); + /* Start per-CPU event timers. */ cpu_initclocks_ap(); @@ -530,7 +535,7 @@ cpu_ipi_stop(struct trapframe *tf __unus } static void -cpu_ipi_preempt(struct trapframe *tf) +cpu_ipi_preempt(struct trapframe *tf __unused) { sched_preempt(curthread); @@ -573,9 +578,11 @@ spitfire_ipi_single(u_int cpu, u_long d0 u_int mid; int i; + mtx_assert(&ipi_mtx, MA_OWNED); KASSERT(cpu != curcpu, ("%s: CPU can't IPI itself", __func__)); KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) & IDR_BUSY) == 0, ("%s: outstanding dispatch", __func__)); + mid = cpuid_to_mid[cpu]; for (i = 0; i < IPI_RETRIES; i++) { s = intr_disable(); @@ -601,12 +608,6 @@ spitfire_ipi_single(u_int cpu, u_long d0 intr_restore(s); if ((ids & (IDR_BUSY | IDR_NACK)) == 0) return; - /* - * Leave interrupts enabled for a bit before retrying - * in order to avoid deadlocks if the other CPU is also - * trying to send an IPI. - */ - DELAY(2); } if (kdb_active != 0 || panicstr != NULL) printf("%s: couldn't send IPI to module 0x%u\n", @@ -624,10 +625,12 @@ cheetah_ipi_single(u_int cpu, u_long d0, u_int mid; int i; + mtx_assert(&ipi_mtx, MA_OWNED); KASSERT(cpu != curcpu, ("%s: CPU can't IPI itself", __func__)); KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) & IDR_CHEETAH_ALL_BUSY) == 0, ("%s: outstanding dispatch", __func__)); + mid = cpuid_to_mid[cpu]; for (i = 0; i < IPI_RETRIES; i++) { s = intr_disable(); @@ -644,12 +647,6 @@ cheetah_ipi_single(u_int cpu, u_long d0, intr_restore(s); if ((ids & (IDR_BUSY | IDR_NACK)) == 0) return; - /* - * Leave interrupts enabled for a bit before retrying - * in order to avoid deadlocks if the other CPU is also - * trying to send an IPI. - */ - DELAY(2); } if (kdb_active != 0 || panicstr != NULL) printf("%s: couldn't send IPI to module 0x%u\n", @@ -669,13 +666,14 @@ cheetah_ipi_selected(cpuset_t cpus, u_lo u_int cpu; int i; + mtx_assert(&ipi_mtx, MA_OWNED); + KASSERT(!CPU_EMPTY(&cpus), ("%s: no CPUs to IPI", __func__)); KASSERT(!CPU_ISSET(curcpu, &cpus), ("%s: CPU can't IPI itself", __func__)); KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) & IDR_CHEETAH_ALL_BUSY) == 0, ("%s: outstanding dispatch", __func__)); - if (CPU_EMPTY(&cpus)) - return; + ids = 0; for (i = 0; i < IPI_RETRIES * mp_ncpus; i++) { s = intr_disable(); @@ -709,12 +707,6 @@ cheetah_ipi_selected(cpuset_t cpus, u_lo } if (CPU_EMPTY(&cpus)) return; - /* - * Leave interrupts enabled for a bit before retrying - * in order to avoid deadlocks if the other CPUs are - * also trying to send IPIs. - */ - DELAY(2 * mp_ncpus); } if (kdb_active != 0 || panicstr != NULL) printf("%s: couldn't send IPI (cpus=%s ids=0x%lu)\n", @@ -732,10 +724,12 @@ jalapeno_ipi_single(u_int cpu, u_long d0 u_int busy, busynack, mid; int i; + mtx_assert(&ipi_mtx, MA_OWNED); KASSERT(cpu != curcpu, ("%s: CPU can't IPI itself", __func__)); KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) & IDR_CHEETAH_ALL_BUSY) == 0, ("%s: outstanding dispatch", __func__)); + mid = cpuid_to_mid[cpu]; busy = IDR_BUSY << (2 * mid); busynack = (IDR_BUSY | IDR_NACK) << (2 * mid); @@ -754,12 +748,6 @@ jalapeno_ipi_single(u_int cpu, u_long d0 intr_restore(s); if ((ids & busynack) == 0) return; - /* - * Leave interrupts enabled for a bit before retrying - * in order to avoid deadlocks if the other CPU is also - * trying to send an IPI. - */ - DELAY(2); } if (kdb_active != 0 || panicstr != NULL) printf("%s: couldn't send IPI to module 0x%u\n", @@ -778,13 +766,14 @@ jalapeno_ipi_selected(cpuset_t cpus, u_l u_int cpu; int i; + mtx_assert(&ipi_mtx, MA_OWNED); + KASSERT(!CPU_EMPTY(&cpus), ("%s: no CPUs to IPI", __func__)); KASSERT(!CPU_ISSET(curcpu, &cpus), ("%s: CPU can't IPI itself", __func__)); KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) & IDR_CHEETAH_ALL_BUSY) == 0, ("%s: outstanding dispatch", __func__)); - if (CPU_EMPTY(&cpus)) - return; + ids = 0; for (i = 0; i < IPI_RETRIES * mp_ncpus; i++) { s = intr_disable(); @@ -811,12 +800,6 @@ jalapeno_ipi_selected(cpuset_t cpus, u_l if ((ids & (IDR_NACK << (2 * cpuid_to_mid[cpu]))) == 0) CPU_CLR(cpu, &cpus); - /* - * Leave interrupts enabled for a bit before retrying - * in order to avoid deadlocks if the other CPUs are - * also trying to send IPIs. - */ - DELAY(2 * mp_ncpus); } if (kdb_active != 0 || panicstr != NULL) printf("%s: couldn't send IPI (cpus=%s ids=0x%lu)\n", Modified: head/sys/sparc64/sparc64/tick.c ============================================================================== --- head/sys/sparc64/sparc64/tick.c Fri Jul 24 14:13:43 2015 (r285838) +++ head/sys/sparc64/sparc64/tick.c Fri Jul 24 15:13:21 2015 (r285839) @@ -31,8 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include #include @@ -46,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -326,7 +323,7 @@ tick_get_timecount_up(struct timecounter static u_int stick_get_timecount_mp(struct timecounter *tc) { - u_long stick; + static u_long stick; sched_pin(); if (curcpu == 0) @@ -340,7 +337,7 @@ stick_get_timecount_mp(struct timecounte static u_int tick_get_timecount_mp(struct timecounter *tc) { - u_long tick; + static u_long tick; sched_pin(); if (curcpu == 0) From owner-svn-src-head@freebsd.org Fri Jul 24 15:25:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A931E9AAB32 for ; Fri, 24 Jul 2015 15:25:26 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) by mx1.freebsd.org (Postfix) with SMTP id 83ADF12D2 for ; Fri, 24 Jul 2015 15:25:26 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Fri, 24 Jul 2015 15:26:18 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t6OFPKB5011699; Fri, 24 Jul 2015 09:25:20 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1437751520.1334.546.camel@freebsd.org> Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... From: Ian Lepore To: Mark R V Murray Cc: John-Mark Gurney , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 24 Jul 2015 09:25:20 -0600 In-Reply-To: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150724012519.GE78154@funkthat.com> Content-Type: text/plain; charset="windows-1251" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 15:25:26 -0000 On Fri, 2015-07-24 at 07:59 +0100, Mark R V Murray wrote: > > On 24 Jul 2015, at 02:25, John-Mark Gurney wrote: > > > > I would like to point out that the goal of collecting large amounts > > is starting to fall out of favor, and I happen to agree with the likes > > of djb[1] that we don't need an infinite amount of entropy collected by > > the system. If the attacker can read out our RNG state, then we are > > already screwed due to many other vulns. > > I’m working on a premise of “tools, not policy”. I’d like there to be > enough harvesting points for the box owner to get the warm fuzzies. > If they choose to use less, fine by me. > > > Many of the issues that FreeBSD sees with lack of entropy at start up > > is more of a problem on how systems are installed and provisioned. I > > don't believe that we currently store any entropy from the install > > process, yet this is one of the best places to get it, the user is > > banging on keyboard selecting options, etc. If an image is designed > > to be cloned (vm images or appliance images) we need to have a > > mechanism to ensure that before we start, we get the entropy from > > other sources, be it a hardware RNG or the console. > > Getting an initial entropy bundle for first boot is high up on my > TODO list. :-) Patches welcome! We need the usual /entropy (or > /var/db/entropy/… or whatever) and crucially we need /boot/entropy > and the correct invocation in /boot/loader.conf. > But keep in mind that loader(8) is optional and not used at all on some non-x86 systems. -- Ian From owner-svn-src-head@freebsd.org Fri Jul 24 16:00:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 394739A9235; Fri, 24 Jul 2015 16:00:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A41C19F7; Fri, 24 Jul 2015 16:00:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OG0bh8073058; Fri, 24 Jul 2015 16:00:37 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OG0aB0072915; Fri, 24 Jul 2015 16:00:36 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201507241600.t6OG0aB0072915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Fri, 24 Jul 2015 16:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285840 - head/sys/dev/mpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 24 Jul 2015 16:00:37 -0000 Author: marius Date: Fri Jul 24 16:00:35 2015 New Revision: 285840 URL: https://svnweb.freebsd.org/changeset/base/285840 Log: - In mpt_send_handshake_cmd(), use bus_space_write_stream_4(9) for writing raw data to the doorbell offset in order to clarify the intent and for avoiding unnecessarily converting the endianess back and forth. Unfortunately, the same can't be done in mpt_recv_handshake_reply() as 16-bit data needs to be read using 32-bit bus accessors. - In mpt_recv_handshake_reply(), get rid of a redundant variable. MFC after: 1 fortnight Modified: head/sys/dev/mpt/mpt.c head/sys/dev/mpt/mpt.h Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Fri Jul 24 15:13:21 2015 (r285839) +++ head/sys/dev/mpt/mpt.c Fri Jul 24 16:00:35 2015 (r285840) @@ -1423,7 +1423,7 @@ mpt_send_handshake_cmd(struct mpt_softc /* Send the command */ for (i = 0; i < len; i++) { - mpt_write(mpt, MPT_OFFSET_DOORBELL, htole32(*data32++)); + mpt_write_stream(mpt, MPT_OFFSET_DOORBELL, *data32++); if (mpt_wait_db_ack(mpt) != MPT_OK) { mpt_prt(mpt, "mpt_send_handshake_cmd: timeout @ index %d\n", i); @@ -1457,7 +1457,7 @@ mpt_recv_handshake_reply(struct mpt_soft *data16++ = le16toh(data & MPT_DB_DATA_MASK); mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0); - /* Get Second Word */ + /* Get second word */ if (mpt_wait_db_int(mpt) != MPT_OK) { mpt_prt(mpt, "mpt_recv_handshake_cmd timeout2\n"); return ETIMEDOUT; @@ -1481,18 +1481,13 @@ mpt_recv_handshake_reply(struct mpt_soft left = (hdr->MsgLength << 1) - 2; reply_left = reply_len - 2; while (left--) { - u_int16_t datum; - if (mpt_wait_db_int(mpt) != MPT_OK) { mpt_prt(mpt, "mpt_recv_handshake_cmd timeout3\n"); return ETIMEDOUT; } data = mpt_read(mpt, MPT_OFFSET_DOORBELL); - datum = le16toh(data & MPT_DB_DATA_MASK); - if (reply_left-- > 0) - *data16++ = datum; - + *data16++ = le16toh(data & MPT_DB_DATA_MASK); mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0); } Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Fri Jul 24 15:13:21 2015 (r285839) +++ head/sys/dev/mpt/mpt.h Fri Jul 24 16:00:35 2015 (r285840) @@ -329,7 +329,6 @@ typedef struct mpt_config_params { } cfgparms_t; /**************************** MPI Target State Info ***************************/ - typedef struct { uint32_t reply_desc; /* current reply descriptor */ uint32_t resid; /* current data residual */ @@ -784,6 +783,7 @@ mpt_assign_serno(struct mpt_softc *mpt, /******************************* Register Access ******************************/ static __inline void mpt_write(struct mpt_softc *, size_t, uint32_t); +static __inline void mpt_write_stream(struct mpt_softc *, size_t, uint32_t); static __inline uint32_t mpt_read(struct mpt_softc *, int); static __inline void mpt_pio_write(struct mpt_softc *, size_t, uint32_t); static __inline uint32_t mpt_pio_read(struct mpt_softc *, int); @@ -794,6 +794,12 @@ mpt_write(struct mpt_softc *mpt, size_t bus_space_write_4(mpt->pci_st, mpt->pci_sh, offset, val); } +static __inline void +mpt_write_stream(struct mpt_softc *mpt, size_t offset, uint32_t val) +{ + bus_space_write_stream_4(mpt->pci_st, mpt->pci_sh, offset, val); +} + static __inline uint32_t mpt_read(struct mpt_softc *mpt, int offset) { @@ -818,6 +824,7 @@ mpt_pio_read(struct mpt_softc *mpt, int KASSERT(mpt->pci_pio_reg != NULL, ("no PIO resource")); return (bus_space_read_4(mpt->pci_pio_st, mpt->pci_pio_sh, offset)); } + /*********************** Reply Frame/Request Management ***********************/ /* Max MPT Reply we are willing to accept (must be power of 2) */ #define MPT_REPLY_SIZE 256 @@ -958,6 +965,7 @@ mpt_cdblen(uint8_t cdb0, int maxlen) return (16); } } + #ifdef INVARIANTS static __inline request_t * mpt_tag_2_req(struct mpt_softc *, uint32_t); static __inline request_t * @@ -1136,6 +1144,7 @@ mpt_write_cur_cfg_page(struct mpt_softc PageAddress, hdr, len, sleep_ok, timeout_ms)); } + /* mpt_debug.c functions */ void mpt_print_reply(void *vmsg); void mpt_print_db(uint32_t mb); @@ -1145,4 +1154,5 @@ void mpt_req_state(mpt_req_state_t state void mpt_print_config_request(void *vmsg); void mpt_print_request(void *vmsg); void mpt_dump_sgl(SGE_IO_UNION *se, int offset); + #endif /* _MPT_H_ */ From owner-svn-src-head@freebsd.org Fri Jul 24 16:52:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53CB49A9BF4; Fri, 24 Jul 2015 16:52:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37ED01281; Fri, 24 Jul 2015 16:52:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OGqNS1099571; Fri, 24 Jul 2015 16:52:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OGqLuv099565; Fri, 24 Jul 2015 16:52:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201507241652.t6OGqLuv099565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 24 Jul 2015 16:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285841 - in head: contrib/elftoolchain/common contrib/elftoolchain/readelf sys/sys usr.bin/elfdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 16:52:23 -0000 Author: emaste Date: Fri Jul 24 16:52:21 2015 New Revision: 285841 URL: https://svnweb.freebsd.org/changeset/base/285841 Log: Add RISC-V ELF machine type definition EM_RISCV is now officially registered as e_machine 243. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/common/elfdefinitions.h head/contrib/elftoolchain/readelf/readelf.c head/sys/sys/elf_common.h head/usr.bin/elfdump/elfdump.c Modified: head/contrib/elftoolchain/common/elfdefinitions.h ============================================================================== --- head/contrib/elftoolchain/common/elfdefinitions.h Fri Jul 24 16:00:35 2015 (r285840) +++ head/contrib/elftoolchain/common/elfdefinitions.h Fri Jul 24 16:52:21 2015 (r285841) @@ -813,7 +813,8 @@ _ELF_DEFINE_EM(EM_KM32, 210, _ELF_DEFINE_EM(EM_KMX32, 211, "KM211 KMX32 32-bit processor") \ _ELF_DEFINE_EM(EM_KMX16, 212, "KM211 KMX16 16-bit processor") \ _ELF_DEFINE_EM(EM_KMX8, 213, "KM211 KMX8 8-bit processor") \ -_ELF_DEFINE_EM(EM_KVARC, 214, "KM211 KMX32 KVARC processor") +_ELF_DEFINE_EM(EM_KVARC, 214, "KM211 KMX32 KVARC processor") \ +_ELF_DEFINE_EM(EM_RISCV, 243, "RISC-V") #undef _ELF_DEFINE_EM #define _ELF_DEFINE_EM(N, V, DESCR) N = V , Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Jul 24 16:00:35 2015 (r285840) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Jul 24 16:52:21 2015 (r285841) @@ -532,6 +532,7 @@ elf_machine(unsigned int mach) case EM_ARCA: return "Arca RISC Microprocessor"; case EM_UNICORE: return "Microprocessor series from PKU-Unity Ltd"; case EM_AARCH64: return "AArch64"; + case EM_RISCV: return "RISC-V"; default: snprintf(s_mach, sizeof(s_mach), "", mach); return (s_mach); Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Fri Jul 24 16:00:35 2015 (r285840) +++ head/sys/sys/elf_common.h Fri Jul 24 16:52:21 2015 (r285841) @@ -297,6 +297,7 @@ typedef struct { #define EM_UNICORE 110 /* Microprocessor series from PKU-Unity Ltd. and MPRC of Peking University */ #define EM_AARCH64 183 /* AArch64 (64-bit ARM) */ +#define EM_RISCV 243 /* RISC-V */ /* Non-standard or deprecated. */ #define EM_486 6 /* Intel i486. */ Modified: head/usr.bin/elfdump/elfdump.c ============================================================================== --- head/usr.bin/elfdump/elfdump.c Fri Jul 24 16:00:35 2015 (r285840) +++ head/usr.bin/elfdump/elfdump.c Fri Jul 24 16:52:21 2015 (r285841) @@ -272,6 +272,7 @@ e_machines(u_int mach) case EM_IA_64: return "EM_IA_64"; case EM_X86_64: return "EM_X86_64"; case EM_AARCH64:return "EM_AARCH64"; + case EM_RISCV: return "EM_RISCV"; } snprintf(machdesc, sizeof(machdesc), "(unknown machine) -- type 0x%x", mach); From owner-svn-src-head@freebsd.org Fri Jul 24 16:57:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7FD19A9C81; Fri, 24 Jul 2015 16:57:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92C701662; Fri, 24 Jul 2015 16:57:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OGvHCd000521; Fri, 24 Jul 2015 16:57:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OGvE7P000508; Fri, 24 Jul 2015 16:57:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201507241657.t6OGvE7P000508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 24 Jul 2015 16:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285842 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 16:57:17 -0000 Author: emaste Date: Fri Jul 24 16:57:13 2015 New Revision: 285842 URL: https://svnweb.freebsd.org/changeset/base/285842 Log: truss: follow pdfork()ed descendents with -f PR: 201276 Reported by: David Drysdale Reviewed by: oshogbo MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2976 Modified: head/usr.bin/truss/amd64-fbsd.c head/usr.bin/truss/amd64-fbsd32.c head/usr.bin/truss/arm-fbsd.c head/usr.bin/truss/i386-fbsd.c head/usr.bin/truss/mips-fbsd.c head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/powerpc64-fbsd.c head/usr.bin/truss/sparc64-fbsd.c Modified: head/usr.bin/truss/amd64-fbsd.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd.c Fri Jul 24 16:52:21 2015 (r285841) +++ head/usr.bin/truss/amd64-fbsd.c Fri Jul 24 16:57:13 2015 (r285842) @@ -158,6 +158,7 @@ amd64_syscall_entry(struct trussinfo *tr if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && (strcmp(fsc->name, "fork") == 0 || + strcmp(fsc->name, "pdfork") == 0 || strcmp(fsc->name, "rfork") == 0 || strcmp(fsc->name, "vfork") == 0)) trussinfo->curthread->in_fork = 1; Modified: head/usr.bin/truss/amd64-fbsd32.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd32.c Fri Jul 24 16:52:21 2015 (r285841) +++ head/usr.bin/truss/amd64-fbsd32.c Fri Jul 24 16:57:13 2015 (r285842) @@ -165,6 +165,7 @@ amd64_fbsd32_syscall_entry(struct trussi if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && (strcmp(fsc->name, "fork") == 0 || + strcmp(fsc->name, "pdfork") == 0 || strcmp(fsc->name, "rfork") == 0 || strcmp(fsc->name, "vfork") == 0)) trussinfo->curthread->in_fork = 1; Modified: head/usr.bin/truss/arm-fbsd.c ============================================================================== --- head/usr.bin/truss/arm-fbsd.c Fri Jul 24 16:52:21 2015 (r285841) +++ head/usr.bin/truss/arm-fbsd.c Fri Jul 24 16:57:13 2015 (r285842) @@ -172,6 +172,7 @@ arm_syscall_entry(struct trussinfo *trus if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && (strcmp(fsc->name, "fork") == 0 || + strcmp(fsc->name, "pdfork") == 0 || strcmp(fsc->name, "rfork") == 0 || strcmp(fsc->name, "vfork") == 0)) trussinfo->curthread->in_fork = 1; Modified: head/usr.bin/truss/i386-fbsd.c ============================================================================== --- head/usr.bin/truss/i386-fbsd.c Fri Jul 24 16:52:21 2015 (r285841) +++ head/usr.bin/truss/i386-fbsd.c Fri Jul 24 16:57:13 2015 (r285842) @@ -162,6 +162,7 @@ i386_syscall_entry(struct trussinfo *tru if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && (strcmp(fsc->name, "fork") == 0 || + strcmp(fsc->name, "pdfork") == 0 || strcmp(fsc->name, "rfork") == 0 || strcmp(fsc->name, "vfork") == 0)) trussinfo->curthread->in_fork = 1; Modified: head/usr.bin/truss/mips-fbsd.c ============================================================================== --- head/usr.bin/truss/mips-fbsd.c Fri Jul 24 16:52:21 2015 (r285841) +++ head/usr.bin/truss/mips-fbsd.c Fri Jul 24 16:57:13 2015 (r285842) @@ -155,6 +155,7 @@ mips_syscall_entry(struct trussinfo *tru if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && (strcmp(fsc->name, "fork") == 0 || + strcmp(fsc->name, "pdfork") == 0 || strcmp(fsc->name, "rfork") == 0 || strcmp(fsc->name, "vfork") == 0)) trussinfo->curthread->in_fork = 1; Modified: head/usr.bin/truss/powerpc-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc-fbsd.c Fri Jul 24 16:52:21 2015 (r285841) +++ head/usr.bin/truss/powerpc-fbsd.c Fri Jul 24 16:57:13 2015 (r285842) @@ -169,6 +169,7 @@ powerpc_syscall_entry(struct trussinfo * if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && (strcmp(fsc->name, "fork") == 0 || + strcmp(fsc->name, "pdfork") == 0 || strcmp(fsc->name, "rfork") == 0 || strcmp(fsc->name, "vfork") == 0)) trussinfo->curthread->in_fork = 1; Modified: head/usr.bin/truss/powerpc64-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-fbsd.c Fri Jul 24 16:52:21 2015 (r285841) +++ head/usr.bin/truss/powerpc64-fbsd.c Fri Jul 24 16:57:13 2015 (r285842) @@ -157,6 +157,7 @@ powerpc64_syscall_entry(struct trussinfo if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && (strcmp(fsc->name, "fork") == 0 || + strcmp(fsc->name, "pdfork") == 0 || strcmp(fsc->name, "rfork") == 0 || strcmp(fsc->name, "vfork") == 0)) trussinfo->curthread->in_fork = 1; Modified: head/usr.bin/truss/sparc64-fbsd.c ============================================================================== --- head/usr.bin/truss/sparc64-fbsd.c Fri Jul 24 16:52:21 2015 (r285841) +++ head/usr.bin/truss/sparc64-fbsd.c Fri Jul 24 16:57:13 2015 (r285842) @@ -161,6 +161,7 @@ sparc64_syscall_entry(struct trussinfo * if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && (strcmp(fsc->name, "fork") == 0 || + strcmp(fsc->name, "pdfork") == 0 || strcmp(fsc->name, "rfork") == 0 || strcmp(fsc->name, "vfork") == 0)) trussinfo->curthread->in_fork = 1; From owner-svn-src-head@freebsd.org Fri Jul 24 17:01:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26FF19A9E08; Fri, 24 Jul 2015 17:01:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1390E1BEA; Fri, 24 Jul 2015 17:01:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OH1HVZ003753; Fri, 24 Jul 2015 17:01:17 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OH1Hif003750; Fri, 24 Jul 2015 17:01:17 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201507241701.t6OH1Hif003750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Fri, 24 Jul 2015 17:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285843 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 17:01:18 -0000 Author: marius Date: Fri Jul 24 17:01:16 2015 New Revision: 285843 URL: https://svnweb.freebsd.org/changeset/base/285843 Log: - Since r253161, uart_intr() abuses FILTER_SCHEDULE_THREAD for signaling uart_bus_attach() during its test that 20 iterations weren't sufficient for clearing all pending interrupts, assuming this means that hardware is broken and doesn't deassert interrupts. However, under pressure, 20 iterations also can be insufficient for clearing all pending interrupts, leading to a panic as intr_event_handle() tries to schedule an interrupt handler not registered. Solve this by introducing a flag that is set in test mode and otherwise restores pre-r253161 behavior of uart_intr(). The approach of additionally registering uart_intr() as handler as suggested in PR 194979 is not taken as that in turn would abuse special pccard and pccbb handling code of intr_event_handle(). [1] - Const'ify uart_driver_name. - Fix some minor style bugs. PR: 194979 [1] Reviewed by: marcel (earlier version) MFC after: 3 days Modified: head/sys/dev/uart/uart_bus.h head/sys/dev/uart/uart_core.c Modified: head/sys/dev/uart/uart_bus.h ============================================================================== --- head/sys/dev/uart/uart_bus.h Fri Jul 24 16:57:13 2015 (r285842) +++ head/sys/dev/uart/uart_bus.h Fri Jul 24 17:01:16 2015 (r285843) @@ -99,6 +99,7 @@ struct uart_softc { int sc_polled:1; /* This UART has no interrupts. */ int sc_txbusy:1; /* This UART is transmitting. */ int sc_isquelch:1; /* This UART has input squelched. */ + int sc_testintr:1; /* This UART is under int. testing. */ struct uart_devinfo *sc_sysdev; /* System device (or NULL). */ @@ -135,7 +136,7 @@ struct uart_softc { }; extern devclass_t uart_devclass; -extern char uart_driver_name[]; +extern const char uart_driver_name[]; int uart_bus_attach(device_t dev); int uart_bus_detach(device_t dev); @@ -157,14 +158,16 @@ void uart_tty_intr(void *arg); static __inline int uart_rx_empty(struct uart_softc *sc) { + return ((sc->sc_rxget == sc->sc_rxput) ? 1 : 0); } static __inline int uart_rx_full(struct uart_softc *sc) { - return ((sc->sc_rxput + 1 < sc->sc_rxbufsz) - ? (sc->sc_rxput + 1 == sc->sc_rxget) : (sc->sc_rxget == 0)); + + return ((sc->sc_rxput + 1 < sc->sc_rxbufsz) ? + (sc->sc_rxput + 1 == sc->sc_rxget) : (sc->sc_rxget == 0)); } static __inline int Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Fri Jul 24 16:57:13 2015 (r285842) +++ head/sys/dev/uart/uart_core.c Fri Jul 24 17:01:16 2015 (r285843) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include "uart_if.h" devclass_t uart_devclass; -char uart_driver_name[] = "uart"; +const char uart_driver_name[] = "uart"; SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs = SLIST_HEAD_INITIALIZER(uart_sysdevs); @@ -260,13 +260,14 @@ static int uart_intr(void *arg) { struct uart_softc *sc = arg; - int cnt, ipend; + int cnt, ipend, testintr; if (sc->sc_leaving) return (FILTER_STRAY); cnt = 0; - while (cnt < 20 && (ipend = UART_IPEND(sc)) != 0) { + testintr = sc->sc_testintr; + while ((!testintr || cnt < 20) && (ipend = UART_IPEND(sc)) != 0) { cnt++; if (ipend & SER_INT_OVERRUN) uart_intr_overrun(sc); @@ -277,7 +278,7 @@ uart_intr(void *arg) if (ipend & SER_INT_SIGCHG) uart_intr_sigchg(sc); if (ipend & SER_INT_TXIDLE) - uart_intr_txidle(sc); + uart_intr_txidle(sc); } if (sc->sc_polled) { @@ -286,7 +287,8 @@ uart_intr(void *arg) } return ((cnt == 0) ? FILTER_STRAY : - ((cnt == 20) ? FILTER_SCHEDULE_THREAD : FILTER_HANDLED)); + ((testintr && cnt == 20) ? FILTER_SCHEDULE_THREAD : + FILTER_HANDLED)); } serdev_intr_t * @@ -433,7 +435,7 @@ uart_bus_attach(device_t dev) /* * Protect ourselves against interrupts while we're not completely * finished attaching and initializing. We don't expect interrupts - * until after UART_ATTACH() though. + * until after UART_ATTACH(), though. */ sc->sc_leaving = 1; @@ -513,7 +515,9 @@ uart_bus_attach(device_t dev) pps_init(&sc->sc_pps); sc->sc_leaving = 0; + sc->sc_testintr = 1; filt = uart_intr(sc); + sc->sc_testintr = 0; /* * Don't use interrupts if we couldn't clear any pending interrupt From owner-svn-src-head@freebsd.org Fri Jul 24 17:46:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 811F59AA4E6; Fri, 24 Jul 2015 17:46:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 710CE14B0; Fri, 24 Jul 2015 17:46:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OHkibN026727; Fri, 24 Jul 2015 17:46:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OHkhFp026723; Fri, 24 Jul 2015 17:46:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201507241746.t6OHkhFp026723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 24 Jul 2015 17:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285844 - head/usr.bin/ar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 17:46:44 -0000 Author: emaste Date: Fri Jul 24 17:46:43 2015 New Revision: 285844 URL: https://svnweb.freebsd.org/changeset/base/285844 Log: ar: add -U (unique) option to disable -D (deterministic) mode This is required in order for us to support deterministic mode by default. If multiple -D or -U options are specified on the command line, the final one takes precedence. GNU ar also uses -U for this. An equivalent change will be applied to ELF Tool Chain's version of ar. PR: 196929 MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3175 Modified: head/usr.bin/ar/ar.1 head/usr.bin/ar/ar.c Modified: head/usr.bin/ar/ar.1 ============================================================================== --- head/usr.bin/ar/ar.1 Fri Jul 24 17:01:16 2015 (r285843) +++ head/usr.bin/ar/ar.1 Fri Jul 24 17:46:43 2015 (r285844) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 22, 2011 +.Dd July 24, 2015 .Dt AR 1 .Os .Sh NAME @@ -66,6 +66,7 @@ .Op Fl D .Op Fl f .Op Fl s | Fl S +.Op Fl U .Op Fl v .Op Fl z .Ar archive @@ -82,6 +83,7 @@ .Op Fl j .Op Fl s | Fl S .Op Fl u +.Op Fl U .Op Fl v .Op Fl z .Ar archive @@ -112,6 +114,7 @@ .Fl M .Nm ranlib .Op Fl D +.Op Fl U .Ar archive ... .Sh DESCRIPTION The @@ -207,6 +210,11 @@ and 0644 instead of file mode from the m .Ar . This ensures that checksums on the resulting archives are reproducible when member contents are identical. +If multiple +.Fl D +and +.Fl U +options are specified on the command line, the final one takes precedence. .It Fl f Synonymous with option .Fl T . @@ -316,6 +324,19 @@ option, the members specified by argumen .Ar will be extracted only if they are newer than the corresponding files in the file system. +.It Fl U +When used in combination with the +.Fl r +or +.Fl q +option, insert the real mtime, uid and gid, and file mode values +from the members named by arguments +.Ar . +If multiple +.Fl D +and +.Fl U +options are specified on the command line, the final one takes precedence. .It Fl v Provide verbose output. When used with the Modified: head/usr.bin/ar/ar.c ============================================================================== --- head/usr.bin/ar/ar.c Fri Jul 24 17:01:16 2015 (r285843) +++ head/usr.bin/ar/ar.c Fri Jul 24 17:46:43 2015 (r285844) @@ -113,7 +113,7 @@ main(int argc, char **argv) len = strlen(bsdar->progname); if (len >= strlen("ranlib") && strcmp(bsdar->progname + len - strlen("ranlib"), "ranlib") == 0) { - while ((opt = getopt_long(argc, argv, "tDV", longopts, + while ((opt = getopt_long(argc, argv, "tDUV", longopts, NULL)) != -1) { switch(opt) { case 't': @@ -122,6 +122,9 @@ main(int argc, char **argv) case 'D': bsdar->options |= AR_D; break; + case 'U': + bsdar->options &= ~AR_D; + break; case 'V': ranlib_version(); break; @@ -157,7 +160,7 @@ main(int argc, char **argv) } } - while ((opt = getopt_long(argc, argv, "abCcdDfijlMmopqrSsTtuVvxz", + while ((opt = getopt_long(argc, argv, "abCcdDfijlMmopqrSsTtUuVvxz", longopts, NULL)) != -1) { switch(opt) { case 'a': @@ -216,6 +219,9 @@ main(int argc, char **argv) case 't': set_mode(bsdar, opt); break; + case 'U': + bsdar->options &= ~AR_D; + break; case 'u': bsdar->options |= AR_U; break; @@ -364,9 +370,9 @@ bsdar_usage(void) (void)fprintf(stderr, "\tar -m [-Tjsvz] archive file ...\n"); (void)fprintf(stderr, "\tar -m [-Tabijsvz] position archive file ...\n"); (void)fprintf(stderr, "\tar -p [-Tv] archive [file ...]\n"); - (void)fprintf(stderr, "\tar -q [-TcDjsvz] archive file ...\n"); - (void)fprintf(stderr, "\tar -r [-TcDjsuvz] archive file ...\n"); - (void)fprintf(stderr, "\tar -r [-TabcDijsuvz] position archive file ...\n"); + (void)fprintf(stderr, "\tar -q [-TcDjsUvz] archive file ...\n"); + (void)fprintf(stderr, "\tar -r [-TcDjsUuvz] archive file ...\n"); + (void)fprintf(stderr, "\tar -r [-TabcDijsUuvz] position archive file ...\n"); (void)fprintf(stderr, "\tar -s [-jz] archive\n"); (void)fprintf(stderr, "\tar -t [-Tv] archive [file ...]\n"); (void)fprintf(stderr, "\tar -x [-CTouv] archive [file ...]\n"); @@ -378,7 +384,7 @@ static void ranlib_usage(void) { - (void)fprintf(stderr, "usage: ranlib [-t] archive ...\n"); + (void)fprintf(stderr, "usage: ranlib [-DtU] archive ...\n"); (void)fprintf(stderr, "\tranlib -V\n"); exit(EX_USAGE); } From owner-svn-src-head@freebsd.org Fri Jul 24 17:58:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF52B9AA6F5; Fri, 24 Jul 2015 17:58:45 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 408B41B37; Fri, 24 Jul 2015 17:58:45 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by wibud3 with SMTP id ud3so74530844wib.1; Fri, 24 Jul 2015 10:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=H2A2BY7gMvTgukoeXDpP/x1gGZ3+VBLVy9IqXEPiUng=; b=paoGBqvSgs4u4OOS/eePS75FX2Pw4fTAZD0gXpjpB1eOzNKjDd7L/4e53iP1BJqdbW GGC3vZfYCifh0t0WaCErfXw5I77I6IC3SyuhcKPHolHcsAIhm85JbSKKfjyG1vOv2z00 FV/IgzmNzRR8Oph9lmO5ZHEAeGCx5EKWYbiL73l+IBHHYBox/+esGpWkJy8GccMRlj5O AZZ1yMsIzIpeL75FvXPkmPGpXPPTfv3yPsel7qac6Tk4QfAujnSif3l7Mz+/ozYlBHYk 72gVvOrHUiyEVgCITlxUrIfs+1JRzaGn6sW8JxSSUgpewi1iQTrBCSw+qnTS+vTkHSpT VuYQ== MIME-Version: 1.0 X-Received: by 10.180.105.36 with SMTP id gj4mr9549940wib.64.1437760723721; Fri, 24 Jul 2015 10:58:43 -0700 (PDT) Sender: antoine.brodin.freebsd@gmail.com Received: by 10.194.17.130 with HTTP; Fri, 24 Jul 2015 10:58:43 -0700 (PDT) In-Reply-To: <201507221958.t6MJwLEk015409@repo.freebsd.org> References: <201507221958.t6MJwLEk015409@repo.freebsd.org> Date: Fri, 24 Jul 2015 19:58:43 +0200 X-Google-Sender-Auth: YIwJCX28xkE_GQ7XVtCcU7-CPWQ Message-ID: Subject: Re: svn commit: r285803 - head/bin/ls From: Antoine Brodin To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 17:58:45 -0000 On Wed, Jul 22, 2015 at 9:58 PM, Allan Jude wrote: > Author: allanjude (doc committer) > Date: Wed Jul 22 19:58:21 2015 > New Revision: 285803 > URL: https://svnweb.freebsd.org/changeset/base/285803 > > Log: > Remove an excess space accidently introduced in the output in ls(1) by r285734 > > Spotted by: dim > Approved by: eadler (mentor) > Sponsored by: ScaleEngine Inc. > Differential Revision: https://reviews.freebsd.org/D3152 > > Modified: > head/bin/ls/print.c Hi, Some recent (less than 5 days old) changes on ls(1) broke it on i386, and more than 8000 ports are affected by this. See for instance http://beefy3.nyi.freebsd.org/data/head-i386-default/p392703_s285807/logs/errors/autoconf-2.69.log >From the log: %%% gmake[3]: Entering directory '/wrkdirs/usr/ports/devel/autoconf/work/autoconf-2.69/doc' Segmentation fault (core dumped) ../build-aux/mdate-sh: failed parsing 'ls -L -l -d -n /' output Updating ./version.texi %%% It used to build fine with r285732 and doesn't work anymore at r285807. Cheers, Antoine > > Modified: head/bin/ls/print.c > ============================================================================== > --- head/bin/ls/print.c Wed Jul 22 19:55:32 2015 (r285802) > +++ head/bin/ls/print.c Wed Jul 22 19:58:21 2015 (r285803) > @@ -456,7 +456,7 @@ printtime(const char *field, time_t ftim > snprintf(fmt, sizeof(fmt), "{d:%s/%%hs} ", field); > xo_attr("value", "%ld", (long) ftime); > xo_emit(fmt, longstring); > - snprintf(fmt, sizeof(fmt), "{en:%s/%%ld} ", field); > + snprintf(fmt, sizeof(fmt), "{en:%s/%%ld}", field); > xo_emit(fmt, (long) ftime); > } > > From owner-svn-src-head@freebsd.org Fri Jul 24 18:00:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9C2C9AA82D; Fri, 24 Jul 2015 18:00:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA2971DE6; Fri, 24 Jul 2015 18:00:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OI0sYN035598; Fri, 24 Jul 2015 18:00:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OI0sWm035597; Fri, 24 Jul 2015 18:00:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201507241800.t6OI0sWm035597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 24 Jul 2015 18:00:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285845 - head/contrib/elftoolchain/readelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 18:00:54 -0000 Author: emaste Date: Fri Jul 24 18:00:53 2015 New Revision: 285845 URL: https://svnweb.freebsd.org/changeset/base/285845 Log: readelf: avoid division by zero on section entry size ELF Tool Chain tickets #439, #444, #445, #467 Reported by: Alexander Cherepanov (#467) Reported by: antiAgainst (others) Reviewed by: brooks MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2338 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Jul 24 17:46:43 2015 (r285844) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Jul 24 18:00:53 2015 (r285845) @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -314,6 +315,7 @@ static const char *dwarf_reg(unsigned in static const char *dwarf_regname(struct readelf *re, unsigned int num); static struct dumpop *find_dumpop(struct readelf *re, size_t si, const char *sn, int op, int t); +static int get_ent_count(struct section *s, int *ent_count); static char *get_regoff_str(struct readelf *re, Dwarf_Half reg, Dwarf_Addr off); static const char *get_string(struct readelf *re, int strtab, size_t off); @@ -2901,6 +2903,24 @@ dump_shdr(struct readelf *re) #undef ST_CTL } +/* + * Return number of entries in the given section. We'd prefer ent_count be a + * size_t *, but libelf APIs already use int for section indices. + */ +static int +get_ent_count(struct section *s, int *ent_count) +{ + if (s->entsize == 0) { + warnx("section %s has entry size 0", s->name); + return (0); + } else if (s->sz / s->entsize > INT_MAX) { + warnx("section %s has invalid section count", s->name); + return (0); + } + *ent_count = (int)(s->sz / s->entsize); + return (1); +} + static void dump_dynamic(struct readelf *re) { @@ -2929,8 +2949,8 @@ dump_dynamic(struct readelf *re) /* Determine the actual number of table entries. */ nentries = 0; - jmax = (int) (s->sz / s->entsize); - + if (!get_ent_count(s, &jmax)) + continue; for (j = 0; j < jmax; j++) { if (gelf_getdyn(d, j, &dyn) != &dyn) { warnx("gelf_getdyn failed: %s", @@ -3176,7 +3196,9 @@ dump_rel(struct readelf *re, struct sect else printf("%-12s %-12s %-19s %-16s %s\n", REL_HDR); } - len = d->d_size / s->entsize; + assert(d->d_size == s->sz); + if (!get_ent_count(s, &len)) + return; for (i = 0; i < len; i++) { if (gelf_getrel(d, i, &r) != &r) { warnx("gelf_getrel failed: %s", elf_errmsg(-1)); @@ -3232,7 +3254,9 @@ dump_rela(struct readelf *re, struct sec else printf("%-12s %-12s %-19s %-16s %s\n", RELA_HDR); } - len = d->d_size / s->entsize; + assert(d->d_size == s->sz); + if (!get_ent_count(s, &len)) + return; for (i = 0; i < len; i++) { if (gelf_getrela(d, i, &r) != &r) { warnx("gelf_getrel failed: %s", elf_errmsg(-1)); @@ -3297,7 +3321,7 @@ dump_symtab(struct readelf *re, int i) Elf_Data *d; GElf_Sym sym; const char *name; - int elferr, stab, j; + int elferr, stab, j, len; s = &re->sl[i]; stab = s->link; @@ -3310,12 +3334,14 @@ dump_symtab(struct readelf *re, int i) } if (d->d_size <= 0) return; + if (!get_ent_count(s, &len)) + return; printf("Symbol table (%s)", s->name); - printf(" contains %ju entries:\n", s->sz / s->entsize); + printf(" contains %d entries:\n", len); printf("%7s%9s%14s%5s%8s%6s%9s%5s\n", "Num:", "Value", "Size", "Type", "Bind", "Vis", "Ndx", "Name"); - for (j = 0; (uint64_t)j < s->sz / s->entsize; j++) { + for (j = 0; j < len; j++) { if (gelf_getsym(d, j, &sym) != &sym) { warnx("gelf_getsym failed: %s", elf_errmsg(-1)); continue; @@ -3353,7 +3379,7 @@ dump_symtabs(struct readelf *re) Elf_Data *d; struct section *s; uint64_t dyn_off; - int elferr, i; + int elferr, i, len; /* * If -D is specified, only dump the symbol table specified by @@ -3378,8 +3404,10 @@ dump_symtabs(struct readelf *re) } if (d->d_size <= 0) return; + if (!get_ent_count(s, &len)) + return; - for (i = 0; (uint64_t)i < s->sz / s->entsize; i++) { + for (i = 0; i < len; i++) { if (gelf_getdyn(d, i, &dyn) != &dyn) { warnx("gelf_getdyn failed: %s", elf_errmsg(-1)); continue; @@ -3567,7 +3595,8 @@ dump_gnu_hash(struct readelf *re, struct maskwords = buf[2]; buf += 4; ds = &re->sl[s->link]; - dynsymcount = ds->sz / ds->entsize; + if (!get_ent_count(ds, &dynsymcount)) + return; nchain = dynsymcount - symndx; if (d->d_size != 4 * sizeof(uint32_t) + maskwords * (re->ec == ELFCLASS32 ? sizeof(uint32_t) : sizeof(uint64_t)) + @@ -3996,7 +4025,7 @@ dump_liblist(struct readelf *re) char tbuf[20]; Elf_Data *d; Elf_Lib *lib; - int i, j, k, elferr, first; + int i, j, k, elferr, first, len; for (i = 0; (size_t) i < re->shnum; i++) { s = &re->sl[i]; @@ -4013,8 +4042,10 @@ dump_liblist(struct readelf *re) if (d->d_size <= 0) continue; lib = d->d_buf; + if (!get_ent_count(s, &len)) + continue; printf("\nLibrary list section '%s' ", s->name); - printf("contains %ju entries:\n", s->sz / s->entsize); + printf("contains %d entries:\n", len); printf("%12s%24s%18s%10s%6s\n", "Library", "Time Stamp", "Checksum", "Version", "Flags"); for (j = 0; (uint64_t) j < s->sz / s->entsize; j++) { @@ -4399,7 +4430,7 @@ static void dump_mips_reginfo(struct readelf *re, struct section *s) { Elf_Data *d; - int elferr; + int elferr, len; (void) elf_errno(); if ((d = elf_rawdata(s->scn, NULL)) == NULL) { @@ -4411,9 +4442,10 @@ dump_mips_reginfo(struct readelf *re, st } if (d->d_size <= 0) return; + if (!get_ent_count(s, &len)) + return; - printf("\nSection '%s' contains %ju entries:\n", s->name, - s->sz / s->entsize); + printf("\nSection '%s' contains %d entries:\n", s->name, len); dump_mips_odk_reginfo(re, d->d_buf, d->d_size); } From owner-svn-src-head@freebsd.org Fri Jul 24 18:13:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E84D19AAB5A; Fri, 24 Jul 2015 18:13:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D90FD19CA; Fri, 24 Jul 2015 18:13:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OIDE2O041962; Fri, 24 Jul 2015 18:13:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OIDESG041961; Fri, 24 Jul 2015 18:13:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201507241813.t6OIDESG041961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 24 Jul 2015 18:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285846 - 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.20 Precedence: list List-Id: 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, 24 Jul 2015 18:13:15 -0000 Author: trasz Date: Fri Jul 24 18:13:13 2015 New Revision: 285846 URL: https://svnweb.freebsd.org/changeset/base/285846 Log: Add missing capitalization. Modified: head/lib/libc/sys/reboot.2 Modified: head/lib/libc/sys/reboot.2 ============================================================================== --- head/lib/libc/sys/reboot.2 Fri Jul 24 18:00:53 2015 (r285845) +++ head/lib/libc/sys/reboot.2 Fri Jul 24 18:13:13 2015 (r285846) @@ -82,7 +82,7 @@ Dump kernel memory before rebooting; see .Xr savecore 8 for more information. .It Dv RB_HALT -the processor is simply halted; no reboot takes place. +The processor is simply halted; no reboot takes place. This option should be used with caution. .It Dv RB_POWEROFF After halting, the shutdown code will do what it can to turn From owner-svn-src-head@freebsd.org Fri Jul 24 18:14:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95BB19AAC63; Fri, 24 Jul 2015 18:14:58 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86AB81F07; Fri, 24 Jul 2015 18:14:58 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OIEwu4042779; Fri, 24 Jul 2015 18:14:58 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OIEw6S042778; Fri, 24 Jul 2015 18:14:58 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201507241814.t6OIEw6S042778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 24 Jul 2015 18:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285847 - head/sbin/init X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 18:14:58 -0000 Author: trasz Date: Fri Jul 24 18:14:57 2015 New Revision: 285847 URL: https://svnweb.freebsd.org/changeset/base/285847 Log: Add missing SIGUSR1 description. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sbin/init/init.8 Modified: head/sbin/init/init.8 ============================================================================== --- head/sbin/init/init.8 Fri Jul 24 18:13:13 2015 (r285846) +++ head/sbin/init/init.8 Fri Jul 24 18:14:57 2015 (r285847) @@ -31,7 +31,7 @@ .\" @(#)init.8 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 14, 2012 +.Dd July 24, 2015 .Dt INIT 8 .Os .Sh NAME @@ -284,6 +284,7 @@ will signal the original as follows: .Bl -column Run-level SIGTERM .It Sy "Run-level Signal Action" +.It Cm 0 Ta Dv SIGUSR1 Ta "Halt" .It Cm 0 Ta Dv SIGUSR2 Ta "Halt and turn the power off" .It Cm 1 Ta Dv SIGTERM Ta "Go to single-user mode" .It Cm 6 Ta Dv SIGINT Ta "Reboot the machine" From owner-svn-src-head@freebsd.org Fri Jul 24 18:16:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26E729AACB4; Fri, 24 Jul 2015 18:16:54 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF5F210CF; Fri, 24 Jul 2015 18:16:53 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZIhWc-000NO3-98; Fri, 24 Jul 2015 19:16:50 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <1437751520.1334.546.camel@freebsd.org> Date: Fri, 24 Jul 2015 19:16:44 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150724012519.GE78154@funkthat.com> <1437751520.1334.546.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 18:16:54 -0000 > On 24 Jul 2015, at 16:25, Ian Lepore wrote: >=20 > But keep in mind that loader(8) is optional and not used at all on = some > non-x86 systems. >=20 Duly noted. It=E2=80=99s on my TODO list to talk to you embedded folks = about this. M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Fri Jul 24 19:10:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9D5C9A97A3; Fri, 24 Jul 2015 19:10:22 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id B55B811E8; Fri, 24 Jul 2015 19:10:22 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [192.168.1.10] (unknown [192.168.1.10]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 73E069424; Fri, 24 Jul 2015 19:10:16 +0000 (UTC) Subject: Re: svn commit: r285803 - head/bin/ls To: Antoine Brodin References: <201507221958.t6MJwLEk015409@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: <55B28D93.5090003@freebsd.org> Date: Fri, 24 Jul 2015 15:10:11 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 24 Jul 2015 19:10:23 -0000 On 2015-07-24 13:58, Antoine Brodin wrote: > On Wed, Jul 22, 2015 at 9:58 PM, Allan Jude wrote: >> Author: allanjude (doc committer) >> Date: Wed Jul 22 19:58:21 2015 >> New Revision: 285803 >> URL: https://svnweb.freebsd.org/changeset/base/285803 >> >> Log: >> Remove an excess space accidently introduced in the output in ls(1) by r285734 >> >> Spotted by: dim >> Approved by: eadler (mentor) >> Sponsored by: ScaleEngine Inc. >> Differential Revision: https://reviews.freebsd.org/D3152 >> >> Modified: >> head/bin/ls/print.c > > Hi, > > Some recent (less than 5 days old) changes on ls(1) broke it on i386, > and more than 8000 ports are affected by this. > > See for instance > http://beefy3.nyi.freebsd.org/data/head-i386-default/p392703_s285807/logs/errors/autoconf-2.69.log > > From the log: > %%% > gmake[3]: Entering directory > '/wrkdirs/usr/ports/devel/autoconf/work/autoconf-2.69/doc' > Segmentation fault (core dumped) > ../build-aux/mdate-sh: failed parsing 'ls -L -l -d -n /' output > Updating ./version.texi > %%% > It used to build fine with r285732 and doesn't work anymore at r285807. > > Cheers, > > Antoine > > >> >> Modified: head/bin/ls/print.c >> ============================================================================== >> --- head/bin/ls/print.c Wed Jul 22 19:55:32 2015 (r285802) >> +++ head/bin/ls/print.c Wed Jul 22 19:58:21 2015 (r285803) >> @@ -456,7 +456,7 @@ printtime(const char *field, time_t ftim >> snprintf(fmt, sizeof(fmt), "{d:%s/%%hs} ", field); >> xo_attr("value", "%ld", (long) ftime); >> xo_emit(fmt, longstring); >> - snprintf(fmt, sizeof(fmt), "{en:%s/%%ld} ", field); >> + snprintf(fmt, sizeof(fmt), "{en:%s/%%ld}", field); >> xo_emit(fmt, (long) ftime); >> } >> >> The r285734 change didn't explicitly cast some references to uid_t, resulting in a segfault on i386. Clang generated a warning about this immediately while I was debugging when I duplicated the xo_emit command as a printf. Can we teach our clang that xo_emit is printf, and so the same formatting type matching should be checked? That would be very helpful. I have posted a review for the fix: https://reviews.freebsd.org/D3191 -- Allan Jude From owner-svn-src-head@freebsd.org Fri Jul 24 19:43:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91A6D9AA02B; Fri, 24 Jul 2015 19:43:19 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68D871BE4; Fri, 24 Jul 2015 19:43:19 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OJhJ10090501; Fri, 24 Jul 2015 19:43:19 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OJhJaq090500; Fri, 24 Jul 2015 19:43:19 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201507241943.t6OJhJaq090500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 24 Jul 2015 19:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285854 - head/sys/amd64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 24 Jul 2015 19:43:19 -0000 Author: alc Date: Fri Jul 24 19:43:18 2015 New Revision: 285854 URL: https://svnweb.freebsd.org/changeset/base/285854 Log: Add a comment discussing the appropriate use of the atomic_*() functions with acquire and release semantics versus the *mb() functions on amd64 processors. Reviewed by: bde (an earlier version), kib Sponsored by: EMC / Isilon Storage Division Modified: head/sys/amd64/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Fri Jul 24 19:37:30 2015 (r285853) +++ head/sys/amd64/include/atomic.h Fri Jul 24 19:43:18 2015 (r285854) @@ -32,6 +32,25 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +/* + * To express interprocessor (as opposed to processor and device) memory + * ordering constraints, use the atomic_*() functions with acquire and release + * semantics rather than the *mb() functions. An architecture's memory + * ordering (or memory consistency) model governs the order in which a + * program's accesses to different locations may be performed by an + * implementation of that architecture. In general, for memory regions + * defined as writeback cacheable, the memory ordering implemented by amd64 + * processors preserves the program ordering of a load followed by a load, a + * load followed by a store, and a store followed by a store. Only a store + * followed by a load to a different memory location may be reordered. + * Therefore, except for special cases, like non-temporal memory accesses or + * memory regions defined as write combining, the memory ordering effects + * provided by the sfence instruction in the wmb() function and the lfence + * instruction in the rmb() function are redundant. In contrast, the + * atomic_*() functions with acquire and release semantics do not perform + * redundant instructions for ordinary cases of interprocessor memory + * ordering on any architecture. + */ #define mb() __asm __volatile("mfence;" : : : "memory") #define wmb() __asm __volatile("sfence;" : : : "memory") #define rmb() __asm __volatile("lfence;" : : : "memory") From owner-svn-src-head@freebsd.org Fri Jul 24 19:47:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C39739AA0D7 for ; Fri, 24 Jul 2015 19:47:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm9-vm0.bullet.mail.bf1.yahoo.com (nm9-vm0.bullet.mail.bf1.yahoo.com [98.139.213.154]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 713881ED4 for ; Fri, 24 Jul 2015 19:47:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1437766870; bh=BrVem3XrIqLp2Kyd/+qayNENnoHBxNr7lVln85zC39Y=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=dyuBnwrmSM1r+ECwLo/tvZLKae95xuK5t3piflKFoCQ6htpbKtExHTPXrHsCBg0qCrQbN2hj09TG4atU5n9PFeAGnAv/xzcwZOLbSWOeD+IVbo9VKVRbZfcRZS4kOrPgfMJGr5vMYDAGrL3R4sX1JJP1FdBDOUmdc4X07jKJin/gawE6tk/ZfLIlAjKLwDDOwJKDroPZMAz7r9WJXb+47KevlgnmV4U7vBrPFi4LNMFFsaiWe1cOntZ5aI5Fig7G2bFVlDbNHa2LdxeBL3XNCF+8klaIvuT6NR6vmxN96SW7mGgm5l4DNexD6jbtPcX48obhAAr2OUjR8WgZ98opuQ== Received: from [66.196.81.172] by nm9.bullet.mail.bf1.yahoo.com with NNFMP; 24 Jul 2015 19:41:10 -0000 Received: from [98.139.213.8] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 24 Jul 2015 19:41:10 -0000 Received: from [127.0.0.1] by smtp108.mail.bf1.yahoo.com with NNFMP; 24 Jul 2015 19:41:10 -0000 X-Yahoo-Newman-Id: 689227.83104.bm@smtp108.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: _a7KhGwVM1lBURZZjbLQgchruUwKTda7VItV2L14.2SVNHI qSw1mqSFEc_0LB1GCD0cOGiVfr0qFU0uFisbrecllFYuynnNrh9x0Qy34sPV W8TKtR2V0Jy7DA40wPUZLnETqHZ_Ziy5mhOL3TaxyV8AEF1dYKvvVis7qwgX 19Mh2UFaBf9KdTG1M7QfpjSuy0UT0c0weny2MrOl5TCnVOcSLzIpAJYVNkY8 HrkvIDUilmiMPwFfzAnfBgGvTYblssxhrdZ4t5MfGrcTL7hgrUx2OoTz9PDR fzOCvi2xAkPJZeaMCdAesDfJ30XQXS6i85dsKqstlb8v0kSyrX8HMYG7LAUw 8BVYg2VVLoxsSl9R6wNVXd2mzQzFhEU3VCjLqhodbR_yt8SOCGCQtolySOlH ayC3KDNQVHrTq7dUnZnR7bl75vD9NN1DLbBddtao5lA5D8D4aeg61rgKZuGI 2.zCSxD7CAELurVLTKF6DasDpWrUg72eC4rbgWwEqGqw5ICZfwrbWf9qcXNq EC9XCJS2T_lVEySMIOVQRRUbaLgoCPux1 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <55B294DB.9020000@FreeBSD.org> Date: Fri, 24 Jul 2015 14:41:15 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Allan Jude , Antoine Brodin CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285803 - head/bin/ls References: <201507221958.t6MJwLEk015409@repo.freebsd.org> <55B28D93.5090003@freebsd.org> In-Reply-To: <55B28D93.5090003@freebsd.org> Content-Type: multipart/mixed; boundary="------------000808070703070504020901" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 24 Jul 2015 19:47:50 -0000 This is a multi-part message in MIME format. --------------000808070703070504020901 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 07/24/15 14:10, Allan Jude wrote: > ... > > The r285734 change didn't explicitly cast some references to uid_t, > resulting in a segfault on i386. Clang generated a warning about this > immediately while I was debugging when I duplicated the xo_emit > command as a printf. > > Can we teach our clang that xo_emit is printf, and so the same > formatting type matching should be checked? That would be very helpful. > Perhaps something like this? (untested) Pedro. --------------000808070703070504020901 Content-Type: text/x-patch; name="libxo-printflike.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="libxo-printflike.diff" Index: contrib/libxo/libxo/xo.h =================================================================== --- contrib/libxo/libxo/xo.h (revision 285847) +++ contrib/libxo/libxo/xo.h (working copy) @@ -160,10 +160,10 @@ xo_emit_hv (xo_handle_t *xop, const char *fmt, va_list vap); int -xo_emit_h (xo_handle_t *xop, const char *fmt, ...); +xo_emit_h (xo_handle_t *xop, const char *fmt, ...) PRINTFLIKE(2, 3) ; int -xo_emit (const char *fmt, ...); +xo_emit (const char *fmt, ...) PRINTFLIKE(1, 2); int xo_open_container_h (xo_handle_t *xop, const char *name); --------------000808070703070504020901-- From owner-svn-src-head@freebsd.org Fri Jul 24 20:04:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 739579AA510; Fri, 24 Jul 2015 20:04:38 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 464A41C8B; Fri, 24 Jul 2015 20:04:37 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [192.168.1.10] (unknown [192.168.1.10]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id A27D194DB; Fri, 24 Jul 2015 20:04:36 +0000 (UTC) Subject: Re: svn commit: r285803 - head/bin/ls To: Pedro Giffuni , Antoine Brodin References: <201507221958.t6MJwLEk015409@repo.freebsd.org> <55B28D93.5090003@freebsd.org> <55B294DB.9020000@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: <55B29A4F.1070808@freebsd.org> Date: Fri, 24 Jul 2015 16:04:31 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55B294DB.9020000@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 20:04:38 -0000 On 2015-07-24 15:41, Pedro Giffuni wrote: > > > On 07/24/15 14:10, Allan Jude wrote: >> ... > >> >> The r285734 change didn't explicitly cast some references to uid_t, >> resulting in a segfault on i386. Clang generated a warning about this >> immediately while I was debugging when I duplicated the xo_emit >> command as a printf. >> >> Can we teach our clang that xo_emit is printf, and so the same >> formatting type matching should be checked? That would be very helpful. >> > > Perhaps something like this? (untested) > > Pedro. > > Yes, jhb@ pointed me in the same direction, and I have already submitted it upstream. It seems they already had it on some things, just not the most useful case. https://github.com/Juniper/libxo/pull/45 -- Allan Jude From owner-svn-src-head@freebsd.org Fri Jul 24 20:21:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2B5A9AA898; Fri, 24 Jul 2015 20:21:00 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B37A41B1D; Fri, 24 Jul 2015 20:21:00 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OKL0v6008782; Fri, 24 Jul 2015 20:21:00 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OKL0fY008781; Fri, 24 Jul 2015 20:21:00 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201507242021.t6OKL0fY008781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 24 Jul 2015 20:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285857 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 20:21:00 -0000 Author: allanjude (doc committer) Date: Fri Jul 24 20:20:59 2015 New Revision: 285857 URL: https://svnweb.freebsd.org/changeset/base/285857 Log: Cast uid and gid to the correct type for display to solve segfault in ls(1) on 32bit arches Correctly escape literal % for display This fixes segfaults in 32bit arches caused by r285734 Reviewed by: ngie Approved by: dim Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3191 Modified: head/bin/ls/print.c Modified: head/bin/ls/print.c ============================================================================== --- head/bin/ls/print.c Fri Jul 24 19:51:51 2015 (r285856) +++ head/bin/ls/print.c Fri Jul 24 20:20:59 2015 (r285857) @@ -192,7 +192,7 @@ printlong(const DISPLAY *dp) if (f_numericonly) { xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {td:user/%-*s}{e:user/%ju} {td:group/%-*s}{e:group/%ju} ", buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, - dp->s_user, np->user, sp->st_uid, dp->s_group, np->group, sp->st_gid); + dp->s_user, np->user, (uintmax_t)sp->st_uid, dp->s_group, np->group, (uintmax_t)sp->st_gid); } else { xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {t:user/%-*s} {t:group/%-*s} ", buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, @@ -486,7 +486,7 @@ printtype(u_int mode) xo_emit("{D:=}{e:type/socket}"); return (1); case S_IFWHT: - xo_emit("{D:%}{e:type/whiteout}"); + xo_emit("{D:%%}{e:type/whiteout}"); return (1); default: break; From owner-svn-src-head@freebsd.org Fri Jul 24 21:15:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A2C59AA11C; Fri, 24 Jul 2015 21:15:39 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D19321C65; Fri, 24 Jul 2015 21:15:38 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t6OLFWAU095282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Jul 2015 14:15:32 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t6OLFWo1095281; Fri, 24 Jul 2015 14:15:32 -0700 (PDT) (envelope-from jmg) Date: Fri, 24 Jul 2015 14:15:32 -0700 From: John-Mark Gurney To: Alan Cox Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285854 - head/sys/amd64/include Message-ID: <20150724211532.GO78154@funkthat.com> References: <201507241943.t6OJhJaq090500@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201507241943.t6OJhJaq090500@repo.freebsd.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Fri, 24 Jul 2015 14:15:32 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 21:15:39 -0000 Alan Cox wrote this message on Fri, Jul 24, 2015 at 19:43 +0000: > Author: alc > Date: Fri Jul 24 19:43:18 2015 > New Revision: 285854 > URL: https://svnweb.freebsd.org/changeset/base/285854 > > Log: > Add a comment discussing the appropriate use of the atomic_*() functions > with acquire and release semantics versus the *mb() functions on amd64 > processors. Please put this documentation in the atomic(9) man page where it is easier to read and access... it's probably best to just move it there and reference atomic(9) here... Also, this advice isn't amd64 specific is it? If it isn't, why is it in an amd64 include file? > Modified: > head/sys/amd64/include/atomic.h > > Modified: head/sys/amd64/include/atomic.h > ============================================================================== > --- head/sys/amd64/include/atomic.h Fri Jul 24 19:37:30 2015 (r285853) > +++ head/sys/amd64/include/atomic.h Fri Jul 24 19:43:18 2015 (r285854) > @@ -32,6 +32,25 @@ > #error this file needs sys/cdefs.h as a prerequisite > #endif > > +/* > + * To express interprocessor (as opposed to processor and device) memory > + * ordering constraints, use the atomic_*() functions with acquire and release > + * semantics rather than the *mb() functions. An architecture's memory > + * ordering (or memory consistency) model governs the order in which a > + * program's accesses to different locations may be performed by an > + * implementation of that architecture. In general, for memory regions > + * defined as writeback cacheable, the memory ordering implemented by amd64 > + * processors preserves the program ordering of a load followed by a load, a > + * load followed by a store, and a store followed by a store. Only a store > + * followed by a load to a different memory location may be reordered. > + * Therefore, except for special cases, like non-temporal memory accesses or > + * memory regions defined as write combining, the memory ordering effects > + * provided by the sfence instruction in the wmb() function and the lfence > + * instruction in the rmb() function are redundant. In contrast, the > + * atomic_*() functions with acquire and release semantics do not perform > + * redundant instructions for ordinary cases of interprocessor memory > + * ordering on any architecture. > + */ > #define mb() __asm __volatile("mfence;" : : : "memory") > #define wmb() __asm __volatile("sfence;" : : : "memory") > #define rmb() __asm __volatile("lfence;" : : : "memory") -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@freebsd.org Fri Jul 24 21:48:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B668E9AA859; Fri, 24 Jul 2015 21:48:54 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A0781FFF; Fri, 24 Jul 2015 21:48:54 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OLmsOg048424; Fri, 24 Jul 2015 21:48:54 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OLmsPS048422; Fri, 24 Jul 2015 21:48:54 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201507242148.t6OLmsPS048422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 24 Jul 2015 21:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285858 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 21:48:54 -0000 Author: brueffer Date: Fri Jul 24 21:48:53 2015 New Revision: 285858 URL: https://svnweb.freebsd.org/changeset/base/285858 Log: Add a basic manpage for the pms driver. MFC after: 1 week Committed from: Essen FreeBSD Hackathon Added: head/share/man/man4/pms.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Jul 24 20:20:59 2015 (r285857) +++ head/share/man/man4/Makefile Fri Jul 24 21:48:53 2015 (r285858) @@ -388,6 +388,7 @@ MAN= aac.4 \ ${_pflog.4} \ ${_pfsync.4} \ pim.4 \ + pms.4 \ polling.4 \ ppbus.4 \ ppc.4 \ Added: head/share/man/man4/pms.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/pms.4 Fri Jul 24 21:48:53 2015 (r285858) @@ -0,0 +1,128 @@ +.\" Copyright (c) 2015 Christian Brueffer +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 23, 2015 +.Dt PMS 4 +.Os +.Sh NAME +.Nm pms +.Nd "PMC-Sierra PM8001/8081/8088/8089/8074/8076/8077 SAS/SATA HBA Controller driver" +.Sh SYNOPSIS +To compile the driver into the kernel, +place the following line in the +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device pms" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +pms_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the PMC-Sierra PM8001/8081/8088/8089/8074/8076/8077 +range of SAS/SATA HBA controllers. +.Sh HARDWARE +The +.Nm +driver supports the following hardware: +.Pp +.Bl -bullet -compact +.It +Tachyon TS Fibre Channel Card +.It +Tachyon TL Fibre Channel Card +.It +Tachyon XL2 Fibre Channel Card +.It +Tachyon DX2 Fibre Channel Card +.It +Tachyon DX2+ Fibre Channel Card +.It +Tachyon DX4+ Fibre Channel Card +.It +Tachyon QX2 Fibre Channel Card +.It +Tachyon QX4 Fibre Channel Card +.It +Tachyon DE4 Fibre Channel Card +.It +Tachyon QE4 Fibre Channel Card +.It +Tachyon XL10 Fibre Channel Card +.It +PMC Sierra SPC SAS-SATA Card +.It +PMC Sierra SPC-V SAS-SATA Card +.It +PMC Sierra SPC-VE SAS-SATA Card +.It +PMC Sierra SPC-V 16 Port SAS-SATA Card +.It +PMC Sierra SPC-VE 16 Port SAS-SATA Card +.It +PMC Sierra SPC-V SAS-SATA Card 12Gig +.It +PMC Sierra SPC-VE SAS-SATA Card 12Gig +.It +PMC Sierra SPC-V 16 Port SAS-SATA Card 12Gig +.It +PMC Sierra SPC-VE 16 Port SAS-SATA Card 12Gig +.It +Adaptec Hialeah 4/8 Port SAS-SATA HBA Card 6Gig +.It +Adaptec Hialeah 4/8 Port SAS-SATA RAID Card 6Gig +.It +Adaptec Hialeah 8/16 Port SAS-SATA HBA Card 6Gig +.It +Adaptec Hialeah 8/16 Port SAS-SATA RAID Card 6Gig +.It +Adaptec Hialeah 8/16 Port SAS-SATA HBA Encryption Card 6Gig +.It +Adaptec Hialeah 8/16 Port SAS-SATA RAID Encryption Card 6Gig +.It +Adaptec Delray 8 Port SAS-SATA HBA Card 12Gig +.It +Adaptec Delray 8 Port SAS-SATA HBA Encryption Card 12Gig +.It +Adaptec Delray 16 Port SAS-SATA HBA Card 12Gig +.It +Adaptec Delray 16 Port SAS-SATA HBA Encryption Card 12Gig +.El +.Sh SEE ALSO +.Xr cam 4 , +.Xr camcontrol 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.2 . +.Sh AUTHORS +.An Achim Leubner Aq Mt Achim.Leubner@pmcs.com From owner-svn-src-head@freebsd.org Fri Jul 24 21:55:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A81F79AA9E1; Fri, 24 Jul 2015 21:55:17 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F8561528; Fri, 24 Jul 2015 21:55:17 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OLtHJ8052387; Fri, 24 Jul 2015 21:55:17 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OLtHvo052386; Fri, 24 Jul 2015 21:55:17 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201507242155.t6OLtHvo052386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 24 Jul 2015 21:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285859 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 24 Jul 2015 21:55:17 -0000 Author: brueffer Date: Fri Jul 24 21:55:16 2015 New Revision: 285859 URL: https://svnweb.freebsd.org/changeset/base/285859 Log: Auto-generate hardware notes for pms(4). MFC after: 1 week Committed from: Essen FreeBSD Hackathon Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Jul 24 21:48:53 2015 (r285858) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Jul 24 21:55:16 2015 (r285859) @@ -731,6 +731,8 @@ &hwlist.nsp; + &hwlist.pms; + &hwlist.pst; &hwlist.siis; From owner-svn-src-head@freebsd.org Fri Jul 24 22:13:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24DBD9AAE5A; Fri, 24 Jul 2015 22:13:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 151921120; Fri, 24 Jul 2015 22:13:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6OMDdEi060568; Fri, 24 Jul 2015 22:13:39 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6OMDdlO060567; Fri, 24 Jul 2015 22:13:39 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201507242213.t6OMDdlO060567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 24 Jul 2015 22:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285862 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 22:13:40 -0000 Author: delphij Date: Fri Jul 24 22:13:39 2015 New Revision: 285862 URL: https://svnweb.freebsd.org/changeset/base/285862 Log: Fix a typo in comment. Submitted by: Yanhui Shen via twitter MFC after: 3 days Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Jul 24 22:08:57 2015 (r285861) +++ head/sys/kern/uipc_socket.c Fri Jul 24 22:13:39 2015 (r285862) @@ -440,7 +440,7 @@ sodealloc(struct socket *so) if (so->so_snd.sb_hiwat) (void)chgsbsize(so->so_cred->cr_uidinfo, &so->so_snd.sb_hiwat, 0, RLIM_INFINITY); - /* remove acccept filter if one is present. */ + /* remove accept filter if one is present. */ if (so->so_accf != NULL) do_setopt_accept_filter(so, NULL); #ifdef MAC From owner-svn-src-head@freebsd.org Sat Jul 25 00:21:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B6D79AA692; Sat, 25 Jul 2015 00:21:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BF7C118C; Sat, 25 Jul 2015 00:21:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6P0LTPE013879; Sat, 25 Jul 2015 00:21:29 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6P0LT7Z013878; Sat, 25 Jul 2015 00:21:29 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201507250021.t6P0LT7Z013878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 25 Jul 2015 00:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285864 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 00:21:30 -0000 Author: delphij Date: Sat Jul 25 00:21:29 2015 New Revision: 285864 URL: https://svnweb.freebsd.org/changeset/base/285864 Log: Document the fact that system(3) can easily be misused due to shell meta characters are honored. While I'm there also mention posix_spawn in the SEE ALSO section. MFC after: 2 weeks Modified: head/lib/libc/stdlib/system.3 Modified: head/lib/libc/stdlib/system.3 ============================================================================== --- head/lib/libc/stdlib/system.3 Sat Jul 25 00:14:02 2015 (r285863) +++ head/lib/libc/stdlib/system.3 Sat Jul 25 00:21:29 2015 (r285864) @@ -32,7 +32,7 @@ .\" @(#)system.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd July 25, 2015 .Dt SYSTEM 3 .Os .Sh NAME @@ -87,7 +87,8 @@ failed. .Xr execve 2 , .Xr fork 2 , .Xr waitpid 2 , -.Xr popen 3 +.Xr popen 3 , +.Xr posix_spawn 3 .Sh STANDARDS The .Fn system @@ -97,3 +98,14 @@ conforms to and is expected to be .St -p1003.2 compatible. +.Sh SECURITY CONSIDERATIONS +The +.Fn system +function is easily misused in a manner that enables a malicious +user to run arbitrary command, +because all meta-characters supported by +.Xr sh 1 +would be honored. +User supplied parameters should always be carefully santized +before they appear in +.Fa string. From owner-svn-src-head@freebsd.org Sat Jul 25 00:58:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83FEE9AAB2C; Sat, 25 Jul 2015 00:58:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A0641FA0; Sat, 25 Jul 2015 00:58:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6P0wpuX026327; Sat, 25 Jul 2015 00:58:51 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6P0wpe1026326; Sat, 25 Jul 2015 00:58:51 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201507250058.t6P0wpe1026326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 25 Jul 2015 00:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285865 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Jul 2015 00:58:51 -0000 Author: gonzo Date: Sat Jul 25 00:58:50 2015 New Revision: 285865 URL: https://svnweb.freebsd.org/changeset/base/285865 Log: OF_getencprop_alloc shouldn't be used to get string value. If string length + 1 is not divisible by 4 this function returns NULL property value. Otherwise - string with each 4 letters inverted Modified: head/sys/dev/ofw/ofw_bus_subr.c Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Sat Jul 25 00:21:29 2015 (r285864) +++ head/sys/dev/ofw/ofw_bus_subr.c Sat Jul 25 00:58:50 2015 (r285865) @@ -395,7 +395,7 @@ ofw_bus_reg_to_rl(device_t dev, phandle_ * This may be just redundant when having ofw_bus_devinfo * but makes this routine independent of it. */ - ret = OF_getencprop_alloc(node, "name", sizeof(*name), (void **)&name); + ret = OF_getprop_alloc(node, "name", sizeof(*name), (void **)&name); if (ret == -1) name = NULL; @@ -511,7 +511,7 @@ ofw_bus_find_child(phandle_t start, cons phandle_t child; for (child = OF_child(start); child != 0; child = OF_peer(child)) { - ret = OF_getencprop_alloc(child, "name", sizeof(*name), (void **)&name); + ret = OF_getprop_alloc(child, "name", sizeof(*name), (void **)&name); if (ret == -1) continue; if (strcmp(name, child_name) == 0) { From owner-svn-src-head@freebsd.org Sat Jul 25 02:59:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 686BA9AA077; Sat, 25 Jul 2015 02:59:46 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 596F2FBA; Sat, 25 Jul 2015 02:59:46 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6P2xk05075099; Sat, 25 Jul 2015 02:59:46 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6P2xk0P075098; Sat, 25 Jul 2015 02:59:46 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201507250259.t6P2xk0P075098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 25 Jul 2015 02:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285866 - 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.20 Precedence: list List-Id: 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, 25 Jul 2015 02:59:46 -0000 Author: gonzo Date: Sat Jul 25 02:59:45 2015 New Revision: 285866 URL: https://svnweb.freebsd.org/changeset/base/285866 Log: If there is panel info in DTB do not wait for HDMI event and setup framebuffer immediately Modified: head/sys/arm/ti/am335x/am335x_lcd.c Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Sat Jul 25 00:58:50 2015 (r285865) +++ head/sys/arm/ti/am335x/am335x_lcd.c Sat Jul 25 02:59:45 2015 (r285866) @@ -998,8 +998,11 @@ am335x_lcd_attach(device_t dev) PWM_PERIOD, PWM_PERIOD) == 0) sc->sc_backlight = 100; - sc->sc_hdmi_evh = EVENTHANDLER_REGISTER(hdmi_event, - am335x_lcd_hdmi_event, sc, 0); + if (panel_node != 0) + am335x_lcd_configure(sc); + else + sc->sc_hdmi_evh = EVENTHANDLER_REGISTER(hdmi_event, + am335x_lcd_hdmi_event, sc, 0); return (0); } From owner-svn-src-head@freebsd.org Sat Jul 25 03:03:34 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AF3B9AA245; Sat, 25 Jul 2015 03:03:34 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7DF119E2; Sat, 25 Jul 2015 03:03:33 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6P33X4K079909; Sat, 25 Jul 2015 03:03:33 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6P33XDQ079908; Sat, 25 Jul 2015 03:03:33 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201507250303.t6P33XDQ079908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 25 Jul 2015 03:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285867 - 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.20 Precedence: list List-Id: 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, 25 Jul 2015 03:03:34 -0000 Author: gonzo Date: Sat Jul 25 03:03:32 2015 New Revision: 285867 URL: https://svnweb.freebsd.org/changeset/base/285867 Log: Synchronize PIN input/output modes with gnu/dts/include/dt-bindings/pinctrl/am33xx.h gpio driver requires exact value to match SoC pin mode with GPIO pin direction Modified: head/sys/arm/ti/am335x/am335x_scm_padconf.h Modified: head/sys/arm/ti/am335x/am335x_scm_padconf.h ============================================================================== --- head/sys/arm/ti/am335x/am335x_scm_padconf.h Sat Jul 25 02:59:45 2015 (r285866) +++ head/sys/arm/ti/am335x/am335x_scm_padconf.h Sat Jul 25 03:03:32 2015 (r285867) @@ -34,8 +34,9 @@ #define PULLTYPESEL (0x01 << 4) /* Pad pullup/pulldown type selection */ #define PULLUDEN (0x01 << 3) /* Pullup/pulldown disabled */ -#define PADCONF_OUTPUT (0) +#define PADCONF_OUTPUT (PULLUDEN) #define PADCONF_OUTPUT_PULLUP (PULLTYPESEL) +#define PADCONF_OUTPUT_PULLDOWN (0) #define PADCONF_INPUT (RXACTIVE | PULLUDEN) #define PADCONF_INPUT_PULLUP (RXACTIVE | PULLTYPESEL) #define PADCONF_INPUT_PULLDOWN (RXACTIVE) From owner-svn-src-head@freebsd.org Sat Jul 25 03:19:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 069FB9AA4B2; Sat, 25 Jul 2015 03:19:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7C2D1E99; Sat, 25 Jul 2015 03:19:03 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6P3J3Tq084334; Sat, 25 Jul 2015 03:19:03 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6P3J3cO084333; Sat, 25 Jul 2015 03:19:03 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201507250319.t6P3J3cO084333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 25 Jul 2015 03:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285868 - 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.20 Precedence: list List-Id: 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, 25 Jul 2015 03:19:04 -0000 Author: gonzo Date: Sat Jul 25 03:19:02 2015 New Revision: 285868 URL: https://svnweb.freebsd.org/changeset/base/285868 Log: Fix color mapping for TDA19988. Values for VIP_CNTRL_1 and VIP_CNTRL_2 registers were mixed up Modified: head/sys/arm/ti/am335x/tda19988.c Modified: head/sys/arm/ti/am335x/tda19988.c ============================================================================== --- head/sys/arm/ti/am335x/tda19988.c Sat Jul 25 03:03:32 2015 (r285867) +++ head/sys/arm/ti/am335x/tda19988.c Sat Jul 25 03:19:02 2015 (r285868) @@ -715,8 +715,8 @@ tda19988_start(void *xdev) /* Default values for RGB 4:4:4 mapping */ tda19988_reg_write(sc, TDA_VIP_CNTRL_0, 0x23); - tda19988_reg_write(sc, TDA_VIP_CNTRL_1, 0x45); - tda19988_reg_write(sc, TDA_VIP_CNTRL_2, 0x01); + tda19988_reg_write(sc, TDA_VIP_CNTRL_1, 0x01); + tda19988_reg_write(sc, TDA_VIP_CNTRL_2, 0x45); done: config_intrhook_disestablish(&sc->enum_hook); From owner-svn-src-head@freebsd.org Sat Jul 25 05:12:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0915B9A953C for ; Sat, 25 Jul 2015 05:12:48 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm28-vm4.bullet.mail.gq1.yahoo.com (nm28-vm4.bullet.mail.gq1.yahoo.com [98.136.216.163]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCF3A1C3D for ; Sat, 25 Jul 2015 05:12:47 +0000 (UTC) (envelope-from scott4long@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1437800822; bh=nCiiXUgsxJsWsFuE+AJd4w+cGsVUquGLsdoO4Q/wr3c=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=jnyDGSIt8XqVw/PVL4cATKIpRlvwT8c2Qrw96LS/mWve/nEGW1K4iDoeICG1C/49DDWeajmvPOgFEikpkFNN0bfojMY4Khgy14NktlhpxFo2ZXdh5ZPsBToDVd2FR7ik0G2ENlOk1/x3vFwFYv02WuwiA6Xk5Cx8YZwXHTmYeWUaXK5IBhwREX54yjEc+v9hGMfgvaVlWRtgnmgGrsaJwK9k/mD64BM4WU4MhcCBUYNaCDvseB+RWiR+4ZF1Xtq3NXnM+vpjUAlnucHyTZP4ORkaxvtfIV6Jwp/Uxi14/koMsKFNzOO7I+W6PGedUURo4K9OcmVDxRIUgy691j/vjg== Received: from [98.137.12.56] by nm28.bullet.mail.gq1.yahoo.com with NNFMP; 25 Jul 2015 05:07:02 -0000 Received: from [98.136.164.64] by tm1.bullet.mail.gq1.yahoo.com with NNFMP; 25 Jul 2015 05:07:02 -0000 Received: from [127.0.0.1] by smtp226.mail.gq1.yahoo.com with NNFMP; 25 Jul 2015 05:07:02 -0000 X-Yahoo-Newman-Id: 743206.14981.bm@smtp226.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: E1Nez9YVM1lI27x6I66_QHTjGBBPAuksAOlO_bYwSZru37Q QRF.vYY3cfjOMnUgcLPHq2ZB.bs83TopncdSYA3WpaSX0WNXxpffz4u_ej3z fPaKMTGi.YVlZvefJ1QKFIWPytFwMMpwzyE58xd9gx7EVtYubFf4jEEOKDJ9 63VNcDY0qXwnxd5a2fNI5R7vtlmiIhp7RB_rP8Sa98DoBvWp1ZrhcWrf7b_o 3.vEr9UV.E9zvJyok7KWc717A7oVpb4Bl1W64iibT.cdrBgXeP91H_yT2oNA B_fDoA.eOMS9TpXetHoe6EfJL3PwmT3.m7Qf6F2xhSyoQcEh.XwrtrlGWeyG z3fxRDyygeG_eUBeirFiUnoWKwMtmIcmF2yXbdiNantjWGEEDXMk0tl7kDL_ HhPDn7juC8wVI7Xz8tcYepMjtzV8A.zT9FDT2VAUqO_iASv88TrRtok.nZQg EcyeIYwLtGled5ZHfJShQ521CVZC78tmYqfxixGryM9FWMor5Ftk2chEGSfX OjalsQFDFUVYnkMrEDz3CjyPXeBErqSZbcYlT8dLV X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... From: Scott Long In-Reply-To: Date: Fri, 24 Jul 2015 23:06:59 -0600 Cc: John-Mark Gurney , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <96EA33AB-7325-4DD2-83F4-B4FAF6F47CB5@yahoo.com> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150724012519.GE78154@funkthat.com> To: Mark R V Murray X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 05:12:48 -0000 > On Jul 24, 2015, at 12:59 AM, Mark R V Murray = wrote: >=20 >=20 >> On 24 Jul 2015, at 02:25, John-Mark Gurney wrote: >>=20 >> I would like to point out that the goal of collecting large amounts >> is starting to fall out of favor, and I happen to agree with the = likes >> of djb[1] that we don't need an infinite amount of entropy collected = by >> the system. If the attacker can read out our RNG state, then we are >> already screwed due to many other vulns. >=20 > I=E2=80=99m working on a premise of =E2=80=9Ctools, not policy=E2=80=9D.= I=E2=80=99d like there to be > enough harvesting points for the box owner to get the warm fuzzies. > If they choose to use less, fine by me. >=20 Sure, and that=E2=80=99s not an unreasonable goal, but the devil is in = the details. It=E2=80=99s an unfortunate fact of modern CPU architecture that even = something as simple and innocent as a run-time control that checks a variable can cause significant performance problems, thanks to the penalty of cache misses and bus contention between lots of CPU cores. Maybe these =E2=80=9Cextended=E2=80=9D collection points should be controlled with a = compile-time option? >> Many of the issues that FreeBSD sees with lack of entropy at start up >> is more of a problem on how systems are installed and provisioned. I >> don't believe that we currently store any entropy from the install >> process, yet this is one of the best places to get it, the user is >> banging on keyboard selecting options, etc. If an image is designed >> to be cloned (vm images or appliance images) we need to have a >> mechanism to ensure that before we start, we get the entropy from >> other sources, be it a hardware RNG or the console. >=20 > Getting an initial entropy bundle for first boot is high up on my > TODO list. :-) Patches welcome! We need the usual /entropy (or > /var/db/entropy/=E2=80=A6 or whatever) and crucially we need = /boot/entropy > and the correct invocation in /boot/loader.conf. >=20 I agree that bootstrap entropy is a big deal, especially with the = increasing prevalence of using virtual machine containers, cloned images, and datacenter automation. Addressing that is an interesting problem, and goes well beyond the scope of in-kernel entropy collection. I wish I = had a simple answer or a patch for you ;-) >> I would like to see us scale back the entropy collection, and replace >> it with something like scan the zone once an hour or something >> similar. Or do something dtrace style, where we nop/jmp the >> collection after we feel that the system has collected enough. >=20 > Most of the current entropy gathering is just about invisible > anyway. I think the above goes too far, but may be a useful way > of enabling/disabling (say) UMA gathering on the fly. >=20 >> Heck, piping in mic data to /dev/random is a good way to seed the >> rng on many machines. >=20 > Well, sure, but what if you don=E2=80=99t have microphone? I want lots > of choices, in anticipation of only a subset being usable. >=20 I still think that for most use cases where you have a high likelyhood of draining /dev/random of useful bits, you=E2=80=99re likely already on = a tight budget for CPU cycles and you=E2=80=99ll probably just look to a = hardware accelerator rather than sacrifice even more CPU cycles. At least, that=E2=80=99s what the nice sale people at Cavium and Intel tell me ;-) Scott From owner-svn-src-head@freebsd.org Sat Jul 25 06:20:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B63869AA2F8; Sat, 25 Jul 2015 06:20:13 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C36015A1; Sat, 25 Jul 2015 06:20:13 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t6P6KCFu002421 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Jul 2015 23:20:12 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t6P6KCZr002420; Fri, 24 Jul 2015 23:20:12 -0700 (PDT) (envelope-from jmg) Date: Fri, 24 Jul 2015 23:20:12 -0700 From: John-Mark Gurney To: Mark R V Murray Cc: src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Message-ID: <20150725062012.GT78154@funkthat.com> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150724012519.GE78154@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Fri, 24 Jul 2015 23:20:12 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 06:20:13 -0000 Mark R V Murray wrote this message on Fri, Jul 24, 2015 at 07:59 +0100: > > On 24 Jul 2015, at 02:25, John-Mark Gurney wrote: > > > > I would like to point out that the goal of collecting large amounts > > is starting to fall out of favor, and I happen to agree with the likes > > of djb[1] that we don't need an infinite amount of entropy collected by > > the system. If the attacker can read out our RNG state, then we are > > already screwed due to many other vulns. > > I???m working on a premise of ???tools, not policy???. I???d like there to be > enough harvesting points for the box owner to get the warm fuzzies. > If they choose to use less, fine by me. Except that we should set a sane default policy. Hashing 136 bytes of the mbuf of every ethernet packet isn't a sane default policy. I'm not saying don't have the hooks, but as Scott and others would like, they need to be turned off by default... > > Many of the issues that FreeBSD sees with lack of entropy at start up > > is more of a problem on how systems are installed and provisioned. I > > don't believe that we currently store any entropy from the install > > process, yet this is one of the best places to get it, the user is > > banging on keyboard selecting options, etc. If an image is designed > > to be cloned (vm images or appliance images) we need to have a > > mechanism to ensure that before we start, we get the entropy from > > other sources, be it a hardware RNG or the console. > > Getting an initial entropy bundle for first boot is high up on my > TODO list. :-) Patches welcome! We need the usual /entropy (or > /var/db/entropy/??? or whatever) and crucially we need /boot/entropy > and the correct invocation in /boot/loader.conf. > > > I would like to see us scale back the entropy collection, and replace > > it with something like scan the zone once an hour or something > > similar. Or do something dtrace style, where we nop/jmp the > > collection after we feel that the system has collected enough. > > Most of the current entropy gathering is just about invisible > anyway. I think the above goes too far, but may be a useful way > of enabling/disabling (say) UMA gathering on the fly. Well, just a random proposal to allow both, but these points should be turned off by default, not enabled by default... > > Heck, piping in mic data to /dev/random is a good way to seed the > > rng on many machines. > > Well, sure, but what if you don???t have microphone? I want lots > of choices, in anticipation of only a subset being usable. I'm fine w/ more choices, but we need to make sure we have sane defaults.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@freebsd.org Sat Jul 25 06:26:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 744F89AA37D; Sat, 25 Jul 2015 06:26:53 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A9911AA8; Sat, 25 Jul 2015 06:26:52 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t6P6QqpU002495 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Jul 2015 23:26:52 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t6P6QpQN002494; Fri, 24 Jul 2015 23:26:51 -0700 (PDT) (envelope-from jmg) Date: Fri, 24 Jul 2015 23:26:51 -0700 From: John-Mark Gurney To: Scott Long Cc: Mark R V Murray , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Message-ID: <20150725062651.GU78154@funkthat.com> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150724012519.GE78154@funkthat.com> <96EA33AB-7325-4DD2-83F4-B4FAF6F47CB5@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <96EA33AB-7325-4DD2-83F4-B4FAF6F47CB5@yahoo.com> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Fri, 24 Jul 2015 23:26:52 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 06:26:53 -0000 Scott Long wrote this message on Fri, Jul 24, 2015 at 23:06 -0600: > > > On Jul 24, 2015, at 12:59 AM, Mark R V Murray wrote: > > > >> On 24 Jul 2015, at 02:25, John-Mark Gurney wrote: > > > >> Heck, piping in mic data to /dev/random is a good way to seed the > >> rng on many machines. > > > > Well, sure, but what if you don???t have microphone? I want lots > > of choices, in anticipation of only a subset being usable. > > I still think that for most use cases where you have a high likelyhood > of draining /dev/random of useful bits, you???re likely already on a tight Once you have enough useful bits in /dev/random, you can NEVER run out of useful bits from /dev/random... [Well, not quite NEVER, but not for a few millennia.] -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@freebsd.org Sat Jul 25 08:10:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD0219AA873; Sat, 25 Jul 2015 08:10:43 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77E15944; Sat, 25 Jul 2015 08:10:43 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZIuXV-000O8c-Tg; Sat, 25 Jul 2015 09:10:38 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <96EA33AB-7325-4DD2-83F4-B4FAF6F47CB5@yahoo.com> Date: Sat, 25 Jul 2015 09:10:31 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150724012519.GE78154@funkthat.com> <96EA33AB-7325-4DD2-83F4-B4FAF6F47CB5@yahoo.com> To: Scott Long X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 08:10:43 -0000 > On 25 Jul 2015, at 06:06, Scott Long wrote: >=20 >> I=E2=80=99m working on a premise of =E2=80=9Ctools, not policy=E2=80=9D= . I=E2=80=99d like there to be >> enough harvesting points for the box owner to get the warm fuzzies. >> If they choose to use less, fine by me. >>=20 >=20 > Sure, and that=E2=80=99s not an unreasonable goal, but the devil is in = the details. Yes, indeed! > It=E2=80=99s an unfortunate fact of modern CPU architecture that even = something > as simple and innocent as a run-time control that checks a variable = can > cause significant performance problems, thanks to the penalty of cache > misses and bus contention between lots of CPU cores. Maybe these > =E2=80=9Cextended=E2=80=9D collection points should be controlled with = a compile-time > option? They can. I=E2=80=99ve coded it already, but not tested it properly, and = will commit in a week or two. :-) >=20 >>> Many of the issues that FreeBSD sees with lack of entropy at start = up >>> is more of a problem on how systems are installed and provisioned. = I >>> don't believe that we currently store any entropy from the install >>> process, yet this is one of the best places to get it, the user is >>> banging on keyboard selecting options, etc. If an image is designed >>> to be cloned (vm images or appliance images) we need to have a >>> mechanism to ensure that before we start, we get the entropy from >>> other sources, be it a hardware RNG or the console. >>=20 >> Getting an initial entropy bundle for first boot is high up on my >> TODO list. :-) Patches welcome! We need the usual /entropy (or >> /var/db/entropy/=E2=80=A6 or whatever) and crucially we need = /boot/entropy >> and the correct invocation in /boot/loader.conf. >>=20 >=20 > I agree that bootstrap entropy is a big deal, especially with the = increasing > prevalence of using virtual machine containers, cloned images, and > datacenter automation. Addressing that is an interesting problem, and > goes well beyond the scope of in-kernel entropy collection. I wish I = had > a simple answer or a patch for you ;-) The hard stuff has been done. We just need to write (e.g.) 4k of good numbers to /boot/entropy and job nearly done. This could be done by sysinstall or by the cloning system, for example. The embedded folks will still need a bit more careful etc/rc.d/* design. >> Well, sure, but what if you don=E2=80=99t have microphone? I want = lots >> of choices, in anticipation of only a subset being usable. >>=20 >=20 > I still think that for most use cases where you have a high likelyhood > of draining /dev/random of useful bits, you=E2=80=99re likely already = on a tight > budget for CPU cycles and you=E2=80=99ll probably just look to a = hardware > accelerator rather than sacrifice even more CPU cycles. At least, > that=E2=80=99s what the nice sale people at Cavium and Intel tell me = ;-) Sure, but I don=E2=80=99t trust them either. This is the professional = mistrust of crypto, not an assertion of incompetence or malice. ;-) They do, however, fulfil a need, but I don=E2=80=99t like the idea of trusting a = single source unless that source has been properly vetted. M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Sat Jul 25 08:22:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B73939AAA93; Sat, 25 Jul 2015 08:22:42 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D966F37; Sat, 25 Jul 2015 08:22:42 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZIuj8-000O9a-T8; Sat, 25 Jul 2015 09:22:39 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <20150725062651.GU78154@funkthat.com> Date: Sat, 25 Jul 2015 09:22:32 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <30C50677-D00A-46B3-AF7A-62FC299D409F@FreeBSD.org> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150724012519.GE78154@funkthat.com> <96EA33AB-7325-4DD2-83F4-B4FAF6F47CB5@yahoo.com> <20150725062651.GU78154@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 08:22:42 -0000 > On 25 Jul 2015, at 07:26, John-Mark Gurney wrote: >=20 > Once you have enough useful bits in /dev/random, you can NEVER run out > of useful bits from /dev/random... >=20 > [Well, not quite NEVER, but not for a few millennia.] So is your position effectively anti-harvesting, or at least to turn off all harvesting after a certain time and never turn it on again? If so, we are pretty far apart philosophically. DJB=E2=80=99s position is interesting, but I am far from persuaded by = it. M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Sat Jul 25 11:10:50 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 221749AA701; Sat, 25 Jul 2015 11:10:50 +0000 (UTC) (envelope-from dru@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12EEE1FFC; Sat, 25 Jul 2015 11:10:50 +0000 (UTC) (envelope-from dru@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PBAnKn085305; Sat, 25 Jul 2015 11:10:49 GMT (envelope-from dru@FreeBSD.org) Received: (from dru@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PBAnw2085304; Sat, 25 Jul 2015 11:10:49 GMT (envelope-from dru@FreeBSD.org) Message-Id: <201507251110.t6PBAnw2085304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dru set sender to dru@FreeBSD.org using -f From: Dru Lavigne Date: Sat, 25 Jul 2015 11:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285869 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 11:10:50 -0000 Author: dru (doc committer) Date: Sat Jul 25 11:10:49 2015 New Revision: 285869 URL: https://svnweb.freebsd.org/changeset/base/285869 Log: Fix transposed words in man page. PR: 201752 Reviewed by: bcr MFC after: 3 days Sponsored by: Essen FreeBSD Hackathon Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sat Jul 25 03:19:02 2015 (r285868) +++ head/usr.sbin/jail/jail.8 Sat Jul 25 11:10:49 2015 (r285869) @@ -620,7 +620,7 @@ The command parameters are .Xr sh 1 command lines that are run in either the system or jail environment. -They may be given multiple values, which run would the specified +They may be given multiple values, which would run the specified commands in sequence. All commands must succeed (return a zero exit status), or the jail will not be created or removed, as appropriate. From owner-svn-src-head@freebsd.org Sat Jul 25 13:02:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03F939AA127; Sat, 25 Jul 2015 13:02:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3B091D73; Sat, 25 Jul 2015 13:02:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PD2gt1033459; Sat, 25 Jul 2015 13:02:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PD2ggP033458; Sat, 25 Jul 2015 13:02:42 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201507251302.t6PD2ggP033458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 25 Jul 2015 13:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285870 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 13:02:43 -0000 Author: trasz Date: Sat Jul 25 13:02:41 2015 New Revision: 285870 URL: https://svnweb.freebsd.org/changeset/base/285870 Log: Document md_root in loader(8). The md(4) manual page mentions it, but it's hard to find and easy to miss. Reviewed by: wblock@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3183 Modified: head/sys/boot/common/loader.8 Modified: head/sys/boot/common/loader.8 ============================================================================== --- head/sys/boot/common/loader.8 Sat Jul 25 11:10:49 2015 (r285869) +++ head/sys/boot/common/loader.8 Sat Jul 25 13:02:41 2015 (r285870) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 22, 2014 +.Dd July 25, 2015 .Dt LOADER 8 .Os .Sh NAME @@ -207,12 +207,18 @@ returns an error itself (see .Op Fl t Ar type .Ar file Cm ... .Xc -Loads a kernel, kernel loadable module (kld), or file of opaque -contents tagged as being of the type +Loads a kernel, kernel loadable module (kld), disk image, +or file of opaque contents tagged as being of the type .Ar type . Kernel and modules can be either in a.out or ELF format. Any arguments passed after the name of the file to be loaded will be passed as arguments to that file. +Use the +.Li md_image +type to make the kernel create a file-backed +.Xr md 4 +disk. +This is useful for booting from a temporary rootfs. Currently, argument passing does not work for the kernel. .Pp .It Ic load_geli Xo From owner-svn-src-head@freebsd.org Sat Jul 25 14:06:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47B709AAE26; Sat, 25 Jul 2015 14:06:33 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 380C51CAB; Sat, 25 Jul 2015 14:06:33 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PE6XaN057854; Sat, 25 Jul 2015 14:06:33 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PE6XMO057853; Sat, 25 Jul 2015 14:06:33 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201507251406.t6PE6XMO057853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 25 Jul 2015 14:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285871 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 14:06:33 -0000 Author: kp Date: Sat Jul 25 14:06:32 2015 New Revision: 285871 URL: https://svnweb.freebsd.org/changeset/base/285871 Log: Pf can reassemble IPv6 fragments now. Obtained from: bluhm (OpenBSD) Sponsored by: Essen FreeBSD Hackathon Modified: head/share/man/man5/pf.conf.5 Modified: head/share/man/man5/pf.conf.5 ============================================================================== --- head/share/man/man5/pf.conf.5 Sat Jul 25 13:02:41 2015 (r285870) +++ head/share/man/man5/pf.conf.5 Sat Jul 25 14:06:32 2015 (r285871) @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 29, 2012 +.Dd July 25, 2015 .Dt PF.CONF 5 .Os .Sh NAME @@ -2381,8 +2381,10 @@ Once this limit is reached, fragments th are dropped until other entries time out. The timeout value can also be adjusted. .Pp -Currently, only IPv4 fragments are supported and IPv6 fragments -are blocked unconditionally. +When forwarding reassembled IPv6 packets, pf refragments them with +the original maximum fragment size. +This allows the sender to determine the optimal fragment size by +path MTU discovery. .Sh ANCHORS Besides the main ruleset, .Xr pfctl 8 From owner-svn-src-head@freebsd.org Sat Jul 25 14:36:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB8349AA368; Sat, 25 Jul 2015 14:36:29 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id BB0D01A49; Sat, 25 Jul 2015 14:36:29 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id A5C221A72; Sat, 25 Jul 2015 14:36:29 +0000 (UTC) Date: Sat, 25 Jul 2015 14:36:29 +0000 From: Alexey Dokuchaev To: Mark R V Murray Cc: John-Mark Gurney , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Message-ID: <20150725143629.GA49086@FreeBSD.org> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150724012519.GE78154@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 14:36:30 -0000 On Fri, Jul 24, 2015 at 07:59:35AM +0100, Mark R V Murray wrote: > [...] > > Heck, piping in mic data to /dev/random is a good way to seed the > > rng on many machines. > > Well, sure, but what if you don't have microphone? I want lots > of choices, in anticipation of only a subset being usable. I like the microphone idea. Not just it adds another hard-to-mess-with (?) entropy source, it can also be a nice "reference" example for people wanting to write their own sources and plug them into the RNG framework. ./danfe From owner-svn-src-head@freebsd.org Sat Jul 25 15:00:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C8FD9AA6E7; Sat, 25 Jul 2015 15:00:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCD4911E; Sat, 25 Jul 2015 15:00:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PF0FtD079864; Sat, 25 Jul 2015 15:00:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PF0F5J079863; Sat, 25 Jul 2015 15:00:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507251500.t6PF0F5J079863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 25 Jul 2015 15:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285872 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 15:00:16 -0000 Author: kib Date: Sat Jul 25 15:00:14 2015 New Revision: 285872 URL: https://svnweb.freebsd.org/changeset/base/285872 Log: With the removal of b_saveaddr in the r285819, b_data must be reset to b_kvabase when the buffer is reclaimed. Otherwise, if b_data for the mapped buffer was adjusted with the page-offset portion of b_offset, nothing would re-adjust the b_data, which breaks buffer management code which expects page-aligned b_data (see e.g. bpman_qenter(), which skips partial pages). Fix a minor issue with the GB_KVAALLOC requests, which could result in returning the mapped buffer if the reused buffer is mapped and have the right amount of KVA reserved. Improve assertion in the vfs_buf_check_mapped() to catch unmapped buffers which have their b_data incorrectly adjusted with offset. Reported and tested by: pho (previous version) Reviewed by: jeff (previous version) Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sat Jul 25 14:06:32 2015 (r285871) +++ head/sys/kern/vfs_bio.c Sat Jul 25 15:00:14 2015 (r285872) @@ -956,6 +956,8 @@ vfs_buf_check_mapped(struct buf *bp) ("mapped buf: b_kvabase was not updated %p", bp)); KASSERT(bp->b_data != unmapped_buf, ("mapped buf: b_data was not updated %p", bp)); + KASSERT(bp->b_data < unmapped_buf || bp->b_data > unmapped_buf + + MAXPHYS, ("b_data + b_offset unmapped %p", bp)); } static inline void @@ -2241,6 +2243,7 @@ getnewbuf_reuse_bp(struct buf *bp, int q bp->b_dirtyoff = bp->b_dirtyend = 0; bp->b_bufobj = NULL; bp->b_pin_count = 0; + bp->b_data = bp->b_kvabase; bp->b_fsprivate1 = NULL; bp->b_fsprivate2 = NULL; bp->b_fsprivate3 = NULL; @@ -2528,6 +2531,10 @@ restart: bp->b_flags |= B_INVAL; brelse(bp); goto restart; + } else if ((gbflags & (GB_UNMAPPED | GB_KVAALLOC)) == + (GB_UNMAPPED | GB_KVAALLOC)) { + bp->b_data = unmapped_buf; + BUF_CHECK_UNMAPPED(bp); } atomic_add_int(&bufreusecnt, 1); } From owner-svn-src-head@freebsd.org Sat Jul 25 15:56:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17C1D9AA099; Sat, 25 Jul 2015 15:56:55 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05C2B1C83; Sat, 25 Jul 2015 15:56:55 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PFusu1007443; Sat, 25 Jul 2015 15:56:54 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PFuok4007421; Sat, 25 Jul 2015 15:56:50 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201507251556.t6PFuok4007421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 25 Jul 2015 15:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285873 - in head: lib/libc/posix1e share/man/man4 share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 15:56:55 -0000 Author: trasz Date: Sat Jul 25 15:56:49 2015 New Revision: 285873 URL: https://svnweb.freebsd.org/changeset/base/285873 Log: Update Capsicum and Mandatory Access Control manual pages to no longer claim they are experimental. Reviewed by: rwatson@, wblock@ MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2985 Modified: head/lib/libc/posix1e/mac.3 head/lib/libc/posix1e/mac.conf.5 head/share/man/man4/capsicum.4 head/share/man/man4/mac.4 head/share/man/man4/mac_ifoff.4 head/share/man/man4/mac_mls.4 head/share/man/man4/mac_none.4 head/share/man/man4/mac_partition.4 head/share/man/man4/mac_seeotheruids.4 head/share/man/man4/mac_stub.4 head/share/man/man4/mac_test.4 head/share/man/man4/procdesc.4 head/share/man/man9/mac.9 Modified: head/lib/libc/posix1e/mac.3 ============================================================================== --- head/lib/libc/posix1e/mac.3 Sat Jul 25 15:00:14 2015 (r285872) +++ head/lib/libc/posix1e/mac.3 Sat Jul 25 15:56:49 2015 (r285873) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2009 +.Dd July 25, 2015 .Dt MAC 3 .Os .Sh NAME @@ -163,14 +163,3 @@ Support for Mandatory Access Control was as part of the .Tn TrustedBSD Project. -.Sh BUGS -The -.Tn TrustedBSD -MAC Framework and associated policies, interfaces, and -applications are considered to be an experimental feature in -.Fx . -Sites considering production deployment should keep the experimental -status of these services in mind during any deployment process. -See also -.Xr mac 9 -for related considerations regarding the kernel framework. Modified: head/lib/libc/posix1e/mac.conf.5 ============================================================================== --- head/lib/libc/posix1e/mac.conf.5 Sat Jul 25 15:00:14 2015 (r285872) +++ head/lib/libc/posix1e/mac.conf.5 Sat Jul 25 15:56:49 2015 (r285873) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 19, 2003 +.Dd July 25, 2015 .Dt MAC.CONF 5 .Os .Sh NAME @@ -110,14 +110,3 @@ Support for Mandatory Access Control was as part of the .Tn TrustedBSD Project. -.Sh BUGS -The -.Tn TrustedBSD -MAC Framework and associated policies, interfaces, and -applications are considered to be an experimental feature in -.Fx . -Sites considering production deployment should keep the experimental -status of these services in mind during any deployment process. -See also -.Xr mac 9 -for related considerations regarding the kernel framework. Modified: head/share/man/man4/capsicum.4 ============================================================================== --- head/share/man/man4/capsicum.4 Sat Jul 25 15:00:14 2015 (r285872) +++ head/share/man/man4/capsicum.4 Sat Jul 25 15:56:49 2015 (r285873) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 19, 2013 +.Dd July 25, 2015 .Dt CAPSICUM 4 .Os .Sh NAME @@ -125,7 +125,3 @@ and .An Kris Kennaway Aq Mt kris@FreeBSD.org at Google, Inc., and .An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net . -.Sh BUGS -.Nm -is considered experimental in -.Fx . Modified: head/share/man/man4/mac.4 ============================================================================== --- head/share/man/man4/mac.4 Sat Jul 25 15:00:14 2015 (r285872) +++ head/share/man/man4/mac.4 Sat Jul 25 15:56:49 2015 (r285873) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2007 +.Dd July 25, 2015 .Dt MAC 4 .Os .Sh NAME @@ -239,14 +239,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: head/share/man/man4/mac_ifoff.4 ============================================================================== --- head/share/man/man4/mac_ifoff.4 Sat Jul 25 15:00:14 2015 (r285872) +++ head/share/man/man4/mac_ifoff.4 Sat Jul 25 15:56:49 2015 (r285873) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 10, 2002 +.Dd July 25, 2015 .Dt MAC_IFOFF 4 .Os .Sh NAME @@ -118,14 +118,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: head/share/man/man4/mac_mls.4 ============================================================================== --- head/share/man/man4/mac_mls.4 Sat Jul 25 15:00:14 2015 (r285872) +++ head/share/man/man4/mac_mls.4 Sat Jul 25 15:56:49 2015 (r285873) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2002 +.Dd July 25, 2015 .Dt MAC_MLS 4 .Os .Sh NAME @@ -236,14 +236,6 @@ Inc.\& under DARPA/SPAWAR contract N6600 .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: head/share/man/man4/mac_none.4 ============================================================================== --- head/share/man/man4/mac_none.4 Sat Jul 25 15:00:14 2015 (r285872) +++ head/share/man/man4/mac_none.4 Sat Jul 25 15:56:49 2015 (r285873) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2002 +.Dd July 25, 2015 .Dt MAC_NONE 4 .Os .Sh NAME @@ -98,14 +98,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: head/share/man/man4/mac_partition.4 ============================================================================== --- head/share/man/man4/mac_partition.4 Sat Jul 25 15:00:14 2015 (r285872) +++ head/share/man/man4/mac_partition.4 Sat Jul 25 15:56:49 2015 (r285873) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2002 +.Dd July 25, 2015 .Dt MAC_PARTITION 4 .Os .Sh NAME @@ -118,14 +118,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: head/share/man/man4/mac_seeotheruids.4 ============================================================================== --- head/share/man/man4/mac_seeotheruids.4 Sat Jul 25 15:00:14 2015 (r285872) +++ head/share/man/man4/mac_seeotheruids.4 Sat Jul 25 15:56:49 2015 (r285873) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 6, 2005 +.Dd July 25, 2015 .Dt MAC_SEEOTHERUIDS 4 .Os .Sh NAME @@ -116,14 +116,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: head/share/man/man4/mac_stub.4 ============================================================================== --- head/share/man/man4/mac_stub.4 Sat Jul 25 15:00:14 2015 (r285872) +++ head/share/man/man4/mac_stub.4 Sat Jul 25 15:56:49 2015 (r285873) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2002 +.Dd July 25, 2015 .Dt MAC_STUB 4 .Os .Sh NAME @@ -101,14 +101,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: head/share/man/man4/mac_test.4 ============================================================================== --- head/share/man/man4/mac_test.4 Sat Jul 25 15:00:14 2015 (r285872) +++ head/share/man/man4/mac_test.4 Sat Jul 25 15:56:49 2015 (r285873) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2002 +.Dd July 25, 2015 .Dt MAC_TEST 4 .Os .Sh NAME @@ -102,14 +102,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: head/share/man/man4/procdesc.4 ============================================================================== --- head/share/man/man4/procdesc.4 Sat Jul 25 15:00:14 2015 (r285872) +++ head/share/man/man4/procdesc.4 Sat Jul 25 15:56:49 2015 (r285873) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2013 +.Dd July 25, 2015 .Dt PROCDESC 4 .Os .Sh NAME @@ -85,7 +85,3 @@ at the University of Cambridge, and and .An Kris Kennaway Aq Mt kris@FreeBSD.org at Google, Inc. -.Sh BUGS -.Nm -is considered experimental in -.Fx . Modified: head/share/man/man9/mac.9 ============================================================================== --- head/share/man/man9/mac.9 Sat Jul 25 15:00:14 2015 (r285872) +++ head/share/man/man9/mac.9 Sat Jul 25 15:56:49 2015 (r285873) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2006 +.Dd July 25, 2015 .Dt MAC 9 .Os .Sh NAME @@ -62,14 +62,6 @@ opportunity to modify security behavior Both consumers of the API (normal kernel services) and security modules must be aware of the semantics of the API calls, particularly with respect to synchronization primitives (such as locking). -.Ss Note on Appropriateness for Production Use -The -.Tn TrustedBSD -MAC Framework included in -.Fx 5.0 -is considered experimental, and should not be deployed in production -environments without careful consideration of the risks associated with -the use of experimental operating system features. .Ss Kernel Objects Supported by the Framework The MAC framework manages labels on a variety of types of in-kernel objects, including process credentials, vnodes, devfs_dirents, mount @@ -232,13 +224,6 @@ Additional contributors include: and .An Tim Robbins . .Sh BUGS -See the earlier section in this document concerning appropriateness -for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. From owner-svn-src-head@freebsd.org Sat Jul 25 16:04:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AC669AA25E for ; Sat, 25 Jul 2015 16:04:52 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm11-vm8.bullet.mail.gq1.yahoo.com (nm11-vm8.bullet.mail.gq1.yahoo.com [98.136.218.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AC8518E for ; Sat, 25 Jul 2015 16:04:52 +0000 (UTC) (envelope-from scott4long@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1437840284; bh=/Ww1kzV+Sc2wxoHG54cxD9RgfA71Ak+b3atavS83iHM=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=FOxM6IXzNuRbDTDH2uLySI+xPudM7Mrpw2aU36/w1pWmrGM6dl+tqaXP7BFoWcdGlHxaEEoDTwbE5koV4+v6QEDa51qD0pC00n2S/RvFqcUdzS0fT6CWxmZM5oEbn/JZtLLQ85r96AFEoRGR/OjfD43WRNIaunxB4931nQmy90lM9wyeQJo9/I9fqA4YoQ7g965GcNiJgYxiiY2u8e7iUCeKmHNDBmrOxa3GmfJJdjhwdaypeDX5j2c5+ZyMPk9jhKkXKX0x+nDqFYw+YRoXhdPvcMH1MmVKMZzC02/UAFwTtToiEJKkmH7f/FcxYRhJ/z8EniHp4uFK9Hla7OlFAA== Received: from [98.137.12.61] by nm11.bullet.mail.gq1.yahoo.com with NNFMP; 25 Jul 2015 16:04:44 -0000 Received: from [208.71.42.190] by tm6.bullet.mail.gq1.yahoo.com with NNFMP; 25 Jul 2015 16:04:44 -0000 Received: from [127.0.0.1] by smtp201.mail.gq1.yahoo.com with NNFMP; 25 Jul 2015 16:04:44 -0000 X-Yahoo-Newman-Id: 653148.51615.bm@smtp201.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: S.DslVAVM1kZhQUbjYyt.PNNCakDNR5RV0kVdBwUEG7ykZg Wkx75VozENoLCnzMDgWAxOiiS7hDbXoC_dfdYQwgLP8t8XbkVHViqoXEYcAE hwZqe.DONKfs..Up7.ZXSQpwO8LxPo7jEVWBAMLnXOougiPj_o5vY2jff_T5 v0nkQ7zmYX9yXge4aOvVGnjqNVG8E5zPOiIfSSvXKTS9e4LNDrbBLgbZzBzI lU5uHoXkiJZESIo2dPgB2t4XFhZ27UjUcLKeN.380kfjNiaHdTHh8VMg_P3m T2bu.05htyte_IEmg9E6.XwYTCC4YuOtwGae98hWdjbv.Rr3OL_QouJOj7vm nbPmmfAeyfwK_2.O5RN3oxY1Apysmd0BOb8aiNmlVmE5IF.aGKvn7s1C1WH5 qY.XKidbg06ERF_uqxBJOGGB3FYFZ4jGI96PJptlkC.wIwkGznKvsJ5FL6Dr rgg3Jz6zN4f52YmzCzOHHlIfY4UHd6hZGpVOrqFTWI1nNsMQA.QanlO3Uh0_ mfQTLSgvXaK2C.UVHKG5xfeFXNKiSXfqLfAb3loXc8w-- X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... From: Scott Long In-Reply-To: <20150725143629.GA49086@FreeBSD.org> Date: Sat, 25 Jul 2015 10:04:42 -0600 Cc: Mark R V Murray , John-Mark Gurney , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Transfer-Encoding: quoted-printable Message-Id: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150724012519.GE78154@funkthat.com> <20150725143629.GA49086@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 16:04:52 -0000 > On Jul 25, 2015, at 8:36 AM, Alexey Dokuchaev = wrote: >=20 > On Fri, Jul 24, 2015 at 07:59:35AM +0100, Mark R V Murray wrote: >> [...] >>> Heck, piping in mic data to /dev/random is a good way to seed the >>> rng on many machines. >>=20 >> Well, sure, but what if you don't have microphone? I want lots >> of choices, in anticipation of only a subset being usable. >=20 > I like the microphone idea. Not just it adds another = hard-to-mess-with > (?) entropy source, it can also be a nice "reference" example for = people > wanting to write their own sources and plug them into the RNG = framework. >=20 Microphones don=E2=80=99t typically exist on virtual machines, servers, = appliances/embedded gadgets, and trusted computers. Nice idea for the = desktop, but far from universal. Scott From owner-svn-src-head@freebsd.org Sat Jul 25 16:12:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ED0A9AA4EC for ; Sat, 25 Jul 2015 16:12:24 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm11-vm3.bullet.mail.gq1.yahoo.com (nm11-vm3.bullet.mail.gq1.yahoo.com [98.136.218.158]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5FBF947 for ; Sat, 25 Jul 2015 16:12:23 +0000 (UTC) (envelope-from scott4long@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1437840356; bh=aOeAGqa0G8DEnCAVzgyBK8VUvb5ExuGQj73OasCCi2g=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=Elv1E6LMGBleJe3HMAu56zlRexxIphCWJ5jtD7TzpEYb9+T1rYhEr0G0ZMovjTvraQn9kY9PnBSMKvyT9Zn424AsODKY/sHD1LfTa/dzmHRqJZ71MBvI7tdefRQfbSrYEurxG9l/VJwZXQ7aWe0oLpnuge/tBUETlF4d9cHZADasM+DuyxgVICG0sCDzuUYY3NrfIOGPdCdNMT7LsNeUeAvrFX9HNSVwiAmHQM7Ys/9pbra6bcZhERcCikWYDjmEgS0h/aWd3S+uXr4H6SfwNvJB27P5gcaAsuoMJ3jdZ+8hQ6KXta8b9iiojAOSBvJkUvFjBLvoIVZw5kk9iJ5ZbQ== Received: from [98.137.12.55] by nm11.bullet.mail.gq1.yahoo.com with NNFMP; 25 Jul 2015 16:05:56 -0000 Received: from [98.136.164.76] by tm15.bullet.mail.gq1.yahoo.com with NNFMP; 25 Jul 2015 16:05:56 -0000 Received: from [127.0.0.1] by smtp238.mail.gq1.yahoo.com with NNFMP; 25 Jul 2015 16:05:56 -0000 X-Yahoo-Newman-Id: 615341.60584.bm@smtp238.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: mKfL5K8VM1nDfK.BZ9drkBlDI0oweffm5qHy5BYXLyHBYRZ UnPs5Um53NXqBPaQd1tu5Mu11KEBeX56Owxu0LEeeR1OSnKyM3Eia7I1VSAF njs6FS_XH2SkwOnGr6raXLdYKsNG7KpeR2xEs76adLVFENi5LkcNj8iVaXkH 3d9hybs6qBCEdl4a0xjqvN4rd_sHtuZYjI57hd7v75ootNKsJQHRyhPtvNhW Y_oKIUAoiELLBfUJzHynijEhIqXK9Sz.PmtcJVXJgMpcwE82zuBzURJ65zUg 3wwAs9GaQWXFM2Ocg5bKX2KxPo_tQQFWbcd_fGaepHiATKIkcYv.NJJUHknN n_2s7swzbHjDWdh2d2RxRKBrWr17mFWq7ASZ2joKKF_rMMCHrydgeOthVXW2 Hy5FQzUvUHJPZ5PN2mj.YtjUudUBk3MYmxxWwMDaEGYv9k2axtQEOf40z.C6 ab2OipsGaQ.j5DCJIY.i3UGeca5xEKxSdaPFN1Uqg6e8XNfDF6AKLcbsm5jO 5RfOTKDREbldPwSaLSlhRQ7XhpZhhEEszBW0x..WD2g-- X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... From: Scott Long In-Reply-To: Date: Sat, 25 Jul 2015 10:05:54 -0600 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <109674C8-0584-4347-9DBE-0401B9BDC514@yahoo.com> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150724012519.GE78154@funkthat.com> <96EA33AB-7325-4DD2-83F4-B4FAF6F47CB5@yahoo.com> To: Mark R V Murray X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 16:12:24 -0000 > On Jul 25, 2015, at 2:10 AM, Mark R V Murray = wrote: >=20 >=20 >> On 25 Jul 2015, at 06:06, Scott Long wrote: >>=20 >>> I=E2=80=99m working on a premise of =E2=80=9Ctools, not policy=E2=80=9D= . I=E2=80=99d like there to be >>> enough harvesting points for the box owner to get the warm fuzzies. >>> If they choose to use less, fine by me. >>>=20 >>=20 >> Sure, and that=E2=80=99s not an unreasonable goal, but the devil is = in the details. >=20 > Yes, indeed! >=20 >> It=E2=80=99s an unfortunate fact of modern CPU architecture that even = something >> as simple and innocent as a run-time control that checks a variable = can >> cause significant performance problems, thanks to the penalty of = cache >> misses and bus contention between lots of CPU cores. Maybe these >> =E2=80=9Cextended=E2=80=9D collection points should be controlled = with a compile-time >> option? >=20 > They can. I=E2=80=99ve coded it already, but not tested it properly, = and will > commit in a week or two. :-) What you posted this morning for review is a great start. Thanks for = the productive conversation on this. Scott From owner-svn-src-head@freebsd.org Sat Jul 25 16:14:56 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB9649AA593; Sat, 25 Jul 2015 16:14:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC47FB85; Sat, 25 Jul 2015 16:14:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PGEuDZ016760; Sat, 25 Jul 2015 16:14:56 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PGEu2r016759; Sat, 25 Jul 2015 16:14:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201507251614.t6PGEu2r016759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 25 Jul 2015 16:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285874 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 16:14:57 -0000 Author: kp Date: Sat Jul 25 16:14:55 2015 New Revision: 285874 URL: https://svnweb.freebsd.org/changeset/base/285874 Log: Remove stale comment. The IPv6 pseudo header checksum was added by bz in r235961. Sponsored by: Essen FreeBSD Hackathon Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Sat Jul 25 15:56:49 2015 (r285873) +++ head/sys/netinet/tcp_output.c Sat Jul 25 16:14:55 2015 (r285874) @@ -1212,7 +1212,6 @@ send: /* * Enable TSO and specify the size of the segments. * The TCP pseudo header checksum is always provided. - * XXX: Fixme: This is currently not the case for IPv6. */ if (tso) { KASSERT(len > tp->t_maxopd - optlen, From owner-svn-src-head@freebsd.org Sat Jul 25 16:16:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A7C49AA5D8; Sat, 25 Jul 2015 16:16:03 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D2E8CD1; Sat, 25 Jul 2015 16:16:03 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZJ27E-000OVA-4u; Sat, 25 Jul 2015 17:16:00 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=us-ascii From: Mark R V Murray In-Reply-To: <109674C8-0584-4347-9DBE-0401B9BDC514@yahoo.com> Date: Sat, 25 Jul 2015 17:15:54 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150724012519.GE78154@funkthat.com> <96EA33AB-7325-4DD2-83F4-B4FAF6F47CB5@yahoo.com> <109674C8-0584-4347-9DBE-0401B9BDC514@yahoo.com> To: Scott Long X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 16:16:03 -0000 > On 25 Jul 2015, at 17:05, Scott Long wrote: > > > What you posted this morning for review is a great start. Thanks for the > productive conversation on this. :-) I will do the same/similar for networking and for file ATIME mods. What else causes grief for you? M -- Mark R V Murray From owner-svn-src-head@freebsd.org Sat Jul 25 16:20:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ED049AA6DF; Sat, 25 Jul 2015 16:20:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E700F82; Sat, 25 Jul 2015 16:20:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PGK5mi017375; Sat, 25 Jul 2015 16:20:05 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PGK5eh017374; Sat, 25 Jul 2015 16:20:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201507251620.t6PGK5eh017374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 25 Jul 2015 16:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285875 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Jul 2015 16:20:05 -0000 Author: trasz Date: Sat Jul 25 16:20:04 2015 New Revision: 285875 URL: https://svnweb.freebsd.org/changeset/base/285875 Log: Use double newlines consistently. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/forth/loader.conf Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sat Jul 25 16:14:55 2015 (r285874) +++ head/sys/boot/forth/loader.conf Sat Jul 25 16:20:04 2015 (r285875) @@ -53,6 +53,7 @@ entropy_cache_type="/boot/entropy" # Req # must not change value even if the # _name above does change! + ############################################################## ### RAM Blacklist configuration ############################# ############################################################## @@ -64,6 +65,7 @@ ram_blacklist_name="/boot/blacklist.txt" ram_blacklist_type="ram_blacklist" # Required for the kernel to find # the blacklist module + ############################################################## ### Loader settings ######################################## ############################################################## @@ -381,6 +383,7 @@ if_xe_load="NO" # Xircom CreditCard PC if_xl_load="NO" # 3Com Etherlink XL (3c900, 3c905, 3c905B) utopia_load="NO" # ATM PHY driver + ############################################################## ### Netgraph modules ####################################### ############################################################## @@ -422,6 +425,7 @@ ng_tty_load="NO" # Netgraph node type t ng_vjc_load="NO" # Van Jacobsen compression netgraph node type ng_vlan_load="NO" # IEEE 802.1Q VLAN tagging netgraph node type + ############################################################## ### Sound modules ########################################## ############################################################## @@ -458,6 +462,7 @@ snd_via82c686_load="NO" # via82c686 snd_vibes_load="NO" # vibes snd_driver_load="NO" # All sound drivers + ############################################################## ### USB modules ############################################ ############################################################## @@ -490,6 +495,7 @@ if_ural_load="NO" # Ralink RT2500USB 80 if_zyd_load="NO" # ZyDAS ZD1211(B) USB 802.11 wireless adapter snd_uaudio_load="NO" # USB audio + ############################################################## ### Other modules ########################################## ############################################################## @@ -514,6 +520,7 @@ amdtemp_load="NO" # AMD K8/K10/K11 temp tpm_load="NO" # Trusted Platform Module wbwd_load="NO" # Winbond watchdog + ############################################################## ### ACPI settings ########################################## ############################################################## @@ -524,6 +531,7 @@ acpi_dsdt_name="/boot/acpi_dsdt.aml" # Override DSDT in BIOS by this file acpi_video_load="NO" # Load the ACPI video extension driver + ############################################################## ### TrustedBSD MAC settings ################################## ############################################################## @@ -536,6 +544,7 @@ mac_none_load="NO" # Null MAC policy mac_partition_load="NO" # Partition MAC policy mac_seeotheruids_load="NO" # UID visbility MAC policy + ############################################################## ### Module loading syntax example ########################## ############################################################## From owner-svn-src-head@freebsd.org Sat Jul 25 17:30:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E83C9AB3DE; Sat, 25 Jul 2015 17:30:58 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E0ECD1939; Sat, 25 Jul 2015 17:30:56 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t6PHUtGi022694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Jul 2015 10:30:55 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t6PHUtle022693; Sat, 25 Jul 2015 10:30:55 -0700 (PDT) (envelope-from jmg) Date: Sat, 25 Jul 2015 10:30:55 -0700 From: John-Mark Gurney To: Alexey Dokuchaev Cc: Mark R V Murray , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Message-ID: <20150725173054.GV78154@funkthat.com> References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <20150724012519.GE78154@funkthat.com> <20150725143629.GA49086@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150725143629.GA49086@FreeBSD.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Sat, 25 Jul 2015 10:30:55 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 17:30:58 -0000 Alexey Dokuchaev wrote this message on Sat, Jul 25, 2015 at 14:36 +0000: > On Fri, Jul 24, 2015 at 07:59:35AM +0100, Mark R V Murray wrote: > > [...] > > > Heck, piping in mic data to /dev/random is a good way to seed the > > > rng on many machines. > > > > Well, sure, but what if you don't have microphone? I want lots > > of choices, in anticipation of only a subset being usable. > > I like the microphone idea. Not just it adds another hard-to-mess-with > (?) entropy source, it can also be a nice "reference" example for people > wanting to write their own sources and plug them into the RNG framework. Shouldn't be done in kernel, just do it from userland, by adding the following to cron: 3 * * * * root sleep $(jot -r 1 120 1); dd if=/dev/dsp bs=512 count=5 2>/dev/null | sha512 > /dev/random -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@freebsd.org Sat Jul 25 17:47:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D10209AB5A1; Sat, 25 Jul 2015 17:47:00 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A87471E59; Sat, 25 Jul 2015 17:47:00 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t6PHkxDw023646 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Jul 2015 10:46:59 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t6PHkxSY023645; Sat, 25 Jul 2015 10:46:59 -0700 (PDT) (envelope-from jmg) Date: Sat, 25 Jul 2015 10:46:59 -0700 From: John-Mark Gurney To: Mark R V Murray Cc: src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Message-ID: <20150725174659.GW78154@funkthat.com> References: <20150724012519.GE78154@funkthat.com> <96EA33AB-7325-4DD2-83F4-B4FAF6F47CB5@yahoo.com> <20150725062651.GU78154@funkthat.com> <30C50677-D00A-46B3-AF7A-62FC299D409F@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30C50677-D00A-46B3-AF7A-62FC299D409F@FreeBSD.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Sat, 25 Jul 2015 10:46:59 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 17:47:01 -0000 Mark R V Murray wrote this message on Sat, Jul 25, 2015 at 09:22 +0100: > > On 25 Jul 2015, at 07:26, John-Mark Gurney wrote: > > > > Once you have enough useful bits in /dev/random, you can NEVER run out > > of useful bits from /dev/random... > > > > [Well, not quite NEVER, but not for a few millennia.] > > So is your position effectively anti-harvesting, or at least to turn > off all harvesting after a certain time and never turn it on again? No, I am not, I was just stating a fact of how CSPRNGs work that people keep forgetting... I'm totally against massive collection that has minimal benefit, but massive performance costs... I raised this issue in the review and you still haven't disabled INODE collection, plus you admitted that you hadn't done benchmarks on the uma case... It's way more important to have a good seed at first boot for your rng when you generate long term ssh keys and the like than it is to continually collecting high rate randomness from the system... > If so, we are pretty far apart philosophically. > > DJB???s position is interesting, but I am far from persuaded by it. What points are you not persuaded by? Are there any questions that I could get answers for that would persuade you to change your mind? I'm not against continually collecting entropy, I just don't think it needs to be high speed, or that frequent.. My suggestion is for a thread to run every few seconds to grovel around collecting some entropy, and adding it... Obviously low perf impact collection points like the keyboard should remain as that continues to one of the best sources (when active/available)... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@freebsd.org Sat Jul 25 18:03:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FE589AB7CB; Sat, 25 Jul 2015 18:03:55 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39194819; Sat, 25 Jul 2015 18:03:54 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.15.0.59/8.15.0.59) with SMTP id t6PI3pSC003379; Sat, 25 Jul 2015 13:03:51 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp1.rice.edu with ESMTP id 1vv49f8688-1; Sat, 25 Jul 2015 13:03:51 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 44F7D4003F; Sat, 25 Jul 2015 13:03:51 -0500 (CDT) Message-ID: <55B3CF86.200@rice.edu> Date: Sat, 25 Jul 2015 13:03:50 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: John-Mark Gurney , Alan Cox CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285854 - head/sys/amd64/include References: <201507241943.t6OJhJaq090500@repo.freebsd.org> <20150724211532.GO78154@funkthat.com> In-Reply-To: <20150724211532.GO78154@funkthat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=1 compositescore=0.9 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 rbsscore=0.9 spamscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1506180000 definitions=main-1507250230 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Jul 2015 18:03:55 -0000 On 07/24/2015 16:15, John-Mark Gurney wrote: > Alan Cox wrote this message on Fri, Jul 24, 2015 at 19:43 +0000: >> Author: alc >> Date: Fri Jul 24 19:43:18 2015 >> New Revision: 285854 >> URL: https://svnweb.freebsd.org/changeset/base/285854 >> >> Log: >> Add a comment discussing the appropriate use of the atomic_*() funct= ions >> with acquire and release semantics versus the *mb() functions on amd= 64 >> processors. > Please put this documentation in the atomic(9) man page where it is > easier to read and access... it's probably best to just move it > there and reference atomic(9) here... > > Also, this advice isn't amd64 specific is it? If it isn't, why is it > in an amd64 include file? While the first sentence is not amd64 specific, the core of this paragraph, the third, four, and fifth sentences, is very amd64 specific. In particular, the redundancy of the rmb() and wmb() functions for ordinary cases of interprocessor memory ordering is not generally true across architectures that we support. For example, on arm64 or powerpc, these functions do provide non-redundant ordering. But, I do agree that the first sentence also belongs in a man page, like atomic(9). Today, however, we have no man page documenting the *mb() functions. >> Modified: >> head/sys/amd64/include/atomic.h >> >> Modified: head/sys/amd64/include/atomic.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/amd64/include/atomic.h Fri Jul 24 19:37:30 2015 (r285853)= >> +++ head/sys/amd64/include/atomic.h Fri Jul 24 19:43:18 2015 (r285854)= >> @@ -32,6 +32,25 @@ >> #error this file needs sys/cdefs.h as a prerequisite >> #endif >> =20 >> +/* >> + * To express interprocessor (as opposed to processor and device) mem= ory >> + * ordering constraints, use the atomic_*() functions with acquire an= d release >> + * semantics rather than the *mb() functions. An architecture's memo= ry >> + * ordering (or memory consistency) model governs the order in which = a >> + * program's accesses to different locations may be performed by an >> + * implementation of that architecture. In general, for memory regio= ns >> + * defined as writeback cacheable, the memory ordering implemented by= amd64 >> + * processors preserves the program ordering of a load followed by a = load, a >> + * load followed by a store, and a store followed by a store. Only a= store >> + * followed by a load to a different memory location may be reordered= =2E >> + * Therefore, except for special cases, like non-temporal memory acce= sses or >> + * memory regions defined as write combining, the memory ordering eff= ects >> + * provided by the sfence instruction in the wmb() function and the l= fence >> + * instruction in the rmb() function are redundant. In contrast, the= >> + * atomic_*() functions with acquire and release semantics do not per= form >> + * redundant instructions for ordinary cases of interprocessor memory= >> + * ordering on any architecture. >> + */ >> #define mb() __asm __volatile("mfence;" : : : "memory") >> #define wmb() __asm __volatile("sfence;" : : : "memory") >> #define rmb() __asm __volatile("lfence;" : : : "memory") From owner-svn-src-head@freebsd.org Sat Jul 25 18:14:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 495609AB932; Sat, 25 Jul 2015 18:14:37 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37098C35; Sat, 25 Jul 2015 18:14:37 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PIEb2n067094; Sat, 25 Jul 2015 18:14:37 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PIEaiX067090; Sat, 25 Jul 2015 18:14:36 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201507251814.t6PIEaiX067090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Sat, 25 Jul 2015 18:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285876 - in head: share/man/man4 sys/dev/cyapa sys/modules/i2c sys/modules/i2c/cyapa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 18:14:37 -0000 Author: grembo (ports committer) Date: Sat Jul 25 18:14:35 2015 New Revision: 285876 URL: https://svnweb.freebsd.org/changeset/base/285876 Log: cyapa(4), driver for the Cypress APA I2C trackpad Differential Revision: https://reviews.freebsd.org/D3068 Reviewed by: kib, wblock Approved by: kib Relnotes: yes Added: head/share/man/man4/cyapa.4 (contents, props changed) head/sys/dev/cyapa/ head/sys/dev/cyapa/cyapa.c (contents, props changed) head/sys/dev/cyapa/cyapa.h (contents, props changed) head/sys/modules/i2c/cyapa/ head/sys/modules/i2c/cyapa/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/modules/i2c/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Jul 25 16:20:04 2015 (r285875) +++ head/share/man/man4/Makefile Sat Jul 25 18:14:35 2015 (r285876) @@ -107,6 +107,7 @@ MAN= aac.4 \ cxgb.4 \ cxgbe.4 \ cy.4 \ + cyapa.4 \ da.4 \ dc.4 \ dcons.4 \ Added: head/share/man/man4/cyapa.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/cyapa.4 Sat Jul 25 18:14:35 2015 (r285876) @@ -0,0 +1,200 @@ +.\" Copyright (c) 2015 Michael Gmelin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 25, 2015 +.Dt CYAPA 4 +.Os +.Sh NAME +.Nm cyapa +.Nd Cypress APA trackpad with I2C interface driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines into +the kernel configuration file: +.Bd -ragged -offset indent +.Cd "device cyapa" +.Cd "device ig4" +.Cd "device smbus" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +cyapa_load="YES" +ig4_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Cypress APA trackpad. +It emulates the IntelliMouse PS/2 protocol. +It supports basic mouse ioctls, so that +.Xr moused 8 +is supported properly. +.Ss Trackpad layout +.Bd -literal + 2/3 1/3 + +--------------------+------------+ + | | Middle | + | | Button | + | Left | | + | Button +------------+ + | | Right | + | | Button | + +--------------------+............| + | Thumb/Button Area | 15% + +---------------------------------+ +.Ed +.Ss Trackpad features +.Bl -tag -width 8n +.It Va Two finger scrolling +Use two fingers for Z axis scrolling. +.It Va Button down/second finger +While one finger clicks and holds down the touchpad, the second finger can be +used to move the mouse cursor. +This can be useful for drawing or selecting text. +.It Va Thumb/Button area +The lower 15% of the trackpad will not affect the mouse cursor position. +This allows for high precision clicking, by controlling the cursor with the +index finger and pushing/holding the pad down with the thumb. +.It Va Trackpad button +Push physical button. +The left two thirds of the pad issues a LEFT button event. +The upper right corner issues a MIDDLE button event. +The lower right corner issues a RIGHT button. +Optionally, tap to click can be enabled (see below). +.El +.Sh SYSCTL VARIABLES +These +.Xr sysctl 8 +variables are available: +.Bl -tag -width 8n +.It Va debug.cyapa_idle_freq +Scan frequency in idle mode, the default is 1. +.It Va debug.cyapa_slow_freq +Scan frequency in slow mode, the default is 20. +.It Va debug.cyapa_norm_freq +Scan frequency in normal mode, the default is 100. +.It Va debug.cyapa_minpressure +Minimum pressure to detect a finger, the default is 12. +.It Va debug.cyapa_enable_tapclick +Controls tap to click. +Possible values: +.Bl -tag -width 8n +.It 0 +Tap to click is disabled. +This is the default value. +.It 1 +Tap to click always generates a left mouse button event. +.It 2 +Tap to click generates left mouse button event if the left 2/3rds of the pad +are tapped and a right mouse button event otherwise. +.It 3 +Tap to click generates mouse button events as if the physical button was +pressed (see +.Sx DESCRIPTION +above). +.El +.It Va debug.cyapa_tapclick_min_ticks +Minimum tap duration in ticks to create a click, the default is 1. +.It Va debug.cyapa_tapclick_max_ticks +Maximum tap duration in ticks to create a click, the default is 8. +.It Va debug.cyapa_move_min_ticks +Minimum ticks before cursor movement occurs, the default is 4. +.It Va debug.cyapa_scroll_wait_ticks +Ticks to wait before starting to scroll, the default is 0. +.It Va debug.cyapa_scroll_stick_ticks +Ticks while preventing cursor movement on single finger after scroll, +the default is 15. +.It Va debug.cyapa_thumbarea_percent +Size of bottom thumb area in percent, the default is 15. +.It Va debug.cyapa_debug +Setting this to a non-zero value enables debug output to console and syslog, +the default is 0. +.It Va debug.cyapa_reset +Setting this to a non-zero value reinitializes the device. +The sysctl resets to zero immediately. +.El +.Sh FILES +.Nm +creates +.Pa /dev/cyapa0 , +which presents the mouse as an +.Ar IntelliMouse PS/2 +device. +It supports +.Xr moused 8 +levels 0 through 2, level 1 is used by default. +.Sh EXAMPLES +To use +.Nm +with +.Xr moused 8 , +add the following lines to the +.Xr rc.conf 5 +file: +.Pp +.Dl moused_enable="YES" +.Dl moused_port="/dev/cyapa0" +.Pp +If vertical scrolling is not desired, add +.Pp +.Dl moused_flags="-l0" +.Pp +to +.Xr rc.conf 5 . +.Pp +Enable tap to click for the left and the right mouse button and +disable the thumb area by adding these lines to the +.Xr sysctl.conf 5 +file: +.Pp +.Dl debug.cyapa_thumbarea_percent=0 +.Dl debug.cyapa_enable_tapclick=2 +.Sh SEE ALSO +.Xr ig4 4 , +.Xr moused 4 , +.Xr smbus 4 , +.Xr sysmouse 4 +.Sh AUTHORS +.An -nosplit +The original +.Nm +driver was written for DragonFly BSD by +.An Matthew Dillon . +.Pp +It has been ported, modified, and enhanced for +.Fx +by +.An Michael Gmelin Aq Mt freebsd@grem.de . +.Pp +This manual page was written by +.An Michael Gmelin Aq Mt freebsd@grem.de . +.Sh BUGS +The +.Nm +driver detects the device based on its I2C address (0x67). +This might have unforeseen consequences if the initialization sequence +is sent to an unknown device at that address. Added: head/sys/dev/cyapa/cyapa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cyapa/cyapa.c Sat Jul 25 18:14:35 2015 (r285876) @@ -0,0 +1,1707 @@ +/* + * Copyright (c) 2014 The DragonFly Project. All rights reserved. + * + * This code is derived from software contributed to The DragonFly Project + * by Matthew Dillon and was subsequently ported, + * modified and enhanced for FreeBSD by Michael Gmelin . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of The DragonFly Project nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific, prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS 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$"); + +/* + * CYAPA - Cypress APA trackpad with I2C Interface driver + * + * Based on DragonFlyBSD's cyapa driver, which referenced the linux + * cyapa.c driver to figure out the bootstrapping and commands. + * + * Unable to locate any datasheet for the device. + * + * + * Trackpad layout: + * + * 2/3 1/3 + * +--------------------+------------+ + * | | Middle | + * | | Button | + * | Left | | + * | Button +------------+ + * | | Right | + * | | Button | + * +--------------------+............| + * | Thumb/Button Area | 15% + * +---------------------------------+ + * + * + * FEATURES + * + * IMPS/2 emulation - Emulates the IntelliMouse protocol. + * + * Jitter supression - Implements 2-pixel hysteresis with memory. + * + * Jump detecion - Detect jumps caused by touchpad. + * + * Two finger scrolling - Use two fingers for Z axis scrolling. + * + * Button down/2nd finger - While one finger clicks and holds down the + * touchpad, the second one can be used to move + * the mouse cursor. Useful for drawing or + * selecting text. + * + * Thumb/Button Area - The lower 15%* of the trackpad will not affect + * the mouse cursor position. This allows for high + * precision clicking, by controlling the cursor + * with the index finger and pushing/holding the + * pad down with the thumb. + * * can be changed using sysctl + * + * Track-pad button - Push physical button. Left 2/3rds of the pad + * will issue a LEFT button event, upper right + * corner will issue a MIDDLE button event, + * lower right corner will issue a RIGHT button + * event. Optional tap support can be enabled + * and configured using sysctl. + * + * WARNINGS + * + * These trackpads get confused when three or more fingers are down on the + * same horizontal axis and will start to glitch the finger detection. + * Removing your hand for a few seconds will allow the trackpad to + * recalibrate. Generally speaking, when using three or more fingers + * please try to place at least one finger off-axis (a little above or + * below) the other two. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "smbus_if.h" +#include "bus_if.h" +#include "device_if.h" + +#define CYAPA_BUFSIZE 128 /* power of 2 */ +#define CYAPA_BUFMASK (CYAPA_BUFSIZE - 1) + +#define ZSCALE 15 + +#define TIME_TO_IDLE (hz * 10) +#define TIME_TO_RESET (hz * 3) + +static MALLOC_DEFINE(M_CYAPA, "cyapa", "CYAPA device data"); + +struct cyapa_fifo { + int rindex; + int windex; + char buf[CYAPA_BUFSIZE]; +}; + +struct cyapa_softc { + device_t dev; + int count; /* >0 if device opened */ + int unit; + int addr; + struct cdev *devnode; + struct selinfo selinfo; + struct mtx mutex; + + int cap_resx; + int cap_resy; + int cap_phyx; + int cap_phyy; + uint8_t cap_buttons; + + int detaching; /* driver is detaching */ + int poll_thread_running; /* poll thread is running */ + + /* PS/2 mouse emulation */ + int track_x; /* current tracking */ + int track_y; + int track_z; + int track_z_ticks; + uint16_t track_but; + char track_id; /* first finger id */ + int track_nfingers; + int delta_x; /* accumulation -> report */ + int delta_y; + int delta_z; + int fuzz_x; + int fuzz_y; + int fuzz_z; + int touch_x; /* touch down coordinates */ + int touch_y; + int touch_z; + int finger1_ticks; + int finger2_ticks; + int finger3_ticks; + uint16_t reported_but; + + struct cyapa_fifo rfifo; /* device->host */ + struct cyapa_fifo wfifo; /* host->device */ + uint8_t ps2_cmd; /* active p2_cmd waiting for data */ + uint8_t ps2_acked; + int active_tick; + int data_signal; + int blocked; + int isselect; + int reporting_mode; /* 0=disabled 1=enabled */ + int scaling_mode; /* 0=1:1 1=2:1 */ + int remote_mode; /* 0 for streaming mode */ + int zenabled; /* z-axis enabled (mode 1 or 2) */ + mousehw_t hw; /* hardware information */ + mousemode_t mode; /* mode */ + int poll_ticks; +}; + +struct cyapa_cdevpriv { + struct cyapa_softc *sc; +}; + +#define CYPOLL_SHUTDOWN 0x0001 + +static void cyapa_poll_thread(void *arg); +static int cyapa_raw_input(struct cyapa_softc *sc, struct cyapa_regs *regs, + int freq); +static void cyapa_set_power_mode(struct cyapa_softc *sc, int mode); + +static int fifo_empty(struct cyapa_softc *sc, struct cyapa_fifo *fifo); +static size_t fifo_ready(struct cyapa_softc *sc, struct cyapa_fifo *fifo); +static char *fifo_read(struct cyapa_softc *sc, struct cyapa_fifo *fifo, + size_t n); +static char *fifo_write(struct cyapa_softc *sc, struct cyapa_fifo *fifo, + size_t n); +static uint8_t fifo_read_char(struct cyapa_softc *sc, + struct cyapa_fifo *fifo); +static void fifo_write_char(struct cyapa_softc *sc, struct cyapa_fifo *fifo, + uint8_t c); +static size_t fifo_space(struct cyapa_softc *sc, struct cyapa_fifo *fifo); +static void fifo_reset(struct cyapa_softc *sc, struct cyapa_fifo *fifo); + +static int cyapa_fuzz(int delta, int *fuzz); + +static int cyapa_idle_freq = 1; +SYSCTL_INT(_debug, OID_AUTO, cyapa_idle_freq, CTLFLAG_RW, + &cyapa_idle_freq, 0, "Scan frequency in idle mode"); +static int cyapa_slow_freq = 20; +SYSCTL_INT(_debug, OID_AUTO, cyapa_slow_freq, CTLFLAG_RW, + &cyapa_slow_freq, 0, "Scan frequency in slow mode "); +static int cyapa_norm_freq = 100; +SYSCTL_INT(_debug, OID_AUTO, cyapa_norm_freq, CTLFLAG_RW, + &cyapa_norm_freq, 0, "Normal scan frequency"); +static int cyapa_minpressure = 12; +SYSCTL_INT(_debug, OID_AUTO, cyapa_minpressure, CTLFLAG_RW, + &cyapa_minpressure, 0, "Minimum pressure to detect finger"); +static int cyapa_enable_tapclick = 0; +SYSCTL_INT(_debug, OID_AUTO, cyapa_enable_tapclick, CTLFLAG_RW, + &cyapa_enable_tapclick, 0, "Enable tap to click"); +static int cyapa_tapclick_min_ticks = 1; +SYSCTL_INT(_debug, OID_AUTO, cyapa_tapclick_min_ticks, CTLFLAG_RW, + &cyapa_tapclick_min_ticks, 0, "Minimum tap duration for click"); +static int cyapa_tapclick_max_ticks = 8; +SYSCTL_INT(_debug, OID_AUTO, cyapa_tapclick_max_ticks, CTLFLAG_RW, + &cyapa_tapclick_max_ticks, 0, "Maximum tap duration for click"); +static int cyapa_move_min_ticks = 4; +SYSCTL_INT(_debug, OID_AUTO, cyapa_move_min_ticks, CTLFLAG_RW, + &cyapa_move_min_ticks, 0, + "Minimum ticks before cursor position is changed"); +static int cyapa_scroll_wait_ticks = 0; +SYSCTL_INT(_debug, OID_AUTO, cyapa_scroll_wait_ticks, CTLFLAG_RW, + &cyapa_scroll_wait_ticks, 0, + "Wait N ticks before starting to scroll"); +static int cyapa_scroll_stick_ticks = 15; +SYSCTL_INT(_debug, OID_AUTO, cyapa_scroll_stick_ticks, CTLFLAG_RW, + &cyapa_scroll_stick_ticks, 0, + "Prevent cursor move on single finger for N ticks after scroll"); +static int cyapa_thumbarea_percent = 15; +SYSCTL_INT(_debug, OID_AUTO, cyapa_thumbarea_percent, CTLFLAG_RW, + &cyapa_thumbarea_percent, 0, + "Size of bottom thumb area in percent"); + +static int cyapa_debug = 0; +SYSCTL_INT(_debug, OID_AUTO, cyapa_debug, CTLFLAG_RW, + &cyapa_debug, 0, "Enable debugging"); +static int cyapa_reset = 0; +SYSCTL_INT(_debug, OID_AUTO, cyapa_reset, CTLFLAG_RW, + &cyapa_reset, 0, "Reset track pad"); + +static void +cyapa_lock(struct cyapa_softc *sc) +{ + + mtx_lock(&sc->mutex); +} + +static void +cyapa_unlock(struct cyapa_softc *sc) +{ + + mtx_unlock(&sc->mutex); +} + +#define CYAPA_LOCK_ASSERT(sc) mtx_assert(&(sc)->mutex, MA_OWNED); + +/* + * Notify if possible receive data ready. Must be called + * with sc->mutex held (cyapa_lock(sc)). + */ +static void +cyapa_notify(struct cyapa_softc *sc) +{ + + CYAPA_LOCK_ASSERT(sc); + + if (sc->data_signal || !fifo_empty(sc, &sc->rfifo)) { + KNOTE_LOCKED(&sc->selinfo.si_note, 0); + if (sc->blocked || sc->isselect) { + if (sc->blocked) { + sc->blocked = 0; + wakeup(&sc->blocked); + } + if (sc->isselect) { + sc->isselect = 0; + selwakeup(&sc->selinfo); + } + } + } +} + +/* + * Initialize the device + */ +static int +init_device(device_t dev, struct cyapa_cap *cap, int addr, int probe) +{ + static char bl_exit[] = { + 0x00, 0xff, 0xa5, 0x00, 0x01, + 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; + static char bl_deactivate[] = { + 0x00, 0xff, 0x3b, 0x00, 0x01, + 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; + device_t bus; + struct cyapa_boot_regs boot; + int error; + int retries; + + bus = device_get_parent(dev); /* smbus */ + + /* Get status */ + error = smbus_trans(bus, addr, CMD_BOOT_STATUS, + SMB_TRANS_NOCNT | SMB_TRANS_7BIT, + NULL, 0, (void *)&boot, sizeof(boot), NULL); + if (error) + goto done; + + /* + * Bootstrap the device if necessary. It can take up to 2 seconds + * for the device to fully initialize. + */ + retries = 20; + while ((boot.stat & CYAPA_STAT_RUNNING) == 0 && retries > 0) { + if (boot.boot & CYAPA_BOOT_BUSY) { + /* Busy, wait loop. */ + } else if (boot.error & CYAPA_ERROR_BOOTLOADER) { + /* Magic */ + error = smbus_trans(bus, addr, CMD_BOOT_STATUS, + SMB_TRANS_NOCNT | SMB_TRANS_7BIT, + bl_deactivate, sizeof(bl_deactivate), + NULL, 0, NULL); + if (error) + goto done; + } else { + /* Magic */ + error = smbus_trans(bus, addr, CMD_BOOT_STATUS, + SMB_TRANS_NOCNT | SMB_TRANS_7BIT, + bl_exit, sizeof(bl_exit), NULL, 0, NULL); + if (error) + goto done; + } + pause("cyapab1", (hz * 2) / 10); + --retries; + error = smbus_trans(bus, addr, CMD_BOOT_STATUS, + SMB_TRANS_NOCNT | SMB_TRANS_7BIT, + NULL, 0, (void *)&boot, sizeof(boot), NULL); + if (error) + goto done; + } + + if (retries == 0) { + device_printf(dev, "Unable to bring device out of bootstrap\n"); + error = ENXIO; + goto done; + } + + /* Check identity */ + if (cap) { + error = smbus_trans(bus, addr, CMD_QUERY_CAPABILITIES, + SMB_TRANS_NOCNT | SMB_TRANS_7BIT, + NULL, 0, (void *)cap, sizeof(*cap), NULL); + + if (strncmp(cap->prod_ida, "CYTRA", 5) != 0) { + device_printf(dev, "Product ID \"%5.5s\" mismatch\n", + cap->prod_ida); + error = ENXIO; + } + } + error = smbus_trans(bus, addr, CMD_BOOT_STATUS, + SMB_TRANS_NOCNT | SMB_TRANS_7BIT, + NULL, 0, (void *)&boot, sizeof(boot), NULL); + + if (probe == 0) /* official init */ + device_printf(dev, "cyapa init status %02x\n", boot.stat); + else if (probe == 2) + device_printf(dev, "cyapa reset status %02x\n", boot.stat); + +done: + if (error) + device_printf(dev, "Unable to initialize\n"); + return (error); +} + +static int cyapa_probe(device_t); +static int cyapa_attach(device_t); +static int cyapa_detach(device_t); +static void cyapa_cdevpriv_dtor(void*); + +static devclass_t cyapa_devclass; + +static device_method_t cyapa_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, cyapa_probe), + DEVMETHOD(device_attach, cyapa_attach), + DEVMETHOD(device_detach, cyapa_detach), + + DEVMETHOD_END +}; + +static driver_t cyapa_driver = { + "cyapa", + cyapa_methods, + sizeof(struct cyapa_softc), +}; + +static d_open_t cyapaopen; +static d_ioctl_t cyapaioctl; +static d_read_t cyaparead; +static d_write_t cyapawrite; +static d_kqfilter_t cyapakqfilter; +static d_poll_t cyapapoll; + +static struct cdevsw cyapa_cdevsw = { + .d_version = D_VERSION, + .d_open = cyapaopen, + .d_ioctl = cyapaioctl, + .d_read = cyaparead, + .d_write = cyapawrite, + .d_kqfilter = cyapakqfilter, + .d_poll = cyapapoll, +}; + +static int +cyapa_probe(device_t dev) +{ + struct cyapa_cap cap; + int unit; + int addr; + int error; + + addr = smbus_get_addr(dev); + + /* + * 0x67 - cypress trackpad on the acer c720 + * (other devices might use other ids). + */ + if (addr != 0x67) + return (ENXIO); + + unit = device_get_unit(dev); + + error = init_device(dev, &cap, addr, 1); + if (error != 0) + return (ENXIO); + + device_set_desc(dev, "Cypress APA I2C Trackpad"); + + return (BUS_PROBE_VENDOR); +} + +static int +cyapa_attach(device_t dev) +{ + struct cyapa_softc *sc; + struct cyapa_cap cap; + int unit; + int addr; + + sc = device_get_softc(dev); + sc->reporting_mode = 1; + + unit = device_get_unit(dev); + addr = *((unsigned char*) device_get_ivars(dev)); + + if (init_device(dev, &cap, addr, 0)) + return (ENXIO); + + mtx_init(&sc->mutex, "cyapa", NULL, MTX_DEF); + + sc->dev = dev; + sc->unit = unit; + sc->addr = addr; + + knlist_init_mtx(&sc->selinfo.si_note, &sc->mutex); + + sc->cap_resx = ((cap.max_abs_xy_high << 4) & 0x0F00) | + cap.max_abs_x_low; + sc->cap_resy = ((cap.max_abs_xy_high << 8) & 0x0F00) | + cap.max_abs_y_low; + sc->cap_phyx = ((cap.phy_siz_xy_high << 4) & 0x0F00) | + cap.phy_siz_x_low; + sc->cap_phyy = ((cap.phy_siz_xy_high << 8) & 0x0F00) | + cap.phy_siz_y_low; + sc->cap_buttons = cap.buttons; + + device_printf(dev, "%5.5s-%6.6s-%2.2s buttons=%c%c%c res=%dx%d\n", + cap.prod_ida, cap.prod_idb, cap.prod_idc, + ((cap.buttons & CYAPA_FNGR_LEFT) ? 'L' : '-'), + ((cap.buttons & CYAPA_FNGR_MIDDLE) ? 'M' : '-'), + ((cap.buttons & CYAPA_FNGR_RIGHT) ? 'R' : '-'), + sc->cap_resx, sc->cap_resy); + + sc->hw.buttons = 5; + sc->hw.iftype = MOUSE_IF_PS2; + sc->hw.type = MOUSE_MOUSE; + sc->hw.model = MOUSE_MODEL_INTELLI; + sc->hw.hwid = addr; + + sc->mode.protocol = MOUSE_PROTO_PS2; + sc->mode.rate = 100; + sc->mode.resolution = 4; + sc->mode.accelfactor = 1; + sc->mode.level = 0; + sc->mode.packetsize = MOUSE_PS2_PACKETSIZE; + + /* Setup input event tracking */ + cyapa_set_power_mode(sc, CMD_POWER_MODE_IDLE); + + /* Start the polling thread */ + kthread_add(cyapa_poll_thread, sc, NULL, NULL, + 0, 0, "cyapa-poll"); + + sc->devnode = make_dev(&cyapa_cdevsw, unit, + UID_ROOT, GID_WHEEL, 0600, "cyapa%d", unit); + + sc->devnode->si_drv1 = sc; + + return (0); +} + +static int +cyapa_detach(device_t dev) +{ + struct cyapa_softc *sc; + + sc = device_get_softc(dev); + + /* Cleanup poller thread */ + cyapa_lock(sc); + while (sc->poll_thread_running) { + sc->detaching = 1; + mtx_sleep(&sc->detaching, &sc->mutex, PCATCH, "cyapadet", hz); + } + cyapa_unlock(sc); + + destroy_dev(sc->devnode); + + knlist_clear(&sc->selinfo.si_note, 0); + seldrain(&sc->selinfo); + knlist_destroy(&sc->selinfo.si_note); + + mtx_destroy(&sc->mutex); + + return (0); +} + +/* + * USER DEVICE I/O FUNCTIONS + */ +static int +cyapaopen(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + struct cyapa_cdevpriv *priv; + int error; + + priv = malloc(sizeof(*priv), M_CYAPA, M_WAITOK | M_ZERO); + priv->sc = dev->si_drv1; + + error = devfs_set_cdevpriv(priv, cyapa_cdevpriv_dtor); + if (error == 0) { + cyapa_lock(priv->sc); + priv->sc->count++; + cyapa_unlock(priv->sc); + } + else + free(priv, M_CYAPA); + + return (error); +} + +static void +cyapa_cdevpriv_dtor(void *data) +{ + struct cyapa_cdevpriv *priv; + + priv = data; + KASSERT(priv != NULL, ("cyapa cdevpriv should not be NULL!")); + + cyapa_lock(priv->sc); + priv->sc->count--; + cyapa_unlock(priv->sc); + + free(priv, M_CYAPA); +} + +static int +cyaparead(struct cdev *dev, struct uio *uio, int ioflag) +{ + struct cyapa_softc *sc; + int error; + int didread; + size_t n; + char* ptr; + + sc = dev->si_drv1; + /* If buffer is empty, load a new event if it is ready */ + cyapa_lock(sc); +again: + if (fifo_empty(sc, &sc->rfifo) && + (sc->data_signal || sc->delta_x || sc->delta_y || + sc->track_but != sc->reported_but)) { + uint8_t c0; + uint16_t but; + int delta_x; + int delta_y; + int delta_z; + + /* Accumulate delta_x, delta_y */ + sc->data_signal = 0; + delta_x = sc->delta_x; + delta_y = sc->delta_y; + delta_z = sc->delta_z; + if (delta_x > 255) { + delta_x = 255; + sc->data_signal = 1; + } + if (delta_x < -256) { + delta_x = -256; + sc->data_signal = 1; + } + if (delta_y > 255) { + delta_y = 255; + sc->data_signal = 1; + } + if (delta_y < -256) { + delta_y = -256; + sc->data_signal = 1; + } + if (delta_z > 255) { + delta_z = 255; + sc->data_signal = 1; + } + if (delta_z < -256) { + delta_z = -256; + sc->data_signal = 1; + } + but = sc->track_but; + + /* Adjust baseline for next calculation */ + sc->delta_x -= delta_x; + sc->delta_y -= delta_y; + sc->delta_z -= delta_z; + sc->reported_but = but; + + /* + * Fuzz reduces movement jitter by introducing some + * hysteresis. It operates without cumulative error so + * if you swish around quickly and return your finger to + * where it started, so to will the mouse. + */ + delta_x = cyapa_fuzz(delta_x, &sc->fuzz_x); + delta_y = cyapa_fuzz(delta_y, &sc->fuzz_y); + delta_z = cyapa_fuzz(delta_z, &sc->fuzz_z); + + /* + * Generate report + */ + c0 = 0; + if (delta_x < 0) + c0 |= 0x10; + if (delta_y < 0) + c0 |= 0x20; + c0 |= 0x08; + if (but & CYAPA_FNGR_LEFT) + c0 |= 0x01; + if (but & CYAPA_FNGR_MIDDLE) + c0 |= 0x04; + if (but & CYAPA_FNGR_RIGHT) + c0 |= 0x02; + + fifo_write_char(sc, &sc->rfifo, c0); + fifo_write_char(sc, &sc->rfifo, (uint8_t)delta_x); + fifo_write_char(sc, &sc->rfifo, (uint8_t)delta_y); + switch(sc->zenabled) { + case 1: + /* Z axis all 8 bits */ + fifo_write_char(sc, &sc->rfifo, (uint8_t)delta_z); + break; + case 2: + /* + * Z axis low 4 bits + 4th button and 5th button + * (high 2 bits must be left 0). Auto-scale + * delta_z to fit to avoid a wrong-direction + * overflow (don't try to retain the remainder). + */ + while (delta_z > 7 || delta_z < -8) + delta_z >>= 1; + c0 = (uint8_t)delta_z & 0x0F; + fifo_write_char(sc, &sc->rfifo, c0); + break; + default: + /* basic PS/2 */ + break; + } + cyapa_notify(sc); + } + + /* Blocking / Non-blocking */ + error = 0; + didread = (uio->uio_resid == 0); + + while ((ioflag & IO_NDELAY) == 0 && fifo_empty(sc, &sc->rfifo)) { + if (sc->data_signal) + goto again; + sc->blocked = 1; + error = mtx_sleep(&sc->blocked, &sc->mutex, PCATCH, "cyablk", 0); + if (error) + break; + } + + /* Return any buffered data */ + while (error == 0 && uio->uio_resid && + (n = fifo_ready(sc, &sc->rfifo)) > 0) { + if (n > uio->uio_resid) + n = uio->uio_resid; + ptr = fifo_read(sc, &sc->rfifo, 0); + cyapa_unlock(sc); + error = uiomove(ptr, n, uio); + cyapa_lock(sc); + if (error) + break; + fifo_read(sc, &sc->rfifo, n); + didread = 1; + } + cyapa_unlock(sc); + + if (error == 0 && didread == 0) { + error = EWOULDBLOCK; + } + return (didread ? 0 : error); +} + +static int +cyapawrite(struct cdev *dev, struct uio *uio, int ioflag) +{ + struct cyapa_softc *sc; + int error; + int cmd_completed; + size_t n; + uint8_t c0; + char* ptr; + + sc = dev->si_drv1; +again: + /* + * Copy data from userland. This will also cross-over the end + * of the fifo and keep filling. + */ + cyapa_lock(sc); + while ((n = fifo_space(sc, &sc->wfifo)) > 0 && uio->uio_resid) { + if (n > uio->uio_resid) + n = uio->uio_resid; + ptr = fifo_write(sc, &sc->wfifo, 0); + cyapa_unlock(sc); + error = uiomove(ptr, n, uio); + cyapa_lock(sc); + if (error) + break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Jul 25 18:22:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F40679ABA83; Sat, 25 Jul 2015 18:22:09 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D957E10BA; Sat, 25 Jul 2015 18:22:09 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from zeta.ixsystems.com (unknown [IPv6:2601:646:8f00:8a91:818d:c100:bfe:b997]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 8993A1CF72; Sat, 25 Jul 2015 11:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1437848529; x=1437862929; bh=p7Xb7awkXFve3AfCGg+/vpsN1cisrkMCvUrFS/CtRBE=; h=Reply-To:Subject:References:To:From:Date:In-Reply-To; b=MpZ4uyxmo8Oaub93NuIWFOpyxrBM9Ie6qnO88FT/wNvi5ZFJ1pnOBrcW+lBRjsuGV U/aJVfBT5jq2KOmU/c4+VSNqbuQ1AYcPzWfAeiiuKryF0Sa76BwxKRfZuPOFyP3jDU g4Om58nm/8GqG0SMSCzcpGAlFQIYAn5t2djxGaPA= Reply-To: d@delphij.net Subject: Re: svn commit: r285876 - in head: share/man/man4 sys/dev/cyapa sys/modules/i2c sys/modules/i2c/cyapa References: <201507251814.t6PIEaiX067090@repo.freebsd.org> To: Michael Gmelin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Xin Li Organization: The FreeBSD Project Message-ID: <55B3D3D1.4050105@delphij.net> Date: Sat, 25 Jul 2015 11:22:09 -0700 MIME-Version: 1.0 In-Reply-To: <201507251814.t6PIEaiX067090@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 18:22:10 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 07/25/15 11:14, Michael Gmelin wrote: > Author: grembo (ports committer) Date: Sat Jul 25 18:14:35 2015 New > Revision: 285876 URL: > https://svnweb.freebsd.org/changeset/base/285876 > > Log: cyapa(4), driver for the Cypress APA I2C trackpad > > Differential Revision: https://reviews.freebsd.org/D3068 Reviewed > by: kib, wblock Approved by: kib Relnotes: yes Maybe "Obtained from: DragonflyBSD"? BTW. Any plan to MFC? Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.1.6 (FreeBSD) iQIcBAEBCgAGBQJVs9PRAAoJEJW2GBstM+nsKXYP/3lKIMoT1pAFjUKvHw8F8k4l 7utYlgyygkr2dSB2W+RFM+q+3yAbIszA6xaIMMiaAgHyCPO7zI6NHQamculFyI8F gNKCJD5tKmK8I+IwD0fL/MndTwsCr0SyxFBE9LioaRJvwJ7UduUS9dpNqXgjam4X y7OAh25n1pr033bQ2EFFHRK5pNE27UR6jbYzZT+6PpbAlbTioMKths/zOUiHU15W Grw9ZTAZyyOAP/GR4oudj+97HNo0V7mIHoSQ5GKqEpWtZ4t86yaFc+OlxdMjnhlX bZjC5nKzVCwtqOxRGT8PEwHuObOjh59POCYtimaAdm+cPm8LC0Ewt1J3dKCLUm7d isLWtJgceZaUbc8j6qF+NQChqSbnGLoQ4DiQaqiQU6tygVJ1b0zsMdnH0xU0ADU1 TpDbcs1rVOYW59GNNeuOnn3rr/u20bsN3tExn4cp3GMoE5b0bGkuNoxVXXF9t6re t9mF+W+WvhmZki9X6FQgShIRUSQCdDudZ+JQtLscyf7SXak2T6wOdVfriFPtMNJn +f0obDM8sURQVPA+gB52q4ybVh67y5t32mcty83HOYtVrx1KDauB1Rl8seh/oL96 +Dk9Cw74ugDnpyRhyaMk/1sgFqtG2BJCwwuzS0oBi2S7ihZZec5PgKkOSZFA2Ons u6vfX8SfnBB3P+ZAmxbV =UcL2 -----END PGP SIGNATURE----- From owner-svn-src-head@freebsd.org Sat Jul 25 18:26:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 044729ABAE5; Sat, 25 Jul 2015 18:26:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8C41122F; Sat, 25 Jul 2015 18:26:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PIQAu5071198; Sat, 25 Jul 2015 18:26:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PIQAWI071194; Sat, 25 Jul 2015 18:26:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201507251826.t6PIQAWI071194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 25 Jul 2015 18:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285877 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 18:26:11 -0000 Author: tuexen Date: Sat Jul 25 18:26:09 2015 New Revision: 285877 URL: https://svnweb.freebsd.org/changeset/base/285877 Log: Move including netinet/icmp6.h around to avoid a problem when including netinet/icmp6.h and net/netmap.h. Both use ni_flags... This allows to build multistack with SCTP support. MFC after: 1 week Modified: head/sys/netinet/sctp_os_bsd.h head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Sat Jul 25 18:14:35 2015 (r285876) +++ head/sys/netinet/sctp_os_bsd.h Sat Jul 25 18:26:09 2015 (r285877) @@ -95,7 +95,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sat Jul 25 18:14:35 2015 (r285876) +++ head/sys/netinet6/sctp6_usrreq.c Sat Jul 25 18:26:09 2015 (r285877) @@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef INET6 #include -#endif #include #include #include @@ -54,13 +52,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef IPSEC #include -#ifdef INET6 #include -#endif /* INET6 */ #endif /* IPSEC */ extern struct protosw inetsw[]; From owner-svn-src-head@freebsd.org Sat Jul 25 18:29:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A430F9ABB1C; Sat, 25 Jul 2015 18:29:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 949A914A4; Sat, 25 Jul 2015 18:29:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PIT7bQ071359; Sat, 25 Jul 2015 18:29:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PIT7sI071357; Sat, 25 Jul 2015 18:29:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507251829.t6PIT7sI071357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 25 Jul 2015 18:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285878 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 18:29:07 -0000 Author: kib Date: Sat Jul 25 18:29:06 2015 New Revision: 285878 URL: https://svnweb.freebsd.org/changeset/base/285878 Log: Revert r173708's modifications to vm_object_page_remove(). Assume that a vnode is mapped shared and mlocked(), and then the vnode is truncated, or truncated and then again extended past the mapping point EOF. Truncation removes the pages past the truncation point, and if pages are later created at this range, they are not properly mapped into the mlocked region, and their wiring count is wrong. The revert leaves the invalidated but wired pages on the object queue, which means that the pages are found by vm_object_unwire() when the mapped range is munlock()ed, and reused by the buffer cache when the vnode is extended again. The changes in r173708 were required since then vm_map_unwire() looked at the page tables to find the page to unwire. This is no longer needed with the vm_object_unwire() introduction, which follows the objects shadow chain. Also eliminate OBJPR_NOTWIRED flag for vm_object_page_remove(), which is now redundand, we do not remove wired pages. Reported by: trasz, Dmitry Sivachenko Suggested and reviewed by: alc Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sat Jul 25 18:26:09 2015 (r285877) +++ head/sys/vm/vm_object.c Sat Jul 25 18:29:06 2015 (r285878) @@ -1063,9 +1063,9 @@ vm_object_sync(vm_object_t object, vm_oo */ flags = OBJPR_NOTMAPPED; else if (old_msync) - flags = OBJPR_NOTWIRED; + flags = 0; else - flags = OBJPR_CLEANONLY | OBJPR_NOTWIRED; + flags = OBJPR_CLEANONLY; vm_object_page_remove(object, OFF_TO_IDX(offset), OFF_TO_IDX(offset + size + PAGE_MASK), flags); } @@ -1894,7 +1894,6 @@ vm_object_page_remove(vm_object_t object int options) { vm_page_t p, next; - int wirings; VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((object->flags & OBJ_UNMANAGED) == 0 || @@ -1928,15 +1927,9 @@ again: VM_OBJECT_WLOCK(object); goto again; } - if ((wirings = p->wire_count) != 0 && - (wirings = pmap_page_wired_mappings(p)) != p->wire_count) { - if ((options & (OBJPR_NOTWIRED | OBJPR_NOTMAPPED)) == - 0) { + if (p->wire_count != 0) { + if ((options & OBJPR_NOTMAPPED) == 0) pmap_remove_all(p); - /* Account for removal of wired mappings. */ - if (wirings != 0) - p->wire_count -= wirings; - } if ((options & OBJPR_CLEANONLY) == 0) { p->valid = 0; vm_page_undirty(p); @@ -1957,19 +1950,8 @@ again: if (p->dirty) goto next; } - if ((options & OBJPR_NOTMAPPED) == 0) { - if ((options & OBJPR_NOTWIRED) != 0 && wirings != 0) - goto next; + if ((options & OBJPR_NOTMAPPED) == 0) pmap_remove_all(p); - /* Account for removal of wired mappings. */ - if (wirings != 0) { - KASSERT(p->wire_count == wirings, - ("inconsistent wire count %d %d %p", - p->wire_count, wirings, p)); - p->wire_count = 0; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); - } - } vm_page_free(p); next: vm_page_unlock(p); Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Sat Jul 25 18:26:09 2015 (r285877) +++ head/sys/vm/vm_object.h Sat Jul 25 18:29:06 2015 (r285878) @@ -207,7 +207,6 @@ struct vm_object { */ #define OBJPR_CLEANONLY 0x1 /* Don't remove dirty pages. */ #define OBJPR_NOTMAPPED 0x2 /* Don't unmap pages. */ -#define OBJPR_NOTWIRED 0x4 /* Don't remove wired pages. */ TAILQ_HEAD(object_q, vm_object); From owner-svn-src-head@freebsd.org Sat Jul 25 18:31:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 071E99ABC07; Sat, 25 Jul 2015 18:31:46 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B3C03195E; Sat, 25 Jul 2015 18:31:44 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t6PIVii2026231 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Jul 2015 11:31:44 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t6PIViSL026230; Sat, 25 Jul 2015 11:31:44 -0700 (PDT) (envelope-from jmg) Date: Sat, 25 Jul 2015 11:31:44 -0700 From: John-Mark Gurney To: Scott Long Cc: Alexey Dokuchaev , Mark R V Murray , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Message-ID: <20150725183144.GX78154@funkthat.com> References: <20150724012519.GE78154@funkthat.com> <20150725143629.GA49086@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Sat, 25 Jul 2015 11:31:44 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 18:31:46 -0000 Scott Long wrote this message on Sat, Jul 25, 2015 at 10:04 -0600: > > On Jul 25, 2015, at 8:36 AM, Alexey Dokuchaev wrote: > > > > On Fri, Jul 24, 2015 at 07:59:35AM +0100, Mark R V Murray wrote: > >> [...] > >>> Heck, piping in mic data to /dev/random is a good way to seed the > >>> rng on many machines. > >> > >> Well, sure, but what if you don't have microphone? I want lots > >> of choices, in anticipation of only a subset being usable. > > > > I like the microphone idea. Not just it adds another hard-to-mess-with > > (?) entropy source, it can also be a nice "reference" example for people > > wanting to write their own sources and plug them into the RNG framework. > > > > Microphones don???t typically exist on virtual machines, servers, appliances/embedded gadgets, and trusted computers. Nice idea for the desktop, but far from universal. virtual machines have things like virtio_random, most embedded gadgets have an ADC that could be used... Appliances a little more difficult, but trusted computers probably have a hardware RNG anyways... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@freebsd.org Sat Jul 25 19:24:34 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B92D59AA146; Sat, 25 Jul 2015 19:24:34 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5FB2B13; Sat, 25 Jul 2015 19:24:34 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PJOYWg094990; Sat, 25 Jul 2015 19:24:34 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PJOYO8094989; Sat, 25 Jul 2015 19:24:34 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201507251924.t6PJOYO8094989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 25 Jul 2015 19:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285879 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 19:24:34 -0000 Author: sbruno Date: Sat Jul 25 19:24:33 2015 New Revision: 285879 URL: https://svnweb.freebsd.org/changeset/base/285879 Log: Remove unused txd_saved. Intialize txd_upper, txd_lower and txd_used at declaration. Differential Revision: D3174 Reviewed by: erj hiren MFC after: 2 weeks Sponsored by: Limelight Networks Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sat Jul 25 18:29:06 2015 (r285878) +++ head/sys/dev/e1000/if_em.c Sat Jul 25 19:24:33 2015 (r285879) @@ -1872,13 +1872,12 @@ em_xmit(struct tx_ring *txr, struct mbuf struct ether_header *eh; struct ip *ip = NULL; struct tcphdr *tp = NULL; - u32 txd_upper, txd_lower, txd_used, txd_saved; + u32 txd_upper = 0, txd_lower = 0, txd_used = 0; int ip_off, poff; int nsegs, i, j, first, last = 0; int error, do_tso, tso_desc = 0, remap = 1; m_head = *m_headp; - txd_upper = txd_lower = txd_used = txd_saved = 0; do_tso = ((m_head->m_pkthdr.csum_flags & CSUM_TSO) != 0); ip_off = poff = 0; From owner-svn-src-head@freebsd.org Sat Jul 25 19:24:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 086BB9AA16E; Sat, 25 Jul 2015 19:24:44 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C01ACC59; Sat, 25 Jul 2015 19:24:43 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZJ53k-000OeQ-0b; Sat, 25 Jul 2015 20:24:39 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <20150725183144.GX78154@funkthat.com> Date: Sat, 25 Jul 2015 20:24:29 +0100 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Transfer-Encoding: quoted-printable Message-Id: References: <20150724012519.GE78154@funkthat.com> <20150725143629.GA49086@FreeBSD.org> <20150725183144.GX78154@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 19:24:44 -0000 > On 25 Jul 2015, at 19:31, John-Mark Gurney wrote: >=20 > virtual machines have things like virtio_random, most embedded gadgets > have an ADC that could be used... Appliances a little more difficult, > but trusted computers probably have a hardware RNG anyways=E2=80=A6 You need to research this more carefully. Ask Ian Lepore about the paucity of entropy on his boxes. M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Sat Jul 25 19:31:12 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B46DA9AA385; Sat, 25 Jul 2015 19:31:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 7A0E71081; Sat, 25 Jul 2015 19:31:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 47AD21A07D8; Sun, 26 Jul 2015 05:31:03 +1000 (AEST) Date: Sun, 26 Jul 2015 05:31:03 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Cox cc: John-Mark Gurney , Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285854 - head/sys/amd64/include In-Reply-To: <55B3CF86.200@rice.edu> Message-ID: <20150726051421.C892@besplex.bde.org> References: <201507241943.t6OJhJaq090500@repo.freebsd.org> <20150724211532.GO78154@funkthat.com> <55B3CF86.200@rice.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=ItbjC+Lg c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=jOycMddxPMzTkANAw7kA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 19:31:12 -0000 On Sat, 25 Jul 2015, Alan Cox wrote: > On 07/24/2015 16:15, John-Mark Gurney wrote: >> Alan Cox wrote this message on Fri, Jul 24, 2015 at 19:43 +0000: >>> ... >>> Log: >>> Add a comment discussing the appropriate use of the atomic_*() functions >>> with acquire and release semantics versus the *mb() functions on amd64 >>> processors. >> Please put this documentation in the atomic(9) man page where it is >> easier to read and access... it's probably best to just move it >> there and reference atomic(9) here... Your "." key is still sticky. >> Also, this advice isn't amd64 specific is it? If it isn't, why is it >> in an amd64 include file? > > While the first sentence is not amd64 specific, the core of this > paragraph, the third, four, and fifth sentences, is very amd64 specific. > In particular, the redundancy of the rmb() and wmb() functions for > ordinary cases of interprocessor memory ordering is not generally true > across architectures that we support. For example, on arm64 or powerpc, > these functions do provide non-redundant ordering. It all applies to i386. Literally after s/amd64/x86/g. > But, I do agree that the first sentence also belongs in a man page, like > atomic(9). Today, however, we have no man page documenting the *mb() > functions. These functions are documented in atomic(9) by their absence. Since they are undocumented, they don't exist :-). The man page is also deficient and wrong about the MD set of types available. It says that the 64 bit type is [always] available, but it is unavailable on most or all 32-bit arches for most or all operations. It says that the set of available smaller types is MD but the only way to find the set is to read the source code. The small types are just bloat, since they are unusable in MI code and never used in MD code for at least amd64 and i386. *mb() is similar. It acts in an undocumented MD way, so it is unusable in MI code. Bruce From owner-svn-src-head@freebsd.org Sat Jul 25 20:00:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E22519AA8C4; Sat, 25 Jul 2015 20:00:31 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A29E41D32; Sat, 25 Jul 2015 20:00:31 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t6PK0Twb031422 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Jul 2015 13:00:29 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t6PK0TTh031421; Sat, 25 Jul 2015 13:00:29 -0700 (PDT) (envelope-from jmg) Date: Sat, 25 Jul 2015 13:00:29 -0700 From: John-Mark Gurney To: Mark R V Murray Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Message-ID: <20150725200029.GZ78154@funkthat.com> References: <20150724012519.GE78154@funkthat.com> <20150725143629.GA49086@FreeBSD.org> <20150725183144.GX78154@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Sat, 25 Jul 2015 13:00:29 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 20:00:32 -0000 Mark R V Murray wrote this message on Sat, Jul 25, 2015 at 20:24 +0100: > > On 25 Jul 2015, at 19:31, John-Mark Gurney wrote: > > > > virtual machines have things like virtio_random, most embedded gadgets > > have an ADC that could be used... Appliances a little more difficult, > > but trusted computers probably have a hardware RNG anyways??? > > You need to research this more carefully. Ask Ian Lepore about the > paucity of entropy on his boxes. I have been following the discussions that Ian and you have had publicly, so I understand the issues involved... I agree we should provide Ian w/ the tools necessary for his boxes to have sufficient entropy... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@freebsd.org Sat Jul 25 20:15:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 372709AAAF4; Sat, 25 Jul 2015 20:15:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F818914; Sat, 25 Jul 2015 20:15:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PKFTHL015431; Sat, 25 Jul 2015 20:15:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PKFTpx015430; Sat, 25 Jul 2015 20:15:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201507252015.t6PKFTpx015430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 25 Jul 2015 20:15:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285881 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Jul 2015 20:15:30 -0000 Author: trasz Date: Sat Jul 25 20:15:29 2015 New Revision: 285881 URL: https://svnweb.freebsd.org/changeset/base/285881 Log: Add md_root example to defaults/loader.conf. Note that this doesn't quite work yet - the preloaded image gets loaded twice for some reason. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/forth/loader.conf Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sat Jul 25 19:30:26 2015 (r285880) +++ head/sys/boot/forth/loader.conf Sat Jul 25 20:15:29 2015 (r285881) @@ -67,6 +67,16 @@ ram_blacklist_type="ram_blacklist" # Req ############################################################## +### Initial memory disk settings ########################### +############################################################## + +#initmd_load="YES" # The "initmd" prefix is arbitrary. +#initmd_type="md_image" # Create md(4) disk at boot. +#initmd_name="/boot/root.img" # Path to a file containing the image. +#rootdev="ufs:/dev/md0" # Set the root filesystem to md(4) device. + + +############################################################## ### Loader settings ######################################## ############################################################## From owner-svn-src-head@freebsd.org Sat Jul 25 20:17:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF6689AAB8E; Sat, 25 Jul 2015 20:17:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6200AE8; Sat, 25 Jul 2015 20:17:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PKHKQ1015584; Sat, 25 Jul 2015 20:17:20 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PKHKTN015583; Sat, 25 Jul 2015 20:17:20 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201507252017.t6PKHKTN015583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 25 Jul 2015 20:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285882 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Jul 2015 20:17:20 -0000 Author: trasz Date: Sat Jul 25 20:17:19 2015 New Revision: 285882 URL: https://svnweb.freebsd.org/changeset/base/285882 Log: Use consistent spacing. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/forth/loader.conf Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sat Jul 25 20:15:29 2015 (r285881) +++ head/sys/boot/forth/loader.conf Sat Jul 25 20:17:19 2015 (r285882) @@ -39,7 +39,7 @@ bitmap_type="splash_image_data" # and pl ############################################################## -### Random number generator configuration ################### +### Random number generator configuration ################## ############################################################## # See rc.conf(5). The entropy_boot_file config variable must agree with the @@ -55,7 +55,7 @@ entropy_cache_type="/boot/entropy" # Req ############################################################## -### RAM Blacklist configuration ############################# +### RAM Blacklist configuration ############################ ############################################################## ram_blacklist_load="NO" # Set this to YES to load a file @@ -173,7 +173,7 @@ module_path="/boot/modules" # Set the mo ############################################################## -### ATA modules ############################################## +### ATA modules ############################################ ############################################################## ataacard_load="NO" # ACARD @@ -543,7 +543,7 @@ acpi_video_load="NO" # Load the ACPI vi ############################################################## -### TrustedBSD MAC settings ################################## +### TrustedBSD MAC settings ################################ ############################################################## mac_biba_load="NO" # Biba MAC policy From owner-svn-src-head@freebsd.org Sat Jul 25 20:17:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCB6F9AAB9B; Sat, 25 Jul 2015 20:17:22 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB2B7AEA; Sat, 25 Jul 2015 20:17:22 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6PKHMqL015599; Sat, 25 Jul 2015 20:17:22 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6PKHKFh015593; Sat, 25 Jul 2015 20:17:20 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201507252017.t6PKHKFh015593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Sat, 25 Jul 2015 20:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285883 - in head: share/man/man4 sys/dev/isl sys/modules/i2c sys/modules/i2c/isl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 20:17:22 -0000 Author: grembo (ports committer) Date: Sat Jul 25 20:17:19 2015 New Revision: 285883 URL: https://svnweb.freebsd.org/changeset/base/285883 Log: isl(4), driver for Intersil I2C ISL29018 Digital Ambient Light Sensor Differential Revision: https://reviews.freebsd.org/D2811 Reviewed by: adrian, wblock Approved by: adrian, wblock Relnotes: yes Added: head/share/man/man4/isl.4 (contents, props changed) head/sys/dev/isl/ head/sys/dev/isl/isl.c (contents, props changed) head/sys/dev/isl/isl.h (contents, props changed) head/sys/modules/i2c/isl/ head/sys/modules/i2c/isl/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/modules/i2c/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Jul 25 20:17:19 2015 (r285882) +++ head/share/man/man4/Makefile Sat Jul 25 20:17:19 2015 (r285883) @@ -216,6 +216,7 @@ MAN= aac.4 \ ipw.4 \ ipwfw.4 \ isci.4 \ + isl.4 \ ismt.4 \ isp.4 \ ispfw.4 \ Added: head/share/man/man4/isl.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/isl.4 Sat Jul 25 20:17:19 2015 (r285883) @@ -0,0 +1,104 @@ +.\" Copyright (c) 2015 Michael Gmelin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 25, 2015 +.Dt ISL 4 +.Os +.Sh NAME +.Nm isl +.Nd Intersil(TM) I2C ISL29018 sensor driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines into +the kernel configuration file: +.Bd -ragged -offset indent +.Cd "device isl" +.Cd "device ig4" +.Cd "device smbus" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +isl_load="YES" +ig4_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides access to sensor data provided by the Intersil(TM) I2C +ISL29018 Digital Ambient Light Sensor and Proximity Sensor with Interrupt +Function. +Functionality is basic and provided through the +.Xr sysctl 8 +interface. +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variables are available: +.Bl -tag -width "dev.isl.X.resolution" +.It Va dev.isl.X.als +Current ALS (Ambient Light Sensor) readout. +.It Va dev.isl.X.ir +Current IR (InfraRed) sensor readout. +.It Va dev.isl.X.prox +Current proximity sensor readout. +.It Va dev.isl.X.resolution +Current sensor resolution. +.It Va dev.isl.X.range +Current sensor range. +.El +.Sh EXAMPLES +.Ss Ambient light sensor read out +.Bd -literal +$ sysctl dev.isl.0.als +dev.isl.0.als: 64 +.Ed +.Ss Automatically adjust brightness +This requires the port +.Pa graphics/intel-backlight +and only works with laptops using a supported Intel(R) GPU. +.Bd -literal +$ pkg install intel-backlight +$ sh /usr/local/share/examples/intel-backlight/isl_backlight.sh +.Ed +.Sh SEE ALSO +.Xr ig4 4 , +.Xr smbus 4 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Michael Gmelin Aq Mt freebsd@grem.de . +.Pp +This manual page was written by +.An Michael Gmelin Aq Mt freebsd@grem.de . +.Sh BUGS +The +.Nm +driver detects the device based on its I2C address (0x44). +This might have unforeseen consequences if the initialization sequence +is sent to an unknown device at that address. Added: head/sys/dev/isl/isl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/isl/isl.c Sat Jul 25 20:17:19 2015 (r285883) @@ -0,0 +1,360 @@ +/*- + * Copyright (c) 2015 Michael Gmelin + * 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$"); + +/* + * Driver for intersil I2C ISL29018 Digital Ambient Light Sensor and Proximity + * Sensor with Interrupt Function, only tested connected over SMBus (ig4iic). + * + * Datasheet: + * http://www.intersil.com/en/products/optoelectronics/ambient-light-and-proximity-sensors/light-to-digital-sensors/ISL29018.html + * http://www.intersil.com/content/dam/Intersil/documents/isl2/isl29018.pdf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "smbus_if.h" +#include "bus_if.h" +#include "device_if.h" + +#define ISL_METHOD_ALS 0x10 +#define ISL_METHOD_IR 0x11 +#define ISL_METHOD_PROX 0x12 +#define ISL_METHOD_RESOLUTION 0x13 +#define ISL_METHOD_RANGE 0x14 + +struct isl_softc { + device_t dev; + int unit; + int addr; + + struct sx isl_sx; + struct sysctl_ctx_list *sysctl_ctx; + struct sysctl_oid *sysctl_tree; +}; + +/* Returns < 0 on problem. */ +static int isl_read_sensor(device_t dev, int addr, uint8_t cmd_mask); + +/* + * Initialize the device + */ +static +int +init_device(device_t dev, int addr, int probe) +{ + static char bl_init[] = { 0x00 }; + + device_t bus; + int error; + + bus = device_get_parent(dev); /* smbus */ + + /* + * init procedure: send 0x00 to test ref and cmd reg 1 + */ + error = smbus_trans(bus, addr, REG_TEST, + SMB_TRANS_NOCNT | SMB_TRANS_7BIT, + bl_init, sizeof(bl_init), NULL, 0, NULL); + if (error) + goto done; + + error = smbus_trans(bus, addr, REG_CMD1, + SMB_TRANS_NOCNT | SMB_TRANS_7BIT, + bl_init, sizeof(bl_init), NULL, 0, NULL); + if (error) + goto done; + + pause("islinit", hz/100); + +done: + if (error) + device_printf(dev, "Unable to initialize\n"); + return (error); +} + +static int isl_probe(device_t); +static int isl_attach(device_t); +static int isl_detach(device_t); + +static int isl_sysctl(SYSCTL_HANDLER_ARGS); + +static devclass_t isl_devclass; + +static device_method_t isl_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, isl_probe), + DEVMETHOD(device_attach, isl_attach), + DEVMETHOD(device_detach, isl_detach), + + DEVMETHOD_END +}; + +static driver_t isl_driver = { + "isl", + isl_methods, + sizeof(struct isl_softc), +}; + +static int +isl_probe(device_t dev) +{ + int unit; + int addr; + int error; + + addr = smbus_get_addr(dev); + + /* + * 0x44 - isl ambient light sensor on the acer c720. + * (other devices might use other ids). + */ + if (addr != 0x44) + return (ENXIO); + + unit = device_get_unit(dev); + + error = init_device(dev, addr, 1); + if (error) + return (ENXIO); + + device_set_desc(dev, "ISL Digital Ambient Light Sensor"); + + return (BUS_PROBE_VENDOR); +} + +static int +isl_attach(device_t dev) +{ + struct isl_softc *sc; + int unit; + int addr; + int use_als; + int use_ir; + int use_prox; + + sc = device_get_softc(dev); + + if (!sc) + return (ENOMEM); + + unit = device_get_unit(dev); + addr = *((unsigned char*) device_get_ivars(dev)); + + if (init_device(dev, addr, 0)) + return (ENXIO); + + sx_init(&sc->isl_sx, "ISL read lock"); + + sc->dev = dev; + sc->unit = unit; + sc->addr = addr; + + sc->sysctl_ctx = device_get_sysctl_ctx(dev); + sc->sysctl_tree = device_get_sysctl_tree(dev); + + use_als = isl_read_sensor(dev, addr, CMD1_MASK_ALS_ONCE) >= 0; + use_ir = isl_read_sensor(dev, addr, CMD1_MASK_IR_ONCE) >= 0; + use_prox = isl_read_sensor(dev, addr, CMD1_MASK_PROX_ONCE) >= 0; + + if (use_als) { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + "als", CTLTYPE_INT | CTLFLAG_RD, + sc, ISL_METHOD_ALS, isl_sysctl, "I", + "Current ALS sensor read-out"); + } + + if (use_ir) { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + "ir", CTLTYPE_INT | CTLFLAG_RD, + sc, ISL_METHOD_IR, isl_sysctl, "I", + "Current IR sensor read-out"); + } + + if (use_prox) { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + "prox", CTLTYPE_INT | CTLFLAG_RD, + sc, ISL_METHOD_PROX, isl_sysctl, "I", + "Current proximity sensor read-out"); + } + + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + "resolution", CTLTYPE_INT | CTLFLAG_RD, + sc, ISL_METHOD_RESOLUTION, isl_sysctl, "I", + "Current proximity sensor resolution"); + + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + "range", CTLTYPE_INT | CTLFLAG_RD, + sc, ISL_METHOD_RANGE, isl_sysctl, "I", + "Current proximity sensor range"); + + return (0); +} + +static int +isl_detach(device_t dev) +{ + struct isl_softc *sc; + + sc = device_get_softc(dev); + sx_destroy(&sc->isl_sx); + + return (0); +} + +static int +isl_sysctl(SYSCTL_HANDLER_ARGS) +{ + static int resolutions[] = { 16, 12, 8, 4}; + static int ranges[] = { 1000, 4000, 16000, 64000}; + + struct isl_softc *sc; + device_t bus; + uint8_t rbyte; + int arg; + int resolution; + int range; + + sc = (struct isl_softc *)oidp->oid_arg1; + arg = -1; + + sx_xlock(&sc->isl_sx); + bus = device_get_parent(sc->dev); /* smbus */ + if (smbus_trans(bus, sc->addr, REG_CMD2, + SMB_TRANS_NOCNT | SMB_TRANS_7BIT, + NULL, 0, &rbyte, sizeof(rbyte), NULL)) { + sx_xunlock(&sc->isl_sx); + return (-1); + } + resolution = resolutions[(rbyte & CMD2_MASK_RESOLUTION) + >> CMD2_SHIFT_RESOLUTION]; + range = ranges[(rbyte & CMD2_MASK_RANGE) >> CMD2_SHIFT_RANGE]; + + switch (oidp->oid_arg2) { + case ISL_METHOD_ALS: + arg = (isl_read_sensor(sc->dev, sc->addr, + CMD1_MASK_ALS_ONCE) * range) >> resolution; + break; + case ISL_METHOD_IR: + arg = isl_read_sensor(sc->dev, sc->addr, + CMD1_MASK_IR_ONCE); + break; + case ISL_METHOD_PROX: + arg = isl_read_sensor(sc->dev, sc->addr, + CMD1_MASK_PROX_ONCE); + break; + case ISL_METHOD_RESOLUTION: + arg = (1 << resolution); + break; + case ISL_METHOD_RANGE: + arg = range; + break; + } + sx_xunlock(&sc->isl_sx); + + SYSCTL_OUT(req, &arg, sizeof(arg)); + return (0); +} + +static int isl_read_sensor(device_t dev, int addr, uint8_t cmd_mask) +{ + device_t bus; + uint8_t rbyte; + uint8_t cmd; + int ret; + + bus = device_get_parent(dev); /* smbus */ + + if (smbus_trans(bus, addr, REG_CMD1, + SMB_TRANS_NOCNT | SMB_TRANS_7BIT, + NULL, 0, &rbyte, sizeof(rbyte), NULL)) { + device_printf(dev, + "Couldn't read first byte before issuing command %d\n", + cmd_mask); + return (-1); + } + + cmd = (rbyte & 0x1f) | cmd_mask; + if (smbus_trans(bus, addr, REG_CMD1, + SMB_TRANS_NOCNT | SMB_TRANS_7BIT, + &cmd, sizeof(cmd), NULL, 0, NULL)) { + device_printf(dev, "Couldn't write command %d\n", cmd_mask); + return (-1); + } + + pause("islconv", hz/10); + + if (smbus_trans(bus, addr, REG_DATA1, + SMB_TRANS_NOCNT | SMB_TRANS_7BIT, + NULL, 0, &rbyte, sizeof(rbyte), NULL)) { + device_printf(dev, + "Couldn't read first byte after command %d\n", cmd_mask); + return (-1); + } + + ret = rbyte; + if (smbus_trans(bus, addr, REG_DATA2, + SMB_TRANS_NOCNT | SMB_TRANS_7BIT, + NULL, 0, &rbyte, sizeof(rbyte), NULL)) { + device_printf(dev, "Couldn't read second byte after command %d\n", cmd_mask); + return (-1); + } + ret += rbyte << 8; + + return (ret); +} + +DRIVER_MODULE(isl, smbus, isl_driver, isl_devclass, NULL, NULL); +MODULE_DEPEND(isl, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); +MODULE_VERSION(isl, 1); Added: head/sys/dev/isl/isl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/isl/isl.h Sat Jul 25 20:17:19 2015 (r285883) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2015 Michael Gmelin + * 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 _ISL_H_ +#define _ISL_H_ + +/* Command register 1 (bits 7-5) */ +#define REG_CMD1 0x00 +#define CMD1_MASK_POWER_DOWN 0x00 /* 00000000 */ +#define CMD1_MASK_ALS_ONCE 0x01 << 5 /* 00100000 */ +#define CMD1_MASK_IR_ONCE 0x02 << 5 /* 01000000 */ +#define CMD1_MASK_PROX_ONCE 0x03 << 5 /* 01100000 */ +/* RESERVED */ /* 10000000 */ +#define CMD1_MASK_ALS_CONT 0x05 << 5 /* 10100000 */ +#define CMD1_MASK_IR_CONT 0x06 << 5 /* 11000000 */ +#define CMD1_MASK_PROX_CONT 0x07 << 5 /* 11100000 */ + +/* Command register 2 (bits) */ +#define REG_CMD2 0x01 + +/* data registers */ +#define REG_DATA1 0x02 +#define REG_DATA2 0x03 +#define CMD2_SHIFT_RANGE 0x00 +#define CMD2_MASK_RANGE (0x03 << CMD2_SHIFT_RANGE) +#define CMD2_SHIFT_RESOLUTION 0x02 +#define CMD2_MASK_RESOLUTION (0x03 << CMD2_SHIFT_RESOLUTION) + +/* Interrupt registers */ +#define REG_INT_LO_LSB 0x04 +#define REG_INT_LO_MSB 0x05 +#define REG_INT_HI_LSB 0x06 +#define REG_INT_HI_MSB 0x07 + +/* Test register (should hold 0x00 at all times */ +#define REG_TEST 0x08 + +#endif Modified: head/sys/modules/i2c/Makefile ============================================================================== --- head/sys/modules/i2c/Makefile Sat Jul 25 20:17:19 2015 (r285882) +++ head/sys/modules/i2c/Makefile Sat Jul 25 20:17:19 2015 (r285883) @@ -1,6 +1,6 @@ # $FreeBSD$ SUBDIR = -SUBDIR += controllers if_ic smbus iicbus iicbb iicsmb iic cyapa smb +SUBDIR += controllers if_ic smbus iicbus iicbb iicsmb iic cyapa smb isl .include Added: head/sys/modules/i2c/isl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/i2c/isl/Makefile Sat Jul 25 20:17:19 2015 (r285883) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/isl +KMOD = isl +SRCS = isl.c device_if.h bus_if.h smbus_if.h vnode_if.h + +.include From owner-svn-src-head@freebsd.org Sat Jul 25 21:51:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E26C19ABA2A; Sat, 25 Jul 2015 21:51:35 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6827133E; Sat, 25 Jul 2015 21:51:35 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZJ7Lv-000Olr-3c; Sat, 25 Jul 2015 22:51:31 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <20150725174659.GW78154@funkthat.com> Date: Sat, 25 Jul 2015 22:51:25 +0100 Cc: src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Content-Transfer-Encoding: quoted-printable Message-Id: <481EBEBF-6CDF-4A61-A66C-A35A5933805D@FreeBSD.org> References: <20150724012519.GE78154@funkthat.com> <96EA33AB-7325-4DD2-83F4-B4FAF6F47CB5@yahoo.com> <20150725062651.GU78154@funkthat.com> <30C50677-D00A-46B3-AF7A-62FC299D409F@FreeBSD.org> <20150725174659.GW78154@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.2102) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 21:51:36 -0000 > On 25 Jul 2015, at 18:46, John-Mark Gurney wrote: >=20 > Mark R V Murray wrote this message on Sat, Jul 25, 2015 at 09:22 = +0100: >>> On 25 Jul 2015, at 07:26, John-Mark Gurney wrote: >>>=20 >>> Once you have enough useful bits in /dev/random, you can NEVER run = out >>> of useful bits from /dev/random... >>>=20 >>> [Well, not quite NEVER, but not for a few millennia.] >>=20 >> So is your position effectively anti-harvesting, or at least to turn >> off all harvesting after a certain time and never turn it on again? >=20 > No, I am not, I was just stating a fact of how CSPRNGs work that > people keep forgetting=E2=80=A6 I think you need to consider the attack/recovery practicalities as well as the theory. > I'm totally against massive collection that has minimal benefit, > but massive performance costs... I raised this issue in the review > and you still haven't disabled INODE collection, plus you admitted > that you hadn't done benchmarks on the uma case=E2=80=A6 Are you following my conversation with ScottL? I=E2=80=99ve agreed this. > It's way more important to have a good seed at first boot for your > rng when you generate long term ssh keys and the like than it is to > continually collecting high rate randomness from the system=E2=80=A6 And that is what the current setup achieves, or achieved. What I had set up was a high-rate collection to unlock the RNG, and the faster stuff was disabled at multi-user time. Unfortunately, even those remnants were too much for UMA, so they will be disabled more permanently. No worries - back to the design board! >> If so, we are pretty far apart philosophically. >>=20 >> DJB???s position is interesting, but I am far from persuaded by it. >=20 > What points are you not persuaded by? Are there any questions that > I could get answers for that would persuade you to change your > mind? The passage of time will do it, I think. I don=E2=80=99t see much overt support for this (I will look out for it), but crucially I=E2=80=99m not aware of a great deal agains it. Its just too, erm, individual right now. :-) > I'm not against continually collecting entropy, I just don't think it > needs to be high speed, or that frequent.. My suggestion is for a > thread to run every few seconds to grovel around collecting some > entropy, and adding it... Obviously low perf impact collection points > like the keyboard should remain as that continues to one of the best > sources (when active/available)=E2=80=A6 The position of the Fortuna authors is that harvesting should be fast enough to thwart attack, and attack is facilitated by reading. Thus a high-speed reader should be backed by a proportionally high-speed harvesting. For ScottL the randomness requirements are low-ish. For (say) a bank, they may be a lot higher, and I see no reason to deny them this if they have no high throughput requirements. M --=20 Mark R V Murray