]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoDisable optimization of the libproc test program.
markj [Sat, 21 Jul 2018 22:10:28 +0000 (22:10 +0000)]
Disable optimization of the libproc test program.

Dead code elimination may remove symbols that are required by the tests.

Reported by: Jenkins, via asomers
MFC after: 1 week

6 years agoStop further SCSI recovery attempts after one has failed.
mav [Sat, 21 Jul 2018 21:34:10 +0000 (21:34 +0000)]
Stop further SCSI recovery attempts after one has failed.

We've got a set of probably damaged hard disks, reporting 0x04,0x02
("Logical unit not ready, initializing command required") in response
to READ CAPACITY(16), where attempts to use START STOP UNIT for recovery
results in 0x44,0x00 ("Internal target failure") after ~1 second delay.
As result of all recovery retries, device open attempt took ~3 seconds
before finally reporting to GEOM that device is opened, but has no media.
If the open was for writing and since it hasn't formally failed, following
close triggered GEOM retaste, opening device few more times with respective
delays.

This change reduces whole time of this cycle from ~12 seconds to ~3 by
giving up on recovery after the first failure.

Reviewed by: ken
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

6 years agoEliminate a comment that doesn't apply to this pmap implementation.
alc [Sat, 21 Jul 2018 21:26:38 +0000 (21:26 +0000)]
Eliminate a comment that doesn't apply to this pmap implementation.

Coalesce the variable definitions for PV entry management.

MFC after: 3 weeks

6 years agoFix sys.fs.tmpfs.mknod_test.{char, block} by reverting r321967
asomers [Sat, 21 Jul 2018 20:14:01 +0000 (20:14 +0000)]
Fix sys.fs.tmpfs.mknod_test.{char, block} by reverting r321967

In r321967 ngie "fixed" these tests by changing their expectations to match
the device numbers produced by the new ino64 code.  But it wasn't the tests
that were broken, it was the kernel.  bde fixed the kernel in r335053.

Reported by: Jenkins
MFC after: Never (only applies to >= 12)

6 years agotftpd(8): when completing an WRQ, flush the file before acknowleding receipt
asomers [Sat, 21 Jul 2018 19:48:31 +0000 (19:48 +0000)]
tftpd(8): when completing an WRQ, flush the file before acknowleding receipt

tftpd(8) should flush a newly written file to disk before ACKing the final DATA
packet.  Otherwise there is a narrow race window when a subsequent read may not
see the file.  This is somewhat related to r330710, but the race window is much
smaller.  Hopefully this will fix the intermittent tests in Jenkins.

Reported by: Jenkins
MFC after: 2 weeks

6 years agoClear expected failures for aesni_aes_gcm tests
asomers [Sat, 21 Jul 2018 19:28:07 +0000 (19:28 +0000)]
Clear expected failures for aesni_aes_gcm tests

These tests were fixed by r335584

PR: 228094
PR: 201447
MFC after: 2 weeks
X-MFC-With: 335584

6 years agoUse the correct DOT language syntax for an ID with a leading digit (0mp).
0mp [Sat, 21 Jul 2018 19:16:38 +0000 (19:16 +0000)]
Use the correct DOT language syntax for an ID with a leading digit (0mp).

It turns out that my username (0mp) is not a valid ID in the DOT language
because it starts with a digit. The easiest way to fix it is to put my
username in double quotes.

Reported by: pstef
Reviewed by: krion (mentor)
Approved by: krion (mentor)
Differential Revision: https://reviews.freebsd.org/D16372

6 years agoMention the Linux compatibility layer instead of the Linux emulator in the BUGS section.
0mp [Sat, 21 Jul 2018 19:09:29 +0000 (19:09 +0000)]
Mention the Linux compatibility layer instead of the Linux emulator in the BUGS section.

linux(4) explicitly states that it is not an emulator.

While here, pet mandoc and igor.

Reviewed by: mat (mentor), rpokala
Approved by: manpages (rpokala), mat (mentor)
Differential Revision: https://reviews.freebsd.org/D16375

6 years agoAdd option MAC to armv6 and armv7 kernels by default, it needs to be
ian [Sat, 21 Jul 2018 18:54:24 +0000 (18:54 +0000)]
Add option MAC to armv6 and armv7 kernels by default, it needs to be
compiled-in to allow loading policy modules at runtime.

6 years agomakefs(8): add test case for PR 229929
asomers [Sat, 21 Jul 2018 17:24:14 +0000 (17:24 +0000)]
makefs(8): add test case for PR 229929

Fix two failing makefs test cases by adding "-M 1m", which was already used
for every other FFS test case.  Add a new test case for the underlying
issue: with no -M, -m, or -s options, makefs can underestimate image size.

PR: 229929
Reported by: Jenkins
MFC after: 2 weeks

6 years agoRevert r336572 and wrap them in machine checks so they are only installed on
brd [Sat, 21 Jul 2018 17:13:39 +0000 (17:13 +0000)]
Revert r336572 and wrap them in machine checks so they are only installed on
i386.

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

6 years agoaudit(4): add test cases for chflagsat(2), lgetfh(2), setfib(2)
asomers [Sat, 21 Jul 2018 16:34:38 +0000 (16:34 +0000)]
audit(4): add test cases for chflagsat(2), lgetfh(2), setfib(2)

These three syscalls aren't currently audited correctly, so the tests are
marked as expected failures.

PR: 228374
Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D16379

6 years agoaudit(4): add more test cases for auditon(2)
asomers [Sat, 21 Jul 2018 16:26:00 +0000 (16:26 +0000)]
audit(4): add more test cases for auditon(2)

auditon(2) is an ioctl-like syscall with several different variants, each of
which has a distinct audit event.  This commit tests the remaining variants
that weren't tested in r336564.

Submitted by: aniketp
MFC after: 2 weeks
X-MFC-With: 336564
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D16381

6 years agorun(4): Support the D-Link DWA-125 rev A3
gavin [Sat, 21 Jul 2018 14:56:15 +0000 (14:56 +0000)]
run(4): Support the D-Link DWA-125 rev A3

Submitted by: Ali Mashtizadeh
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D16029

6 years agoRaise "Report Count" value limit in HID descriptor parser.
wulf [Sat, 21 Jul 2018 14:20:17 +0000 (14:20 +0000)]
Raise "Report Count" value limit in HID descriptor parser.

This fixes usage/report size calculation of Microsoft`s "Touch Hardware
Quality Assurance" certificate blob found in many touchscreens.

While here, join several "c->flags = dval" lines in to single line.

Reviewed by: hselasky
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16357

6 years agoSet the IPv4 version in the IP header for UDP and UDPLite.
tuexen [Sat, 21 Jul 2018 02:14:13 +0000 (02:14 +0000)]
Set the IPv4 version in the IP header for UDP and UDPLite.

6 years agoSet CLSET_TIMEOUT on TCP connections to pNFS DSs.
rmacklem [Sat, 21 Jul 2018 01:33:07 +0000 (01:33 +0000)]
Set CLSET_TIMEOUT on TCP connections to pNFS DSs.

Use CLSET_TIMEOUT to set the timeout for connections to DSs instead of
specifying a timeout on each RPC. This is done so that SO_SNDTIMEO
is set on the TCP socket as well as specifying a time limit when
waiting for an RPC reply.  Useful if the send queue for the TCP
connection has become constipated, due to a failed DS.
The choice of lease_duration / 4 is fairly arbitrary, but seems to work
ok, with a lower bound of 10sec.
For client connections to a DS, set the retry limit to vfs.nfsd.dsretries,
which is 2 by default.
This patch should only affect pNFS connections to DSs.
This patch requires r336542.

MFC after: 2 weeks

6 years agoPurge some old apmd files
brd [Sat, 21 Jul 2018 00:12:41 +0000 (00:12 +0000)]
Purge some old apmd files

Approved by: allanjude
Differential Revision: https://reviews.freebsd.org/D16373

6 years agoRegenerate src.conf.5.
kib [Fri, 20 Jul 2018 23:55:47 +0000 (23:55 +0000)]
Regenerate src.conf.5.

Sponsored by: Mellanox Technologies

6 years agoEnable OFED build (without extras) by default.
kib [Fri, 20 Jul 2018 23:53:20 +0000 (23:53 +0000)]
Enable OFED build (without extras) by default.

Reviewed by: bdrewery, hselasky (previous version)
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Release notes: yes
Differential revision: https://reviews.freebsd.org/D16230

6 years agoMove mostly useless examples binaries from OFED, as well as the Subnet
kib [Fri, 20 Jul 2018 23:52:11 +0000 (23:52 +0000)]
Move mostly useless examples binaries from OFED, as well as the Subnet
Manager, under the new option WITH_OFED_EXTRA, disabled by default.

Reviewed by: bdrewery, hselasky (previous version)
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D16230

6 years agoMove OFED libraries libmlx5.so.1 and libibverbs.so.1 to /lib.
kib [Fri, 20 Jul 2018 23:49:57 +0000 (23:49 +0000)]
Move OFED libraries libmlx5.so.1 and libibverbs.so.1 to /lib.

The is required because libpcap.so depends on the libraries when OFED
is enabled.

Reviewed by: bdrewery, hselasky
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D16230

6 years agoImprove the binmiscctl manual page
0mp [Fri, 20 Jul 2018 22:50:21 +0000 (22:50 +0000)]
Improve the binmiscctl manual page

- Use "Fl -" instead of "Cm --" for long options.
- Sort options alphabetically.
- Pet "mandoc -Tlint".
- Clean up the description of the "--interpreter" option.
- Clean up the description of the first example in the examples section.
- Use ".Bd -literal -offset indent" for all example code blocks for consistency.
- Use "Nm" instead of "Cm binmiscctl".
- Indent all examples for consistency.

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

6 years agoRegenerate src.conf.5 after several accumulated changes.
kib [Fri, 20 Jul 2018 22:37:25 +0000 (22:37 +0000)]
Regenerate src.conf.5 after several accumulated changes.

The larger is the removal of arm/armeb architecture.  Also noted is
the addition of WITHOUT_SERVICESDB and default change for WITH_CXX.

Sponsored by: Mellanox Technologies

6 years agoAllow mounting FUSE filesystems in jails
asomers [Fri, 20 Jul 2018 21:35:31 +0000 (21:35 +0000)]
Allow mounting FUSE filesystems in jails

Reviewed by: jamie
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16371

6 years agoSeparate the audit(4) tests for auditon(2)'s individual commands
asomers [Fri, 20 Jul 2018 18:59:48 +0000 (18:59 +0000)]
Separate the audit(4) tests for auditon(2)'s individual commands

auditon(2) is an ioctl-like syscall with several different variants, each of
which has a distinct audit event.  Write separate audit(4) tests for each
variant.

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D16255

6 years agoRecommit r336497: Fix powl, cpow, cpowf, and cpowl imports from OpenBSD
dim [Fri, 20 Jul 2018 18:27:30 +0000 (18:27 +0000)]
Recommit r336497: Fix powl, cpow, cpowf, and cpowl imports from OpenBSD

This is a follow-up to r336299.

* lib/msun/Makefile:
  . Remove polevll.c

* lib/msun/ld80/e_powl.c:
  . Copy contents of polevll.c to here.  This is the only consumer of
    these functions.  Make functions 'static inline'.
  . Make reducl a 'static inline' function.

* lib/msun/man/exp.3:
  . Remove BUGS section that no longer applies.

* lib/msun/src/math_private.h:
  . Remove prototypes of __p1evll() and __polevll()

* lib/msun/src/s_cpow.c:
* lib/msun/src/s_cpowf.c:
* lib/msun/src/s_cpowl.c
  . Include math_private.h.
  . Use the CMPLX macro from either C99 or math_private.h (depends on
    compiler support) instead of the problematic use of complex I.

Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>
PR: 229876
MFC after: 1 week

6 years agoAdd a note about the new 'ntpd' userid, and the fact that rc.d/ntpd now
ian [Fri, 20 Jul 2018 18:02:52 +0000 (18:02 +0000)]
Add a note about the new 'ntpd' userid, and the fact that rc.d/ntpd now
automatically runs the daemon as that user if it can.

6 years agoFix `make` in sys/modules/spigen
lwhsu [Fri, 20 Jul 2018 17:46:55 +0000 (17:46 +0000)]
Fix `make` in sys/modules/spigen

Reviewed by: ian
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16368

6 years agoAdd knob to control tx ring abdication.
shurd [Fri, 20 Jul 2018 17:45:26 +0000 (17:45 +0000)]
Add knob to control tx ring abdication.

r323954 changed the mp ring behaviour when 64-bit atomics were
available to abdicate the TX ring rather than having one become a
consumer thereby running to completion on TX. The consumer of the mp
ring was then triggered in the tx task rather than blocking the TX call.
While this significantly lowered the number of RX drops in small-packet
forwarding, it also negatively impacts TX performance.

With this change, the default behaviour is reverted, causing one TX ring
to become a consumer during the enqueue call. A new sysctl,
dev.X.Y.iflib.tx_abdicate is added to control this behaviour.

Reviewed by: gallatin
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16302

6 years agoImprove netmap TX handling when TX IRQs are not used/supported
shurd [Fri, 20 Jul 2018 17:24:45 +0000 (17:24 +0000)]
Improve netmap TX handling when TX IRQs are not used/supported

Use the timer to poll for TX completions when there are
outstanding TX slots. Track when the last driver timer was called
to prevent overcalling it. Also clean up some kring vs NIC ring
usage.

Reviewed by: marius, Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16300

6 years agoAdd support for pmap_enter(psind = 1) to the arm64 pmap.
markj [Fri, 20 Jul 2018 16:37:04 +0000 (16:37 +0000)]
Add support for pmap_enter(psind = 1) to the arm64 pmap.

See the commit log messages for r321378 and r336288 for descriptions of
this functionality.

Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D16303

6 years agoAnnotate a parameter as unused.
alc [Fri, 20 Jul 2018 16:31:25 +0000 (16:31 +0000)]
Annotate a parameter as unused.

X-MFC with: r336288

6 years agoInitialize the L3 page's wire count correctly after a L2 entry demotion.
markj [Fri, 20 Jul 2018 16:31:08 +0000 (16:31 +0000)]
Initialize the L3 page's wire count correctly after a L2 entry demotion.

Reviewed by: alc
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16303

6 years agovt/ofwfb: Fix brain-o from r336514, use the correct form of /chosen/stdout-path
jhibbits [Fri, 20 Jul 2018 16:18:24 +0000 (16:18 +0000)]
vt/ofwfb: Fix brain-o from r336514, use the correct form of /chosen/stdout-path

/chosen/stdout-path is a string, not ihandle.  Treat it as such.

With this, ofwfb now starts correctly on a POWER9 system when launched from
the local console (not serial).

6 years agovt/ofwfb: Check that /chosen/stdout is valid before using it in initialization
jhibbits [Fri, 20 Jul 2018 16:08:14 +0000 (16:08 +0000)]
vt/ofwfb: Check that /chosen/stdout is valid before using it in initialization

The FDT implementation of OF_instance_to_package() backend checks the
cross-reference to get the node.  On failure, this returns the input handle
unchanged.  In the case of ofwfb attachment, if /chosen/stdout property does not
exist, sc->sc_handle is either garbage or 0, which then gets propagated to node.
This will prevent "screen" from being used, resulting in not properly attaching.
Correct this by matching the code in ofwfb_probe().

6 years agoApply some late-arriving markup suggestions from the phab review, and add a
ian [Fri, 20 Jul 2018 16:06:44 +0000 (16:06 +0000)]
Apply some late-arriving markup suggestions from the phab review, and add a
paragraph that mentions the possibility of starting ntpd as a non-root user
rather than starting it as root and using its '-u' option to drop root privs
after startup.

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

6 years agoTest that the dtrace UDP receive probe fires.
tuexen [Fri, 20 Jul 2018 15:37:29 +0000 (15:37 +0000)]
Test that the dtrace UDP receive probe fires.

This test ensures that the fix committed in
https://svnweb.freebsd.org/changeset/base/336551
actually works.

Reviewed by: dteske@, markj@, rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16046

6 years agoAdd missing dtrace probes for received UDP packets.
tuexen [Fri, 20 Jul 2018 15:32:20 +0000 (15:32 +0000)]
Add missing dtrace probes for received UDP packets.

Fire UDP receive probes when a packet is received and there is no
endpoint consuming it. Fire the probe also if the TTL of the
received packet is smaller than the minimum required by the endpoint.

Clarify also in the man page, when the probe fires.

Reviewed by: dteske@, markj@, rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16046

6 years agoDocument kernel/signal/crashdump devd(8) notification.
trasz [Fri, 20 Jul 2018 14:32:36 +0000 (14:32 +0000)]
Document kernel/signal/crashdump devd(8) notification.

Discussed with: kib@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16323

6 years agoSupport installing manpages for multiple or alternate architecture(s).
ian [Fri, 20 Jul 2018 14:23:01 +0000 (14:23 +0000)]
Support installing manpages for multiple or alternate architecture(s).

Some section-4 manpages are architecture-specific, and the build process
currently generates only the pages for the MACHINE_CPUARCH being built.
man(1) supports a '-m' option to find manpages belonging to an arbitrary
architecture other than the MACHINE_[CPU]ARCH, but we have no way to
generate and install alternate-arch pages right now.

This change adds a new make.conf variable, MAN_ARCH, which can be a list of
one or more MACHINE_ARCH or MACHINE_CPUARCH values. All arch-specific
manpages that exist for the named arches will be installed. If unset, it
continues the behavior of installing just the MACHINE_CPUARCH being built.

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

6 years agoAutomatically run ntpd as non-root when possible.
ian [Fri, 20 Jul 2018 13:59:29 +0000 (13:59 +0000)]
Automatically run ntpd as non-root when possible.

Ntpd needs only a subset of full root privileges to do its job. Specifically
it needs the ability to manipulate system time, and to re-bind to a
privileged UDP port after interface changes. The mac_ntpd(4) policy module
(see r336525) can grant these privs.

These changes detect the availability of mac_ntpd(4). If enabled, and if the
ntpd configuration is fairly vanilla, it automatically runs ntpd as the
non-root user 'ntpd' (uid 123). "Vanilla" means the config doesn't include
command line or ntp.conf options changing the location of files or using any
files/dirs likely to be inaccessible to user ntpd.  Ntpd can still run as
non-root when using such options, but the admin must ensure all required
files and dirs are accessible, and then set ntpd_user=ntpd in rc.conf.

Note that these changes also address PR 199127 by using the command_args
technique suggested in the patch. They also tangentially address PR 113552,
which is primarily about inconsistent filenames in documentation, but some
of the inconsistancy was caused by old code in rc.d/ntpd which is leftover
from the intial import from netbsd. There was code to do chroot setup which
required the use of the netbsd clockctl(4) device; that code never had any
effect on freebsd, because we lack that device and don't build ntpd with the
options that would allow using it.

PR: 113552 199127
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16050

6 years agoAdd SPDX tags to example manual pages and POSIX copyright.
0mp [Fri, 20 Jul 2018 13:45:09 +0000 (13:45 +0000)]
Add SPDX tags to example manual pages and POSIX copyright.

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

6 years agoCentralize the complications for special efficient rounding to integers.
bde [Fri, 20 Jul 2018 12:42:24 +0000 (12:42 +0000)]
Centralize the complications for special efficient rounding to integers.

This was open-coded in range reduction for trig and exp functions.  Now
there are 3 static inline functions rnint[fl]() that replace open-coded
expressions, and type-generic irint() and i64rint() macros that hide the
complications for efficiently using non-generic irint() and irintl()
functions and casts.

Special details:

ld128/e_rem_pio2l.h needs to use i64rint() since it needs a 46-bit integer
result.  Everything else only needs a (less than) 32-bit integer result so
uses irint().

Float and double cases now use float_t and double_t locally instead of
STRICT_ASSIGN() to avoid bugs in extra precision.

On amd64, inline asm is now only used for irint() on long doubles.  The SSE
asm for irint() on amd64 only existed because the ifdef tangles made the
correct method of simply casting to int for this case non-obvious.

6 years agoSet SO_SNDTIMEO in the client side krpc when CLSET_TIMEOUT is done.
rmacklem [Fri, 20 Jul 2018 12:03:16 +0000 (12:03 +0000)]
Set SO_SNDTIMEO in the client side krpc when CLSET_TIMEOUT is done.

During testing of the pNFS client, it was observed that an RPC could get
stuck in sosend() for a very long time if the network connection to a DS
had failed. This is fixed by setting SO_SNDTIMEO on the TCP socket.
This is only done when CLSET_TIMEOUT is done and this is not done by any
use of the krpc currently in the source tree, so there should be no effect
on extant uses.
A future patch will use CLSET_TIMEOUT for TCP connections to DSs.

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

6 years agolibcrypt: There is no need to clear message digest context after they
delphij [Fri, 20 Jul 2018 07:16:28 +0000 (07:16 +0000)]
libcrypt: There is no need to clear message digest context after they
are finialized after r336539, so do not do it.

Submitted by: David CARLIER <devnexen gmail com>
MFC after: 1 month (after r336539)
Differential Revision: https://reviews.freebsd.org/D16059

6 years agoGet rid of unused variables.
delphij [Fri, 20 Jul 2018 07:07:27 +0000 (07:07 +0000)]
Get rid of unused variables.

copied_key and copied_salt are assigned with NULL and never used
otherwise. Remove the two variables and related code.

Reviewed by: pfg
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16314

6 years agolibmd: Always erase context in _Final method, and when doing
delphij [Fri, 20 Jul 2018 07:01:28 +0000 (07:01 +0000)]
libmd: Always erase context in _Final method, and when doing
it, consistently use explicit_bzero().

Update manual pages to match the behavior.

Reviewed by: pfg, allanjude, jmg
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D16316

6 years agoBump version to 1200075 for zfsloader being folded into loader.
imp [Fri, 20 Jul 2018 05:34:02 +0000 (05:34 +0000)]
Bump version to 1200075 for zfsloader being folded into loader.

As an aside: 1200074 should be used as the last version with big
endian arm support, should that be needed. it was actually removed
a day later, but no bump was made until now.

6 years agoMention zfsloader being folded into loader in UPDATING.
imp [Fri, 20 Jul 2018 05:26:36 +0000 (05:26 +0000)]
Mention zfsloader being folded into loader in UPDATING.

6 years agoRemove three stray instances of zfsloader.
imp [Fri, 20 Jul 2018 05:26:14 +0000 (05:26 +0000)]
Remove three stray instances of zfsloader.

6 years agoHoist EFI_TARGET and SOURCE_DATE_EPOCH up into efi/Makefile.inc
imp [Fri, 20 Jul 2018 05:18:03 +0000 (05:18 +0000)]
Hoist EFI_TARGET and SOURCE_DATE_EPOCH up into efi/Makefile.inc

6 years agoNM and OBJCOPY are already defined for all builds. There's no need to
imp [Fri, 20 Jul 2018 05:17:56 +0000 (05:17 +0000)]
NM and OBJCOPY are already defined for all builds. There's no need to
conditionally define them here.

6 years agoEliminate zfsloader man page.
imp [Fri, 20 Jul 2018 05:17:49 +0000 (05:17 +0000)]
Eliminate zfsloader man page.

Remove all cross references to zfsloader.8 and /boot/zfsloader.
Move ZFS specific info into loader.8.

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

6 years agoCollapse zfsloader functionality back down into loader.
imp [Fri, 20 Jul 2018 05:17:37 +0000 (05:17 +0000)]
Collapse zfsloader functionality back down into loader.

We no longer really need a separate zfsloader. It was useful when we
were first supporting ZFS and had limited ability to properly boot off
of ZFS without the special boot loader. Now that the boot loader has
matured, go the way loader.efi pioneered and just build one
binary. Change the name of the loader to load in the secondary boot
blocks to be just /boot/loader. Provide a symbolic link from zfsloader
to loader so people who have not upgraded their boot blocks are not
affected. This has the happy benefit of making coexistence easier as
well (fewer binaries in the matrix).

Discussed with: allanjude@, kevans@
RelNotes: Yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16361

6 years agoRemove a redundant declaration.
cy [Fri, 20 Jul 2018 02:25:39 +0000 (02:25 +0000)]
Remove a redundant declaration.

While at it add a blank line, conforming with the convention
used in this file.

X-MFC-with: r336203

6 years agoTo reduce our diff between our sources and our upline, sync up
cy [Fri, 20 Jul 2018 02:17:19 +0000 (02:17 +0000)]
To reduce our diff between our sources and our upline, sync up
with upline. Also making it easier to read.

Obtained from: diffing base with ports
X-MFC-with: r336203

6 years agoMFV: r336486
cy [Fri, 20 Jul 2018 02:04:10 +0000 (02:04 +0000)]
MFV: r336486

Prevent reinstallation of an already in-use group key.
Upline git commit cb5132bb35698cc0c743e34fe0e845dfc4c3e410.

Obtained from: https://w1.fi/security/2017-1/\
rebased-v2.6-0002-Prevent-reinstallation-\
of-an-already-in-use-group-ke.patch
X-MFC-with: r336203

6 years agoRevert r336501. It was a of the wrong rev from the vendor branch.
cy [Fri, 20 Jul 2018 01:53:28 +0000 (01:53 +0000)]
Revert r336501. It was a of the wrong rev from the vendor branch.

6 years agocryptocheck: Correct mismatch between OpenSSL use and OCF Blake2
cem [Fri, 20 Jul 2018 01:51:05 +0000 (01:51 +0000)]
cryptocheck: Correct mismatch between OpenSSL use and OCF Blake2

This corrects a mistake introduced to the cryptocheck tool in r331418.

Our CRYPTO_BLAKE2B and CRYPTO_BLAKE2S algorithms refer to either the plain,
unkeyed hashes (specified with cri_klen = 0), or a Blake2-specific keyed MAC
(when a cri_key is provided).

In contrast, OpenSSL's Blake2 algorithms only provide the plain hash.
Cryptocheck's T_HMAC corresponds to OpenSSL's HMAC() routine, which is the
ordinary HMAC construction applied to any plain, unkeyed hash.  We don't
have any HMAC-Blake2 cipher modes in OCF, so fix the test to only test
Blake2 as a plain hash.

(Ideally we would test keyed Blake2 as well, but that is left as future
work.)

PR: 229795

6 years agoAdd ntpd to the list of users/groups to check before installing.
ian [Fri, 20 Jul 2018 00:44:04 +0000 (00:44 +0000)]
Add ntpd to the list of users/groups to check before installing.

6 years agoMake it possible to run ntpd as a non-root user, add ntpd uid and gid.
ian [Thu, 19 Jul 2018 23:55:29 +0000 (23:55 +0000)]
Make it possible to run ntpd as a non-root user, add ntpd uid and gid.

Code analysis and runtime analysis using truss(8) indicate that the only
privileged operations performed by ntpd are adjusting system time, and
(re-)binding to privileged UDP port 123. These changes add a new mac(4)
policy module, mac_ntpd(4), which grants just those privileges to any
process running with uid 123.

This also adds a new user and group, ntpd:ntpd, (uid:gid 123:123), and makes
them the owner of the /var/db/ntp directory, so that it can be used as a
location where the non-privileged daemon can write files such as the
driftfile, and any optional logfile or stats files.

Because there are so many ways to configure ntpd, the question of how to
configure it to run without root privs can be a bit complex, so that will be
addressed in a separate commit. These changes are just what's required to
grant the limited subset of privs to ntpd, and the small change to ntpd to
prevent it from exiting with an error if running as non-root.

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

6 years agoNote big endian arm removal.
imp [Thu, 19 Jul 2018 23:54:18 +0000 (23:54 +0000)]
Note big endian arm removal.

6 years agoarm64: Add vt_efifb to GENERIC
manu [Thu, 19 Jul 2018 21:59:52 +0000 (21:59 +0000)]
arm64: Add vt_efifb to GENERIC

We can now have efifb being setup correctly.
Enjoy video output on some boards when you couldn't before.

Tested-On:  Pine64
Tested-On:  Pine64-LTS
Tested-On:  Pinebook

6 years agoRaise the size of L3 table for early devmap on arm64
manu [Thu, 19 Jul 2018 21:58:06 +0000 (21:58 +0000)]
Raise the size of L3 table for early devmap on arm64

Some driver (like efifb) needs to map more than the current L2_SIZE
Raise the size so we can map the framebuffer setup by the bootloader.

Reviewed by: cognet

6 years agoRevert r336509. Fails buildworld.
jhibbits [Thu, 19 Jul 2018 21:06:58 +0000 (21:06 +0000)]
Revert r336509.  Fails buildworld.

I had naively assumed that building kernel would be sufficient to test that
the header is sane.  However, it turns out this now needs -fms-extensions to
build.  Rather than sprinkling -fms-extensions all over the place, revert
for now, and revisit with a better fix.

6 years agoofwfb: Check for /chosen/stdout-path in addition to /chosen/stdout
jhibbits [Thu, 19 Jul 2018 20:22:46 +0000 (20:22 +0000)]
ofwfb: Check for /chosen/stdout-path in addition to /chosen/stdout

Some platforms use /chosen/stdout-path as the property containing the path to
the stdout node, not /chosen/stdout.

6 years agoWhitespace changes due to changes in ident.
tuexen [Thu, 19 Jul 2018 20:16:33 +0000 (20:16 +0000)]
Whitespace changes due to changes in ident.

6 years agoMerge the md_page structs for AIM and Book-E into a single unioned struct
jhibbits [Thu, 19 Jul 2018 20:13:33 +0000 (20:13 +0000)]
Merge the md_page structs for AIM and Book-E into a single unioned struct

Summary:
Ports like sysutils/lsof troll through kernel structures, and
therefore include kernel headers and all the dirty secrets involved.  struct
vm_page includes the struct md_page inline, which currently is only defined
if AIM or BOOKE is defined.  Thus, by default, sysutils/lsof cannot build,
due to the struct md_page having an incomplete type.  Fix this by merging
the two struct definitions into an anonymous struct-union.

A similar change could be made to unify the pmap structures as well.

Reviewed By: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D16232

6 years agoRevert https://svnweb.freebsd.org/changeset/base/336503
tuexen [Thu, 19 Jul 2018 20:11:14 +0000 (20:11 +0000)]
Revert https://svnweb.freebsd.org/changeset/base/336503
since I also ran the export script with different parameters.

6 years agoDelete an XXX comment addressed by r336505.
markj [Thu, 19 Jul 2018 20:11:08 +0000 (20:11 +0000)]
Delete an XXX comment addressed by r336505.

X-MFC with: r336505
Sponsored by: The FreeBSD Foundation

6 years agoMFV r336490:
cy [Thu, 19 Jul 2018 20:10:34 +0000 (20:10 +0000)]
MFV r336490:

Prevent installation of an all-zero TK.
This is also upline git commit 53bb18cc8b7a4da72e47e4b3752d0d2135cffb23.

Obtained from: https://w1.fi/security/2017-1/\
rebased-v2.6-0004-Prevent-installation-\
of-an-all-zero-TK.patch
X-MFC-with: r336203

6 years agoHave preload_delete_name() free pages backing preloaded data.
markj [Thu, 19 Jul 2018 20:00:28 +0000 (20:00 +0000)]
Have preload_delete_name() free pages backing preloaded data.

On i386 and amd64, add a vm_phys segment for physical memory used to
store the kernel binary and other preloaded data.  This makes it
possible to free such memory back to the system once it is no longer
needed, e.g., when a preloaded kernel module is unloaded.  Previously,
it would have remained unused.

Reviewed by: kib, royger
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16330

6 years agoProvide the full module path to preload_delete_name().
markj [Thu, 19 Jul 2018 19:50:42 +0000 (19:50 +0000)]
Provide the full module path to preload_delete_name().

The basename will never match against the preload metadata, so these
calls previously had no effect.

Reviewed by: kib, royger
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16330

6 years agoWhitespace changes due to change if ident.
tuexen [Thu, 19 Jul 2018 19:33:42 +0000 (19:33 +0000)]
Whitespace changes due to change if ident.

6 years agoMFV: r336486
cy [Thu, 19 Jul 2018 19:22:26 +0000 (19:22 +0000)]
MFV: r336486

Prevent reinstallation of an already in-use group key.
Upline git commit cb5132bb35698cc0c743e34fe0e845dfc4c3e410.

Obtained from: https://w1.fi/security/2017-1/\
rebased-v2.6-0002-Prevent-reinstallation-\
of-an-already-in-use-group-ke.patch
X-MFC-with: r336203

6 years agoRevert r336497 for now, as it breaks on architectures using gcc, with:
dim [Thu, 19 Jul 2018 19:07:25 +0000 (19:07 +0000)]
Revert r336497 for now, as it breaks on architectures using gcc, with:

cc1: warnings being treated as errors
/usr/src/lib/msun/src/s_cpow.c: In function 'cpow':
/usr/src/lib/msun/src/s_cpow.c:63: warning: implicit declaration of function 'CMPLX'

6 years agoMFV: r336485
cy [Thu, 19 Jul 2018 19:04:30 +0000 (19:04 +0000)]
MFV: r336485

Address: hostapd: Avoid key reinstallation in FT handshake

Obtained from: https://w1.fi/security/2017-1/\
rebased-v2.6-0001-hostapd-Avoid-key-\
reinstallation-in-FT-handshake.patch
X-MFC-with: r336203

6 years agoWhen reporting an error, print the errno value.
kib [Thu, 19 Jul 2018 19:03:18 +0000 (19:03 +0000)]
When reporting an error, print the errno value.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agoFix powl, cpow, cpowf, and cpowl imports from OpenBSD
dim [Thu, 19 Jul 2018 18:44:10 +0000 (18:44 +0000)]
Fix powl, cpow, cpowf, and cpowl imports from OpenBSD

This is a follow-up to r336299.

* lib/msun/Makefile:
  . Remove polevll.c

* lib/msun/ld80/e_powl.c:
  . Copy contents of polevll.c to here.  This is the only consumer of
    these functions.  Make functions 'static inline'.
  . Make reducl a 'static inline' function.

* lib/msun/man/exp.3:
  . Remove BUGS section that no longer applies.

* lib/msun/src/math_private.h:
  . Remove prototypes of __p1evll() and __polevll()

* lib/msun/src/s_cpow.c:
* lib/msun/src/s_cpowf.c:
* lib/msun/src/s_cpowl.c
  . Use the CMPLX macro from either C99 or math_private.h (depends of
    compiler support) instead of the problematic use of complex I.

Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>
PR: 229876
MFC after: 1 week

6 years agoStop writing past the end of the buffer in the msgget_limit test. The value
andrew [Thu, 19 Jul 2018 17:13:46 +0000 (17:13 +0000)]
Stop writing past the end of the buffer in the msgget_limit test. The value
in i is already correct to write to the last item in the buf array.

Obtained from: CheriBSD
Sponsored by: DARPA, AFRL

6 years agoRevert r329254. The underlying cause for the copy-on-write problem in
alc [Thu, 19 Jul 2018 17:01:10 +0000 (17:01 +0000)]
Revert r329254.  The underlying cause for the copy-on-write problem in
multithreaded programs that was addressed by r329254 was in the
implementation of pmap_enter() on some architectures, notably, amd64.
kib@, markj@ and I have audited all of the pmap_enter() implementations,
and fixed the broken ones, specifically, amd64 (r335784, r335971), i386
(r336092), mips (r336248), and riscv (r336294).

To be clear, the reason to address the problem within pmap_enter() and
revert r329254 is not just a matter of principle.  An effect of r329254
was that a copy-on-write fault actually entailed two page faults, not
one, even for single-threaded programs.  Now, in the expected case for
either single- or multithreaded programs, we are back to a single page
fault to complete a copy-on-write operation.  (In extremely rare
circumstances, a multithreaded program could suffer two page faults.)

Reviewed by: kib, markj
Tested by: truckman
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D16301

6 years agonewsyslog.8: Remove cutesy nonsense
cem [Thu, 19 Jul 2018 16:03:20 +0000 (16:03 +0000)]
newsyslog.8: Remove cutesy nonsense

Sponsored by: Dell EMC Isilon

6 years agoFix spurious and extra underflows and resulting inaccuracies for some cases
bde [Thu, 19 Jul 2018 15:04:10 +0000 (15:04 +0000)]
Fix spurious and extra underflows and resulting inaccuracies for some cases
with 1 huge component and 1 tiny (but nowhere near denormal) component.
Rescale earlier so that a scale factor of 2 can be combined with a non-
scale divisor of 2, so that the division doesn't shift out a bit.  In the
usual case where the scale factor is just 1, the division may shift out a
bit, but then the underflow is not spurious and the inaccuracies are harder
to fix.

6 years agoOops, r336412 undid the fix of the overflow threshold in r323003. Restore
bde [Thu, 19 Jul 2018 14:24:48 +0000 (14:24 +0000)]
Oops, r336412 undid the fix of the overflow threshold in r323003.  Restore
the previous overflow threshold and adjust comments.

6 years agoDescribe how to prevent *.core files from being created using ulimit.
0mp [Thu, 19 Jul 2018 13:09:29 +0000 (13:09 +0000)]
Describe how to prevent *.core files from being created using ulimit.

While here, pet mandoc.

Reviewed by: eadler (previous revision), jilles (previous revision), mat (mentor)
Approved by: manpages (jilles), mat (mentor)
Differential Revision: https://reviews.freebsd.org/D15609

6 years agoPROFILE, TESTS and CXX build options are no longer broken for RISC-V.
br [Thu, 19 Jul 2018 13:02:29 +0000 (13:02 +0000)]
PROFILE, TESTS and CXX build options are no longer broken for RISC-V.

Sponsored by: DARPA, AFRL

6 years agoUpdate mentor and mentee information.
0mp [Thu, 19 Jul 2018 12:58:10 +0000 (12:58 +0000)]
Update mentor and mentee information.

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

6 years agoAdd a GCC 7.1.0 no-error warning flag.
br [Thu, 19 Jul 2018 12:56:54 +0000 (12:56 +0000)]
Add a GCC 7.1.0 no-error warning flag.

This is required to build libdevdctl.

Note this flag is not required for GCC 8.1.0.

Sponsored by: DARPA, AFRL

6 years agofdt_pinctrl: Add some TSLOG annotations
manu [Thu, 19 Jul 2018 11:41:53 +0000 (11:41 +0000)]
fdt_pinctrl: Add some TSLOG annotations

While we see the time spent in the pin controller attach via the hooks in
DEVICE_ATTACH, it is useful to see the time spent configuring the pins.

6 years agocpufreq_dt: Add operating-points-v2 support
manu [Thu, 19 Jul 2018 11:31:49 +0000 (11:31 +0000)]
cpufreq_dt: Add operating-points-v2 support

Oppv2 add more flexibility on regulator value for the core voltage amongst
other new thing.
For now only shared opp table is supported as I don't have hardware with
non-shared opp table.

Tested-On: OrangePi One (with oppv1 and oppv2)
Tested-On: Pine64-LTS

6 years agokern_cpu: When adding abs frequency allow for unordered insertion
manu [Thu, 19 Jul 2018 11:28:14 +0000 (11:28 +0000)]
kern_cpu: When adding abs frequency allow for unordered insertion

Keep the list ordered as some code assume that it is but allow for
unordered cf_settings sets.

6 years agoarm: Implement cpu_est_clockrate for armv[67]
manu [Thu, 19 Jul 2018 11:27:11 +0000 (11:27 +0000)]
arm: Implement cpu_est_clockrate for armv[67]

6 years agoxen: add missing file from r336474
royger [Thu, 19 Jul 2018 10:14:52 +0000 (10:14 +0000)]
xen: add missing file from r336474

6 years agoxen: implement early init helper for PVHv2
royger [Thu, 19 Jul 2018 08:44:52 +0000 (08:44 +0000)]
xen: implement early init helper for PVHv2

In order to setup an initial environment and jump into the generic
hammer_time initialization function. Some of the code is shared with
PVHv1, while other code is PVHv2 specific.

This allows booting FreeBSD as a PVHv2 DomU and Dom0.

Sponsored by: Citrix Systems R&D

6 years agoxen: allow very early initialization of the hypercall page
royger [Thu, 19 Jul 2018 08:13:41 +0000 (08:13 +0000)]
xen: allow very early initialization of the hypercall page

Allow the hypercall page to be initialized very early, even before
vtophys is functional. Also make the function global so it can be
called by other files.

This will be needed in order to perform the early bringup on PVHv2
guests.

Sponsored by: Citrix Systems R&D

6 years agoxen: attach the PV CPU if no CPU device is present
royger [Thu, 19 Jul 2018 08:00:52 +0000 (08:00 +0000)]
xen: attach the PV CPU if no CPU device is present

When booted as PVHv2, there's no ACPI CPU object, so attach the PV CPU
device in order to take it's place.

This is required in case some device or driver tries to poke at the
PCPU device field.

Sponsored by: Citrix Systems R&D

6 years agoxen: do not limit PV console usage to PV guests
royger [Thu, 19 Jul 2018 07:58:24 +0000 (07:58 +0000)]
xen: do not limit PV console usage to PV guests

The Xen PV console is also available to HVM and PVHv2 guests, so don't
limit the console usage to PV guests only.

Sponsored by: Citrix Systems R&D

6 years agoxen: remove direct usage of HYPERVISOR_start_info
royger [Thu, 19 Jul 2018 07:54:45 +0000 (07:54 +0000)]
xen: remove direct usage of HYPERVISOR_start_info

HYPERVISOR_start_info is only available to PV and PVHv1 guests, HVM
and PVHv2 guests get this data from HVM parameters that are fetched
using a hypercall.

Instead provide a set of helper functions that should be used to fetch
this data. The helper functions have different implementations
depending on whether FreeBSD is running as PVHv1 or HVM/PVHv2 guest
type.

This helps to cleanup generic Xen code by removing quite a lot of
xen_pv_domain and xen_hvm_domain macro usages.

Sponsored by: Citrix Systems R&D

6 years agoxen: add PVHv2 entry point
royger [Thu, 19 Jul 2018 07:39:35 +0000 (07:39 +0000)]
xen: add PVHv2 entry point

The PVHv2 entry point is fairly similar to the multiboot1 one. The
kernel is started in protected mode with paging disabled. More
information about the exact BSP state can be found in the pvh.markdown
document on the Xen tree.

This entry point is going to be joined with the native entry point at
hammer_time, and in order to do so the BSP needs to be bootstrapped
into long mode with the same set of page tables as used on bare metal.

Sponsored by: Citrix Systems R&D