]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoImprove --strip-trailing-cr handling:
delphij [Fri, 27 Jul 2018 05:21:20 +0000 (05:21 +0000)]
Improve --strip-trailing-cr handling:

 - Advance ctold for f1 and ctnew for f2
 - ungetc() if the character is unexpected
 - Don't break early when we hit the combination on one side

PR: 230049
Reported by: maskray <emacsray gmail com>
Reviewed by: bapt, maskray
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16451

5 years agotop(1): fixed the empty output problem in non-interactive mode (-n, -b) regressed...
daichi [Fri, 27 Jul 2018 01:20:34 +0000 (01:20 +0000)]
top(1): fixed the empty output problem in non-interactive mode (-n, -b) regressed in r336028

PR: 229842
Reported by: Ali Abdallah <aliovx@gmail.com>
Reviewed by: eadler, cy
Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D16455

5 years agoFor the dynamic I/O scheduler, make the TRIM stuff also count against
imp [Thu, 26 Jul 2018 22:55:51 +0000 (22:55 +0000)]
For the dynamic I/O scheduler, make the TRIM stuff also count against
read bias so we do reads in preference to TRIMs. This helps a lot when
many trims are delivered at once from the upper layers as they tend to
delay READs due to priority inversion in the code today.

The non iosched case will be fixed when the trim comibing changes
needed for nvme come in later this year.

Sponsored by: Netflix

5 years agoRe-apply r336625 which was reverted with r336638, now that the underlying
ian [Thu, 26 Jul 2018 20:03:11 +0000 (20:03 +0000)]
Re-apply r336625 which was reverted with r336638, now that the underlying
pw_scan(3) has been fixed in a way that doesn't perturb other callers of
it or the getpwnam(3) family.

Make pw(8) showuser work the same with or without -R <path> for non-root
users.  Without -R, pw(8) uses getpwnam(3), which will open master.passwd
for the root user or passwd for non-root users.  With -R <path> pw(8) was
always opening <path>/master.passwd, which would fail for a non-root user,
then falsely claim the userid you're trying to show doesn't exist.

Now for a non-root user it opens <path>/passwd, and populates the fields in
the returned struct passwd which aren't present in that file with well-known
canonical values, which duplicates the behavior of getpwnam(3).  The net
effect is that the showuser output is identical whether using -R or not.

5 years agoFix OL_DIR definition following r336721.
gjb [Thu, 26 Jul 2018 19:42:23 +0000 (19:42 +0000)]
Fix OL_DIR definition following r336721.

Sponsored by: The FreeBSD Foundation

5 years agoMake pw_scan(3) more compatible with getpwent(3) et. al. when processing
ian [Thu, 26 Jul 2018 18:34:38 +0000 (18:34 +0000)]
Make pw_scan(3) more compatible with getpwent(3) et. al. when processing
data from /etc/passwd rather than /etc/master.passwd.

The libc getpwent(3) and related functions automatically read master.passwd
when run by root, or passwd when run by a non-root user.  When run by non-
root, getpwent() copes with the missing data by setting the corresponding
fields in the passwd struct to known values (zeroes for numbers, or a
pointer to an empty string for literals).  When libutil's pw_scan(3) was
used to parse a line without the root-accessible data, it was leaving
garbage in the corresponding fields.

These changes rename the static pw_init() function used by getpwent() and
friends to __pw_initpwd(), and move it into pw_scan.c so that common init
code can be shared between libc and libutil.  pw_scan(3) now calls
__pw_initpwd() before __pw_scan(), just like the getpwent() family does, so
that reading an arbitrary passwd file in either format and parsing it with
pw_scan(3) returns the same results as getpwent(3) would.

This also adds a new pw_initpwd(3) function to libutil, so that code which
creates passwd structs from scratch in some manner that doesn't involve
pw_scan() can initialize the struct to the values expected by lots of
existing code, which doesn't expect to encounter NULL pointers or garbage
values in some fields.

5 years agoelf_common: update ARM ABI flag names
emaste [Thu, 26 Jul 2018 17:52:57 +0000 (17:52 +0000)]
elf_common: update ARM ABI flag names

In the V5 ABI the flags are EF_ARM_ABI_FLOAT_HARD and
EF_ARM_ABI_FLOAT_SOFT. The flags have the same values as the legacy GCC
flags EF_ARM_VFP_FLOAT and EF_ARM_SOFT_FLOAT respectively.

The legacy names are kept for compatibility.

Reported by: Peter Smith (Linaro)
Reviewed by: imp
Sponsored by: The FreeBSD Foundation

5 years agoConvert bsd.files.mk to support DIRS and simplify by only having one install
brd [Thu, 26 Jul 2018 17:05:33 +0000 (17:05 +0000)]
Convert bsd.files.mk to support DIRS and simplify by only having one install
target.

Also update the pfctl tests Makefile to work with this change.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D16430

5 years agoMove apmd.conf to CONFS in usr.sbin/apmd which simplifies this nicely.
brd [Thu, 26 Jul 2018 16:51:23 +0000 (16:51 +0000)]
Move apmd.conf to CONFS in usr.sbin/apmd which simplifies this nicely.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D16431

5 years agoMove dumpdates creation to CONFS=
brd [Thu, 26 Jul 2018 16:45:25 +0000 (16:45 +0000)]
Move dumpdates creation to CONFS=

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D16435

5 years agoImplement pmap_mincore() for riscv.
markj [Thu, 26 Jul 2018 16:08:26 +0000 (16:08 +0000)]
Implement pmap_mincore() for riscv.

Reviewed by: alc, br
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16444

5 years agoFix fabs(3) for powerpcspe, this time for real
jhibbits [Thu, 26 Jul 2018 14:42:20 +0000 (14:42 +0000)]
Fix fabs(3) for powerpcspe, this time for real

SPE ABI uses the soft-float ABI, which splits doubles into two words.  As such,
fabs(3) cannot work on a double directly.  It's too costly to convert the
argument pair into a single double to use efdabs, so clear the top bit of the
high word, which is the sign bit.

5 years agoDisable OFED for RISC-V: it does not build.
br [Thu, 26 Jul 2018 14:15:04 +0000 (14:15 +0000)]
Disable OFED for RISC-V: it does not build.

Sponsored by: DARPA, AFRL

5 years agotop(1): forgot in r336160
daichi [Thu, 26 Jul 2018 13:53:22 +0000 (13:53 +0000)]
top(1): forgot in r336160

Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D16452

5 years agomakefs: use FreeBSD brelse function signature
emaste [Thu, 26 Jul 2018 13:33:10 +0000 (13:33 +0000)]
makefs: use FreeBSD brelse function signature

Although the ffs (and later msdosfs) implementation in makefs is
independent of the one in kernel, it makes sense to keep differences to
a minimum in order to ease comparison and porting changes across.

Submitted by: Siva Mahadevan
Sponsored by: The FreeBSD Foundation

5 years agocxgbe(4): Consider rateunit before ratemode when displaying information
np [Thu, 26 Jul 2018 07:29:44 +0000 (07:29 +0000)]
cxgbe(4): Consider rateunit before ratemode when displaying information
about a traffic class.  This matches the order in which the firmware
evaluates unit and mode internally.

Sponsored by: Chelsio Communications

5 years agocxgbe(4): Better defaults for all cl-rl rate limiters.
np [Thu, 26 Jul 2018 06:42:09 +0000 (06:42 +0000)]
cxgbe(4): Better defaults for all cl-rl rate limiters.

Start in "class" instead of "flow" mode.  This eliminates the need to
specify an MTU, which is not available that early anyway.  It also
allows the user to manually configure ch-rl rate limiting after attach.
This used to fail because ch-rl isn't supported if cl-rl "flow" mode is
configured.

Set all traffic classes to 1Gbps during initialization.  The goal is to
start off with _any_ valid configuration and 1Gbps works even for
gigabit cards.

Sponsored by: Chelsio Communications

5 years agoIgnore Device Paths in the Boot Info that don't have Media path
imp [Thu, 26 Jul 2018 05:08:58 +0000 (05:08 +0000)]
Ignore Device Paths in the Boot Info that don't have Media path
nodes. These show up in default entries on SuperMicro motherboards and
elsewhere. Before, we couldn't find a block device associated with the
device path and return BAD_CHOICE which was an instant
failure. However, a VendHw node isn't specifc, so when we don't find a
media path, return NOT_SPECIFIC so that the rest of the algorithms
work.

Sponsored by: Netflix.

5 years agoIntroduce test program for auditpipe(4)
asomers [Thu, 26 Jul 2018 00:16:41 +0000 (00:16 +0000)]
Introduce test program for auditpipe(4)

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

5 years agoALTQ support for iflib.
pkelsey [Wed, 25 Jul 2018 22:46:36 +0000 (22:46 +0000)]
ALTQ support for iflib.

Reviewed by: jmallett, mmacy
Differential Revision: https://reviews.freebsd.org/D16433

5 years agoOnly build ipmi_linux on x86
jhibbits [Wed, 25 Jul 2018 19:31:32 +0000 (19:31 +0000)]
Only build ipmi_linux on x86

Somehow this wasn't triggered in my pre-commit build.

5 years agoSupport building IPMI as a module on powerpc64
jhibbits [Wed, 25 Jul 2018 18:58:57 +0000 (18:58 +0000)]
Support building IPMI as a module on powerpc64

This still only supports IPMI via OPAL on powerpc64, but now it can be tested
with a GENERIC kernel.

5 years agoInstall base gdb in /usr/libexec for 32-bit arm by default.
jhb [Wed, 25 Jul 2018 18:21:14 +0000 (18:21 +0000)]
Install base gdb in /usr/libexec for 32-bit arm by default.

kgdb in ports now supports 32-bit arm kernels.  sparc64 is now the only
remaining architecture which ships base gdb in /usr/bin.

Relnotes: yes

5 years agoRaise a proper SIGTRAP / TRAP_TRACE signal for a PT_STEP step on arm.
jhb [Wed, 25 Jul 2018 18:11:37 +0000 (18:11 +0000)]
Raise a proper SIGTRAP / TRAP_TRACE signal for a PT_STEP step on arm.

Previously, a step by PT_STEP resulted in no signal being raised to
the debugger so that a step was silently completed with the program
continuing to execute after the step.  Fix by raising a SIGTRAP
signal with TRAP_TRACE as the signal code.

To simplify the error handling cases (if ptrace_clear_single_step()
fails, etc.) move the handling of PTRACE_BREAKPOINT into the
gdb_trapper() function.  If ptrace_clear_single_step() fails,
gdb_trapper() won't claim the fault, and the default case of
SIGILL / ILL_OPC will be used.

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

5 years agorelease: Add OL_DIR forgot in r336600
manu [Wed, 25 Jul 2018 17:45:56 +0000 (17:45 +0000)]
release: Add OL_DIR forgot in r336600

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D16439

5 years agocxgbe(4): Remove useless code that crept in with r336718.
np [Wed, 25 Jul 2018 17:45:43 +0000 (17:45 +0000)]
cxgbe(4): Remove useless code that crept in with r336718.

MFC after: 3 days
X-MFC With: 336718

5 years agocxgbetool(8): Require and validate only those inputs that are applicable
np [Wed, 25 Jul 2018 17:20:54 +0000 (17:20 +0000)]
cxgbetool(8): Require and validate only those inputs that are applicable
to the type of rate limiter being configured.  For example, the class
WRR scheduler doesn't need any kbps limits (it just needs the weights
for each class), the channel scheduler doesn't need anything except the
aggregate kbps to limit the channel to, and so on.

MFC after: 3 days
Sponsored by: Chelsio Communications

5 years agocxgbe(4): Validate only those parameters that are relevant to the
np [Wed, 25 Jul 2018 17:20:06 +0000 (17:20 +0000)]
cxgbe(4): Validate only those parameters that are relevant to the
type of rate limiter being programmed.  Skip the ones that are not
applicable.

MFC after: 3 days
Sponsored by: Chelsio Communications

5 years agoAdd a few forgotten files to ObsoleteFiles.inc:
dim [Wed, 25 Jul 2018 17:14:05 +0000 (17:14 +0000)]
Add a few forgotten files to ObsoleteFiles.inc:
* libcasper.so.0, which started in /usr/lib, then moved to /lib, but
  was later replaced by libcasper.so.1
* 32-bit versions of static casper libraries
* 32-bit versions of static stand libraries
* 32-bit versions of static ifc(onfig) libraries

5 years agoDisable 'C'-compressed ISA extension.
br [Wed, 25 Jul 2018 16:07:35 +0000 (16:07 +0000)]
Disable 'C'-compressed ISA extension.

It works excellent, but KDB disassembler and DTrace FBT provider for
RISC-V do lack support for it. They currently handle 4-byte instructions
only, while C-compressed ISA extension introduces 2-byte instructions
freely mixing them together.

So disable it for now.

Reviewed by: markj@
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16436

5 years agoSimplify the arm64 implementation of pmap_mincore().
markj [Wed, 25 Jul 2018 15:58:14 +0000 (15:58 +0000)]
Simplify the arm64 implementation of pmap_mincore().

No functional change intended.

Reviewed by: alc
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16427

5 years agoRemove unused string.
br [Wed, 25 Jul 2018 15:44:49 +0000 (15:44 +0000)]
Remove unused string.

Reported by: markj@
Sponsored by: DARPA, AFRL

5 years agotop(1): increase number of columns for memory
eadler [Wed, 25 Jul 2018 14:05:17 +0000 (14:05 +0000)]
top(1): increase number of columns for memory

The original intention was 4 columns but with a usable a result. In
practice this was not the case. Increase the number of columns to 5
until humanize_number learns alternative ways of presenting the number.

Requested by: many
Ref D15801

5 years agomakefs: whitespace cleanup in msdos files
emaste [Wed, 25 Jul 2018 13:27:20 +0000 (13:27 +0000)]
makefs: whitespace cleanup in msdos files

Sponsored by: The FreeBSD Foundation

5 years agofind(1): remove empty else condition
eadler [Wed, 25 Jul 2018 03:42:07 +0000 (03:42 +0000)]
find(1): remove empty else condition

reported by: brooks

5 years agobsd-family-tree: Announce NetBSD 8.0
eadler [Wed, 25 Jul 2018 03:29:29 +0000 (03:29 +0000)]
bsd-family-tree: Announce NetBSD 8.0

Use the correct date...

5 years agobsd-family-tree: Announce NetBSD 8.0
eadler [Wed, 25 Jul 2018 03:24:05 +0000 (03:24 +0000)]
bsd-family-tree: Announce NetBSD 8.0

Obtained from: https://www.netbsd.org/releases/formal-8/

5 years agoRemove support for QLNX_RCV_IN_TASKQ - i.e., Rx only in TaskQ.
davidcs [Wed, 25 Jul 2018 02:36:55 +0000 (02:36 +0000)]
Remove support for QLNX_RCV_IN_TASKQ - i.e., Rx only in TaskQ.
Added support for LLDP passthru
Upgrade ECORE to version 8.33.5.0
Upgrade STORMFW to version 8.33.7.0
Added support for SRIOV

MFC after:5 days

5 years agoActually install bsd.dirs.mk
brd [Wed, 25 Jul 2018 00:33:09 +0000 (00:33 +0000)]
Actually install bsd.dirs.mk

Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D16434

5 years agosockopt.h: remove stale comment
emaste [Wed, 25 Jul 2018 00:18:21 +0000 (00:18 +0000)]
sockopt.h: remove stale comment

Some old compatibility bits were removed in r227503 but this comment
was left behind.

Reported by: br, via review D11962
Sponsored by: The FreeBSD Foundation

5 years agollvm: remove __FreeBSD_version conditionals
emaste [Wed, 25 Jul 2018 00:06:18 +0000 (00:06 +0000)]
llvm: remove __FreeBSD_version conditionals

All supported FreeBSD build host versions have backtrace.h, so we can
just eliminate that test.  For futimes() we can test the compiler's
built-in __FreeBSD__ major version rather than relying on including
osreldate.h.  This should reduce the frequency with which Clang gets
rebuilt when building world.

Reviewed by: dim
Sponsored by: The FreeBSD Foundation

5 years agoSince r336611, n is only used for INET in iflib_parse_header().
marius [Tue, 24 Jul 2018 23:40:27 +0000 (23:40 +0000)]
Since r336611, n is only used for INET in iflib_parse_header().
Reported by: rpokala

5 years agoFix register usage in fabs(3) for powerpcspe
jhibbits [Tue, 24 Jul 2018 22:05:55 +0000 (22:05 +0000)]
Fix register usage in fabs(3) for powerpcspe

This still used the FPU register definition, which gcc converted to using %r1
(stack register).  Fix to use %r3.

5 years agoFix floating point exception definitions for powerpcspe
jhibbits [Tue, 24 Jul 2018 22:04:56 +0000 (22:04 +0000)]
Fix floating point exception definitions for powerpcspe

These were incorrectly implemented in the original port.

5 years agoRevert msdosfs MAKEFS #ifdef changes from r319870
emaste [Tue, 24 Jul 2018 21:10:17 +0000 (21:10 +0000)]
Revert msdosfs MAKEFS #ifdef changes from r319870

These changes are not needed for current msdosfs makefs WIP.

Submitted by: Siva Mahadevan
Sponsored by: The FreeBSD Foundation

5 years agoEmbed a simplebus_softc in struct soc_softc.
markj [Tue, 24 Jul 2018 21:02:11 +0000 (21:02 +0000)]
Embed a simplebus_softc in struct soc_softc.

This is required by the definition of the soc driver.

Reviewed by: br
Sponsored by: The FreeBSD Foundation

5 years agoBuild ofwdump on riscv.
markj [Tue, 24 Jul 2018 20:20:17 +0000 (20:20 +0000)]
Build ofwdump on riscv.

Sponsored by: The FreeBSD Foundation

5 years agoExtend ranges of the critical sections to ensure that context switch
kib [Tue, 24 Jul 2018 19:22:52 +0000 (19:22 +0000)]
Extend ranges of the critical sections to ensure that context switch
code never sees FPU pcb flags not consistent with the hardware state.

This is uncovered by the eager FPU switch mode.

Analyzed, reviewed and tested by: gleb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoUpdate .Dd in light of r336662.
rpokala [Tue, 24 Jul 2018 19:21:11 +0000 (19:21 +0000)]
Update .Dd in light of r336662.

MFC after: 1 week
X-MFC-With: r336662
Pointy-hat to: rpokala

5 years agoUpdated .Dd missed in r336674.
bz [Tue, 24 Jul 2018 18:51:38 +0000 (18:51 +0000)]
Updated .Dd missed in r336674.

5 years agoUpdate man page with support for 41000 Series adapters
davidcs [Tue, 24 Jul 2018 18:39:46 +0000 (18:39 +0000)]
Update man page with support for 41000 Series adapters

MFC after:5 days

5 years agoAdd jhixson to committers-ports.dot and calendar.freebsd
jhixson [Tue, 24 Jul 2018 18:33:26 +0000 (18:33 +0000)]
Add jhixson to committers-ports.dot and calendar.freebsd

Approved by: miwi (mentor), kmoore (mentor), araujo (mentor)
Differential Revision: https://reviews.freebsd.org/D16424

5 years agoofw: Load initrd file
leitao [Tue, 24 Jul 2018 16:52:52 +0000 (16:52 +0000)]
ofw: Load initrd file

This is an OFW initrd module that would load the initrd from device tree
parameters and give the to the md driver.

With this patch, it is possible to pass a rootfs image through kexec in PowerNV
mode (powerpc64). In order to user it, you should set the MD_ROOT_MEM option in
your kernel configuration.

Reviewed by: jhibbits
Approved by: jhibbits (mentor)
Differential Revision: https://reviews.freebsd.org/D15705

5 years agoicmp_quotelen was accidentially changes in r336676, undo this.
andrew [Tue, 24 Jul 2018 16:45:01 +0000 (16:45 +0000)]
icmp_quotelen was accidentially changes in r336676, undo this.

Sponsored by: DARPA, AFRL

5 years agoUse the new VNET_DEFINE_STATIC macro when we are defining static VNET
andrew [Tue, 24 Jul 2018 16:35:52 +0000 (16:35 +0000)]
Use the new VNET_DEFINE_STATIC macro when we are defining static VNET
variables.

Reviewed by: bz
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16147

5 years agoConvert bsd.confs.mk to support DIRS.
brd [Tue, 24 Jul 2018 16:34:58 +0000 (16:34 +0000)]
Convert bsd.confs.mk to support DIRS.

This paves the way for moving config files out of head/etc and into the
directories with the src.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D16406

5 years agoAs with DPCPU create VNET_DEFINE_STATIC for when a variable needs to be
andrew [Tue, 24 Jul 2018 16:31:16 +0000 (16:31 +0000)]
As with DPCPU create VNET_DEFINE_STATIC for when a variable needs to be
declaired static. This will allow us to change the definition on arm64
as it has the same issues described in r336349.

Reviewed by: bz
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16147

5 years agoDelete the example tcp stack "fastpath" which
rrs [Tue, 24 Jul 2018 14:55:47 +0000 (14:55 +0000)]
Delete the example tcp stack "fastpath" which
was only put in has an example.

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

5 years agoIn C remquol() and thus also in C remainderl(), don't clobber the sign bit
bde [Tue, 24 Jul 2018 11:50:05 +0000 (11:50 +0000)]
In C remquol() and thus also in C remainderl(), don't clobber the sign bit
of NaNs before possible returning a NaN.

The remquo*() and remainder*() functions should now give bitwise identical
results across arches and implementations, and bitwise consistent results
(with lower precisions having truncated mantissas) across precisions.  x86
already had consistency across amd64 and i386 and precisions by using the
i387 consistently and normally not using the C versions.  Inconsistencies
for C reqmquol() were first detected on sparc64.

Remove double second clearing of the sign bit and extra blank lines.

5 years agolld: fix addends with partial linking
emaste [Tue, 24 Jul 2018 11:35:22 +0000 (11:35 +0000)]
lld: fix addends with partial linking

[ELF] Update addends in non-allocatable sections for REL targets when
creating a relocatable output.

LLVM PR: 37735
LLVM Differential Revision: https://reviews.llvm.org/D48929

PR: 225128
Obtained from: LLVM r336799 by Igor Kudrin

5 years agoFix the conversion to use nan_mix() in r336362. fmod*(x, y),
bde [Tue, 24 Jul 2018 10:10:16 +0000 (10:10 +0000)]
Fix the conversion to use nan_mix() in r336362.  fmod*(x, y),
remainder*(x, y) and remquo*(x, y, quo) were broken for y = 0 by changing
multiplication by y to addition of y.  (When y is 0, the result should be
NaN but became 1 for finite x.)

Use a new macro nan_mix_op() to give more control over the mixing, and
expand comments.

Recent re-testing missed finding this bug since I only tested the macro
version on amd64 and i386 and these arches don't use the C versions (they
use either asm versions or builtins).

Reported by: enh via freebsd-numerics

5 years agoDeprecate jedec_ts(4) and point users to jedec_dimm(4) instead
rpokala [Tue, 24 Jul 2018 08:15:02 +0000 (08:15 +0000)]
Deprecate jedec_ts(4) and point users to jedec_dimm(4) instead

jedec_dimm(4) is a superset of the functionality of jedec_ts(4). Mark
jedec_ts(4) as removed in FreeBSD 12, and include a pointer to the migration
instructions in the jedec_dimm(4) manpage, in both the jedec_ts(4) code and
the jedec_ts(4) manpage. Add a note to the jedec_dimm(4) manpage about the
fact that it is a superset of jedec_ts(4).

This change will be MFCed to stable/11 and stable/10; the followup change
to actually remove jedec_ts(4) from -HEAD will not.

Reviewed by: avg
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16412

5 years agoZFS: Reserve DMU_BACKUP_FEATURE flags for Native Encryption and ZSTD
allanjude [Tue, 24 Jul 2018 04:38:11 +0000 (04:38 +0000)]
ZFS: Reserve DMU_BACKUP_FEATURE flags for Native Encryption and ZSTD

5 years agogeli init: Allow initialization of multiple geli providers at once if
woodsb02 [Mon, 23 Jul 2018 23:04:43 +0000 (23:04 +0000)]
geli init: Allow initialization of multiple geli providers at once if
they use same passphrase and keyfiles.

Unique salt will be randomly generated for each provider to ensure the
Master Key for each is unique.

This change follows on from r335673 and r336602, which allowed multiple
providers to be attached in a single command.

Reviewed by: asomers
Approved by: sobomax
Differential Revision: https://reviews.freebsd.org/D16115

5 years agoSay a little more about the new protocol.
imp [Mon, 23 Jul 2018 22:15:36 +0000 (22:15 +0000)]
Say a little more about the new protocol.

Requested by: emaste@

5 years agoarch.7: fix whitespace from r336435
emaste [Mon, 23 Jul 2018 21:09:57 +0000 (21:09 +0000)]
arch.7: fix whitespace from r336435

Previously armeb's Final Release rendered as 'Ta 11.x'.

Sponsored by: The FreeBSD Foundation

5 years agoFinalize the boot manager protocol support for next-stage boot
imp [Mon, 23 Jul 2018 20:36:59 +0000 (20:36 +0000)]
Finalize the boot manager protocol support for next-stage boot
loading.

If we are booting in a conforming UEFI Boot Manager Environment, then
use the BootCurrent variable to find the BootXXXX we're using. Once we
find that, then if it contains more than one EFI_DEVICE_PATH in its
what to boot section, try to use the last one as the kernel to
load. This will also set the default root partition as well. If
there's only one path, or if there's an error along the way, assume
that nothing specific was specified and revert to the old
algorithm. If something was specified, but not found, then fail the
boot. Otherwise you that, specific thing. On FreeBSD, this can be set
using efibootmgr -l <loader> -k <kernel>. We try a few variations of
kernel to cope with the fact that UEFI comes from a DOS world where
paths might be upper case and/or contain back-slashes.

Note: In an ideal world, we'd work out where we are in chain loading
by looking at the passed-in image handle and doing name
matching. However, that's unreliable since at least boot1.efi booted
images don't have that, hence the assumption that loader.efi needs to
load the last thing on the list, if possible.

The reason we fail for something specific is so that we can fully
participate in the UEFI Boot Manager Protocol and fail over to the
next item in the list of BootOrder choices when something goes wrong
at this stage.

This implements was was talked about in freebsd-arch@ last year
https://docs.freebsd.org/cgi/getmsg.cgi?fetch=3576+0+archive/2017/freebsd-arch/20171022.freebsd-arch
and documented in full (after changed resulting from the discussion) in
https://docs.google.com/document/d/1aK9IqF-60JPEbUeSAUAkYjF2W_8EnmczFs6RqCT90Jg/edit#
although one or two minor details may have been modified in this
implementation to make it work, and the ZFS MEDIA PATH extension isn't
implemented. This does not yet move things to ESP:\efi\freebsd\loader.efi.

RelNotes: Yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16403

5 years agoImplement efiblk_get_pdinfo_by_device_path
imp [Mon, 23 Jul 2018 20:36:54 +0000 (20:36 +0000)]
Implement efiblk_get_pdinfo_by_device_path

Lookup a block device by it's device path. We use a 'loose' lookup
whereby we scan forward to the first Media Path portion of the device
path, then look at all our handles for one whose first Media Path
matches. This will also work if the device path pointed to has a
following file path (or paths) as that's ignored. It assumes that
there's only one media path node that describes the entire device,
which is true as of the latest UEFI spec (2.7 Errata A) as far as I've
been able to determine.

Sponsored by: Netflix

5 years agoImplement efi_devpath_length
imp [Mon, 23 Jul 2018 20:36:50 +0000 (20:36 +0000)]
Implement efi_devpath_length

Return the total length, in bytes, of the device path (including the
terminating node at the end).

Sponsored by: Netflix

5 years agoImplement efi_devpath_match_node
imp [Mon, 23 Jul 2018 20:36:45 +0000 (20:36 +0000)]
Implement efi_devpath_match_node

Returns true if the first node pointed to by devpath1 is identical to
the first node pointed to by devpath2, with care taken to not read
past the end of the valid parts of either devpath1 or
devpath2. Otherwise, returns false.

Sponsored by: Netflix

5 years agoStore the number of handles we get back in efipart_nhandles rather
imp [Mon, 23 Jul 2018 20:36:41 +0000 (20:36 +0000)]
Store the number of handles we get back in efipart_nhandles rather
than the number of bytes. Don't divide by the element size every time
we have to iterate. Eliminate now-unused variables.

Sponsored by: Netflix

5 years agoImplement efi_devpath_to_media_path
imp [Mon, 23 Jul 2018 20:36:25 +0000 (20:36 +0000)]
Implement efi_devpath_to_media_path

Takes a generic device path as its input. Scans through it to find the
first media_path node in it and returns a pointer to it. If none is
found, NULL is returned.

Sponsored by: Netflix

5 years agoUse __riscv to determine building for RISC-V
lwhsu [Mon, 23 Jul 2018 19:49:54 +0000 (19:49 +0000)]
Use __riscv to determine building for RISC-V

Reviewed by: br
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16398

5 years agoarch.7: Clarify architecture-specific macro use
emaste [Mon, 23 Jul 2018 19:39:20 +0000 (19:39 +0000)]
arch.7: Clarify architecture-specific macro use

Compilers may define multiple variants of architecture-specific macros
(for example, both __x86_64 and __x86_64__).  Add a note that the macros
documented in arch.7 are the preferred ones for FreeBSD.

Sponsored by: The FreeBSD Foundation

5 years agoNow that we set the busy_detect bit in the bas to support setting it
imp [Mon, 23 Jul 2018 19:27:11 +0000 (19:27 +0000)]
Now that we set the busy_detect bit in the bas to support setting it
for the console, set our override in the bas as well.

Tested by: emaste@

5 years agoSupport compressed crash dumps in crashinfo(8).
jhb [Mon, 23 Jul 2018 18:08:56 +0000 (18:08 +0000)]
Support compressed crash dumps in crashinfo(8).

Temporarily decompress a copy of a crash dump compressed with either
gzip or zstd and run various tools against the decompressed copy while
generating the crash information.  The uncompressed copy is deleted when
the script exits.

Note that crashinfo is enabled by default, so this will attempt to
decompress the most recent compressed crash dump after a crash that
generates a compressed crash dump.  Users who wish to only do offline
analysis of compressed crash dumps can disable crashinfo in rc.conf.

Tested by: ler
Reviewed by: markj
MFC after: 2 weeks

5 years agoRevert r336619, it appears to cause problems with ssh, and probably other
ian [Mon, 23 Jul 2018 17:26:38 +0000 (17:26 +0000)]
Revert r336619, it appears to cause problems with ssh, and probably other
things which use pw_scan().

5 years agofix incorrect operator in the AUDITPIPE_SET_QLIMIT bounds check
avg [Mon, 23 Jul 2018 16:56:49 +0000 (16:56 +0000)]
fix incorrect operator in the AUDITPIPE_SET_QLIMIT bounds check

PR: 229983
Submitted by: Aniket Pandey <aniketp@iitk.ac.in>
Reported by: Aniket Pandey <aniketp@iitk.ac.in>
MFC after: 1 week

5 years agoAdd the initial DIRS infrastructure for creating directories with the
brd [Mon, 23 Jul 2018 16:11:03 +0000 (16:11 +0000)]
Add the initial DIRS infrastructure for creating directories with the
necessary owner, group, mode and flags.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D16405

5 years agofollow-up to r336635, update TAILQ to CK_SLIST for ie_handlers
avg [Mon, 23 Jul 2018 15:36:55 +0000 (15:36 +0000)]
follow-up to r336635, update TAILQ to CK_SLIST for ie_handlers

arm, mips and sparc64 were affected.

5 years agoRevert r336625 until I figure out why it worked with simple testing but
ian [Mon, 23 Jul 2018 14:58:44 +0000 (14:58 +0000)]
Revert r336625 until I figure out why it worked with simple testing but
reportedly fails the kyua tests and causes other real-world problems.

Reported by: cy@ asomers@

5 years agochange interrupt event's list of handlers from TAILQ to CK_SLIST
avg [Mon, 23 Jul 2018 12:51:23 +0000 (12:51 +0000)]
change interrupt event's list of handlers from TAILQ to CK_SLIST

The primary reason for this commit is to separate mechanical and nearly
mechanical code changes from an upcoming fix for unsafe teardown of
shared interrupt handlers that have only filters (see D15905).

The technical rationale is that SLIST is sufficient.  The only operation
that gets worse performance -- O(n) instead of O(1) is a removal of a
handler,  but it is not a critical operation and the list is expected to
be rather short.

Additionally, it is easier to reason about SLIST when considering the
concurrent lock-free access to the list from the interrupt context and
the interrupt thread.

CK_SLIST is used because the upcoming change depends on the memory order
provided by CK_SLIST insert and the fact that CL_SLIST remove does not
trash the linkage in a removed element.

While here, I also fixed a couple of whitespace issues, made code under
ifdef notyet compilable, added a lock assertion to ithread_update() and
made intr_event_execute_handlers() static as it had no external callers.

Reviewed by: cem (earlier version)
MFC after: 4 weeks
Differential Revision: https://reviews.freebsd.org/D16016

5 years agoMFV CK@r336629: Import CK as of commit 1c1f9901c2dea7a883342cd03d3906a1bc482583
avg [Mon, 23 Jul 2018 11:21:43 +0000 (11:21 +0000)]
MFV CK@r336629: Import CK as of commit 1c1f9901c2dea7a883342cd03d3906a1bc482583

This adds CK_SLIST_INSERT_PREVPTR and CK_SLIST_REMOVE_PREVPTR macros
as well as ck_pr_dec_is_zero family of functions.

MFC after: 3 weeks

5 years agoFix setjmp for RISC-V:
br [Mon, 23 Jul 2018 09:54:28 +0000 (09:54 +0000)]
Fix setjmp for RISC-V:
o The correct value for _JB_SIGMASK is 27.
o The storage size for double-precision floating
  point register is 8 bytes.

Submitted by: "James Clarke" <jrtc4@cam.ac.uk>
Reviewed by: markj@
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16344

5 years agoUpdate modify counter when setting a mixer control.
hselasky [Mon, 23 Jul 2018 09:16:23 +0000 (09:16 +0000)]
Update modify counter when setting a mixer control.

PR: 229969
MFC after: 1 week

5 years agoRemove duplicated entry
uqs [Mon, 23 Jul 2018 08:52:57 +0000 (08:52 +0000)]
Remove duplicated entry

5 years agoepair(4): make sure we do not duplicate MAC addresses
eugen [Mon, 23 Jul 2018 07:11:58 +0000 (07:11 +0000)]
epair(4): make sure we do not duplicate MAC addresses
in case of reused if_index.

PR: 229957
Tested by: O. Hartmann <ohartmann@walstatt.org>
Approved by: avg (mentor)

5 years agoFix the attempt to see if we're overriding the console in the command
imp [Mon, 23 Jul 2018 06:38:48 +0000 (06:38 +0000)]
Fix the attempt to see if we're overriding the console in the command
line args. I had thought console would be NULL, but it's efi. Set it
to efi (as a clue) before we initialize the console, then test it to
see if it changed on the command line to do the automatic
override. This gets my serial console back.

5 years agoOlder zfs boot blocks don't support symlinks. install the link to
imp [Mon, 23 Jul 2018 06:04:05 +0000 (06:04 +0000)]
Older zfs boot blocks don't support symlinks. install the link to
zfsloader as a hard link. While newer ones do, the whole point of the
link was to transition to the new world order smoothly. A hard link is
less flexible, but it works and will result in fewer bumps. Adjust
UPDATING entry to match.

5 years agoMake pw(8) showuser work the same with or without -R <path> for non-root
ian [Sun, 22 Jul 2018 23:41:40 +0000 (23:41 +0000)]
Make pw(8) showuser work the same with or without -R <path> for non-root
users.  Without -R, pw(8) uses getpwnam(3), which will open master.passwd
for the root user or passwd for non-root users.  With -R <path> pw(8) was
always opening <path>/master.passwd, which would fail for a non-root user,
then falsely claim the userid you're trying to show doesn't exist.

Now for a non-root user it opens <path>/passwd and zeroes out the 3 fields
that aren't available in the passwd file, which duplicates the behavior of
getpwnam(3).  The net effect is that the showuser output is identical
whether using -R or not.

5 years agofix use of empty in Makefile.ec2
mmacy [Sun, 22 Jul 2018 23:33:48 +0000 (23:33 +0000)]
fix use of empty in Makefile.ec2

empty() takes a variable name - not the expanded value

Reported by: sjg

5 years agoAdd busy detect quirk to list of console options
mmacy [Sun, 22 Jul 2018 23:32:21 +0000 (23:32 +0000)]
Add busy detect quirk to list of console options

This change allows one to set the busy_detect flag
required by the synopsys UART at the loader prompt.
This is needed by the EPYC 3000 SoC.

This will give users a working console up to the point where getty is required:
hw.uart.console="mm:0xfedc9000,rs:2,bd:1"

Reviewed by: imp
MFC after: 4 weeks
Differential Revision: https://reviews.freebsd.org/D16399

5 years agoCorrectly reference SRCTOP, avoid multiple invocations of svn
mmacy [Sun, 22 Jul 2018 23:20:24 +0000 (23:20 +0000)]
Correctly reference SRCTOP, avoid multiple invocations of svn

Reported by: sjg

5 years agofix build non-svn checkouts post r336593
mmacy [Sun, 22 Jul 2018 22:57:52 +0000 (22:57 +0000)]
fix build non-svn checkouts post r336593

The change made in r336593 assumes that the build is happening in a
svn checkout resulting in misleading debug output. Check that we're
actually working in an svn checkout before proceeding to call svn.

5 years agoAdd udma_barrier definitions for RISC-V
lwhsu [Sun, 22 Jul 2018 22:35:17 +0000 (22:35 +0000)]
Add udma_barrier definitions for RISC-V

Reviewed by: kib
Sponsored by: The FreeBSD Foundation

5 years agoSet the pw_class field to NULL when scanning the non-master passwd file.
ian [Sun, 22 Jul 2018 22:34:20 +0000 (22:34 +0000)]
Set the pw_class field to NULL when scanning the non-master passwd file.
This avoids a null pointer deref in pw_dup(), which assumes that all
pointers are either NULL or valid.

5 years agoTemporarily disable the sys/acl/00 and sys/acl/02 tests
asomers [Sun, 22 Jul 2018 21:00:11 +0000 (21:00 +0000)]
Temporarily disable the sys/acl/00 and sys/acl/02 tests

These tests are failing due to PR 229930.  Unfortunately, TAP tests can't be
marked as expected failures.

PR: 229930
Reported by: Jenkins

5 years agoFix a potential use after free in getsockopt() access to inp_options
mmacy [Sun, 22 Jul 2018 20:02:14 +0000 (20:02 +0000)]
Fix a potential use after free in getsockopt() access to inp_options

Discussed with: jhb
Reviewed by: sbruno, transport
MFC after: 2 weeks
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14621

5 years agoUse the right buffer size when calling snprintf().
markj [Sun, 22 Jul 2018 18:31:15 +0000 (18:31 +0000)]
Use the right buffer size when calling snprintf().

PR: 229952

5 years agoAdd a regression test for PR 131876.
markj [Sun, 22 Jul 2018 18:07:08 +0000 (18:07 +0000)]
Add a regression test for PR 131876.

PR: 131876
MFC after: 1 week