]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agodtc(1): Update to 0892ec7; HACKING and implicit header fixes
kevans [Thu, 23 Aug 2018 02:26:40 +0000 (02:26 +0000)]
dtc(1): Update to 0892ec7; HACKING and implicit header fixes

Fixes courtesy of arichardson and jmg:
- HACKING was pointing to the wrong place
- Added headers were being relied on implicitly, but libstdc++ did not
  comply with the unspoken wishes of dtc.

MFC after: 1 week

5 years agoRemove ZFS leftovers when WITHOUT_ZFS is set
kevans [Thu, 23 Aug 2018 02:14:39 +0000 (02:14 +0000)]
Remove ZFS leftovers when WITHOUT_ZFS is set

Submitted by: Oliver Pinter
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16810

5 years agobectl(8): Man page and usage cleanup
kevans [Thu, 23 Aug 2018 02:09:52 +0000 (02:09 +0000)]
bectl(8): Man page and usage cleanup

- Some overly-long lines
- Consistently using .Brq ({})
- Consistently using .Cm
- Not using .Ao/.Ac around .Ar

PR: 230576
Submitted by: Yuri Pankov (with a fair amount of rebasing pre-commit)

5 years agobectl(8): jail: Tear down jail by default after command exits
kevans [Thu, 23 Aug 2018 01:45:18 +0000 (01:45 +0000)]
bectl(8): jail: Tear down jail by default after command exits

Add a -U flag to get back the old behavior. The new behavior is a little
more friendly to the common use cases, jail the BE and execute a script.
Having the jail torn down automatically when the script is finished, or when
you exit the shell, is a little more friendly than having to remember to
`bectl ujail`.

Batch mode (-b) will continue to leave the jail up, as it's assumed the
caller has other intentions.

Submitted by: Shawn Webb (partially)

5 years agodevstat(9): Constify function parameters that can be const
cem [Thu, 23 Aug 2018 01:42:45 +0000 (01:42 +0000)]
devstat(9): Constify function parameters that can be const

No functional change.

When attempting to document the changed argument types in devstat.9, I
discovered the 20 year old manual page severely mismatched reality even
prior to my simple change.  So I took a first cut pass cleaning that up to
match reality.  I'm sure I've missed some things; the goal was just to leave
it better than when I started.

Sponsored by: Dell EMC Isilon

5 years agofdt_fixups: relocate the /chosen node after applying fixups
kevans [Thu, 23 Aug 2018 01:22:13 +0000 (01:22 +0000)]
fdt_fixups: relocate the /chosen node after applying fixups

As indicated by the comment, any fixups applied (which might include
overlays) can invalidate the previously located node by adding nodes or
setting/adding properties. The later fdt_setprop of fixup-applied property
would then fail because of the bad/wrong node offset.

This would have generally been harmless, but potentially caused multiple
applications of fixups and caused a little bit of bloat.

MFC after: 1 week

5 years agocxgbev(4): Updates to the VF driver to cope with recent ifmedia and
np [Thu, 23 Aug 2018 00:58:10 +0000 (00:58 +0000)]
cxgbev(4): Updates to the VF driver to cope with recent ifmedia and
ctrlq changes in the base driver.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoFix the nfsuserd.8 man page for the changes made to support uid/gid
rmacklem [Thu, 23 Aug 2018 00:05:13 +0000 (00:05 +0000)]
Fix the nfsuserd.8 man page for the changes made to support uid/gid
numbers in owner and owner_group strings.

This is a content change.

5 years agotftpd: Fix data corruption bug with netascii
asomers [Wed, 22 Aug 2018 23:31:27 +0000 (23:31 +0000)]
tftpd: Fix data corruption bug with netascii

Transferring files in netascii format requires, among other things,
translating all CR characters to a CR,NUL pair. tftpd does this correctly
except when the CR occurs as the last octet of a packet. In that case, it
erroneously drops the NUL which should be part of the following packet. The
bug was caused by using 0 as a sentinel value in a variable that could
legitimately hold 0. Fix it by switching the sentinel value to -1.

PR: 178055
Reported by: Richard <rsitze@gmail.com>
Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16853

5 years ago[ig4] Fix I/O timeout issue with Designware I2C controller on AMD platforms
gonzo [Wed, 22 Aug 2018 22:56:01 +0000 (22:56 +0000)]
[ig4] Fix I/O timeout issue with Designware I2C controller on AMD platforms

Due to hardware limitation AMD I2C controller can't trigger pending
interrupt if interrupt status has been changed after clearing
interrupt status bits.  So, I2C will lose the interrupt and IO will be
timed out. Implements a workaround to disable I2C controller interrupt
and re-enable I2C interrupt before existing interrupt handler.

Submitted by: rajfbsd@gmail.com
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16720

5 years agoKASSERT: Make runtime optionality optional
cem [Wed, 22 Aug 2018 22:19:42 +0000 (22:19 +0000)]
KASSERT: Make runtime optionality optional

Add an option, KASSERT_PANIC_OPTIONAL, that allows runtime KASSERT()
behavior changes.  When this option is not enabled, code that allows
KASSERTs to become optional is not enabled, and all violated assertions
cause termination.

The runtime KASSERT behavior was added in r243980.

One important distinction here is that panic has __dead2
("attribute((noreturn))"), while kassert_panic does not.  Static analyzers
like Coverity understand __dead2.  Without it, KASSERTs go misunderstood,
resulting in many false positives that result from violation of program
invariants.

Reviewed by: jhb, jtl, np, vangyzen
Relnotes: yes
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16835

5 years agoAdd support for send, receive and state-change DTrace providers for
tuexen [Wed, 22 Aug 2018 21:23:32 +0000 (21:23 +0000)]
Add support for send, receive and state-change DTrace providers for
SCTP. They are based on what is specified in the Solaris DTrace manual
for Solaris 11.4.

Reviewed by: 0mp, dteske, markj
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16839

5 years agoMove services to usr.sbin/services_mkdb/
brd [Wed, 22 Aug 2018 21:22:40 +0000 (21:22 +0000)]
Move services to usr.sbin/services_mkdb/

This is pkgbase related as it switches to CONFS to properly tag this as a
config file.

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

5 years agoPrepare the kernel linker to handle PC-relative ifunc relocations.
markj [Wed, 22 Aug 2018 20:44:30 +0000 (20:44 +0000)]
Prepare the kernel linker to handle PC-relative ifunc relocations.

The boot-time ifunc resolver assumes that it only needs to apply
IRELATIVE relocations to PLT entries.  With an upcoming optimization,
this assumption no longer holds, so add the support required to handle
PC-relative relocations targeting GNU_IFUNC symbols.
- Provide a custom symbol lookup routine that can be used in early boot.
  The default lookup routine uses kobj, which is not functional at that
  point.
- Apply all existing relocations during boot rather than filtering
  IRELATIVE relocations.
- Ensure that we continue to apply ifunc relocations in a second pass
  when loading a kernel module.

Reviewed by: kib
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16749

5 years agoAdd -s "help" and -l "help" to print a list of supported PCI and LPC devices.
araujo [Wed, 22 Aug 2018 20:23:08 +0000 (20:23 +0000)]
Add -s "help" and -l "help" to print a list of supported PCI and LPC devices.

For tools that uses bhyve such like libvirt, it is important to be able to
probe what features are supported by the given bhyve binary.

To give more context, libvirt probes bhyve's capabilities in a not very
effective way:
- Running 'bhyve -h' and parsing output.
- To detect devices, it runs 'bhyve -s 0,dev' for every each device and
  parses error output to identify if the device is supported or not.

PR: 2101111
Submitted by: novel
MFC after: 2 weeks
Relnotes: yes
Sponsored by: iXsystems Inc.

5 years agoExtended pf(4) ioctl interface and pfctl(8) to allow bandwidths of
pkelsey [Wed, 22 Aug 2018 19:38:48 +0000 (19:38 +0000)]
Extended pf(4) ioctl interface and pfctl(8) to allow bandwidths of
2^32 bps or greater to be used.  Prior to this, bandwidth parameters
would simply wrap at the 2^32 boundary.  The computations in the HFSC
scheduler and token bucket regulator have been modified to operate
correctly up to at least 100 Gbps.  No other algorithms have been
examined or modified for correct operation above 2^32 bps (some may
have existing computation resolution or overflow issues at rates below
that threshold).  pfctl(8) will now limit non-HFSC bandwidth
parameters to 2^32 - 1 before passing them to the kernel.

The extensions to the pf(4) ioctl interface have been made in a
backwards-compatible way by versioning affected data structures,
supporting all versions in the kernel, and implementing macros that
will cause existing code that consumes that interface to use version 0
without source modifications.  If version 0 consumers of the interface
are used against a new kernel that has had bandwidth parameters of
2^32 or greater configured by updated tools, such bandwidth parameters
will be reported as 2^32 - 1 bps by those old consumers.

All in-tree consumers of the pf(4) interface have been updated.  To
update out-of-tree consumers to the latest version of the interface,
define PFIOC_USE_LATEST ahead of any includes and use the code of
pfctl(8) as a guide for the ioctls of interest.

PR: 211730
Reviewed by: jmallett, kp, loos
MFC after: 2 weeks
Relnotes: yes
Sponsored by: RG Nets
Differential Revision: https://reviews.freebsd.org/D16782

5 years agoif_media: Add new 2.5G/5G/25G/40G/50G/100G/200G/400G media types
erj [Wed, 22 Aug 2018 18:19:56 +0000 (18:19 +0000)]
if_media: Add new 2.5G/5G/25G/40G/50G/100G/200G/400G media types

Upcoming Ethernet hardware will support new media types that aren't in the kernel
yet, so they are added here. These mostly include new 25G/50G/100G media types;
and this commit introduces new 200G/400G speeds and media.

Reviewed by: hselasky@, jhb@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D16731

5 years agoAdd dmu_tx_assign() error handling in zfs_unlinked_drain().
mav [Wed, 22 Aug 2018 16:32:53 +0000 (16:32 +0000)]
Add dmu_tx_assign() error handling in zfs_unlinked_drain().

The error handling got lost during r334810, while according to the report
error there may happen in case of dataset being over quota.  In such case
just leave the node in the unlinked list to be freed sometimes later.

PR: 229887
Sponsored by: iXsystems, Inc.

5 years agoCreate separate taskqueue to call zfs_unlinked_drain().
mav [Wed, 22 Aug 2018 16:27:24 +0000 (16:27 +0000)]
Create separate taskqueue to call zfs_unlinked_drain().

r334810 introduced zfs_unlinked_drain() dispatch to taskqueue on every
deletion of a file with extended attributes.  Using system_taskq for that
with its multiple threads in case of multiple files deletion caused all
available CPU threads to uselessly spin on busy locks, completely blocking
the system.

Use of single dedicated taskqueue is the only easy solution I've found,
while in would be great if we could specify that some task should be
executed only once at a time, but never in parallel, while many tasks
could use different threads same time.

Sponsored by: iXsystems, Inc.

5 years agoMove all devfs related files to sbin/devfs/
brd [Wed, 22 Aug 2018 15:55:23 +0000 (15:55 +0000)]
Move all devfs related files to sbin/devfs/

This is related to pkgbase as it uses CONFS to properly tag these as config
files.

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

5 years agoTurn off LOADER_GELI and LOADER_LUA for sparc64, until those options
lidl [Wed, 22 Aug 2018 15:29:54 +0000 (15:29 +0000)]
Turn off LOADER_GELI and LOADER_LUA for sparc64, until those options
are fully debugged.  With these options off, the unified "loader"
binary for sparc64 works to boot a kernel from ZFS.

Submitted by: kevans
Reviewed by: imp kevans

5 years agoSkip PMAP_PCID_KERN + 1 PCPU pcid_next value on APs as well.
kib [Wed, 22 Aug 2018 14:58:52 +0000 (14:58 +0000)]
Skip PMAP_PCID_KERN + 1 PCPU pcid_next value on APs as well.
r337838 did it for BSP.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 years agoIncrease the size of the heap size available on sparc64 during
lidl [Wed, 22 Aug 2018 14:33:57 +0000 (14:33 +0000)]
Increase the size of the heap size available on sparc64 during
operation of "loader".  The dramatic increase in size of
SPA_MAXBLOCKSIZE in r304321 causes the heap space to be exhausted,
so malloc() fails, ultimately leading to a memcpy() with a
destination of 0x0.

MFC after: 3 days

5 years agoAdding device ID for Terratec SiXPack 5.1+.
avatar [Wed, 22 Aug 2018 14:06:31 +0000 (14:06 +0000)]
Adding device ID for Terratec SiXPack 5.1+.

MFC after: 3 days

5 years agoNote that ntpd_sync_on_start is a preferred alternative to ntpdate_enable.
0mp [Wed, 22 Aug 2018 13:30:48 +0000 (13:30 +0000)]
Note that ntpd_sync_on_start is a preferred alternative to ntpdate_enable.

A similar note is already present in the description of the
ntpd_sync_on_start variable.

This patch adds a note to the description of the ntpdate_enable variable.
This way it would be easier to spot.  Otherwise a user might skip the part
of the manual describing ntpd_sync_on_start if they stop reading after
learning about ntpdate_enable.

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

5 years agoSuggest to reboot after installworld in the example of development workflow.
0mp [Wed, 22 Aug 2018 13:25:41 +0000 (13:25 +0000)]
Suggest to reboot after installworld in the example of development workflow.

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

5 years agoRevert r320758, which was the man page update for r320757 just reverted.
rmacklem [Wed, 22 Aug 2018 12:26:17 +0000 (12:26 +0000)]
Revert r320758, which was the man page update for r320757 just reverted.

This is a content change.

PR: 230752

5 years agoRevert r320757 since it can cause "excl->shared" panics.
rmacklem [Wed, 22 Aug 2018 12:20:10 +0000 (12:20 +0000)]
Revert r320757 since it can cause "excl->shared" panics.

PR#230752 shows a panic where an nfsd thread tries to do soconnect() on
the AF_LOCAL socket used by the nfsuserd while already holding an
exclusive lock on it. I am not 100% sure how this happens, but since an
AF_LOCAL socket is in the file system namespace it is conceivable that it
could lock it and then attempt an upcall to the nfsuserd.
However, reverting r320757 stops the nfsuserd from using an AF_LOCAL
socket, so it should avoid any such panic().
r320757 did fix a problem with running the nfsuserd when jails were
enabled, but that can be dealt with less elegantly by allowing the
use of an alternate address instead of 127.0.0.1.
The gssd daemon also uses an AF_LOCAL socket, but it will do upcalls
before the nfsd thread processes the RPC, so I think it should not
be suseptible to this problem.

PR: 230752

5 years agoUse unifdef -x1 instead of ignoring the shell exit code
arichardson [Wed, 22 Aug 2018 11:56:51 +0000 (11:56 +0000)]
Use unifdef -x1 instead of ignoring the shell exit code

This way the target fails if unifdef doesn't exist or doesn't modify the
file instead of just generating an empty .c file.
I found this while building without inherited $PATH (D16815)

Approved By: jhb (mentor)

5 years agoStop using unifdef to generate bsdxml.h
arichardson [Wed, 22 Aug 2018 11:56:42 +0000 (11:56 +0000)]
Stop using unifdef to generate bsdxml.h

The current invocation of unifdef causes the build to fail when using a shell
with -o pipefail on by default since unifdef will return a non-zero exit status
if it changes something. The only thing this call to unifdef does is remove 5
lines that will be ignored by the compiler anyway. Furthermore, it is the only
make rule in the source tree that requires unifdef. Removing this call also
makes it slightly easier to build without inhering $PATH (D16815) since we
don't need unifdef anymore.

I also noticed that the sed call to replace the include guard has been broken
for over 10 years since the import of expat 2.0.1 changed it from
`XmlParse_INCLUDED` to `Expat_INCLUDED`. I could also fix this but since it's
been broken for so long and no one noticed, it's probably not necessary.

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

5 years agotop(1): Use warnx and errx instead of fprintf
eadler [Wed, 22 Aug 2018 10:07:15 +0000 (10:07 +0000)]
top(1): Use warnx and errx instead of fprintf

This also makes make "-v" exit without error, since it isn't.

5 years agoloader: bios loader should allow to chain load a file
tsoome [Wed, 22 Aug 2018 10:04:42 +0000 (10:04 +0000)]
loader: bios loader should allow to chain load a file

The current chain command does accept only device, allow also a file to be used,
such as /boot/pmbr or /boot/mbr (or stored third party MBR/VBR block).

Also fix file descriptor leak.

5 years agotop(1): issue warning on invalid delay
eadler [Wed, 22 Aug 2018 09:49:38 +0000 (09:49 +0000)]
top(1): issue warning on invalid delay

When top -sH is run it continually updates. It should issue an warning
instead.

Reported by: jmg
PR: 230803

5 years agopfctl: Remove unused function
kp [Wed, 22 Aug 2018 08:27:49 +0000 (08:27 +0000)]
pfctl: Remove unused function

Fix compile issues.

MFC after: 1 week

5 years agopfctl: Improve set skip handling for groups
kp [Wed, 22 Aug 2018 08:14:29 +0000 (08:14 +0000)]
pfctl: Improve set skip handling for groups

Rely on the kernel to appropriately mark group members as skipped.
Once a group is skipped we can clear the update flag on all the members.

PR: 229241
Submitted by: Andreas Longwitz <longwitz AT incore.de>
MFC after: 1 week

5 years agoMake NVMe compatible with the original API
chuck [Wed, 22 Aug 2018 04:29:24 +0000 (04:29 +0000)]
Make NVMe compatible with the original API

The original NVMe API used bit-fields to represent fields in data
structures defined by the specification (e.g. the op-code in the command
data structure). The implementation targeted x86_64 processors and
defined the bit fields for little endian dwords (i.e. 32 bits).

This approach does not work as-is for big endian architectures and was
changed to use a combination of bit shifts and masks to support PowerPC.
Unfortunately, this changed the NVMe API and forces #ifdef's based on
the OS revision level in user space code.

This change reverts to something that looks like the original API, but
it uses bytes instead of bit-fields inside the packed command structure.
As a bonus, this works as-is for both big and little endian CPU
architectures.

Bump __FreeBSD_version to 1200081 due to API change

Reviewed by: imp, kbowling, smh, mav
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D16404

5 years agoin_mcast: fix copy paste error when clearing flag
mmacy [Wed, 22 Aug 2018 04:09:55 +0000 (04:09 +0000)]
in_mcast: fix copy paste error when clearing flag

5 years agor338172 followup - removal of stray drm references
mmacy [Wed, 22 Aug 2018 03:04:43 +0000 (03:04 +0000)]
r338172 followup - removal of stray drm references

5 years agor338172 follow - remove firmwares
mmacy [Wed, 22 Aug 2018 02:53:35 +0000 (02:53 +0000)]
r338172 follow - remove firmwares

5 years agocleanup after git svn detritus left by r338172
mmacy [Wed, 22 Aug 2018 02:43:34 +0000 (02:43 +0000)]
cleanup after git svn detritus left by r338172

5 years agodisconnect drm2 from tegra build until made self-contained
mmacy [Wed, 22 Aug 2018 02:18:45 +0000 (02:18 +0000)]
disconnect drm2 from tegra build until made self-contained

5 years agolualoader: Fix loader.conf(5) EOL validation for 'exec' lines
kevans [Wed, 22 Aug 2018 01:52:55 +0000 (01:52 +0000)]
lualoader: Fix loader.conf(5) EOL validation for 'exec' lines

This includes some light rework to simplify the line parsing, as well.  If
we hit a line match, we'll always either use the line and move on to the
next line, or we'll spew out malformed line errors.

We had multiple spots to output the error and set the status based on
whether we had a non-nil first capture group or failed EOL validation, but
it was always the same error.  Light rework entails a small label jump to
skip error handling and elimination of 'found' local.

5 years agoRemove legacy drm and drm2 from tree
mmacy [Wed, 22 Aug 2018 01:50:12 +0000 (01:50 +0000)]
Remove legacy drm and drm2 from tree

As discussed on the MLs drm2 conflicts with the ports' version and there
is no upstream for most if not all of drm. Both have been merged in to
a single port.

Users on powerpc, 32-bit hardware, or with GPUs predating Radeon
and i915 will need to install the graphics/drm-legacy-kmod. All
other users should be able to use one of the LinuxKPI-based ports:
graphics/drm-stable-kmod, graphics/drm-next-kmod, graphics/drm-devel-kmod.

MFC: never
Approved by: core@

5 years agolualoader: Refactor config line expressions
kevans [Tue, 21 Aug 2018 23:42:20 +0000 (23:42 +0000)]
lualoader: Refactor config line expressions

A couple of issues addressed:

1.) Modules with - in the name were not recognized as modules
2.) The module regex was repeated for each place a module name may appear
3.) The 'strip leading space' bits were repeated for each expression
4.) The trailing 'comment validation' stuff was repeated every expression

#4 still has some more work to be done. exec lines, for instance, don't
capture a 'value' -- there's only one capture pattern. This throws off the
'c' value that we match, so the trailing bits aren't *actually* being
validated. This isn't a new issue, though, so a future comit will address
this.

5 years agolualoader: Just compare expression directly
kevans [Tue, 21 Aug 2018 23:34:30 +0000 (23:34 +0000)]
lualoader: Just compare expression directly

5 years agocxgbe(4): Be explicit about ignoring the return value of cmpset in some
np [Tue, 21 Aug 2018 23:33:38 +0000 (23:33 +0000)]
cxgbe(4): Be explicit about ignoring the return value of cmpset in some
cases.

Reported by: Coverity (CIDs 10093981009400100940113573251394783).  All false positives.
Sponsored by: Chelsio Communications

5 years agonewsyslog(8): Reject configurations that specify setuid or executable logs
cem [Tue, 21 Aug 2018 23:12:46 +0000 (23:12 +0000)]
newsyslog(8): Reject configurations that specify setuid or executable logs

Prevent some classes of foot-shooting that may result in permissions
problems.

Reviewed by: dab, delphij, vangyzen (earlier version)
Relnotes: yes (behavior change)
Sponsored by: Dell EMC Isilon
Differential Revision: D16831

5 years agoFix resource leak when using strdup(3).
araujo [Tue, 21 Aug 2018 23:11:26 +0000 (23:11 +0000)]
Fix resource leak when using strdup(3).

Reported by: Coverity
CID: 1394929
Sponsored by: iXsystems Inc.

5 years agoFix null deref in mld_v1_transmit_report
mmacy [Tue, 21 Aug 2018 23:03:02 +0000 (23:03 +0000)]
Fix null deref in mld_v1_transmit_report

After r337866 it is possible for an in_multi6 to be referenced while
mid teardown. Handle case of cleared ifnet pointer.

Reported by: ae

5 years agofix copy/paste error when clearing ifma flag
mmacy [Tue, 21 Aug 2018 22:59:22 +0000 (22:59 +0000)]
fix copy/paste error when clearing ifma flag

CID: 1395119
Reported by: vangyzen

5 years agocxgbe/tom: Make sure 'matched' is always initialized before use.
np [Tue, 21 Aug 2018 22:19:34 +0000 (22:19 +0000)]
cxgbe/tom: Make sure 'matched' is always initialized before use.

Reported by: Coverity (CID 1390894)
MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agocxgbe(4): Do not leak memory in case of errors during VI initialization.
np [Tue, 21 Aug 2018 22:15:57 +0000 (22:15 +0000)]
cxgbe(4): Do not leak memory in case of errors during VI initialization.

Reported by: Coverity (CID 1392026)
MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agocxgbe(4): Make it clear that VI_INIT_DONE implies vi->ntxq > 0, and so
np [Tue, 21 Aug 2018 21:42:17 +0000 (21:42 +0000)]
cxgbe(4): Make it clear that VI_INIT_DONE implies vi->ntxq > 0, and so
rc will never be returned uninitialized.

Reported by: Coverity (CID 1394884).  This is a false positive though.
Sponsored by: Chelsio Communications

5 years agocxgbe(4): Check the RO bit properly before disabling relaxed ordering.
np [Tue, 21 Aug 2018 21:32:51 +0000 (21:32 +0000)]
cxgbe(4): Check the RO bit properly before disabling relaxed ordering.

Reported by: Coverity (CID 1384286)
MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoAdd muge(4) to the arm64 GENERIC kernel
gonzo [Tue, 21 Aug 2018 21:30:19 +0000 (21:30 +0000)]
Add muge(4) to the arm64 GENERIC kernel

muge(4) is the USB ethernet adapter that is used in RPi 3B+. Shipping it
in GENERIC kernel allows using NFS root out of the box instead of either
building custom kernel or modifying loader.conf for early loading of if_muge.ko

No objections: emaste

5 years agocxgbe(4): Avoid overflow while calculating channel rate.
np [Tue, 21 Aug 2018 21:08:58 +0000 (21:08 +0000)]
cxgbe(4): Avoid overflow while calculating channel rate.

Reported by: Coverity (CID 1008352)
MFC after: 1 week
Sponsored by: Chelsio Communications

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