]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoloader.efi: handle efi_cons_init() failure cases better
tsoome [Wed, 18 Mar 2020 22:21:42 +0000 (22:21 +0000)]
loader.efi: handle efi_cons_init() failure cases better

if we fail to allocate buffer, set up the TERM_EMU and continue.
On output, use TERM_EMU in case we did fail to allocate buffer.

4 years agomlx5: Basic PCIe side of SR-IOV support.
kib [Wed, 18 Mar 2020 22:17:01 +0000 (22:17 +0000)]
mlx5: Basic PCIe side of SR-IOV support.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies
MFC after: 2 weeks

4 years agoPACKAGE_STRING should be the same as PACKAGE_VERSION.
cy [Wed, 18 Mar 2020 22:14:25 +0000 (22:14 +0000)]
PACKAGE_STRING should be the same as PACKAGE_VERSION.

MFC after: 3 days

4 years agolinuxkpi: Add infrastructure to pass FreeBSD IOV method calls into
kib [Wed, 18 Mar 2020 22:10:49 +0000 (22:10 +0000)]
linuxkpi: Add infrastructure to pass FreeBSD IOV method calls into
pci_driver methods.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies
MFC after: 2 weeks

4 years agoAdd pci_iov_if.h header as a dependency for Linuxkpi consumers.
kib [Wed, 18 Mar 2020 22:09:16 +0000 (22:09 +0000)]
Add pci_iov_if.h header as a dependency for Linuxkpi consumers.

Sponsored by: Mellanox Technologies
MFC after: 2 weeks

4 years agomlx5_core: add sysctls to report device capabilities.
kib [Wed, 18 Mar 2020 21:54:32 +0000 (21:54 +0000)]
mlx5_core: add sysctls to report device capabilities.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies
MFC after: 2 weeks

4 years agoDo not spuriously re-enable disabled io_apic pin on EOI for some configurations.
kib [Wed, 18 Mar 2020 21:34:52 +0000 (21:34 +0000)]
Do not spuriously re-enable disabled io_apic pin on EOI for some configurations.

If EOI suppression is supported but reported ioapic version is so old
that it does not has EOI register (weird virtualization setup), fix
Intel trick of eoi-ing by flipping pin type (edge/level) to account
for the disabled pin.

Reported by: Juniper
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D23965

4 years agoStop (trying to) renumber io apics.
kib [Wed, 18 Mar 2020 21:31:35 +0000 (21:31 +0000)]
Stop (trying to) renumber io apics.

It does not serve any purpose now, the io apic id is not seen by
software, and some Intel documents claim that the register is
implemented for FUD reasons.  More, renumbering seems to not work on
new Intel machines which actually have mismatched MADT and hw IDs.

On older machines where separate APIC bus existed, unique numbering of
all APICs was required for bus arbitration to work, but it is no
longer true (that machines were SMP from pre-Pentium IV era).

When matching PCIe IOAPIC device against MADT-enumerated IOAPICs,
compare io_apic_id from BAR against io_apic_id read from the
MADT-pointed register page.

Reviewed by: jhb
Tested by: flo (previous version), pho
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D23965

4 years agosrc.opts.mk: remove remaining support for pre-C++11 C++ compilers
emaste [Wed, 18 Mar 2020 21:28:55 +0000 (21:28 +0000)]
src.opts.mk: remove remaining support for pre-C++11 C++ compilers

Delete the conditions that forcibly disabled GOOGLETEST and LLDB for
pre-C++11 C++ compilers, since we no longer support such compilers.

Also delete the complicated method of defaulting LIBCPLUSPLUS to YES.

Prodded by: kevans
Sponsored by: The FreeBSD Foundation

4 years agoWiden the stored io_apic_id to 8 bits.
kib [Wed, 18 Mar 2020 21:24:34 +0000 (21:24 +0000)]
Widen the stored io_apic_id to 8 bits.

It seems that the newer Intel chipset did that, and Linux reads 8
bits. The only detail is that all seen datasheets, even under NDA,
claim that io apic id is 4 bits.

Submitted by: jeff
Reviewed by: jhb
Tested by: flo, pho
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D23965

4 years agoRevert r359083, fixed properly by r359088
emaste [Wed, 18 Mar 2020 21:20:10 +0000 (21:20 +0000)]
Revert r359083, fixed properly by r359088

r359083 introduced a workaround for stale libomp dependencies during a
regular (no -DNO_CLEAN) buildworld.  r359088 addressed the reason the
clean step missed libomp, so revert the workaround.

Sponsored by: The FreeBSD Foundation

4 years agosrc.opts.mk: drop C++11 compiler conditional from OPENMP
emaste [Wed, 18 Mar 2020 21:15:45 +0000 (21:15 +0000)]
src.opts.mk: drop C++11 compiler conditional from OPENMP

We no longer support older C++ compilers, so do not need to explicitly
test for C++11 support.

After r339946 we stopped running `cc --version` during cleandir/obj
stages, so stopped setting COMPILER_FEATURES.  This in turn meant
lib/libomp was excluded from the clean stage in a normal buildworld
(i.e., one without -DNO_CLEAN), and this is what caused recent build
failures with errors about missing ittnotify_static.c.

This commit should obviate the need for the workaround committed in
r359083.  Thanks to bdrewery for the insight and for pushing for a
correct fix.  There are more cleanups to be done, but this change is
a simplification and an improvement over r359083.

Sponsored by: The FreeBSD Foundation

4 years agoMerge commit 585a3cc31 from llvm git (by me):
dim [Wed, 18 Mar 2020 20:50:30 +0000 (20:50 +0000)]
Merge commit 585a3cc31 from llvm git (by me):

  Fix -Wdeprecated-copy-dtor and -Wdeprecated-dynamic-exception-spec
  warnings.

  Summary:
  The former are like:

  libcxx/include/typeinfo:322:11: warning: definition of implicit copy
  constructor for 'bad_cast' is deprecated because it has a
  user-declared destructor [-Wdeprecated-copy-dtor]
    virtual ~bad_cast() _NOEXCEPT;
    ^
  libcxx/include/typeinfo:344:11: note: in implicit copy constructor
  for 'std::bad_cast' first required here
      throw bad_cast();
    ^

  Fix these by adding an explicitly defaulted copy constructor.

  The latter are like:

  libcxx/include/codecvt:105:37: warning: dynamic exception
  specifications are deprecated [-Wdeprecated-dynamic-exception-spec]
      virtual int do_encoding() const throw();
      ^~~~~~~

  Fix these by using the _NOEXCEPT macro instead.

  Reviewers: EricWF, mclow.lists, ldionne, #libc

  Reviewed By: EricWF, #libc

  Subscribers: dexonsmith, libcxx-commits

  Tags: #libc

  Differential Revision: https://reviews.llvm.org/D76150

This is because we use -Wsystem-headers during buildworld, and the two
warnings above are now triggered by default with clang 10, preventing
most C++ code from compiling without NO_WERROR.

Requested by: brooks
MFC after: 6 weeks
X-MFC-With: 358851
Differential Revision: https://reviews.freebsd.org/D24049

4 years agoMerge commit b8ebc11f0 from llvm git (by Sanjay Patel):
dim [Wed, 18 Mar 2020 20:44:40 +0000 (20:44 +0000)]
Merge commit b8ebc11f0 from llvm git (by Sanjay Patel):

  [EarlyCSE] avoid crashing when detecting min/max/abs patterns (PR41083)

  As discussed in PR41083:
  https://bugs.llvm.org/show_bug.cgi?id=41083
  ...we can assert/crash in EarlyCSE using the current hashing scheme
  and instructions with flags.

  ValueTracking's matchSelectPattern() may rely on overflow (nsw, etc)
  or other flags when detecting patterns such as min/max/abs composed
  of compare+select. But the value numbering / hashing mechanism used
  by EarlyCSE intersects those flags to allow more CSE.

  Several alternatives to solve this are discussed in the bug report.
  This patch avoids the issue by doing simple matching of min/max/abs
  patterns that never requires instruction flags. We give up some CSE
  power because of that, but that is not expected to result in much
  actual performance difference because InstCombine will canonicalize
  these patterns when possible. It even has this comment for abs/nabs:

    /// Canonicalize all these variants to 1 pattern.
    /// This makes CSE more likely.

  (And this patch adds PhaseOrdering tests to verify that the expected
  transforms are still happening in the standard optimization
  pipelines.

  I left this code to use ValueTracking's "flavor" enum values, so we
  don't have to change the callers' code. If we decide to go back to
  using the ValueTracking call (by changing the hashing algorithm
  instead), it should be obvious how to replace this chunk.

  Differential Revision: https://reviews.llvm.org/D74285

This fixes an assertion when building the math/gsl port on PowerPC64.

Requested by: pkubja
MFC after: 6 weeks
X-MFC-With: 358851

4 years agoMerge commit 315f8a55f from llvm git (by Fangrui Song):
dim [Wed, 18 Mar 2020 20:38:15 +0000 (20:38 +0000)]
Merge commit 315f8a55f from llvm git (by Fangrui Song):

  [ELF][PPC32] Don't report "relocation refers to a discarded section"
  for .got2

  Similar to D63182 [ELF][PPC64] Don't report "relocation refers to a
  discarded section" for .toc

  Reviewed By: Bdragon28

  Differential Revision: https://reviews.llvm.org/D75419

This is needed to fix compile errors when building for ppc32/lld10.

Requested by: bdragon
MFC after: 6 weeks
X-MFC-With: 358851
Differential Revision: https://reviews.freebsd.org/D24110

4 years agoMerge commit 00925aadb from llvm git (by Fangrui Song):
dim [Wed, 18 Mar 2020 20:28:26 +0000 (20:28 +0000)]
Merge commit 00925aadb from llvm git (by Fangrui Song):

  [ELF][PPC32] Fix canonical PLTs when the order does not match the PLT order

  Reviewed By: Bdragon28

  Differential Revision: https://reviews.llvm.org/D75394

This is needed to fix miscompiled canonical PLTs on ppc32/lld10.

Requested by: bdragon
MFC after: 6 weeks
X-MFC-With: 358851
Differential Revision: https://reviews.freebsd.org/D24109

4 years agoinvoke _cleanobj_fast_depend_hack unconditionally
emaste [Wed, 18 Mar 2020 20:12:46 +0000 (20:12 +0000)]
invoke _cleanobj_fast_depend_hack unconditionally

Apparently make ${CLEANDIR} is leaving stale entries in .depend files;
for now invoke the hacky cleanup in both the -DNO_CLEAN and normal
(no -DNO_CLEAN) cases.

In collaboration with: dim
Sponsored by: The FreeBSD Foundation

4 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
dim [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 agoFixup line lost from previous commit (r359072)
freqlabs [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
freqlabs [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
0mp [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
emaste [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
luporl [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
hrs [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.
hrs [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.
jkim [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
bcran [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
bcran [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
bcran [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().
bdragon [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.
jkim [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.
jkim [Wed, 18 Mar 2020 02:13:12 +0000 (02:13 +0000)]
Merge OpenSSL 1.1.1e.

4 years agopowerpc: Axe PPC4xx support.
jhibbits [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.
np [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.
jhb [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
cem [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.
jkim [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.
jhb [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
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.
jhb [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 [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 [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
emaste [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
emaste [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
emaste [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
arichardson [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
arichardson [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
0mp [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.
hselasky [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.
kevlo [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
pkelsey [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
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
cem [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
mav [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.
trasz [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.
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 [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.
hselasky [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
kp [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
emaste [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.
imp [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
emaste [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
emaste [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.
pfg [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
pkelsey [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
pkelsey [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...
pkelsey [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
pkelsey [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
pkelsey [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()
pkelsey [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
pkelsey [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
pkelsey [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
imp [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*
kevans [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
bz [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
tsoome [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.
delphij [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
imp [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
emaste [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
freqlabs [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.
imp [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.
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
lwhsu [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
emaste [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.
mav [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
0mp [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
jhibbits [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
np [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
freqlabs [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
cem [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
oshogbo [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
0mp [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
ngie [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
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
emaste [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
emaste [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
luporl [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.
dim [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
tsoome [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.
pfg [Thu, 12 Mar 2020 03:56:54 +0000 (03:56 +0000)]
style(9): Fix space after #define.

No functional change.