]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoifconfig.4, lagg.4: fix documentation bug: -use_flowid needs to be used
Eugene Grosbein [Sat, 22 Dec 2018 11:38:54 +0000 (11:38 +0000)]
ifconfig.4, lagg.4: fix documentation bug: -use_flowid needs to be used
to force local hash computation and disable usage of RSS hash
provided by driver.

PR: 234242
MFC after: 1 week

5 years agoOops, rounddown() for the start was misspelled roundup() in r342295,
Bruce Evans [Sat, 22 Dec 2018 09:31:55 +0000 (09:31 +0000)]
Oops, rounddown() for the start was misspelled roundup() in r342295,
so only aligned starts worked.  This broke releasing caches in most
cases where the i/o size is smaller than the fs block size.

5 years agoconfig(8): Remove all instances of an option when opting out
Kyle Evans [Sat, 22 Dec 2018 06:08:06 +0000 (06:08 +0000)]
config(8): Remove all instances of an option when opting out

Quick follow-up to r342362: options can appear multiple times now, so
clean up all of them as needed. For non-OPTIONS options, this has no effect
since they're already de-duplicated.

MFC after: 1 week
X-MFC-With: r342362

5 years agoconfig(8): Allow duplicate options to be specified
Kyle Evans [Sat, 22 Dec 2018 06:02:34 +0000 (06:02 +0000)]
config(8): Allow duplicate options to be specified

config(8)'s option handling has been written to allow duplicate options; if
the value changes, then the latest value is used and an informative message
is printed to stderr like so:

/usr/src/sys/amd64/conf/TEST: option "VERBOSE_SYSINIT" redefined from 0 to 1

Currently, this is only a possibility for cpu types, MAXUSERS, and
MACHINE_ARCH. Anything else duplicated in a config file will use the first
value set and error about duplicated options on subsequent appearances,
which is arguably unfriendly since one could specify:

include GENERIC
nooptions VERBOSE_SYSINIT
options VERBOSE_SYSINIT

to redefine the value later anyways.

Reported by: mmacy
MFC after: 1 week

5 years agoTry the first 256 units with nvmecontrol devlist.
Warner Losh [Fri, 21 Dec 2018 23:22:37 +0000 (23:22 +0000)]
Try the first 256 units with nvmecontrol devlist.

The nvmecontrol code that did the devlist assumed that we had a
tightly-packed allocation of units. Since pci writing exists, this
isn't the case. Loop over the first 256 units, which is a reasonable
number of possible units.

Sponsored by: Netflix

5 years agoFix clobbering of the fatchain cache for clustered i/o's when full
Bruce Evans [Fri, 21 Dec 2018 21:17:45 +0000 (21:17 +0000)]
Fix clobbering of the fatchain cache for clustered i/o's when full
clustering is not done.  The bug caused extreme slowness for large
files in some cases.

There is no way to tell VOP_BMAP() how many blocks are wanted, so for
all file systems it has to waste time in some cases by searching for
more contiguous blocks than will be accessed.  For msdosfs, it also
clobbered the fatchain cache in these cases by advancing the cache to
point to the chain entry for block that won't be read.  This makes
the cache useless for the next sequential i/o (or VOP_BMAP()), so the
fat chain is searched from the beginning.  The cache only has 1 relevant
entry, so it is similarly useless for random i/o.

Fix this by only advancing the cache to point to the chain entry for
the first block that will be read.  Clustering uses results from
VOP_BMAP(), so when more than 1 block is read by clustering, the cache
is not advanced as optimally as before, but it is at most 1 cluster
size behind and searching the chain through the blocks for this cluster
doesn't take too long.

5 years agoRemove unused macros from t4_tom.h.
Navdeep Parhar [Fri, 21 Dec 2018 20:46:45 +0000 (20:46 +0000)]
Remove unused macros from t4_tom.h.

5 years agomps(4), mpr(4): remove SATA ID command cancellation hack
Conrad Meyer [Fri, 21 Dec 2018 20:30:52 +0000 (20:30 +0000)]
mps(4), mpr(4): remove SATA ID command cancellation hack

Add a generic mechanism to override mp?_wait_command's timeout behavior,
which continues to invoke reinit by default.  Invokers who set
cm_timeout_handler may avoid automatic reinit and do their own handling.

Adapt mp?sas_get_sata_identify to this mechanism and remove its callout
hack.

Reviewed by: scottl
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D18614

5 years agomps(4), mpr(4): Fix lifetime of command buffer for mp?sas_get_sata_identify
Conrad Meyer [Fri, 21 Dec 2018 20:29:16 +0000 (20:29 +0000)]
mps(4), mpr(4): Fix lifetime of command buffer for mp?sas_get_sata_identify

In the event that the ID command timed out, mps(4)/mpr(4) did not free the
command until it could be cancelled.  However, it freed the associated
buffer (cm_data).  Fix the lifetime issue by freeing the associated buffer
only after Abort Task or controller reset.

Reviewed by: scottl
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D18612

5 years agoQuick fix for initialization of mnt_iosize_max. (This limit controls
Bruce Evans [Fri, 21 Dec 2018 20:12:43 +0000 (20:12 +0000)]
Quick fix for initialization of mnt_iosize_max.  (This limit controls
mainly clustering and read-ahead.)  Copy the initialization from ffs,
and also copy a couple of lines of ffs's nearby style for initialization
order and whitespace.

A correct fix would de-duplicate the initialization and fix bitrot in it
instead of adding another instance of the duplication.  Complications to
use the size preferred by the device have been reduced to hard-coding
slightly pessimal and/or inconsistent defaults, using large code that was
almost needed to support the complications.

For msdosfs, the result was that mnt_iosize_max was DFTLPHYS (64K) but is
now MAXPHYS (128K).

5 years agoFix passing wrong variables to nvlist_destroy() after r333446.
Alexander Motin [Fri, 21 Dec 2018 17:22:15 +0000 (17:22 +0000)]
Fix passing wrong variables to nvlist_destroy() after r333446.

Reported by: Alexander Fedorov (IT-Grad.ru)
MFC after: 5 days

5 years agonetmap: update nmreplay(8)
Vincenzo Maffione [Fri, 21 Dec 2018 14:45:10 +0000 (14:45 +0000)]
netmap: update nmreplay(8)

Small modifications to the nmreplay man page.
Used igor and mandoc tools to fix warnings and errors.

Reviewed by: bcr
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D18629

5 years agonetmap: nmreplay: import various fixes from upstream (2704a51839906)
Vincenzo Maffione [Fri, 21 Dec 2018 13:56:57 +0000 (13:56 +0000)]
netmap: nmreplay: import various fixes from upstream (2704a51839906)

Changelist:
    - General reformatting
    - Fix packet duplication in cons(). Whenever cons() reached the
      burst limit it would send all pending packets without advancing
      head. This caused the last injected packet to be sent again in
      the next round.
    - Fix full-speed transmissions after first loop.

MFC after: 3 days

5 years agonetmap: move buf_size validation code to its own function
Vincenzo Maffione [Fri, 21 Dec 2018 11:50:14 +0000 (11:50 +0000)]
netmap: move buf_size validation code to its own function

This code validates the netmap buf_size against the interface MTU
and maximum descriptor size, to make sure the values are consistent.
Moving this functionality to its own function is needed because this
function is also called by Linux-specific code.

MFC after: 3 days

5 years agonetmap: pipes: make sure both ends use the same number of slots
Vincenzo Maffione [Fri, 21 Dec 2018 11:32:55 +0000 (11:32 +0000)]
netmap: pipes: make sure both ends use the same number of slots

5 years agoAllow use underscores and dots in service names without escaping.
Andrey V. Elsukov [Fri, 21 Dec 2018 10:41:45 +0000 (10:41 +0000)]
Allow use underscores and dots in service names without escaping.

PR: 234237
MFC after: 1 week

5 years agoUse VOP_ADVISE() with POSIX_FADV_DONTNEED instead of IO_DIRECT to
Bruce Evans [Fri, 21 Dec 2018 08:15:31 +0000 (08:15 +0000)]
Use VOP_ADVISE() with POSIX_FADV_DONTNEED instead of IO_DIRECT to
implement not double-caching for reads from vnode-backed md devices.
Use VOP_ADVISE() similarly instead of !IO_DIRECT unsimilarly for writes.
Add a "cache" option to mdconfig to allow changing the default of not
caching.

This depends on a recent commit to fix VOP_ADVISE().  A previous version
had optimizations for sequential i/o's (merge the i/o's and only uncache
for discontiguous i/o's and for full blocks), but optimizations and
knowledge of block boundaries belong in VOP_ADVISE().  Read-ahead should
also be handled better, by supporting it in md and discarding it in
VOP_ADVISE().

POSIX_FADV_DONTNEED is ignored by zfs, but so is IO_DIRECT.

POSIX_FADV_DONTNEED works better than IO_DIRECT if it is not ignored,
since it only discards from the buffer cache immediately, while
IO_DIRECT also discards from the page cache immediately.

IO_DIRECT was not used for writes since it was claimed to be too slow,
but most of the slowness for writes is from doing them synchronously by
default.  Non-synchronous writes still deadlock in many cases.

IO_DIRECT only has a special implementation for ffs reads with DIRECTIO
configured.  Otherwise, if it is not ignored than it uses the buffer and
page caches normally except for discarding everything after each i/o,
and then it has much the same overheads as POSIX_FADV_DONTNEED.  The
overheads for reading with ffs and DIRECTIO were similar in tests of md.

Reviewed by: kib

5 years agoFix missing (sub)options in usage message to prepare for adding a new one.
Bruce Evans [Fri, 21 Dec 2018 06:38:13 +0000 (06:38 +0000)]
Fix missing (sub)options in usage message to prepare for adding a new one.

Reviewed by: kib

5 years agoFix rounding in vop_stdadvise() for POSIX_FADV_NOREUSE (really
Bruce Evans [Fri, 21 Dec 2018 04:57:59 +0000 (04:57 +0000)]
Fix rounding in vop_stdadvise() for POSIX_FADV_NOREUSE (really
POSIX_FADV_DONTNEED).  The most broken case was for applications that
advise for the whole file and then do block-aligned i/o's 1 block at
a time.  Then advice is sent to VOP_ADVISE() 1 block at a time, but
in vop_stdadvise() the 1-block advice was turned into 0-block advice
for the buffer cache part.

The bugs were caused partly by callers representing the region as
(a_start, a_end), where a_end is actually the maximum, and everything
else representing the region as (start, end) where 'end' is actually
the end (1 after the maximum).  The maximum a_end must be rounded up,
but was rounded down.  Also, rounding to page boundaries was inconsistent.

The bugs and fixes have no effect for zfs and other file systems that
don't use the buffer cache or the page cache.  Most or all file systems
currently use the default VOP_FADVISE(), but it finds a null buffer cache
and a null page cache for file systems that don't use normal methods.

Reviewed by: kib

5 years agoSome filesystems (like cd9660 and ext3) require that VFS_STATFS()
Kirk McKusick [Fri, 21 Dec 2018 01:09:25 +0000 (01:09 +0000)]
Some filesystems (like cd9660 and ext3) require that VFS_STATFS()
be called before VFS_ROOT() is called. Move the call for VFS_STATFS()
so that it is done after VFS_MOUNT(), but before VFS_ROOT().
This change actually improves the robustness of the mount system
call because it returns an error rather than failing silently
when VFS_STATFS() returns failure.

Reported by:  Rebecca Cran <rebecca@bluestop.org>
Sponsored by: Netflix

5 years agocxgbe/iw_cxgbe: Remove redundant CTRs from c4iw_alloc/c4iw_rdev_open.
Navdeep Parhar [Thu, 20 Dec 2018 22:39:58 +0000 (22:39 +0000)]
cxgbe/iw_cxgbe: Remove redundant CTRs from c4iw_alloc/c4iw_rdev_open.
This information is readily available elsewhere.

Sponsored by: Chelsio Communications

5 years agocxgbe/iw_cxgbe: Do not terminate CTRx messages with \n.
Navdeep Parhar [Thu, 20 Dec 2018 22:31:07 +0000 (22:31 +0000)]
cxgbe/iw_cxgbe: Do not terminate CTRx messages with \n.

5 years agoAdd an UPDATING message for r342286.
Rick Macklem [Thu, 20 Dec 2018 22:26:54 +0000 (22:26 +0000)]
Add an UPDATING message for r342286.

5 years agoFix the NFSv4 server to obey vfs.nfsd.nfs_privport.
Rick Macklem [Thu, 20 Dec 2018 22:21:41 +0000 (22:21 +0000)]
Fix the NFSv4 server to obey vfs.nfsd.nfs_privport.

When the NFSv4 server was coded, I believed that the specification authors
did not want NFSv4 servers to require a client to use a reserved port#.
However, recently it has been noted that the Linux NFSv4 server does support
a check for a reserved port#.
Since both the FreeBSD and Linux NFSv4 clients use a reserved port# by
default, enabling vfs.nfsd.nfs_privport to require a reserved port# for
NFSv4 the same as it does for NFSv2, 3 seems reasonable.
The only case where this could cause a POLA violation is a FreeBSD NFSv4
server with vfs.nfsd.nfs_privport set, but with NFSv4 clients doing mounts
without using a reserved port# (< 1024).

Tested by: chaz.newton58@gmail.com
PR: 234106
MFC after: 1 week

5 years agotpm(4): Fix GCC build after r342084 (TPM 2.0 driver commit)
Conrad Meyer [Thu, 20 Dec 2018 20:55:33 +0000 (20:55 +0000)]
tpm(4): Fix GCC build after r342084 (TPM 2.0 driver commit)

Move static variable definition (cdevsw) to a more conventional location
(the C file it is used in), rather than a header.

This fixes the GCC warning, -Wunused-variable ("defined but not used") when
the tpm20.h header is included in files other than tpm20.c (e.g.,
tpm_tis.c).

X-MFC-with: r342084
Sponsored by: Dell EMC Isilon

5 years agocxgbe(4): Make sure the rx queues start off with the correct timestamp
Navdeep Parhar [Thu, 20 Dec 2018 20:34:21 +0000 (20:34 +0000)]
cxgbe(4): Make sure the rx queues start off with the correct timestamp
settings on initialization.

Sponsored by: Chelsio Communications

5 years agoRework UEFI ESP generation
Rebecca Cran [Thu, 20 Dec 2018 19:39:37 +0000 (19:39 +0000)]
Rework UEFI ESP generation

Currently, the installer uses pre-created 800KB FAT12 filesystems that
it dd's onto the ESP partition.
This changeset improves that by having the installer generate a FAT32
filesystem directly onto the ESP using newfs_msdos and then copying
loader.efi into /EFI/freebsd.
For live installs it then runs efibootmgr to add a FreeBSD boot entry
in the BIOS.

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

5 years agoWait a maximum of 300 seconds for network send/recv in libsa
Rebecca Cran [Thu, 20 Dec 2018 19:27:46 +0000 (19:27 +0000)]
Wait a maximum of 300 seconds for network send/recv in libsa

The reason for this change is that currently, a send/recv
takes many hours to time out.
This is suboptimal in the bootloader because it means for example
that NFS will take hours to fail before allowing subsequent access
methods such as gzip to be tried.

Setting MAXWAIT to 300 seconds (5 minutes) still allows slow
connections of 1Mb to be used to download a 30MB kernel file.

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

5 years agoFix a regression in the TCP handling of received segments.
Michael Tuexen [Thu, 20 Dec 2018 16:05:30 +0000 (16:05 +0000)]
Fix a regression in the TCP handling of received segments.
When receiving TCP segments the stack protects itself by limiting
the resources allocated for a TCP connections. This patch adds
an exception to these limitations for the TCP segement which is the next
expected in-sequence segment. Without this patch, TCP connections
may stall and finally fail in some cases of packet loss.

Reported by: jhb@
Reviewed by: jtl@, rrs@
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D18580

5 years agoRemove setting of long-unused MK_NCP option
Ed Maste [Thu, 20 Dec 2018 15:53:27 +0000 (15:53 +0000)]
Remove setting of long-unused MK_NCP option

NCP was removed from the tree in 2013 (r248097) and disconnected some
time before.

Reported by: bz
Sponsored by: The FreeBSD Foundation

5 years agoFix panic message when we can't create thread for one wire temperature
Warner Losh [Thu, 20 Dec 2018 05:46:56 +0000 (05:46 +0000)]
Fix panic message when we can't create thread for one wire temperature
reading.

5 years agocxgbe/iw_cxgbe: Use -ve errno when interfacing with linuxkpi/OFED.
Navdeep Parhar [Thu, 20 Dec 2018 01:35:45 +0000 (01:35 +0000)]
cxgbe/iw_cxgbe: Use -ve errno when interfacing with linuxkpi/OFED.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

5 years agoFix obtaining RSP address in TPM CRB for non-amd64 platforms
Marcin Wojtas [Thu, 20 Dec 2018 01:05:09 +0000 (01:05 +0000)]
Fix obtaining RSP address in TPM CRB for non-amd64 platforms

On amd64 the RSP address can be read in single 8-byte transaction,
which is obviously not possible on 32-bit platforms. Fix that
by performing 2 4-byte read on them.

Obtained from: Semihalf
Sponsored by: Stormshield

5 years agocxgbe/iw_cxgbe: Add a knob for testing that lets iWARP connections cycle
Navdeep Parhar [Thu, 20 Dec 2018 01:00:21 +0000 (01:00 +0000)]
cxgbe/iw_cxgbe: Add a knob for testing that lets iWARP connections cycle
through 4-tuples quickly.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

5 years agocxgbe/iw_cxgbe: Use DSGLs to write to card's memory when appropriate.
Navdeep Parhar [Wed, 19 Dec 2018 23:29:01 +0000 (23:29 +0000)]
cxgbe/iw_cxgbe: Use DSGLs to write to card's memory when appropriate.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

5 years agoregcomp: revert part of r341838 which turned out to be unrelated
Yuri Pankov [Wed, 19 Dec 2018 23:28:56 +0000 (23:28 +0000)]
regcomp: revert part of r341838 which turned out to be unrelated
and caused issues with search in less.

PR: 234066
Reviewed by: pfg
Differential revision: https://reviews.freebsd.org/D18611

5 years agoCheck for probes enabled in priv_check_cred before evaluting the error.
Mateusz Guzik [Wed, 19 Dec 2018 23:28:29 +0000 (23:28 +0000)]
Check for probes enabled in priv_check_cred before evaluting the error.

Sponsored by: The FreeBSD Foundation

5 years agoAdd note to 32-bit mips smp config files documenting the status
Warner Losh [Wed, 19 Dec 2018 23:22:14 +0000 (23:22 +0000)]
Add note to 32-bit mips smp config files documenting the status

5 years agoProvide SDT_PROBES_ENABLED for kernels without KDTRACE.
Mateusz Guzik [Wed, 19 Dec 2018 23:19:05 +0000 (23:19 +0000)]
Provide SDT_PROBES_ENABLED for kernels without KDTRACE.

Sponsored by: The FreeBSD Foundation

5 years ago32-bit mips SMP is unsupported
Warner Losh [Wed, 19 Dec 2018 23:15:49 +0000 (23:15 +0000)]
32-bit mips SMP is unsupported

Per discussions on mips@, 32-bit mips SMP is now unsupported. The
files in the tree will compile for a while longer, but when the
atomic_swap_64 or similar atomic enters into the MI part of the tree,
as currently foreseen sometime next year, these ports will start to no
longer link. The JZ4780 is the only such system we have.

The UP version of this chip is unaffected by this, and will remain
supported.

Discussed on: mips@
Relnotes: yes

5 years agoAllow multi-byte thousands separators in strfmon(3)
Conrad Meyer [Wed, 19 Dec 2018 22:57:47 +0000 (22:57 +0000)]
Allow multi-byte thousands separators in strfmon(3)

PR: 234010
Reported by: Jon Tejnung <jon AT herrskogen.se>
Reviewed by: yuripv
Differential Revision: https://reviews.freebsd.org/D18605

5 years agoFix the date
Warner Losh [Wed, 19 Dec 2018 22:56:31 +0000 (22:56 +0000)]
Fix the date

The first part of the mips pruning has been commited. This part
is uncontested. Fix the date in the UPDATING file to reflect when
I made the commit. The contested parts will be committed (or not)
once those discussions complete.

5 years agoRemove old config file for SENTRY5
Warner Losh [Wed, 19 Dec 2018 22:54:34 +0000 (22:54 +0000)]
Remove old config file for SENTRY5

This is an older broadcom part that implements the mips32 ISA. 32-bit
FreeBSD/mips now requires mips32r2, so retire this config. Most of the
broadcom port is shared with newer ports, so what little code may be
unique to this part has not been GC'd at this time.

Discussed on: freebsd-mips@
Differential Revision: https://reviews.freebsd.org/D18543

5 years agoRemove support for running 32-bit kernels on 64-bit hardware.
Warner Losh [Wed, 19 Dec 2018 22:54:29 +0000 (22:54 +0000)]
Remove support for running 32-bit kernels on 64-bit hardware.

This was useful in bring up. However, it causes more issues than the
support is worth (64-bit atomics being chief among them).

Discussed on: freebsd-mips@
Differential Revision: https://reviews.freebsd.org/D18543

5 years agoRemove the GXEMUL support.
Warner Losh [Wed, 19 Dec 2018 22:54:23 +0000 (22:54 +0000)]
Remove the GXEMUL support.

gxemul was a nice stop-gap while qemu support for mips was firmed
up. Now MALTA* + qemu is the platform of choice retire gxemul support.
It's unknown when this was last confirmed working.

Discussed on: freebsd-mips@
Differential Revision: https://reviews.freebsd.org/D18543

5 years agoRemove support for the now very old SiByte MIPS platform. It's not
Warner Losh [Wed, 19 Dec 2018 22:54:03 +0000 (22:54 +0000)]
Remove support for the now very old SiByte MIPS platform. It's not
relevant and is unused. It's also getting in the way of progress in
some admittedly minor ways. Better to retire it to reduce the burden
on the project.

Discussed on: freebsd-mips@
Differential Revision: https://reviews.freebsd.org/D18543

5 years agoFix alignment issue in uefisign
Marcin Wojtas [Wed, 19 Dec 2018 22:47:37 +0000 (22:47 +0000)]
Fix alignment issue in uefisign

The pe_certificate structure has to be aligned to 8 bytes. [1]
Since this is now checked in edk2, any binaries signed with
older version of this tool will fail verification.

References:
[1] https://docs.microsoft.com/en-us/windows/desktop/Debug/pe-format#the-attribute-certificate-table-image-only

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: trasz
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D18554

5 years agoInclude the new TPM 2.0 driver in the TPM module.
Marcin Wojtas [Wed, 19 Dec 2018 22:43:10 +0000 (22:43 +0000)]
Include the new TPM 2.0 driver in the TPM module.

Update the appropriate Makefile to build the new driver
together with the old one.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reported by: kib
Obtained from: Semihalf
Sponsored by: Stormshield

5 years agomac: reduce pessimization of sdt probe handling
Mateusz Guzik [Wed, 19 Dec 2018 22:30:26 +0000 (22:30 +0000)]
mac: reduce pessimization of sdt probe handling

Prior to the change the code would branch on return value and then check
if probes are enabled. Since vast majority of the time they are not, this
is clearly wasteful. Check probes first.

Sponsored by: The FreeBSD Foundation

5 years agoRemove iBCS2: plug a wart missed in r342242
Mateusz Guzik [Wed, 19 Dec 2018 22:08:51 +0000 (22:08 +0000)]
Remove iBCS2: plug a wart missed in r342242

Sponsored by: The FreeBSD Foundation

5 years agoRemove iBCS2, part3: the implementation
Mateusz Guzik [Wed, 19 Dec 2018 22:02:49 +0000 (22:02 +0000)]
Remove iBCS2, part3: the implementation

Reviewed by: kib (previous version)
Sponsored by: The FreeBSD Foundation

5 years agoRemove iBCS2, part2: general kernel
Mateusz Guzik [Wed, 19 Dec 2018 21:57:58 +0000 (21:57 +0000)]
Remove iBCS2, part2: general kernel

Reviewed by: kib (previous version)
Sponsored by: The FreeBSD Foundation

5 years agoRemove iBCS2, part1: userspace
Mateusz Guzik [Wed, 19 Dec 2018 21:56:54 +0000 (21:56 +0000)]
Remove iBCS2, part1: userspace

iBCS2 was disconnected from the build in 2015 (see r291419)

bsdconfig parts submitted by dteske.

Reviewed by: kib (previous version)
Sponsored by: The FreeBSD Foundation

5 years agoMicrooptimize corner case of ID bitmap handling.
Mateusz Guzik [Wed, 19 Dec 2018 20:29:52 +0000 (20:29 +0000)]
Microoptimize corner case of ID bitmap handling.

Prior to the change we would avoidably test more possibly used IDs.

While here update the comment: there is no pidchecked variable anymore.

5 years agoDeinline vfork handling out of the syscall return path.
Mateusz Guzik [Wed, 19 Dec 2018 20:27:26 +0000 (20:27 +0000)]
Deinline vfork handling out of the syscall return path.

vfork is rarely called (comparatively to other syscalls) and it avoidably
pollutes the fast path.

Sponsored by: The FreeBSD Foundation

5 years agoUpdate priv(9) after r341827
Mateusz Guzik [Wed, 19 Dec 2018 20:25:58 +0000 (20:25 +0000)]
Update priv(9) after r341827

Reported by: trasz
Sponsored by: The FreeBSD Foundation

5 years agocxgbe(4): Do not issue mbox commands after t4_fw_bye.
Navdeep Parhar [Wed, 19 Dec 2018 19:21:29 +0000 (19:21 +0000)]
cxgbe(4): Do not issue mbox commands after t4_fw_bye.

Sponsored by: Chelsio Communications

5 years agobootpd: validate hardware type
Ed Maste [Wed, 19 Dec 2018 18:16:29 +0000 (18:16 +0000)]
bootpd: validate hardware type

Due to insufficient validation of network-provided data it may have been
possible for a malicious actor to craft a bootp packet which could cause
a stack buffer overflow.

admbugs: 850
Reported by: Reno Robert
Reviewed by: markj
Approved by: so
Security: FreeBSD-SA-18:15.bootpd
Sponsored by: The FreeBSD Foundation

5 years agoReplace uses of sbadaddr with stval.
Mark Johnston [Wed, 19 Dec 2018 17:52:09 +0000 (17:52 +0000)]
Replace uses of sbadaddr with stval.

The sbadaddr register was renamed in version 1.10 of the privileged
architecture specification.  No functional change intended.

Submitted by: Mitchell Horne <mhorne063@gmail.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18594

5 years agoImplement cpu_halt() for RISC-V.
Mark Johnston [Wed, 19 Dec 2018 17:45:16 +0000 (17:45 +0000)]
Implement cpu_halt() for RISC-V.

Submitted by: Mitchell Horne <mhorne063@gmail.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18595

5 years agoasmc: Add support for MacPro1,1
David Bright [Wed, 19 Dec 2018 16:45:37 +0000 (16:45 +0000)]
asmc: Add support for MacPro1,1

PR: 203431
Submitted by: jjr@alisa.org & holindho@saunalahti.fi
Reported by: jjr@alisa.org
MFC after: 1 week

5 years agoRemove a use of a negative array index from fxp(4).
Mark Johnston [Wed, 19 Dec 2018 04:54:32 +0000 (04:54 +0000)]
Remove a use of a negative array index from fxp(4).

This fixes a warning seen when compiling amd64 GENERIC with clang 7.
Also remove the workaround added in r337324.  clang 7 and gcc 4.2
generate the same code with or without the code change.

Reviewed by: imp (previous version)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D18603

5 years agonet80211: fix out-of-bounds read in ieee80211_amrr(9).
Andriy Voskoboinyk [Wed, 19 Dec 2018 03:08:10 +0000 (03:08 +0000)]
net80211: fix out-of-bounds read in ieee80211_amrr(9).

ieee80211_alloc_node() does not initialize rateset tables; that's not
expected by rate control modules and will result in array access at
index -1 - where ni_essid[] array is located (zeroed at allocation, so
there are no user-visible consequences).

Just delay rate control initialization to the moment, when rateset
tables are initiaziled; nothing will use rates here anyway.

MFC after: 4 days

5 years agocxgbe/t4_tom: fixes for issues on the passive open side.
Navdeep Parhar [Wed, 19 Dec 2018 01:37:00 +0000 (01:37 +0000)]
cxgbe/t4_tom: fixes for issues on the passive open side.

- Fix PR 227760 by getting the TOE to respond to the SYN after the call
  to toe_syncache_add, not during it.  The kernel syncache code calls
  syncache_respond just before syncache_insert.  If the ACK to the
  syncache_respond is processed in another thread it may run before the
  syncache_insert and won't find the entry.  Note that this affects only
  t4_tom because it's the only driver trying to insert and expand
  syncache entries from different threads.

- Do not leak resources if an embryonic connection terminates at
  SYN_RCVD because of L2 lookup failures.

- Retire lctx->synq and associated code because there is never a need to
  walk the list of embryonic connections associated with a listener.
  The per-tid state is still called a synq entry in the driver even
  though the synq itself is now gone.

PR: 227760
MFC after: 2 weeks
Sponsored by: Chelsio Communications

5 years agoFix DDB's "show malloc" after r338899.
Mark Johnston [Wed, 19 Dec 2018 00:17:22 +0000 (00:17 +0000)]
Fix DDB's "show malloc" after r338899.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agocyapa.4, isl.4: cross-reference and document use of chromebook_platform(4)
Andriy Gapon [Tue, 18 Dec 2018 21:43:33 +0000 (21:43 +0000)]
cyapa.4, isl.4: cross-reference and document use of chromebook_platform(4)

PR: 218632
Reported by: Denis Kozadaev <denis@tambov.ru>
MFC after: 1 week

5 years agoUse mbufq instead of ifqueue to queue mbufs.
Gleb Smirnoff [Tue, 18 Dec 2018 19:38:13 +0000 (19:38 +0000)]
Use mbufq instead of ifqueue to queue mbufs.

5 years agoFix typo and formatting...
Warner Losh [Tue, 18 Dec 2018 19:05:57 +0000 (19:05 +0000)]
Fix typo and formatting...

5 years agoadd pre-commit review request for drm*.
Warner Losh [Tue, 18 Dec 2018 18:52:12 +0000 (18:52 +0000)]
add pre-commit review request for drm*.
Move dev/usb/wlan to sys/dev/usb/wlan as it was the odd-man-out.

5 years agoichwd: add a few assertions about tco_version
Andriy Gapon [Tue, 18 Dec 2018 17:17:53 +0000 (17:17 +0000)]
ichwd: add a few assertions about tco_version

Those should ensure correctness of ichwd_find_ich_lpc_bridge() and
ichwd_find_ich_lpc_bridge() as well as make it easier for both humans
and static analyzers to see the relation between tco_version and ich and
smb variables in ichwd_identify().

Reported by: Coverity
CID: 13963141396317
MFC after: 10 days

5 years agoUse caph_enter_casper() in ping(8).
Mark Johnston [Tue, 18 Dec 2018 16:47:03 +0000 (16:47 +0000)]
Use caph_enter_casper() in ping(8).

Reported by: oshogbo
MFC with: r341837
Sponsored by: The FreeBSD Foundation

5 years agoconst poison the `new` pointer of __sysctl.
Brooks Davis [Tue, 18 Dec 2018 12:44:38 +0000 (12:44 +0000)]
const poison the `new` pointer of __sysctl.

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18444

5 years agoiwi(4): do not leak node reference when IWI_FLAG_ASSOCIATED flag is set.
Andriy Voskoboinyk [Tue, 18 Dec 2018 05:08:56 +0000 (05:08 +0000)]
iwi(4): do not leak node reference when IWI_FLAG_ASSOCIATED flag is set.

MFC after: 6 days

5 years agoMFV r342175:
Cy Schubert [Tue, 18 Dec 2018 01:12:30 +0000 (01:12 +0000)]
MFV r342175:

Update sqlite3-3.23.1 --> sqlite3-3.26.0 (3260000)

MFC after: 3 days
Security: https://blade.tencent.com/magellan/index_en.html
No known CVE was apparently registered.

5 years agoRemove UMS support code from radeonkms.
Mark Johnston [Mon, 17 Dec 2018 21:48:20 +0000 (21:48 +0000)]
Remove UMS support code from radeonkms.

The code is unreachable since the entries of radeon_ioctls[] are not
associated with any device: we provide only the KMS entry points.
Moreover, r600_cp_dispatch_texture() contains an integer overflow bug
that can be triggered from userspace.[1]

Reported by: Anonymous of the Shellphish Grill Team[1]
Reviewed by: dumbbell
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18516

5 years agoCatch up with r338948.
Mark Johnston [Mon, 17 Dec 2018 21:34:09 +0000 (21:34 +0000)]
Catch up with r338948.

MFC with: r342178

5 years agofix formatting and style in ig4iic_acpi_probe afetr r339754
Andriy Gapon [Mon, 17 Dec 2018 21:33:25 +0000 (21:33 +0000)]
fix formatting and style in ig4iic_acpi_probe afetr r339754

This includes removing stray whitespace, adding a line after the
variable declaration block and removing a redundant check.

MFC after: 1 week
X-MFC with: r339754

5 years agoRevert r336326.
Mark Johnston [Mon, 17 Dec 2018 21:13:05 +0000 (21:13 +0000)]
Revert r336326.

In testing on a Dell Latitude 7480, having ig4.ko loaded during a
suspend caused the system to hang.  It turns out that ig4iic_intr() was
being called after the device entered D3, and entered an infinite loop
because a read of the I2C status register returned all ones, causing us
to attempt to read a byte from the data buffer until one of the status
bits clears.  This occured because ig4iic_pci0 shares an interrupt with
the VGA device on this laptop, so ig4iic_intr() gets called even when
there is no work to do.  This is exactly the problem fixed by r342170,
which resolves the hang for me and allows suspend/resume to work with
ig4.ko loaded.  So, re-enable autoloading of ig4.ko in the hope that
r342170 resolves the problem universally.

Reviewed by: gonzo
MFC after: 1 month (pending an MFC of r342170)
Differential Revision: https://reviews.freebsd.org/D18587

5 years agoImport sqlite3-3.26.0 (3260000)
Cy Schubert [Mon, 17 Dec 2018 20:19:35 +0000 (20:19 +0000)]
Import sqlite3-3.26.0 (3260000)

Obtained from: https://www.sqlite.org/2018/sqlite-autoconf-3260000.tar.gz

5 years agoConditionalize installtion audit(4) tests on MK_AUDIT
Alan Somers [Mon, 17 Dec 2018 18:35:32 +0000 (18:35 +0000)]
Conditionalize installtion audit(4) tests on MK_AUDIT

MK_AUDIT already controls auditd(8), praudit(1), etc.  It should also control
the audit test suite.

Submitted by: ngie
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd/pull/240

5 years agoaudit(4) tests: require /etc/rc.d/auditd
Alan Somers [Mon, 17 Dec 2018 18:11:06 +0000 (18:11 +0000)]
audit(4) tests: require /etc/rc.d/auditd

These tests should be skipped if /etc/rc.d/auditd is missing, which could be
the case if world was built with WITHOUT_AUDIT set.  Also, one test case
requires /etc/rc.d/accounting.

Submitted by: ngie
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd/pull/240

5 years agoasmc: Add support for mid-2011 Macmini 5,2
David Bright [Mon, 17 Dec 2018 17:21:45 +0000 (17:21 +0000)]
asmc: Add support for mid-2011 Macmini 5,2

PR: 225911
Submitted by: trev <fbsdbugs4@sentry.org>
Reported by: trev <fbsdbugs4@sentry.org>
MFC after: 1 week

5 years agoadd support for marking interrupt handlers as suspended
Andriy Gapon [Mon, 17 Dec 2018 17:11:00 +0000 (17:11 +0000)]
add support for marking interrupt handlers as suspended

The goal of this change is to fix a problem with PCI shared interrupts
during suspend and resume.

I have observed a couple of variations of the following scenario.
Devices A and B are on the same PCI bus and share the same interrupt.
Device A's driver is suspended first and the device is powered down.
Device B generates an interrupt. Interrupt handlers of both drivers are
called. Device A's interrupt handler accesses registers of the powered
down device and gets back bogus values (I assume all 0xff). That data is
interpreted as interrupt status bits, etc. So, the interrupt handler
gets confused and may produce some noise or enter an infinite loop, etc.

This change affects only PCI devices.  The pci(4) bus driver marks a
child's interrupt handler as suspended after the child's suspend method
is called and before the device is powered down.  This is done only for
traditional PCI interrupts, because only they can be shared.

At the moment the change is only for x86.

Notable changes in core subsystems / interfaces:
- BUS_SUSPEND_INTR and BUS_RESUME_INTR methods are added to bus
  interface along with convenience functions bus_suspend_intr and
  bus_resume_intr;
- rman_set_irq_cookie and rman_get_irq_cookie functions are added to
  provide a way to associate an interrupt resource with an interrupt
  cookie;
- intr_event_suspend_handler and intr_event_resume_handler functions
  are added to the MI interrupt handler interface.

I added two new interrupt handler flags, IH_SUSP and IH_CHANGED, to
implement the new intr_event functions.  IH_SUSP marks a suspended
interrupt handler.  IH_CHANGED is used to implement a barrier that
ensures that a change to the interrupt handler's state is visible
to future interrupts.
While there, I fixed some whitespace issues in comments and changed a
couple of logically boolean variables to be bool.

MFC after: 1 month (maybe)
Differential Revision: https://reviews.freebsd.org/D15755

5 years agoadd a knob that disables detection of write protected disks
Andriy Gapon [Mon, 17 Dec 2018 16:01:37 +0000 (16:01 +0000)]
add a knob that disables detection of write protected disks

It has been reported that on some systems (with real hardware passed
through to a virtual machine) the WP detection causes USB disk probing
failures.

While here, also fix the selection of the next state in the case
of malloc failure in DA_STATE_PROBE_WP.  It was DA_STATE_PROBE_RC
unconditionally even when it should have been DA_STATE_PROBE_RC16.

PR: 225794
Reported by: David Boyd <David.Boyd49@twc.com>
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D18496

5 years agoAllow ng_nat to be attached to a ethernet interface directly via ng_ether(4)
Maxim Sobolev [Mon, 17 Dec 2018 16:00:35 +0000 (16:00 +0000)]
Allow ng_nat to be attached to a ethernet interface directly via ng_ether(4)
or the likes. Add new control message types: setdlt and getdlt to switch
from default DLT_RAW (no encapsulation) to DLT_EN10MB (ethernet).

Approved by: glebius
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D18535

5 years agoAdd removed CTM files to ObsoleteFiles.inc as a follow-up to r342126.
Stefan Eßer [Mon, 17 Dec 2018 10:17:56 +0000 (10:17 +0000)]
Add removed CTM files to ObsoleteFiles.inc as a follow-up to r342126.

5 years agoloader: zfs reader should not probe partitionless disks (UEFI case)
Toomas Soome [Mon, 17 Dec 2018 07:43:29 +0000 (07:43 +0000)]
loader: zfs reader should not probe partitionless disks (UEFI case)

With r342151 I did fix the BIOS version of zfs_probe_dev() from accessing
the whole disk, but the fix was not complete - we actually did not check
if the device name was really for whole disk. Since UEFI version
is only calling the zfs_probe_dev() with partitions and not with whole
disk, the UEFI loader was not able to find the zfs pools.

This update does correct the issue by calling archsw.arch_getdev() to
translate the device name back to dev_desc, and we have whole disk when both
partition and slice values are -1.

Reported by: alvisen_gmail.com
Differential Revision: https://reviews.freebsd.org/D18558

5 years agoWork around BIOS quirks on HPE Proliant MicroServer Gen10
Greg Lehey [Mon, 17 Dec 2018 07:09:46 +0000 (07:09 +0000)]
Work around BIOS quirks on HPE Proliant MicroServer Gen10

PR: 221350
Submitted by: Bob Bishop
Reported by: Rafal Lukawiecki
Reviewed by: jhb
MFC after: 2 weeks

5 years agoAdd revision number for TP-Link TL-WN722N to prevent ambiguity between
Andriy Voskoboinyk [Mon, 17 Dec 2018 05:07:57 +0000 (05:07 +0000)]
Add revision number for TP-Link TL-WN722N to prevent ambiguity between
different chipsets.

MFC after: 3 days
X-MFC with: 341786

5 years agoOptionalObsoleteFiles: Fix deleting usr/tests/usr.sbin/sa
Alan Somers [Sun, 16 Dec 2018 23:45:46 +0000 (23:45 +0000)]
OptionalObsoleteFiles: Fix deleting usr/tests/usr.sbin/sa

It's a directory, not a file.

Reported by: ngie
MFC after: 2 weeks
X-MFC-With: 300938

5 years agoConditionally install /etc/rc.d/audit* based on ${MK_AUDIT}
Alan Somers [Sun, 16 Dec 2018 23:38:46 +0000 (23:38 +0000)]
Conditionally install /etc/rc.d/audit* based on ${MK_AUDIT}

/usr/sbin/audit(dist)?d are only installed if ${MK_AUDIT} == yes. Their
supporting scripts should only be installed in those instances as well.

Submitted by: ngie
Reviewed by: emaste
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd/pull/242

5 years agoMake (no)ro an alias for (no)readonly
Poul-Henning Kamp [Sun, 16 Dec 2018 18:10:55 +0000 (18:10 +0000)]
Make (no)ro an alias for (no)readonly

5 years agoloader: zfs reader should not probe partitionless disks
Toomas Soome [Sun, 16 Dec 2018 08:58:14 +0000 (08:58 +0000)]
loader: zfs reader should not probe partitionless disks

First of all, normal setups can not boot such pools as the tools
do not support installing boot programs.

Secondly, for proper pool configuration detection, we need to checks all
four label copies on disk, 2 from front and 2 from the end of the disk,
but zfs label does not contain the size of the disk - so we depend on
firmware to report the correct disk size or use information from the
partition table.

Without partition table, we only can rely on firmware to report and support
disk IO properly.

There is a specific case: 8TB disks are reported by BIOS to have 4294967295
sectors (0x00000000ffffffff), the sectors reported by OS is 15628053168
(0x00000003a3812ab0), so the reported size is less than actual but is hitting
32-bit max. Unfortuantely the real limit must be even lower because probing
this disk in this system will wnd up with hung system.

UEFI boot of this system seems not to be affected.

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

5 years agoAdd a missing leading / in a filename.
Cy Schubert [Sun, 16 Dec 2018 04:06:53 +0000 (04:06 +0000)]
Add a missing leading / in a filename.

MFC after: 3 days

5 years agoDocument new required MI behaviour of pmap_enter(9) for CoW.
Konstantin Belousov [Sun, 16 Dec 2018 01:51:38 +0000 (01:51 +0000)]
Document new required MI behaviour of pmap_enter(9) for CoW.

Reviewed by: markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D18568

5 years agoperiodic/weekly/340.noid: do not use sysrc(8) that depends
Eugene Grosbein [Sat, 15 Dec 2018 23:20:08 +0000 (23:20 +0000)]
periodic/weekly/340.noid: do not use sysrc(8) that depends
on bsdinstall(8) and may be non-functional
for system built WITHOUT_BSDINSTALL. (*)

Also, add a check for jails sharing whole tree with host (path=/)
and do not skip it.

Reported by: Andre.Albsmeier@siemens.com (*)
MFC after: 1 week

5 years agoRepair build post-r342139
Cy Schubert [Sat, 15 Dec 2018 22:02:02 +0000 (22:02 +0000)]
Repair build post-r342139

5 years agoRemove, the now very outdated, timed.
George V. Neville-Neil [Sat, 15 Dec 2018 21:34:40 +0000 (21:34 +0000)]
Remove, the now very outdated, timed.

Submitted by: Kyle Spiers ksspiers at gmail
Reviewed by: bcr,brooks,bz,sbruno
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D18505

5 years agoClarify panic in set_rootvnode().
Kirk McKusick [Sat, 15 Dec 2018 19:18:58 +0000 (19:18 +0000)]
Clarify panic in set_rootvnode().
Check for panic in vfs_mountroot_shuffle().

Sponsored by: Netflix

5 years agoUnder UFS/FFS the VFS_ROOT() function will return an error if the inode
Kirk McKusick [Sat, 15 Dec 2018 19:04:50 +0000 (19:04 +0000)]
Under UFS/FFS the VFS_ROOT() function will return an error if the inode
check-hash fails. Panic'ing is not an appropriate response. So, check
for an error return from VFS_ROOT() and when an error is reported,
unwind and return the error.

Reported by:  Gary Jennejohn (gj)
Sponsored by: Netflix