]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMove all bluetooth related config files out of etc
brd [Tue, 21 Aug 2018 19:28:53 +0000 (19:28 +0000)]
Move all bluetooth related config files out of etc

This helps with pkgbase by switching to CONFS so they are properly tagged as
config files.

Approved by: will (mentor)
Differential Revision: https://reviews.freebsd.org/D16833

5 years agoFor CID 1394785, add a comment explaining that global->event_buf is
cy [Tue, 21 Aug 2018 19:17:35 +0000 (19:17 +0000)]
For CID 1394785, add a comment explaining that global->event_buf is
not really a char * but a struct rt_msghdr *.

MFC after: 3 days

5 years agoFUSE extattrs: fix issue when neither uio nor size were not passed to VOP_* (cosmetic...
fsu [Tue, 21 Aug 2018 18:50:29 +0000 (18:50 +0000)]
FUSE extattrs: fix issue when neither uio nor size were not passed to VOP_* (cosmetic only).

Reviewed by:    cem, pfg
MFC after:      2 weeks

Differential Revision: https://reviews.freebsd.org/D13737

5 years agoFUSE extattrs: fix issue when neither uio nor size were not passed to VOP_*.
fsu [Tue, 21 Aug 2018 18:39:47 +0000 (18:39 +0000)]
FUSE extattrs: fix issue when neither uio nor size were not passed to VOP_*.

The requested size was returned incorrectly in case uio == NULL from listextattr because the
nameprefix/name conversion was not applied.
Also, make a_size/uio returning logic more unified with other filesystems.

Reviewed by:    cem, pfg
MFC after:      2 weeks

Differential Revision: https://reviews.freebsd.org/D13528

5 years agoChange unused inodes counters behavior in the cylinder groups.
fsu [Tue, 21 Aug 2018 18:39:29 +0000 (18:39 +0000)]
Change unused inodes counters behavior in the cylinder groups.
Make it more close to native ext4 implementation to avoid fsck errors.

5 years agoFix directory blocks checksum updating logic.
fsu [Tue, 21 Aug 2018 18:39:02 +0000 (18:39 +0000)]
Fix directory blocks checksum updating logic.

Count dirent tail in the searchslot logic in case of directory block search.
Add htree root csum update function call in case of rename.

5 years agoRevert r337978: Rework rtld's TLS Variant I implementation to match r326794
brooks [Tue, 21 Aug 2018 18:22:12 +0000 (18:22 +0000)]
Revert r337978: Rework rtld's TLS Variant I implementation to match r326794

Michal Meloun reports that it breaks ctype (isspace()..) related
functions on armv7 so back out while we diagnose the issue.

Reported by: Michal Meloun <melounmichal@gmail.com>

5 years agoRemove 'imen' global variable from atpic(4).
jhb [Tue, 21 Aug 2018 17:13:51 +0000 (17:13 +0000)]
Remove 'imen' global variable from atpic(4).

In pre-SMPng, the global 'imen' was used to track mask state of the
hardware interrupts and was aligned to the masks used by spl*().
When the atpic code was converted to using the x86 interrupt source
abstraction, the global 'imen' was preserved by having each PIC
instance point to an invididual byte in the global 'imen' to hold its
8-bit interrupt mask.  The global 'imen' is no longer used for
anything however, so rather than storing pointers in 'struct atpic',
just store the individual 8-bit mask for each PIC as a char.

While here, convert the ATPIC macro to using C99 initializers.

Reviewed by: kib, imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16827

5 years agoMove ftpusers to libexec/ftpd/
brd [Tue, 21 Aug 2018 17:07:52 +0000 (17:07 +0000)]
Move ftpusers to libexec/ftpd/

Thsi helps with pkgbase by switching to CONFS so that ftpusers will be
properly tagged as a config file.

Approved by: will (mentor)
Differential Revision: https://reviews.freebsd.org/D16787

5 years agoMove all syslogd related configs to usr.sbin/syslogd/
brd [Tue, 21 Aug 2018 17:01:47 +0000 (17:01 +0000)]
Move all syslogd related configs to usr.sbin/syslogd/

This helps with pkgbase as it switches these to use CONFS which properly tags
them as config files.

Approved by: will (mentor)
Differential Revision: https://reviews.freebsd.org/D16783

5 years agoRelax the check added in 338096
arichardson [Tue, 21 Aug 2018 16:52:14 +0000 (16:52 +0000)]
Relax the check added in 338096

Checking for any include below ${SRCTOP}/sys is too strict and breaks
e.g. mkimg which includes sys/sys/disk. ABI issues will only be caused
by including headers in sys/sys since they might not match the host.

Approved By: jhb (mentor)
Suggested By: imp

5 years agoMove all devd related configs to sbin/devd/
brd [Tue, 21 Aug 2018 16:51:45 +0000 (16:51 +0000)]
Move all devd related configs to sbin/devd/

This helps with pkgbase as it switches these to using CONFS so they are
properly tagged as config files.

Approved by: will (mentor), imp
Differential Revision: https://reviews.freebsd.org/D16781

5 years agoEliminate kmem_malloc()'s unused arena parameter. (The arena parameter
alc [Tue, 21 Aug 2018 16:43:46 +0000 (16:43 +0000)]
Eliminate kmem_malloc()'s unused arena parameter.  (The arena parameter
became unused in FreeBSD 12.x as a side-effect of the NUMA-related
changes.)

Reviewed by: kib, markj
Discussed with: jeff, re@
Differential Revision: https://reviews.freebsd.org/D16825

5 years agoSet arc_kmem_cache_reap_retry_ms to 0 and make it configurable.
markj [Tue, 21 Aug 2018 16:37:37 +0000 (16:37 +0000)]
Set arc_kmem_cache_reap_retry_ms to 0 and make it configurable.

r329759 introduced this parameter, which controls the rate at which ZFS
UMA zones are drained when the ARC reclaim thread is shrinking the ARC.
The reclamation target is derived from the global free page count, and
arc_shrink() only frees buffers back to UMA, so the free page count is
not updated until the zones are drained.  Thus, back-to-back calls to
arc_shrink() within the arc_kmem_cache_reap_retry_ms interval do not
provide immediate feedback to the arc_reclaim control loop, so we may
free more of the ARC than needed to address a transient page shortage.

As we do not implement the asynchronous zone draining added in r329759,
disable the retry interval, restoring pre-r329759 behaviour.  That is,
we will drain the ZFS UMA zones before each attempt to shrink the ARC.

Reviewed by: mav
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoQuieten the svn (or svnlite) commands used to extract information from an
cperciva [Tue, 21 Aug 2018 15:30:47 +0000 (15:30 +0000)]
Quieten the svn (or svnlite) commands used to extract information from an
SVN checkout for placement into an EC2 AMI.  We only run these if there
is a .svn directory; but in the event that SVN was used to check out a
tree which is then exported over NFS, we were unnecessarily noisy.

Reported by: Andrey Fesenko
MFC after: 3 days
X-MFC-With: r336420, r336433, r336593, r336621,
r336622, r336624, r337394, r337401

5 years agominor grammar nit, to what? between them..
jmg [Tue, 21 Aug 2018 15:11:43 +0000 (15:11 +0000)]
minor grammar nit, to what?  between them..

5 years agoRemove unneccessary code, which also introduced a (very minor)
trasz [Tue, 21 Aug 2018 14:34:24 +0000 (14:34 +0000)]
Remove unneccessary code, which also introduced a (very minor)
race condition, due to a missing call to cfiscsi_target_release().

Discussed with: mav@
Tested by: Eugene M. Zheganin <emz at norma.perm.ru> (earlier version)
MFC after: 2 weeks
Sponsored by: playkey.net

5 years agoEnabling the IPPROTO_IPV6 level socket option IPV6_USE_MIN_MTU on a TCP
tuexen [Tue, 21 Aug 2018 14:12:30 +0000 (14:12 +0000)]
Enabling the IPPROTO_IPV6 level socket option IPV6_USE_MIN_MTU on a TCP
socket resulted in sending fragmented IPV6 packets.

This is fixes by reducing the MSS to the appropriate value. In addtion,
if the socket option is set before the handshake happens, announce this
MSS to the peer. This is not stricly required, but done since TCP
is conservative.

PR: 173444
Reviewed by: bz@, rrs@
MFC after: 1 month
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16796

5 years agoFix the inheritance of IPv6 level socket options on TCP sockets.
tuexen [Tue, 21 Aug 2018 14:07:36 +0000 (14:07 +0000)]
Fix the inheritance of IPv6 level socket options on TCP sockets.

This was broken for IPv6 listening socket, which are not IPV6_ONLY,
and the accepted TCP connection was using IPv4.

Reviewed by: bz@, rrs@
MFC after: 1 month
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16792

5 years agoAdd SOL_SOCKET level socket option with name SO_DOMAIN to get
tuexen [Tue, 21 Aug 2018 14:04:30 +0000 (14:04 +0000)]
Add SOL_SOCKET level socket option with name SO_DOMAIN to get
the domain of a socket.

This is helpful when testing and Solaris and Linux have the same
socket option using the same name.

Reviewed by: bcr@, rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16791

5 years agoWhitespace change.
tuexen [Tue, 21 Aug 2018 13:37:06 +0000 (13:37 +0000)]
Whitespace change.

5 years agoRefactor the SHUTDOWN_PENDING state handling.
tuexen [Tue, 21 Aug 2018 13:25:32 +0000 (13:25 +0000)]
Refactor the SHUTDOWN_PENDING state handling.

This is not a functional change but a preperation for the upcoming
DTrace support. It is necessary to change the state in one
logical operation, even if it involves clearing the sub state
SHUTDOWN_PENDING.

MFC after: 1 month

5 years ago- Add CSV output to gstat via -C flag.
araujo [Tue, 21 Aug 2018 11:22:49 +0000 (11:22 +0000)]
- Add CSV output to gstat via -C flag.

Add a -C option, similar to -B, that allows gstat to produce basic CSV output
with absolute timestamps (ISO 8601, nearly.) Multiple devices are handled by
way of a single-pivot CSV table with duplicated timestamps for each object
output.

Submitted by: Nick Principe <nap__ixsystems.com>
Reviewed by: myself, imp@, asomers (earlier verison), bcr (manpages)
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D16151

5 years agoDe-spl mly(4).
jhb [Tue, 21 Aug 2018 10:08:12 +0000 (10:08 +0000)]
De-spl mly(4).

The driver already has mutex locking and holds its per-softc lock across
calls to the one function that still used splcam().

5 years agoFix -DWITHOUT_AUTO_OBJ build of rescue after r338096
arichardson [Tue, 21 Aug 2018 09:35:56 +0000 (09:35 +0000)]
Fix -DWITHOUT_AUTO_OBJ build of rescue after r338096

Approved By: jhb (mentor)

5 years agoMake dnode definition uniform on !x86
mmacy [Tue, 21 Aug 2018 03:45:09 +0000 (03:45 +0000)]
Make dnode definition uniform on !x86

gcc4 requires -fms-extensions to accept anonymous union members

5 years agoMake epoch KBI consistent between INVARIANTS and non-INVARIANTS
mmacy [Tue, 21 Aug 2018 03:33:54 +0000 (03:33 +0000)]
Make epoch KBI consistent between INVARIANTS and non-INVARIANTS

move extra fields under EPOCH_TRACKER_DEBUG

Reported by: hps

5 years agoMFV r338092: ntp 4.2.8p12.
delphij [Tue, 21 Aug 2018 02:38:07 +0000 (02:38 +0000)]
MFV r338092: ntp 4.2.8p12.

Relnotes: yes

5 years agolibthr: minor spacing cleanup.
pfg [Tue, 21 Aug 2018 01:33:25 +0000 (01:33 +0000)]
libthr: minor spacing cleanup.

No functional change.

X-MFC with: r337992

5 years agoAdjust formatting of grep and zgrep manual pages.
0mp [Mon, 20 Aug 2018 22:23:59 +0000 (22:23 +0000)]
Adjust formatting of grep and zgrep manual pages.

grep(1) changes:
 - Pet mandoc & igor.
 - Stylize the text more with macros when appropriate.
 - Stylize equal signs in long options (e.g., "--color=auto") with
   the "Cm" macro as suggested by mdoc(7).
 - Add missing arguments to --exlude, --exclude-dir, --include and
   --include-dir.
 - Remove a duplicate entry for the --context flag.
 - Use a list in the EXAMPLES sections to make it easier to tell
   which paragraphs belong to which example.
 - Cross reference zgrep(1).

zgrep(1) changes:
 - Fix Nd.
 - Split synopsis into paragraphs for readability.
 - Cross reference bzip(1), grep(1) and xz(1).

Reviewed by: bcr
Approved by: mat (mentor)
Differential Revision: https://reviews.freebsd.org/D16779

5 years agoefidev.4: Improve formatting.
0mp [Mon, 20 Aug 2018 22:16:15 +0000 (22:16 +0000)]
efidev.4: Improve formatting.

- Move some information out of the SYNOPSIS section because it is formated
  in a broken way by mandoc(1) otherwise.
- Improve the formatting of the list of provided ioctls.
- Use "Fa" for struct fields.
- Pet mandoc and igor.
- Fix typos.

Reviewed by: kevans
Approved by: mat (mentor)
Differential Revision: https://reviews.freebsd.org/D16765

5 years agoconfig(8): Allow escape-quoted empty strings
kevans [Mon, 20 Aug 2018 22:08:03 +0000 (22:08 +0000)]
config(8): Allow escape-quoted empty strings

For use with things like BOOT_TAG=\"\" -- there are valid reasons to allow
empty strings, especially as these are usually being passed through as
options. The same argument could perhaps be made for the unquoted
variant in things like MODULES_OVERRIDE="", but it's not immediately clear
that this is an issue so I've left it untouched.

MFC after: 3 days

5 years agocxgbe/tom: Provide the hardware tid in tcp_info.
np [Mon, 20 Aug 2018 21:40:14 +0000 (21:40 +0000)]
cxgbe/tom: Provide the hardware tid in tcp_info.

Submitted by: marius@

5 years agoTRIM consolodation is supposed to be off by default
mckusick [Mon, 20 Aug 2018 21:19:21 +0000 (21:19 +0000)]
TRIM consolodation is supposed to be off by default

5 years agoFix incorrect output when printing block lists for files small enough
mckusick [Mon, 20 Aug 2018 20:44:11 +0000 (20:44 +0000)]
Fix incorrect output when printing block lists for files small enough
to fit in only direct blocks whose size is exactly a multiple of the
filesystem block size.

Reported by:  Peter Holm
Tested by:    Peter Holm
Sponsored by: Netflix

5 years agoMove options INTRNG into std.armv6 and std.armv7
imp [Mon, 20 Aug 2018 20:31:53 +0000 (20:31 +0000)]
Move options INTRNG into std.armv6 and std.armv7

INTRNG is required on all armv6 and armv7 systems, so make it
standard.

5 years agoGC inc_isipv6; it was added for "temp" compatibility in 2001, r86764
bz [Mon, 20 Aug 2018 20:06:36 +0000 (20:06 +0000)]
GC inc_isipv6; it was added for "temp" compatibility in 2001, r86764
and does not seem to be used.

5 years agomergemaster: better defaults for SOURCEDIR
imp [Mon, 20 Aug 2018 19:39:49 +0000 (19:39 +0000)]
mergemaster: better defaults for SOURCEDIR

If we can't find a Makefile.inc1 in the specified / default SOURCEDIR, and
there's a Makefile.inc1 in the current directory, offer the user the choice
of using . for SOURCEDIR.

Differential Revsion: https://reviews.freebsd.org/D16709

5 years agoUpdate comment about ABI of flush_l1s_sw to match the reality.
kib [Mon, 20 Aug 2018 19:09:39 +0000 (19:09 +0000)]
Update comment about ABI of flush_l1s_sw to match the reality.

CPUID instruction clobbers %rbx and %rdx.

Sponsored by: The FreeBSD Foundation
MFC after: 13 days

5 years agoAlways initialize PCPU kcr3 for vmspace0 pmap.
kib [Mon, 20 Aug 2018 19:07:57 +0000 (19:07 +0000)]
Always initialize PCPU kcr3 for vmspace0 pmap.

If an exception or NMI occurs before CPU switched to a pmap different
from vmspace0, PCPU kcr3 is left zero for pti config, which causes
triple-fault in the handler.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 years ago[ig4] add ACPI Device HID for AMD platforms
gonzo [Mon, 20 Aug 2018 18:50:56 +0000 (18:50 +0000)]
[ig4] add ACPI Device HID for AMD platforms

Added ACPI Device HID AMDI0010 for the designware I2C controllers in
future AMD platforms. Also, when verifying component version check for
minimal value instead of exact match.

PR: 230641
Submitted by: Rajesh <rajfbsd@gmail.com>
Reviewed by: cem, gonzo
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16670

5 years agoIn r324732 sysinstall was replaced by bsdinstall.
bhd [Mon, 20 Aug 2018 18:17:50 +0000 (18:17 +0000)]
In r324732 sysinstall was replaced by bsdinstall.
However, for post-install configuration, bsdinstall
is not of much use. Point the user to bsdconfig instead.

Reviewed by: 0mp, bcr
Approved by: 0mp, bcr
Differential Revision: https://reviews.freebsd.org/D16751

5 years agoSerial console menus for lua.
imp [Mon, 20 Aug 2018 16:44:09 +0000 (16:44 +0000)]
Serial console menus for lua.

Remove a bunch of special cases for UEFI and serial consoles.  We do
want to do curses and menu things here. This makes us match what we do
in FORTH, with the possible exception of boxes around menus.

Differential Revision:  https://reviews.freebsd.org/D16816

5 years agoEliminate kmem_alloc_contig()'s unused arena parameter.
alc [Mon, 20 Aug 2018 15:57:27 +0000 (15:57 +0000)]
Eliminate kmem_alloc_contig()'s unused arena parameter.

Reviewed by: hselasky, kib, markj
Discussed with: jeff
Differential Revision: https://reviews.freebsd.org/D16799

5 years agoRemove extra M_ZERO from NG_MKRESPONSE() argument.
mav [Mon, 20 Aug 2018 14:35:54 +0000 (14:35 +0000)]
Remove extra M_ZERO from NG_MKRESPONSE() argument.

NG_MKRESPONSE() sets M_ZERO by itself.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week

5 years agoiostat: update man page for r277566
will [Mon, 20 Aug 2018 13:42:22 +0000 (13:42 +0000)]
iostat: update man page for r277566

The original commit added granularity to the transaction latency display
in the extended device stats mode, but didn't update the man page.

Reported by: Miroslav Lachman <000.fbsd@quip.cz> via jmg
MFC after: 1 day

5 years agoThis change represents a substantial restructure of the way we
rrs [Mon, 20 Aug 2018 12:43:18 +0000 (12:43 +0000)]
This change represents a substantial restructure of the way we
reassembly inbound tcp segments. The old algorithm just blindly
dropped in segments without coalescing. This meant that every
segment could take up greater and greater room on the linked list
of segments. This of course is now subject to a tighter limit (100)
of segments which in a high BDP situation will cause us to be a
lot more in-efficent as we drop segments beyond 100 entries that
we receive. What this restructure does is cause the reassembly
buffer to coalesce segments putting an emphasis on the two
common cases (which avoid walking the list of segments) i.e.
where we add to the back of the queue of segments and where we
add to the front. We also have the reassembly buffer supporting
a couple of debug options (black box logging as well as counters
for code coverage). These are compiled out by default but can
be added by uncommenting the defines.

Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D16626

5 years agoMerge amd64 and i386 <machine/intr_machdep.h> headers.
jhb [Mon, 20 Aug 2018 12:31:39 +0000 (12:31 +0000)]
Merge amd64 and i386 <machine/intr_machdep.h> headers.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16803

5 years agoCreate a manual page for beinstall.sh.
0mp [Mon, 20 Aug 2018 11:05:36 +0000 (11:05 +0000)]
Create a manual page for beinstall.sh.

Reviewed by: bcr, brd, will
Approved by: krion (mentor)
Differential Revision: https://reviews.freebsd.org/D16742

5 years agoDon't rebuild ioctl.c and relink libsysdecode if there are no changes
arichardson [Mon, 20 Aug 2018 10:59:49 +0000 (10:59 +0000)]
Don't rebuild ioctl.c and relink libsysdecode if there are no changes

Instead generate a temporary file and only overwrite ioctl.c if the
files are actually different.

Approved By: jhb (mentor)

5 years agoDon't create directories in ${WORLDTMP}/legacy with mtree
arichardson [Mon, 20 Aug 2018 10:39:53 +0000 (10:39 +0000)]
Don't create directories in ${WORLDTMP}/legacy with mtree

This has two advantages:
1) We no longer create lots of empty directories that are not needed
2) This is a requirement for building on non-FreeBSD hosts since mtree will
only exist after the bootstrap-tools phase there.

Aproved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16773

5 years agoAllow bootstrapping libmd on MacOS
arichardson [Mon, 20 Aug 2018 10:39:48 +0000 (10:39 +0000)]
Allow bootstrapping libmd on MacOS

The assembly files use directives that only work for ELF targets so skip
them when bootstrapping on MacOS.

Reviewed By: imp
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D14247

5 years agoAvoid depending on system headers from the source tree during bootstrap
arichardson [Mon, 20 Aug 2018 10:39:42 +0000 (10:39 +0000)]
Avoid depending on system headers from the source tree during bootstrap

This can cause surprising errors if the build tools is built against
headers that don't match the host system. It is also required in order
to allow building on non-FreeBSD systems where the headers in
/usr/include/sys are usually completely incompatible with those in the
source tree.

I added an error to Makefile.boot if this is done and found this was
only the case in libnv. With this error in the Makefile ABI breakages
such as r336019 should no longer be possible.

Reviewed By: bdrewery, kevans
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16186

5 years agoMake mkioctls script work on Linux and MacOS
arichardson [Mon, 20 Aug 2018 10:39:37 +0000 (10:39 +0000)]
Make mkioctls script work on Linux and MacOS

Using find -s  will not work with the Linux or MacOS find command. We pipe
to sort instead since the only real requirement here is that the order
stays the same. While I am touching this file I also fixed a `==` construct
which is not supported by POSIX sh but appears to work on FreeBSD.

Reviewed By: imp
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D14246

5 years agoFully retire the unimplemented -t option from vmstat(8).
jhb [Mon, 20 Aug 2018 09:29:21 +0000 (09:29 +0000)]
Fully retire the unimplemented -t option from vmstat(8).

It was #ifdef'd out in the 4.4BSD import and hasn't been re-enabled
since then.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16804

5 years agoNVMe spec version 1.3c says that "serial number" field must be 7-bit ASCII,
araujo [Mon, 20 Aug 2018 04:56:37 +0000 (04:56 +0000)]
NVMe spec version 1.3c says that "serial number" field must be 7-bit ASCII,
with unused bytes padded by space characters. Same for firmware number and
namespace number.

Discussed with: imp@
Sponsored by: iXsystems Inc.

5 years agoUsers must set the number of queues from 1 to maximum 16 queues.
araujo [Mon, 20 Aug 2018 04:50:11 +0000 (04:50 +0000)]
Users must set the number of queues from 1 to maximum 16 queues.

Sponsored by: iXsystems Inc.

5 years agoFix double mutex lock.
araujo [Mon, 20 Aug 2018 04:44:29 +0000 (04:44 +0000)]
Fix double mutex lock.

Reported by: Coverity
CID: 1394833
Discussed with: Leon Dang
Sponsored by: iXsystems Inc.

5 years agolualoader: Install all manpages
kevans [Mon, 20 Aug 2018 02:40:10 +0000 (02:40 +0000)]
lualoader: Install all manpages

Now that a complete set is written, save for one describing loader.lua,
install all of them. This was not previously done as they were written to
hopefully avoid confusion as bits and pieces of the overall system were
undocumented.

5 years agoAdd color.lua(8), password.lua(8), and screen.lua(8)
kevans [Mon, 20 Aug 2018 02:37:24 +0000 (02:37 +0000)]
Add color.lua(8), password.lua(8), and screen.lua(8)

5 years agoIn r331279 the code used ENOSYS to check the existence of getrandom(2).
delphij [Mon, 20 Aug 2018 02:17:55 +0000 (02:17 +0000)]
In r331279 the code used ENOSYS to check the existence of getrandom(2).
This will only work if the caller already handles SIGSYS, which is not
always the case.

Address this by checking osreldate instead. Note that because there
was not __FreeBSD_version bump when the system call was added, use
1200061 (r332100) which is the first bump after the introduction of
the system call.

PR: 230762
Reported by: Jenkins via Mark Millard
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D16807

5 years agoAdd drawer.lua(8)
kevans [Mon, 20 Aug 2018 02:08:39 +0000 (02:08 +0000)]
Add drawer.lua(8)

5 years agouse sbuf so that lines are printed together... As aarch64 often
jmg [Sun, 19 Aug 2018 21:37:51 +0000 (21:37 +0000)]
use sbuf so that lines are printed together...  As aarch64 often
has SMP enabled, lines can get intermixed with other console output
making these lines hard to read...

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D16689

5 years agoadd snps IP uart support / genaralize UART
mmacy [Sun, 19 Aug 2018 21:10:21 +0000 (21:10 +0000)]
add snps IP uart support / genaralize UART

This is an amalgam of a patch by Doug Ambrisko to
generalize uart_acpi_find_device, imp moving the
ACPI table to uart_dev_ns8250.c and advice by jhb
to work around a bug in the EPYC 3151 BIOS
(the BIOS incorrectly marks the serial ports as
disabled)

Reviewed by: imp
MFC after: 8 weeks
Differential Revision: https://reviews.freebsd.org/D16432

5 years agopowerpc conf: Add PRINTF_BUFR_SIZE option to Book-E configs
jhibbits [Sun, 19 Aug 2018 19:07:59 +0000 (19:07 +0000)]
powerpc conf: Add PRINTF_BUFR_SIZE option to Book-E configs

Without this, printf is very hard to follow at times on multicore systems.

5 years agoSort SPR_SPEFSCR in the SPR list
jhibbits [Sun, 19 Aug 2018 19:03:43 +0000 (19:03 +0000)]
Sort SPR_SPEFSCR in the SPR list

Also remove duplicate definition of SPR_IBAT0U.

5 years agopowerpc64: Align frequently used/exclusive data on cacheline boundaries
jhibbits [Sun, 19 Aug 2018 19:00:44 +0000 (19:00 +0000)]
powerpc64: Align frequently used/exclusive data on cacheline boundaries

This is effectively a merge from amd64 of r312888, r323235, and r333486.

I've been running this on my POWER9 Talos for some time now with no ill
effects.

Suggested by: mjg

5 years agoarm64: allwinner: Add aw_syscon driver to GENERIC
manu [Sun, 19 Aug 2018 18:55:33 +0000 (18:55 +0000)]
arm64: allwinner: Add aw_syscon driver to GENERIC

Recent DTS use the syscon for the emac controller.
We support this but since U-Boot is still using old DTS it was never
needed for us to add this support, but this is a problem when using upstream
recent DTS and will be when U-Boot will catch up.

While here add a new compatible to the aw_syscon driver as Linux changed it ...

5 years agobooke pmap: hide debug-ish printf behind bootverbose
jhibbits [Sun, 19 Aug 2018 18:54:43 +0000 (18:54 +0000)]
booke pmap: hide debug-ish printf behind bootverbose

It's not necessary during normal operation to know the mapped region size
and wasted space.

5 years agoUpdate L1TF workaround to sustain L1D pollution from NMI.
kib [Sun, 19 Aug 2018 18:47:16 +0000 (18:47 +0000)]
Update L1TF workaround to sustain L1D pollution from NMI.

Current mitigation for L1TF in bhyve flushes L1D either by an explicit
WRMSR command, or by software reading enough uninteresting data to
fully populate all lines of L1D.  If NMI occurs after either of
methods is completed, but before VM entry, L1D becomes polluted with
the cache lines touched by NMI handlers.  There is no interesting data
which NMI accesses, but something sensitive might be co-located on the
same cache line, and then L1TF exposes that to a rogue guest.

Use VM entry MSR load list to ensure atomicity of L1D cache and VM
entry if updated microcode was loaded.  If only software flush method
is available, try to help the bhyve sw flusher by also flushing L1D on
NMI exit to kernel mode.

Suggested by and discussed with: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D16790

5 years agolualoader: Add drawer-exported variables for default logodefs
kevans [Sun, 19 Aug 2018 18:43:10 +0000 (18:43 +0000)]
lualoader: Add drawer-exported variables for default logodefs

Uncovered while writing the documentation from this, we previously
explicitly fell back to orb or orbbw if an invalid or incompatible logodef
was selected -- in contrast to branddefs, which have an exported variable
that one can whip up a quick local.lua to override in a safe manner that
works regardless of whether or not loader.conf(5) successfully loads.

5 years agolualoader: Hide the rest of the private interfaces
kevans [Sun, 19 Aug 2018 18:37:33 +0000 (18:37 +0000)]
lualoader: Hide the rest of the private interfaces

These are less controversial than the others, thus done in a separate
commit. These are all used internally and ways to override are provided via
soon-to-be-documented API or loader.conf(5) variables.

5 years agolualoader: Hide most of the internal drawing functions
kevans [Sun, 19 Aug 2018 18:22:01 +0000 (18:22 +0000)]
lualoader: Hide most of the internal drawing functions

Ideally, all of the functionality to revamp the loader screen has associated
APIs that are flexible enough that third-party scripts wouldn't need to
override these.

5 years agoTurn back the clock just a little: make userboot.so always be 4th
imp [Sun, 19 Aug 2018 18:18:19 +0000 (18:18 +0000)]
Turn back the clock just a little: make userboot.so always be 4th

Turns out there was a hidden dependency we hasn't counted upon.  The
host load /boot/userboot.so to boot the VMs it runs. This means that
the change to lua meant suddently that nobody could run their older
VMs because LUA wasn't in 10.0, last month's HardenedBSD, 11.2 or
whatever.  Even more than for the /boot/loader* binaries, we need a
good coexistance strategy for this. While that's being designed and
implemented, drop back to always 4th for userboot.so. This will fail
safe in all but the most extreme environments (but lua-only hacks
to .lua files won't be processes in VMs until we fix it).

Differential Review: https://reviews.freebsd.org/D16805

5 years agolualoader: Stop exporting drawer.draw
kevans [Sun, 19 Aug 2018 18:12:11 +0000 (18:12 +0000)]
lualoader: Stop exporting drawer.draw

drawer.draw is the back-end for drawlogo and drawbrand and should not be
used directly.

5 years agoFix a couple of comment nits.
jhb [Sun, 19 Aug 2018 17:57:51 +0000 (17:57 +0000)]
Fix a couple of comment nits.

5 years agoBump __FreeBSD_version after r338059 (Chacha20 based arc4random(3)
delphij [Sun, 19 Aug 2018 17:47:30 +0000 (17:47 +0000)]
Bump __FreeBSD_version after r338059 (Chacha20 based arc4random(3)
and deprecation of arc4random_stir and arc4random_addrandom).

5 years agoDocument socket control message routines for ancillary data access (CMSG_DATA).
0mp [Sun, 19 Aug 2018 17:42:49 +0000 (17:42 +0000)]
Document socket control message routines for ancillary data access (CMSG_DATA).

PR: 227777
Reviewed by: bcr, eadler
Approved by: mat (mentor), manpages (bcr)
Obtained from: OpenBSD
Differential Revision: https://reviews.freebsd.org/D15215

5 years agoUpdate userland arc4random() with OpenBSD's Chacha20 based arc4random().
delphij [Sun, 19 Aug 2018 17:40:50 +0000 (17:40 +0000)]
Update userland arc4random() with OpenBSD's Chacha20 based arc4random().

  ObsoleteFiles.inc:

    Remove manual pages for arc4random_addrandom(3) and
    arc4random_stir(3).

  contrib/ntp/lib/isc/random.c:
  contrib/ntp/sntp/libevent/evutil_rand.c:

    Eliminate in-tree usage of arc4random_addrandom().

  crypto/heimdal/lib/roken/rand.c:
  crypto/openssh/config.h:

    Eliminate in-tree usage of arc4random_stir().

  include/stdlib.h:

    Remove arc4random_stir() and arc4random_addrandom() prototypes,
    provide temporary shims for transistion period.

  lib/libc/gen/Makefile.inc:

    Hook arc4random-compat.c to build, add hint for Chacha20 source for
    kernel, and remove arc4random_addrandom(3) and arc4random_stir(3)
    links.

  lib/libc/gen/arc4random.c:

    Adopt OpenBSD arc4random.c,v 1.54 with bare minimum changes, use the
    sys/crypto/chacha20 implementation of keystream.

  lib/libc/gen/Symbol.map:

    Remove arc4random_stir and arc4random_addrandom interfaces.

  lib/libc/gen/arc4random.h:

    Adopt OpenBSD arc4random.h,v 1.4 but provide _ARC4_LOCK of our own.

  lib/libc/gen/arc4random.3:

    Adopt OpenBSD arc4random.3,v 1.35 but keep FreeBSD r114444 and
    r118247.

  lib/libc/gen/arc4random-compat.c:

    Compatibility shims for arc4random_stir and arc4random_addrandom
    functions to preserve ABI.  Log once when called but do nothing
    otherwise.

  lib/libc/gen/getentropy.c:
  lib/libc/include/libc_private.h:

    Fold __arc4_sysctl into getentropy.c (renamed to arnd_sysctl).
    Remove from libc_private.h as a result.

  sys/crypto/chacha20/chacha.c:
  sys/crypto/chacha20/chacha.h:

    Make it possible to use the kernel implementation in libc.

PR: 182610
Reviewed by: cem, markm
Obtained from: OpenBSD
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16760

5 years agoFix the MPTable probe code after the 4:4 changes on i386.
jhb [Sun, 19 Aug 2018 17:36:50 +0000 (17:36 +0000)]
Fix the MPTable probe code after the 4:4 changes on i386.

The MPTable probe code was using PMAP_MAP_LOW as the PA -> VA offset
when searching for the table signature but still using KERNBASE once
it had found the table.  As a result, the mpfps table pointed into a
random part of the kernel text instead of the actual MP Table.

Rather than adding more #ifdef's, use BIOS_PADDRTOVADDR from
<machine/pc/bios.h> which already uses PMAP_MAP_LOW on i386 and KERNBASE
on amd64.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16802

5 years agoFor traditional disks, the filesystem attempts to allocate the
mckusick [Sun, 19 Aug 2018 17:19:20 +0000 (17:19 +0000)]
For traditional disks, the filesystem attempts to allocate the
blocks of a file as contiguously as possible. Since the filesystem
does not know how large a file will grow when it is first being
written, it initially places the file in a set of blocks in which
it currently fits. As it grows, it is relocated to areas with
larger contiguous blocks.  In this way it saves its large contiguous
sets of blocks for the files that need them and thus avoids
unnecessaily fragmenting its disk space.

We used to skip reallocating the blocks of a file into a contiguous
sequence if the underlying flash device requested BIO_DELETE
notifications, because devices that benefit from BIO_DELETE also
benefit from not moving the data. However, in the algorithm described
above that reallocates the blocks, the destination for the data is
usually moved before the data is written to the initially allocated
location. So we rarely suffer the penalty of extra writes.  With
the addition of the consolodation of contiguous blocks into single
BIO_DELETE operations, having fewer but larger contiguous blocks
reduces the number of (slow and expensive) BIO_DELETE operations.
So when doing BIO_DELETE consolodation, we do block reallocation.

Reviewed by:  kib
Tested by:    Peter Holm
Sponsored by: Netflix

5 years agoAdd consolodation of TRIM / BIO_DELETE commands to the UFS/FFS filesystem.
mckusick [Sun, 19 Aug 2018 16:56:42 +0000 (16:56 +0000)]
Add consolodation of TRIM / BIO_DELETE commands to the UFS/FFS filesystem.

When deleting files on filesystems that are stored on flash-memory
(solid-state) disk drives, the filesystem notifies the underlying
disk of the blocks that it is no longer using. The notification
allows the drive to avoid saving these blocks when it needs to
flash (zero out) one of its flash pages. These notifications of
no-longer-being-used blocks are referred to as TRIM notifications.
In FreeBSD these TRIM notifications are sent from the filesystem
to the drive using the BIO_DELETE command.

Until now, the filesystem would send a separate message to the drive
for each block of the file that was deleted. Each Gigabyte of file
size resulted in over 3000 TRIM messages being sent to the drive.
This burst of messages can overwhelm the drive's task queue causing
multiple second delays for read and write requests.

This implementation collects runs of contiguous blocks in the file
and then consolodates them into a single BIO_DELETE command to the
drive. The BIO_DELETE command describes the run of blocks as a
single large block being deleted. Each Gigabyte of file size can
result in as few as two BIO_DELETE commands and is typically less
than ten.  Though these larger BIO_DELETE commands take longer to
run, they do not clog the drive task queue, so read and write
commands can intersperse effectively with them.

Though this new feature has been throughly reviewed and tested, it
is being added disabled by default so as to minimize the possibility
of disrupting the upcoming 12.0 release. It can be enabled by running
``sysctl vfs.ffs.dotrimcons=1''. Users are encouraged to test it.
If no problems arise, we will consider requesting that it be enabled
by default for 12.0.

Reviewed by:  kib
Tested by:    Peter Holm
Sponsored by: Netflix

5 years agoRemove some vestiges of IPI_LAZYPMAP on i386.
jhb [Sun, 19 Aug 2018 16:14:59 +0000 (16:14 +0000)]
Remove some vestiges of IPI_LAZYPMAP on i386.

The support for lazy pmap invalidations on i386 was removed in r281707.
This removes the constant for the IPI and stops accounting for it when
sizing the interrupt count arrays.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16801

5 years agoAdd config.lua(8) to the tree
kevans [Sun, 19 Aug 2018 15:07:39 +0000 (15:07 +0000)]
Add config.lua(8) to the tree

Reviewed by: 0mp, rpokala (earlier version)
Differential Revision: https://reviews.freebsd.org/D14819

5 years agoDon't expose the uptime via the TCP timestamps.
tuexen [Sun, 19 Aug 2018 14:56:10 +0000 (14:56 +0000)]
Don't expose the uptime via the TCP timestamps.

The TCP client side or the TCP server side when not using SYN-cookies
used the uptime as the TCP timestamp value. This patch uses in all
cases an offset, which is the result of a keyed hash function taking
the source and destination addresses and port numbers into account.
The keyed hash function is the same a used for the initial TSN.

Reviewed by: rrs@
MFC after: 1 month
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16636

5 years agolibsa: Add lshrdi3.c for powerpc* and mips
kevans [Sun, 19 Aug 2018 14:48:32 +0000 (14:48 +0000)]
libsa: Add lshrdi3.c for powerpc* and mips

5 years agoProvide set_constraint_handler_s(3) man page.
kib [Sun, 19 Aug 2018 14:39:57 +0000 (14:39 +0000)]
Provide set_constraint_handler_s(3) man page.

Mention abort_handler_s(3) and ignore_handler_s(3), provide
cross-reference from memset(3).

Submitted by: Yuri Pankov <yuripv@yuripv.net>
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D16797

5 years agostand: Flip the default interpreter to Lua
kevans [Sun, 19 Aug 2018 14:26:33 +0000 (14:26 +0000)]
stand: Flip the default interpreter to Lua

After years in the making, lualoader is ready to make its debut. Both
flavors of loader are still built by default, and may be installed as
/boot/loader or /boot/loader.efi as appropriate either by manually creating
hard links or using LOADER_DEFAULT_INTERP as documented in build(7).

Discussed with: imp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16795

5 years agoClarify that memset_s(3) requires __STDC_WANT_LIB_EXT1__ for visibility.
kib [Sun, 19 Aug 2018 14:25:28 +0000 (14:25 +0000)]
Clarify that memset_s(3) requires __STDC_WANT_LIB_EXT1__ for visibility.
Fix typos and other nits.

Submitted by: Yuri Pankov <yuripv@yuripv.net>
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D16797

5 years agoUse tab for indent.
kib [Sun, 19 Aug 2018 14:22:45 +0000 (14:22 +0000)]
Use tab for indent.

Submitted by: Yuri Pankov <yuripv@yuripv.net>
MFC after: 3 days

5 years agoThe bucket index is subtracted by one at lines 2304 and 2314. When 0 it
cy [Sun, 19 Aug 2018 13:45:03 +0000 (13:45 +0000)]
The bucket index is subtracted by one at lines 2304 and 2314.  When 0 it
becomes -1, except these are unsigned integers, so they become very large
numbers. Thus are always larger than the maximum bucket; the hash table
insertion fails causing NAT to fail.

This commit ensures that if the index is already zero it is not reduced
prior to insertion into the hash table.

PR: 208566

5 years agoAdd handy DTrace probes useful in diagnosing NAT issues. DTrace probes
cy [Sun, 19 Aug 2018 13:44:59 +0000 (13:44 +0000)]
Add handy DTrace probes useful in diagnosing NAT issues. DTrace probes
are situated next to error counters and/or in one instance prior to the
-1 return from various functions. This was useful in diagnosis of
PR/208566 and will be handy in the future diagnosing NAT failures.

PR: 208566
MFC after: 3 days

5 years agoExpose np (nat_t - an entry in the nat table structure) in the DTrace
cy [Sun, 19 Aug 2018 13:44:56 +0000 (13:44 +0000)]
Expose np (nat_t - an entry in the nat table structure) in the DTrace
probe when nat fails (label badnat). This is useful in diagnosing
failed NAT issues and was used in PR/208566.

PR: 208566
MFC after: 3 days

5 years agoFix typo.
kib [Sun, 19 Aug 2018 13:23:46 +0000 (13:23 +0000)]
Fix typo.

Noted by: Yuri Pankov <yuripv@yuripv.net>
MFC after: 12 days

5 years agoDocument LOADER_DEFAULT_INTERP.
imp [Sun, 19 Aug 2018 10:15:28 +0000 (10:15 +0000)]
Document LOADER_DEFAULT_INTERP.

This controls what interpreter the default boot loader in
/boot/loader{,.efi} is, and which one we compile into userboot by
default.

5 years agosend-pr: wave goodbye
eadler [Sun, 19 Aug 2018 07:12:35 +0000 (07:12 +0000)]
send-pr: wave goodbye

Entering into the world of 12.x we no longer need even the placeholder
for send-pr. It has not done anything for some time.

With Hat: bugmeister

5 years agobuild: remove reference to some dead utilities
eadler [Sun, 19 Aug 2018 07:05:33 +0000 (07:05 +0000)]
build: remove reference to some dead utilities

5 years agodiff(1): Refactor -B a little bit
kevans [Sun, 19 Aug 2018 04:15:38 +0000 (04:15 +0000)]
diff(1): Refactor -B a little bit

Instead of doing a second pass to skip empty lines if we've specified -I, go
ahead and check both at once. Ignore critera has been split out into its own
function to try and keep the logic cleaner.

5 years agodiff(1): Implement -B/--ignore-blank-lines
kevans [Sun, 19 Aug 2018 03:57:20 +0000 (03:57 +0000)]
diff(1): Implement -B/--ignore-blank-lines

As noted by cem in r338035, coccinelle invokes diff(1) with the -B flag.
This was not previously implemented here, so one was forced to create a link
for GNU diff to /usr/local/bin/diff

Implement the -B flag and add some primitive tests for it. It is implemented
in the same fashion that -I is implemented; each chunk's lines are scanned,
and if a non-blank line is encountered then the chunk will be output.
Otherwise, it's skipped.

MFC after: 2 weeks

5 years agoExtending the delay cycles to give the codec more time to pump ADC data across the...
avatar [Sun, 19 Aug 2018 01:14:46 +0000 (01:14 +0000)]
Extending the delay cycles to give the codec more time to pump ADC data across the AC-link.

Without this patch, some CS4614 cards will need users to reload the driver manually or
the hardware won't be initialised properly. Something like:

# kldload snd_csa
# kldunload snd_csa
# kldload snd_csa

Tested with: Terratec SiXPack 5.1+