]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
Dimitry Andric [Wed, 18 Mar 2020 18:26:53 +0000 (18:26 +0000)]
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
llvmorg-10.0.0-rc4-5-g52c365aa9ca.  The actual release should follow Real
Soon Now.

PR:             244251
MFC after:      6 weeks

4 years agoVendor import of llvm-project branch release/10.x
Dimitry Andric [Wed, 18 Mar 2020 18:20:05 +0000 (18:20 +0000)]
Vendor import of llvm-project branch release/10.x
llvmorg-10.0.0-rc4-5-g52c365aa9ca.

4 years agoFixup line lost from previous commit (r359072)
Ryan Moeller [Wed, 18 Mar 2020 17:01:03 +0000 (17:01 +0000)]
Fixup line lost from previous commit (r359072)

Reviewed by: kevans
Approved by: mav (mentor)
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D24115

4 years agoloader: Add a "kernel.loaded" hook
Ryan Moeller [Wed, 18 Mar 2020 16:21:11 +0000 (16:21 +0000)]
loader: Add a "kernel.loaded" hook

This hook can be useful, for example to run a local function to choose
different modules to load when a user has picked a different kernel
from the menu.

Reviewed by: kevans
Approved by: mav (mentor)
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D24115

4 years agoDocument that posixshmcontrol first appeared in 12.1
Mateusz Piotrowski [Wed, 18 Mar 2020 15:02:09 +0000 (15:02 +0000)]
Document that posixshmcontrol first appeared in 12.1

Also while here, I am addressing some linting issues.

PR: 243132
Submitted by: Noah Altunian <nbaltunian gmail com>
Approved by: bcr (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24112

4 years agoif_muge: use C99 bool for boolean vars
Ed Maste [Wed, 18 Mar 2020 14:16:14 +0000 (14:16 +0000)]
if_muge: use C99 bool for boolean vars

4 years agoAdd fsck_flags config option
Leandro Lupori [Wed, 18 Mar 2020 13:09:47 +0000 (13:09 +0000)]
Add fsck_flags config option

On UFS with SU+J, sometimes fsck's default recovery from journal marks the
filesystem as clean but some errors remain.

With SU only, default fsck in preen mode sometimes thinks all errors have
been fixed but some still remain.

To address the issues above, this change adds a new config option:
fsck_flags.  By default it's set to -p, but the user may change it to -y
or -f -y, for instance, to force a full fsck after a system crash.

Submitted by: jhibbits@ (original version)
Reviewed by: mckusick
Differential Revision: https://reviews.freebsd.org/D24087

4 years agoRemove /etc/host.conf, which was automatically generated from
Hiroki Sato [Wed, 18 Mar 2020 08:17:24 +0000 (08:17 +0000)]
Remove /etc/host.conf, which was automatically generated from
nsswitch.conf for backward compatibility.  This file was used
over 19 years ago, before introducing nsdispatch() in the
name-service lookup APIs.

MFC after: 3 days

4 years ago-F is GNU diff specific, not implemented in BSD diff.
Hiroki Sato [Wed, 18 Mar 2020 08:00:46 +0000 (08:00 +0000)]
-F is GNU diff specific, not implemented in BSD diff.

Reported by: kouya@ryuhoku.jp
MFC after: 3 days

4 years agoRemove wrong entries added in the previous commit.
Jung-uk Kim [Wed, 18 Mar 2020 05:28:36 +0000 (05:28 +0000)]
Remove wrong entries added in the previous commit.

Pointyhat to: jkim

4 years agoBhyve: log message when rfb client connects
Rebecca Cran [Wed, 18 Mar 2020 03:17:15 +0000 (03:17 +0000)]
Bhyve: log message when rfb client connects

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D24098

4 years agoBhyve: DPRINTF already includes newline, so don't add another
Rebecca Cran [Wed, 18 Mar 2020 03:15:57 +0000 (03:15 +0000)]
Bhyve: DPRINTF already includes newline, so don't add another

Reviewed by: jhb, vmaffione, emaste
Differential Revision: https://reviews.freebsd.org/D24099

4 years agoath_hal: fix typo in ath_hal_printf
Rebecca Cran [Wed, 18 Mar 2020 03:14:17 +0000 (03:14 +0000)]
ath_hal: fix typo in ath_hal_printf

4 years ago[PowerPC][Book-E] Fix missing load base in elf_cpu_parse_dynamic().
Brandon Bergren [Wed, 18 Mar 2020 02:58:18 +0000 (02:58 +0000)]
[PowerPC][Book-E] Fix missing load base in elf_cpu_parse_dynamic().

When I implemented MD DYNAMIC parsing, I was originally passing a
linker_file_t so that the MD code could relocate pointers.

However, it turns out this isn't even filled in until later, so it was
always 0.

Just pass the load base (ef->address) directly, as that's really the only
thing we were interested in in the first place.

This fixes a crash on RB800 where it was trying to write to an unmapped
address when updating the GOT.

Reviewed by: jhibbits
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D24105

4 years agoReduce diff with the vendor version. No functional change.
Jung-uk Kim [Wed, 18 Mar 2020 02:20:03 +0000 (02:20 +0000)]
Reduce diff with the vendor version.  No functional change.

4 years agoMerge OpenSSL 1.1.1e.
Jung-uk Kim [Wed, 18 Mar 2020 02:13:12 +0000 (02:13 +0000)]
Merge OpenSSL 1.1.1e.

4 years agopowerpc: Axe PPC4xx support.
Justin Hibbits [Wed, 18 Mar 2020 01:09:43 +0000 (01:09 +0000)]
powerpc: Axe PPC4xx support.

Summary:
The support was added almost a decade ago, and never completed.  Just axe
it.  It was also inadvertently broken 5 years ago, and nobody noticed.

Reviewed by: bdragon
Differential Revision: https://reviews.freebsd.org/D23753

4 years agoRemove spurious warning about invalid VPD data.
Navdeep Parhar [Wed, 18 Mar 2020 01:09:40 +0000 (01:09 +0000)]
Remove spurious warning about invalid VPD data.

The warning used to be displayed for valid VPDs about 512B or above in
size.  Fix the size check and add a break while here so that the routine
stops if if detects any problem.

Tested with "pciconf -lV"

Reviewed by: kib@, jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D23679

4 years agoFix the workaround to ignore the #warning for GCC.
John Baldwin [Tue, 17 Mar 2020 23:22:07 +0000 (23:22 +0000)]
Fix the workaround to ignore the #warning for GCC.

clang and gcc use different warning flags for #warning preprocessor
directives.

Reported by: Jenkins
MFC after: 1 week

4 years agoImplement sysctl kern.boot_id
Conrad Meyer [Tue, 17 Mar 2020 22:27:16 +0000 (22:27 +0000)]
Implement sysctl kern.boot_id

Boot IDs are random, opaque 128-bit identifiers that distinguish distinct
system boots.  A new ID is generated each time the system boots.  Unlike
kern.boottime, the value is not modified by NTP adjustments.  It remains fixed
until the machine is restarted.

PR: 244867
Reported by: Ricardo Fraile <rfraile AT rfraile.eu>
MFC after: I do not intend to, but feel free

4 years agoImport OpenSSL 1.1.1e.
Jung-uk Kim [Tue, 17 Mar 2020 21:27:57 +0000 (21:27 +0000)]
Import OpenSSL 1.1.1e.

4 years agoAdd missing DTrace files for WITHOUT_CDDL=yes.
John Baldwin [Tue, 17 Mar 2020 21:11:38 +0000 (21:11 +0000)]
Add missing DTrace files for WITHOUT_CDDL=yes.

Reviewed by: dteske
MFC after: 1 week
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24037

4 years agoHandle the timers in a consistent sequence according to the definition
Michael Tuexen [Tue, 17 Mar 2020 19:20:12 +0000 (19:20 +0000)]
Handle the timers in a consistent sequence according to the definition
of the timer type.
Just a cleanup, no functional change intended.

MFC after: 1 week

4 years agoMark procfs-based process debugging as deprecated for FreeBSD 13.
John Baldwin [Tue, 17 Mar 2020 18:44:03 +0000 (18:44 +0000)]
Mark procfs-based process debugging as deprecated for FreeBSD 13.

Attempting to use ioctls on /proc/<pid>/mem to control a process will
trigger warnings on the console.  The <sys/pioctl.h> include file will
also now emit a compile-time warning when used from userland.

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

4 years agoSupport SUBDIR.${MK_FOO}.${MK_BAR} expresssions.
Brooks Davis [Tue, 17 Mar 2020 18:17:32 +0000 (18:17 +0000)]
Support SUBDIR.${MK_FOO}.${MK_BAR} expresssions.

This allows simplification of Makefiles where some SUBDIR entries depend
on two things (e.g. something that depends on C++ and some other knob).

Discussed with: imp, jhb
Obtained from: CheriBSD
MFC after: 3 days
Sponsored by: DARPA

4 years agoAdd an internal liblua and use it in flua.
Brooks Davis [Tue, 17 Mar 2020 17:28:12 +0000 (17:28 +0000)]
Add an internal liblua and use it in flua.

The new liblua will be used in a forthcoming import of kyua.

Reviewed by: kevans
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24090

4 years agoldd: add aout deprecation notice
Ed Maste [Tue, 17 Mar 2020 16:42:25 +0000 (16:42 +0000)]
ldd: add aout deprecation notice

Reported by: kib

4 years agoldconfig: add aout deprecation notice
Ed Maste [Tue, 17 Mar 2020 15:57:25 +0000 (15:57 +0000)]
ldconfig: add aout deprecation notice

aout support in ldconfig hasn't been required since FreeBSD 2.x.
Anyone still using FreeBSD 2 shared libraries can also use a FreeBSD 2
ldconfig to generate aout ldconfig hints.

Sponsored by: The FreeBSD Foundation

4 years agoMakefile.inc1: add a note when deleting stale dependencies
Ed Maste [Tue, 17 Mar 2020 14:12:19 +0000 (14:12 +0000)]
Makefile.inc1: add a note when deleting stale dependencies

We have ad-hoc stale dependency handling in Makefile.inc1 to handle the
cases where file extensions change, but it appears that some cases are
not functional.  Add a note when about to clean stale deps to help
when investigating failure reports.

Sponsored by: The FreeBSD Foundation

4 years agoFix misleading indentation warning in OCTEON1 kernel
Alex Richardson [Tue, 17 Mar 2020 11:59:45 +0000 (11:59 +0000)]
Fix misleading indentation warning in OCTEON1 kernel

This is required to switch MIPS to compile with LLVM by default (D23204).

Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D24091

4 years agoFix build of XLP MIPS kernel with clang
Alex Richardson [Tue, 17 Mar 2020 11:59:40 +0000 (11:59 +0000)]
Fix build of XLP MIPS kernel with clang

Clang does not recognize some of the GCC optimization options that are
used to compile ucore_app.bin. This is required to switch MIPS to
compile with LLVM by default (D23204).

Reviewed By: imp
Differential Revision: https://reviews.freebsd.org/D24092

4 years agoTell the world how to convert gigabytes to bytes with units(1) easily
Mateusz Piotrowski [Tue, 17 Mar 2020 10:02:59 +0000 (10:02 +0000)]
Tell the world how to convert gigabytes to bytes with units(1) easily

It turns out that units(1) is not as horrible to use in scripts
as I initially thought. When the --terse flag is combined
with an appropriate output format (set via --output-format),
units(1) is actually capable of producing very nice results.
For example:

    units -o %0.f -t '4 gigabytes' bytes

is is just going to print out the expected value of 4294967296.

There is no time to waste. People have to know about it.

I am adding an example for this at the top of the examples section
because this is what users are most likely looking for.

Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D24096

4 years agoAdd new USB device ID to u3g driver.
Hans Petter Selasky [Tue, 17 Mar 2020 09:12:47 +0000 (09:12 +0000)]
Add new USB device ID to u3g driver.

Submitted by: super_gromit@hotmail.com
PR: 244798
MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoConvert to the standard section 4 SYNOPSIS layout.
Kevin Lo [Tue, 17 Mar 2020 05:33:05 +0000 (05:33 +0000)]
Convert to the standard section 4 SYNOPSIS layout.

4 years agoRestore power-of-2 queue count constraint from r290948
Patrick Kelsey [Tue, 17 Mar 2020 03:32:13 +0000 (03:32 +0000)]
Restore power-of-2 queue count constraint from r290948

When vmx(4) was converted to an iflib driver in r343291, the
power-of-2 queue count constraint was removed as it appeared that
current implementations of the VMXNET3 virtual device no longer
required that constraint.  It turns out that some of the
implementations still do, and on such systems, the device will fail to
initialize when configured with a non-power-of-2 RX or TX queue count.

PR: 237321
Reported by: ncrogers@gmail.com
MFC after: 1 week

4 years agoAdd tcberner as co-mentor for salvadore
Lorenzo Salvadore [Mon, 16 Mar 2020 23:37:57 +0000 (23:37 +0000)]
Add tcberner as co-mentor for salvadore

Approved by: gerald (mentor)

4 years agoRemove misleading / redundant bzero in callout_callwheel_init
Conrad Meyer [Mon, 16 Mar 2020 22:25:25 +0000 (22:25 +0000)]
Remove misleading / redundant bzero in callout_callwheel_init

The intent seems to be zeroing all of the cc_cpu array, or its singleton on
such platforms.  The assumption made is that the BSP is always zero.  The
code smell was introduced in r326218, which changed the prior explicit zero
to 'curcpu'.  The change is only valid if curcpu continues to be zero,
contrary to the aim expressed in that commit message.

So, more succinctly, the expression could be: memset(cc_cpu,0,sizeof(cc_cpu)).

However, there's no point.  cc_cpu lives in the data section and has a zero
initial value already.  So this revision just removes the problematic
statement.

No functional change.  Appeases a (false positive, ish) Coverity CID.

CID: 1383567
Reported by: Puneeth Jothaiah <puneethkumar.jothaia AT dell.com>
Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D24089

4 years agoFix infinite scan on a pool with only special allocations
Alexander Motin [Mon, 16 Mar 2020 19:03:10 +0000 (19:03 +0000)]
Fix infinite scan on a pool with only special allocations

Attempt to run scrub or resilver on a new pool containing only special
allocations (special vdev added on creation) caused infinite loop
because of dsl_scan_should_clear() limiting memory usage to 5% of pool
size, which it calculated accounting only normal allocation class.

Addition of special and just in case dedup classes fixes the issue.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #10106
Closes #8694
openzfs/zfs@fa130e010c2ff9b33aba11d2699b667e454b3ccb

4 years agoMake autofs(5) timeout messages include affected process name and PID.
Edward Tomasz Napierala [Mon, 16 Mar 2020 16:17:58 +0000 (16:17 +0000)]
Make autofs(5) timeout messages include affected process name and PID.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

4 years agoAvoid a cache miss accessing an mbuf ext_pgs pointer when doing SW kTLS.
Andrew Gallatin [Mon, 16 Mar 2020 14:03:27 +0000 (14:03 +0000)]
Avoid a cache miss accessing an mbuf ext_pgs pointer when doing SW kTLS.

For a Netflix 90Gb/s 100% TLS software kTLS workload, this reduces
the CPI of tcp_m_copym() from ~3.5 to ~2.5 as reported by vtune.

Reviewed by: jtl, rrs
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D23998

4 years agoatp: fix mouse attachment on PowerBook5,6 (G4)
Alfredo Dal'Ava Junior [Mon, 16 Mar 2020 13:53:29 +0000 (13:53 +0000)]
atp: fix mouse attachment on PowerBook5,6 (G4)

Skip device mode switch step on Fountain-based devices as they don't
support RAW_SENSOR_MODE command, so failing to attach.

This was reproduced on PowerBook G4 (model PowerBook5,6) equipped with
product ID 0x020e

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

4 years agoFix for double unlock in ipoib.
Hans Petter Selasky [Mon, 16 Mar 2020 12:33:57 +0000 (12:33 +0000)]
Fix for double unlock in ipoib.

The ipoib_unicast_send() function is not supposed to unlock the priv lock.

MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agobridge tests: Basic span test
Kristof Provost [Mon, 16 Mar 2020 08:44:46 +0000 (08:44 +0000)]
bridge tests: Basic span test

Reviewed by: philip, emaste (previous version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23961

4 years agoif_muge: whitespace and style cleanup
Ed Maste [Sun, 15 Mar 2020 21:47:16 +0000 (21:47 +0000)]
if_muge: whitespace and style cleanup

Submitted by: clang-format (in part)
Sponsored by: The FreeBSD Foundation

4 years agoWe don't need $M/$M in the path anymore.
Warner Losh [Sun, 15 Mar 2020 17:40:14 +0000 (17:40 +0000)]
We don't need $M/$M in the path anymore.

Now that machdep files are gone, we don't need $S/$M/$M in the path to find
them.

4 years agomuge: drop CSUM from MUGE_DEFAULT_TSO_CSUM_ENABLE
Ed Maste [Sun, 15 Mar 2020 03:32:39 +0000 (03:32 +0000)]
muge: drop CSUM from MUGE_DEFAULT_TSO_CSUM_ENABLE

TSO is independent of checksum offload

4 years agomuge: enable RXCSUM as it now works
Ed Maste [Sun, 15 Mar 2020 03:03:01 +0000 (03:03 +0000)]
muge: enable RXCSUM as it now works

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agocalendar(1): Updates and corrections for some calendar files.
Pedro F. Giffuni [Sun, 15 Mar 2020 00:49:06 +0000 (00:49 +0000)]
calendar(1): Updates and corrections for some calendar files.

These have an educational value and are, no doubt, an integral part of the fun
behind running the BSDs.

PR: 242909, 242918
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23581

4 years agoRemove extraneous code from iflib
Patrick Kelsey [Sat, 14 Mar 2020 20:13:42 +0000 (20:13 +0000)]
Remove extraneous code from iflib

ifsd_cidx is never used, and the line removed from rxd_frag_to_sd() is
just dead code.

Reviewed by: erj, gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23951

4 years agoAdjust if_vmx default receive parameters for better out-of-box performance
Patrick Kelsey [Sat, 14 Mar 2020 20:11:46 +0000 (20:11 +0000)]
Adjust if_vmx default receive parameters for better out-of-box performance

These adjustments improve performance with jumbo frames and/or LRO
enabled (i.e., when there may be multiple descriptors per packet) by
increasing the default size of the receive queues and by always using
page-sized buffers for the body type receive ring.

This patch also adjust the initialization of the max frame size to
remove cases where certain configuration sequences would result in 2K
receive buffers being used instead of 4K ones when jumbo frames were
enabled.

Reviewed by: gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23950

4 years agoFix if_vmx receive checksum offload bug and harden against the device skipping receiv...
Patrick Kelsey [Sat, 14 Mar 2020 20:08:04 +0000 (20:08 +0000)]
Fix if_vmx receive checksum offload bug and harden against the device skipping receive descriptors

This fixes a bug where the checksum offload status of received packets
was being taken from the first descriptor instead of the last, which
affected LRO packets.

The driver has been hardened against the device skipping receive
descriptors, although it is not believed that this can occur given the
way this implementation configures the receive rings.

Additionally, for packets received with the error indicator set, the
driver now forces the length of all fragments in that packet to zero
prior to passing it to iflib.  Such packets should wind up being
discarded at some point in the stack anyway, but this removes any
questions by killing them in the driver.

Counters have been added (and exposed via sysctls) for skipped receive
descriptors, zero-length packets received, and packets received with
the error indicator set so that these conditions can be easily
observed in the field.

PR: 243126, 243392, 240628
Reported by: avg, alexandr.oleynikov@gmail.com, Harald Schmalzbauer
Reviewed by: gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23949

4 years agoRemove refill budget from iflib
Patrick Kelsey [Sat, 14 Mar 2020 19:58:50 +0000 (19:58 +0000)]
Remove refill budget from iflib

Reviewed by: gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23948

4 years agoAllow iflib drivers to specify the buffer size used for each receive queue
Patrick Kelsey [Sat, 14 Mar 2020 19:56:46 +0000 (19:56 +0000)]
Allow iflib drivers to specify the buffer size used for each receive queue

Reviewed by: erj, gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23947

4 years agoRemove freelist contiguous-indexes assertion from rxd_frag_to_sd()
Patrick Kelsey [Sat, 14 Mar 2020 19:55:05 +0000 (19:55 +0000)]
Remove freelist contiguous-indexes assertion from rxd_frag_to_sd()

The vmx driver is an example of an iflib driver that might report
packets using non-contiguous descriptors (with unused descriptors
either between received packets or between the fragments of a received
packet), so this assertion needs to be removed.

For such drivers, the freelist producer and consumer indexes don't
relate directly to driver ring slots (the driver deals directly with
freelist buffer indexes supplied by iflib during refill, and reports
them with each fragment during packet reception), but do continue to
be used by iflib for accounting, such as determining the number of
ring slots that are refillable.

PR: 243126, 243392, 240628
Reported by: avg, alexandr.oleynikov@gmail.com, Harald Schmalzbauer
Reviewed by: gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23946

4 years agoFix iflib zero-length fragment handling
Patrick Kelsey [Sat, 14 Mar 2020 19:51:55 +0000 (19:51 +0000)]
Fix iflib zero-length fragment handling

The dmamap for zero-length fragments should not be unloaded, as doing
so breaks the the cluster-reuse logic in _iflib_fl_refill().

All zero-length fragments are now handled by the assemble_segments()
path so that the cluster-reuse logic there does not have to be
replicated in the small-single-fragment-packet path of
iflib_rxd_pkt_get().

Packets consisting entirely of zero-length fragments (which result in
a NULL mbuf pointer) are now properly tolerated.  This allows drivers
(such as the vmx driver) to pass such packets to iflib when a
descriptor error occurs during packet reception, the advantage being
that the refill of descriptors associated with the error packet are
handled via the existing iflib machinery without having to duplicate
parts of that machinery in the driver to handle that error case.

Reviewed by: avg, erj, gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23945

4 years agoFix iflib freelist state corruption
Patrick Kelsey [Sat, 14 Mar 2020 19:43:44 +0000 (19:43 +0000)]
Fix iflib freelist state corruption

This fixes a bug in iflib freelist management that breaks the required
correspondence between freelist indexes and driver ring slots.

PR: 243126, 243392, 240628
Reported by: avg, alexandr.oleynikov@gmail.com, Harald Schmalzbauer
Reviewed by: avg, gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23943

4 years agoSparc64 and pc98 needed cam_machdep and/or ata_machdep for various
Warner Losh [Sat, 14 Mar 2020 18:35:44 +0000 (18:35 +0000)]
Sparc64 and pc98 needed cam_machdep and/or ata_machdep for various
reasons. Those have now left the tree, and with them the need to have machdep
files. Places that called the routines in quesiton have been removed
previously. Remove these files from the Makefile to tidy up.

4 years agolibssp: don't compile with -fstack-protector*
Kyle Evans [Sat, 14 Mar 2020 15:15:27 +0000 (15:15 +0000)]
libssp: don't compile with -fstack-protector*

This similarly matches what we do in libc; compiling libssp with
-fstack-protector* is actively harmful.  For instance, if the canary ctor
ends up with a stack protector then it will trivially trigger a false
positive as the canary's being initialized.

This was noted by the reporter as irc/ircd-hybrid started crashing at start
after our libssp was MFC'd to stable/11, as its build will explicitly link
in libssp. On FreeBSD, this isn't necessary as SSP bits are included in
libc, but it should absolutely not trigger runtime breakage -- it does mean
that the canary will get initialized twice, but as this is happening early
on in application startup it should just be redundant work.

Reported by: Tod McQuillin <devin@sevenlayer.studio>
MFC after: 3 days

4 years agokern_jail: missing \0 termination check on osrelease parameter
Bjoern A. Zeeb [Sat, 14 Mar 2020 14:04:55 +0000 (14:04 +0000)]
kern_jail: missing \0 termination check on osrelease parameter

If a user spplies a non-\0 terminated osrelease parameter reading it back
may disclose kernel memory.
This is a problem in case of nested jails (children.max > 0, which is not
the default).  Otherwise root outside the jail has access to kernel memory
by other means and root inside a jail cannot create a child jail.

Add the proper \0 check at the end of a supplied osrelease parameter and
make sure any copies of the field will be \0-terminated.

Submitted by: Hans Christian Woithe (chwoithe yahoo.com)
MFC after: 3 days

4 years agoloader: add comconsole implementation on top of SIO protocol
Toomas Soome [Sat, 14 Mar 2020 06:36:03 +0000 (06:36 +0000)]
loader: add comconsole implementation on top of SIO protocol

Provide comconsole on top of SIO for arm platforms (x86 does use bios version).

4 years agoRemove unneeded checks for prelen.
Xin LI [Sat, 14 Mar 2020 05:57:22 +0000 (05:57 +0000)]
Remove unneeded checks for prelen.

In order to determine the type of a compressed file, we have to read
in the first four bytes which may also be important for decompression
purposes, to do that we would pass the buffer that we have already
read in, along with the size of it.

Rename header1 to fourbytes to make that explicit, and remove all
checks for prelen.

Reported by: cem
Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24034

4 years agoAdd comment about how the deferred callback for AC_FOUND_DEVICE we
Warner Losh [Sat, 14 Mar 2020 02:36:45 +0000 (02:36 +0000)]
Add comment about how the deferred callback for AC_FOUND_DEVICE we
generate for a race where a device goes away, we start to tear down
the periph state for the device, and then the device suddently
reappears. The key that makes it work is removal of periph from the
drv list before calling the deferred callback.

Hat tip to: mav@

4 years agomuge: correct RX checksum offload
Ed Maste [Sat, 14 Mar 2020 01:52:38 +0000 (01:52 +0000)]
muge: correct RX checksum offload

Submitted by: Johannes <iz-rpi04@hs-karlsruhe.de>
MFC after: 1 week

4 years agoTODO DONE: Use sx_xholder in SPL rwlock.h
Ryan Moeller [Sat, 14 Mar 2020 00:16:15 +0000 (00:16 +0000)]
TODO DONE: Use sx_xholder in SPL rwlock.h

Approved by: mav (mentor)
MFC after: 1 week
Sponsored by: iXsystems, Inc.

4 years agoGive some indication of the CCB that's in flight when we panic.
Warner Losh [Fri, 13 Mar 2020 18:45:36 +0000 (18:45 +0000)]
Give some indication of the CCB that's in flight when we panic.

Print the pointer to ccb so we can find it (for what good it does)
as well as the type of operation in flight when the cam_path has
been freed out from under us. This helps both core analysis as well
as automated systems that collect panic strings but little else.

4 years agosendfile() does currently not support SCTP sockets.
Michael Tuexen [Fri, 13 Mar 2020 18:38:28 +0000 (18:38 +0000)]
sendfile() does currently not support SCTP sockets.
Therefore, fail the call.

Reviewed by: markj@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24059

4 years agoSkip sys.netpfil.pf.nat.exhaust on all platforms as it not only fails on amd64
Li-Wen Hsu [Fri, 13 Mar 2020 16:44:48 +0000 (16:44 +0000)]
Skip sys.netpfil.pf.nat.exhaust on all platforms as it not only fails on amd64

PR: 244703
Sponsored by: The FreeBSD Foundation

4 years agoflua: implement chmod
Ed Maste [Fri, 13 Mar 2020 15:40:35 +0000 (15:40 +0000)]
flua: implement chmod

Lua does not provide a native way to change the permission of a file.

Submitted by: Yang Wang <2333@outlook.jp>
Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24036

4 years agoIncrease buffer in mprsas_log_command() from 192 to 224 bytes.
Alexander Motin [Fri, 13 Mar 2020 14:51:11 +0000 (14:51 +0000)]
Increase buffer in mprsas_log_command() from 192 to 224 bytes.

192 bytes are not enough to print long commands, such as ATA COMMAND PASS
THROUGH(16), that makes debug output difficult to read.

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

4 years agoCMSG_DATA.3: Fix formatting of printf escape sequences
Mateusz Piotrowski [Fri, 13 Mar 2020 11:07:48 +0000 (11:07 +0000)]
CMSG_DATA.3: Fix formatting of printf escape sequences

Escape sequences like "\n" have to be escaped twice in examples in our
mdoc(7)-based manual pages in order to be displayed properly. The problem
is that otherwise they are interpreted by mdoc(7), which results in:

    printf("parent: received '%s'0, buf);

being shown to the user instead of:

    printf("parent: received '%s'\n", buf);

Approved by: bcr (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24056

4 years agopowerpc: Simplify _nodrop variants of FPU and vector register saves
Justin Hibbits [Fri, 13 Mar 2020 01:27:37 +0000 (01:27 +0000)]
powerpc: Simplify _nodrop variants of FPU and vector register saves

No need for an extra temporary.  It doesn't even help with readability.

Suggested by: kib (almost 2 years ago)

4 years agocxgbe(4): Do not display error messages related to the CLIP table if
Navdeep Parhar [Fri, 13 Mar 2020 00:12:15 +0000 (00:12 +0000)]
cxgbe(4): Do not display error messages related to the CLIP table if
it's not in use by TOE or KTLS.

Reviewed by: jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D24046

4 years agolibpmcstat: Try /boot/modules if module not found
Ryan Moeller [Thu, 12 Mar 2020 23:04:40 +0000 (23:04 +0000)]
libpmcstat: Try /boot/modules if module not found

Modules from ports/pkg are commonly installed to /boot/modules rather than to
the same directory the kernel resides in.  Look there if a module is not found
next to the kernel.

Submitted by: mmacy
Reported by: Nick Principe <nap@iXsystems.com>
Approved by: mmacy (mentor)
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

4 years agokern_shutdown: Add missing EKCD ifdef
Conrad Meyer [Thu, 12 Mar 2020 21:26:36 +0000 (21:26 +0000)]
kern_shutdown: Add missing EKCD ifdef

Submitted by: Puneeth Jothaiah <puneethkumar.jothaia AT dell.com>
Reviewed by: bdrewery
Sponsored by: Dell EMC Isilon

4 years agologger: capsicumize
Mariusz Zaborski [Thu, 12 Mar 2020 19:55:51 +0000 (19:55 +0000)]
logger: capsicumize

Submitted by: Tiger Gao <tig@freebsdfoundation.org>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23744

4 years agoftw.3: Follow style(9) in the example
Mateusz Piotrowski [Thu, 12 Mar 2020 18:28:23 +0000 (18:28 +0000)]
ftw.3: Follow style(9) in the example

Reported by: oshogbo
Approved by: bcr (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24043

4 years agoRemove /usr/share/snmp/defs/tc.def with delete-old if MK_BSNMP == no
Enji Cooper [Thu, 12 Mar 2020 16:06:26 +0000 (16:06 +0000)]
Remove /usr/share/snmp/defs/tc.def with delete-old if MK_BSNMP == no

This removes a lingering file on new installs of CURRENT, originally
added in r345797.

MFC after: 1 week
MFC with: r345797

4 years agoUse KMOD_TCPSTAT_INC instead of TCPSTAT_INC for RACK and BBR, since
Michael Tuexen [Thu, 12 Mar 2020 15:37:41 +0000 (15:37 +0000)]
Use KMOD_TCPSTAT_INC instead of TCPSTAT_INC for RACK and BBR, since
these are kernel modules. Also add a KMOD_TCPSTAT_ADD and use that
instead of TCPSTAT_ADD.

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

4 years agoMakefile.inc1: move dependency hack comment to the block it applies to
Ed Maste [Thu, 12 Mar 2020 14:01:17 +0000 (14:01 +0000)]
Makefile.inc1: move dependency hack comment to the block it applies to

4 years agoExtend r358907 to explicitly remove stale lib32 dependency
Ed Maste [Thu, 12 Mar 2020 13:42:08 +0000 (13:42 +0000)]
Extend r358907 to explicitly remove stale lib32 dependency

After r325072 stale lib32 dependencies were not remooved.  A more
holistic approach is needed to address this but for the immediate issue
(-DNO_CLEAN builds across r358851) just readd the explicit lib32 path.

Reported by: dim
Sponsored by: The FreeBSD Foundation

4 years agoEnable ixl device on PowerPC64
Leandro Lupori [Thu, 12 Mar 2020 12:47:10 +0000 (12:47 +0000)]
Enable ixl device on PowerPC64

The ixl driver now works on PowerPC64 and may be compiled in-kernel and
as a module.

Reviewed by: alfredo, erj
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D23974

4 years agoAllow -DNO_CLEAN build across r358851.
Dimitry Andric [Thu, 12 Mar 2020 11:39:04 +0000 (11:39 +0000)]
Allow -DNO_CLEAN build across r358851.

The openmp 10.0.0 import renamed one .c file to .cpp, and this is
something our dependency system does not handle correctly.  Add another
ad-hoc cleanup to get rid of the stale dependency.

PR: 244251
MFC after: 6 weeks
X-MFC-With: 358851

4 years agotest if port does exist via using scratch register
Toomas Soome [Thu, 12 Mar 2020 06:45:08 +0000 (06:45 +0000)]
test if port does exist via using scratch register

The SCR, scratch register was not present on the 8250 and 8250B UART, so we
can use to test if we actually do have serial port.

We need this test because some systems will get long delays while attempting
to write to non-existing port and this will slow down the console IO
to extreme.

MFC after: 1 week

4 years agostyle(9): Fix space after #define.
Pedro F. Giffuni [Thu, 12 Mar 2020 03:56:54 +0000 (03:56 +0000)]
style(9): Fix space after #define.

No functional change.

4 years agoFix r358688 -- Remember to actually save r3 before processing.
Brandon Bergren [Wed, 11 Mar 2020 23:34:44 +0000 (23:34 +0000)]
Fix r358688 -- Remember to actually save r3 before processing.

Crash was noticed by pkubaj building gcc9.

Apparently non dword-aligned char pointers are somewhat rare in the wild.

Reported by: pkubaj
Sponsored by: Tag1 Consulting, Inc.

4 years agoCheck for busy or wired in vm_page_relookup(). Some callers will only keep
Jeff Roberson [Wed, 11 Mar 2020 22:25:45 +0000 (22:25 +0000)]
Check for busy or wired in vm_page_relookup().  Some callers will only keep
a page wired and expect it to still be present.

Reported by: delphij@FreeBSD.org
Reviewed by: kib

4 years agoWhen mounting a UFS filesystem, return EINTEGRITY rather than EIO
Kirk McKusick [Wed, 11 Mar 2020 21:00:40 +0000 (21:00 +0000)]
When mounting a UFS filesystem, return EINTEGRITY rather than EIO
when a superblock check-hash error is detected. This change clarifies
a mount that failed due to media hardware failures (EIO) from a mount
that failed due to media errors (EINTEGRITY) that can be corrected by
running fsck(8).

Sponsored by: Netflix

4 years agoarch.7: remove extraneous markup from header table sizing
Ed Maste [Wed, 11 Mar 2020 20:40:24 +0000 (20:40 +0000)]
arch.7: remove extraneous markup from header table sizing

Reported by: 0mp (in response to r358891)

4 years agoCorrectly spell TUNABLES.
Bjoern A. Zeeb [Wed, 11 Mar 2020 20:23:36 +0000 (20:23 +0000)]
Correctly spell TUNABLES.

4 years agowmt(4): Reapply r358872 (by hselasky) modified to use
Vladimir Kondratyev [Wed, 11 Mar 2020 20:05:49 +0000 (20:05 +0000)]
wmt(4): Reapply r358872 (by hselasky) modified to use
maximal input report size instead of wMaxPacketSize.

If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller
will pack multiple touch events in the packet and the current code will only
process the first touch event.

As a result some important events are lost like releasing the finger from the
touchscreen.

Use the maximal input report size as buffer size instead.

PR: 244718
Tested by: Oskar Holmlund <oskar.holmlund@ohdata.se>, wulf
MFC after: 3 days
Discussed with: hselasky

4 years agoRemove extra Sy from table header
Ed Maste [Wed, 11 Mar 2020 20:05:06 +0000 (20:05 +0000)]
Remove extra Sy from table header

Reported by: 0mp

4 years agowmt(4): revert r358872 (by hselasky)
Vladimir Kondratyev [Wed, 11 Mar 2020 19:57:43 +0000 (19:57 +0000)]
wmt(4): revert r358872 (by hselasky)

Limiting frame size to maximum packet size breaks devices which have input
report size larger than wMaxPacketSize. Maximal input report size should be
used instead.
Revert the commit as it have not been MFC-ed yet.

Discussed with: hselasky

4 years agoelf.5: start documenting ELF note sections
Ed Maste [Wed, 11 Mar 2020 18:15:18 +0000 (18:15 +0000)]
elf.5: start documenting ELF note sections

I intend to document FreeBSD's ELF notes (see review D23982), but start
with a section documenting the format of the note section itself.

Sponsored by: The FreeBSD Foundation

4 years agoRemove redundantly repetitive static __inline forward function
Warner Losh [Wed, 11 Mar 2020 15:12:31 +0000 (15:12 +0000)]
Remove redundantly repetitive static __inline forward function
declarations.

We typically don't use them elsewhere in the kernel, and they aren't
needed here: the actual functions are a few lines away and aren't
mutually recursive.

4 years agoelfctl: remove memory leak
Ed Maste [Wed, 11 Mar 2020 13:51:01 +0000 (13:51 +0000)]
elfctl: remove memory leak

CID: 1420356
Reported by: Coverity Scan
Sponsored by: The FreeBSD Foundation

4 years agoTemporarily skip 2 failing tests after llvm10 import
Li-Wen Hsu [Wed, 11 Mar 2020 12:43:54 +0000 (12:43 +0000)]
Temporarily skip 2 failing tests after llvm10 import

PR: 244732
Sponsored by: The FreeBSD Foundation

4 years agoTemporarily skip sys.geom.class.gate.ggate_test.ggated in CI
Li-Wen Hsu [Wed, 11 Mar 2020 10:42:05 +0000 (10:42 +0000)]
Temporarily skip sys.geom.class.gate.ggate_test.ggated in CI

PR: 244737
Sponsored by: The FreeBSD Foundation

4 years agoIf the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller
Hans Petter Selasky [Wed, 11 Mar 2020 08:16:13 +0000 (08:16 +0000)]
If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller
will pack multiple touch events in the packet and the current code will only
process the first touch event.

As a result some important events are lost like releasing the finger from the
touchscreen.

Use the maximum maximum packet size as buffer size instead.

Submitted by: Oskar Holmlund <oskar.holmlund@ohdata.se>
PR: 244718
MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoRevert r358858 as it breaks some ipfw(8) setups.
Alexander V. Chernikov [Wed, 11 Mar 2020 08:08:53 +0000 (08:08 +0000)]
Revert r358858 as it breaks some ipfw(8) setups.

Reported by: O. Hartmann <o.hartmann@walstatt.org>

4 years agofusefs: avoid cache corruption with buggy fuse servers
Alan Somers [Wed, 11 Mar 2020 04:29:45 +0000 (04:29 +0000)]
fusefs: avoid cache corruption with buggy fuse servers

The FUSE protocol allows the client (kernel) to cache a file's size, if the
server (userspace daemon) allows it. A well-behaved daemon obviously should
not change a file's size while a client has it cached. But a buggy daemon
might. If the kernel ever detects that that has happened, then it should
invalidate the entire cache for that file. Previously, we would not only
cache stale data, but in the case of a file extension while we had the size
cached, we accidentally extended the cache with zeros.

PR: 244178
Reported by: Ben RUBSON <ben.rubson@gmx.com>
Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24012