]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoNormalize deployment tools usage and definitions by putting into one place
Maxim Sobolev [Tue, 7 Apr 2020 02:46:22 +0000 (02:46 +0000)]
Normalize deployment tools usage and definitions by putting into one place
instead of sprinkling them out over many disjoint files. This is a follow-up
to achieve the same goal in an incomplete rev.348521.

Approved by: imp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D20520

4 years agoriscv: Add semicolon missing from r359672
Jessica Clarke [Mon, 6 Apr 2020 23:54:50 +0000 (23:54 +0000)]
riscv: Add semicolon missing from r359672

Somehow this got lost between build-testing and submitting to Phabricator.

4 years agoFix compilation with upstream clang builtin headers.
Brooks Davis [Mon, 6 Apr 2020 23:38:46 +0000 (23:38 +0000)]
Fix compilation with upstream clang builtin headers.

By using -nobuiltininc and adding the clang builtin headers resource dir
to the end of the compiler header search path, we can still find headers
such as immintrin.h but find the FreeBSD version of stddef.h/stdarg.h/..
first.

This is a workaround until we are able to settle on and complete a plan
to harmonize guard macros with LLVM.  We've mostly worked out this on
FreeBSD systems by removing select headers from the installed set of
devel/llvm*, but that isn't a good solution for cross build.

Submitted by: arichardson
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17002

4 years agomail/gprof/tip: tap with the ugly stick
Kyle Evans [Mon, 6 Apr 2020 23:28:24 +0000 (23:28 +0000)]
mail/gprof/tip: tap with the ugly stick

The ugly stick here is this bit in the respective headers:

#ifndef EXTERN
#define EXTERN extern
#endif

with a follow-up #define EXTERN in a single .c file to push all of their
definitions into one spot. A pass should be made over these three later to
push these definitions into the correct files instead, but this will suffice
for now and at a more leisurely pace.

MFC after: 3 days

4 years agoFix noisy NFSv4 server printf.
Rick Macklem [Mon, 6 Apr 2020 23:21:39 +0000 (23:21 +0000)]
Fix noisy NFSv4 server printf.

Peter reported that his dmesg was getting cluttered with
nfsrv_cache_session: no session
messages when he rebooted his NFS server and they did not seem useful.
He was correct, in that these messages are "normal" and expected when
NFSv4.1 or NFSv4.2 are mounted and the server is rebooted.
This patch silences the printf() during the grace period after a reboot.
It also adds the client IP address to the printf(), so that the message
is more useful if/when it occurs. If this happens outside of the
server's grace period, it does indicate something is not working correctly.
Instead of adding yet another nd_XXX argument, the arguments for
nfsrv_cache_session() were simplified to take a "struct nfsrv_descript *".

Reported by: pen@lysator.liu.se
MFC after: 2 weeks

4 years agoindent: fix the -fno-common build
Kyle Evans [Mon, 6 Apr 2020 23:20:20 +0000 (23:20 +0000)]
indent: fix the -fno-common build

Spread the globals far and wide, hopefully to the files that make the most
sense.

-fno-common will become the default in GCC10/LLVM11.

MFC after: 3 days

4 years agoyp*: fix -fno-common build
Kyle Evans [Mon, 6 Apr 2020 23:16:05 +0000 (23:16 +0000)]
yp*: fix -fno-common build

This is mostly two problems spread out far and wide:
- ypldap_process should be declared properly
- debug is defined differently in many programs

For the latter, just extern it and define it everywhere that actually needs
it. This mostly works out nicely for ^/libexec/ypxfr, which can remove the
assignment at the beginning of main in favor of defining it properly.

-fno-common will become the default in GCC10/LLVM11.

MFC after: 3 days

4 years agontpd: fix build with -fno-common
Kyle Evans [Mon, 6 Apr 2020 23:11:43 +0000 (23:11 +0000)]
ntpd: fix build with -fno-common

Only a small nit here: psl should be declared extern and defined exactly
once.

-fno-common will become the default in GCC10/LLVM11.

MFC after: 3 days

4 years agokqueue tests: fix -fno-common build
Kyle Evans [Mon, 6 Apr 2020 23:08:07 +0000 (23:08 +0000)]
kqueue tests: fix -fno-common build

vnode_fd and kqfd are both shared among multiple CU; define them exactly
once.

In the case of vnode_fd, it was simply the declaration that needed
correction.

-fno-common will become the default in GCC10/LLVM11.

MFC after: 3 days

4 years agolibcasper: Constify cap_sysctl_limit_mib() mib parameter
Conrad Meyer [Mon, 6 Apr 2020 23:07:56 +0000 (23:07 +0000)]
libcasper: Constify cap_sysctl_limit_mib() mib parameter

No functional change. Minor API change that is nicer for consumers. ABI is
identical; the routine never needed to modify the pointed to value.

Reviewed by: emaste, markj
Differential Revision: https://reviews.freebsd.org/D24319

4 years agoRISC-V: copy the DTB to early KVA
Mitchell Horne [Mon, 6 Apr 2020 22:48:43 +0000 (22:48 +0000)]
RISC-V: copy the DTB to early KVA

The location of the device-tree blob is passed to the kernel by the
previous booting stage (i.e. BBL or OpenSBI). Currently, we leave it
untouched and mark the 1MB of memory holding it as unavailable.

Instead, do what is done by other fake_preload_metadata() routines and
copy to the DTB to KVA space. This is more in line with what loader(8)
will provide us in the future, and it allows us to reclaim the hole in
physical memory.

Reviewed by: markj, kp (earlier version)
Differential Revision: https://reviews.freebsd.org/D24152

4 years agoriscv: Make sure local hart's icache is synced in pmap_sync_icache
Jessica Clarke [Mon, 6 Apr 2020 22:31:30 +0000 (22:31 +0000)]
riscv: Make sure local hart's icache is synced in pmap_sync_icache

The only way to flush the local hart's icache is with a FENCE.I (or an
equivalent SBI call); a normal FENCE is insufficient and, for the
single-hart case, unnecessary.

Reviewed by: jhb (mentor), markj
Approved by: jhb (mentor), markj
Differential Revision: https://reviews.freebsd.org/D24317

4 years agoriscv: Fix pmap_fault_fixup for L3 pages
Jessica Clarke [Mon, 6 Apr 2020 22:29:15 +0000 (22:29 +0000)]
riscv: Fix pmap_fault_fixup for L3 pages

Summary:
The parentheses being in the wrong place means that, for L3 pages,
oldpte has all bits except PTE_V cleared, and so all the subsequent
checks against oldpte will fail, causing us to bail out and not retry
the faulting instruction after an SFENCE.VMA. This causes a WITNESS +
INVARIANTS kernel to fault on the "Chisel P3" (BOOM-based) DARPA SSITH
GFE SoC in pmap_init when writing to pv_table and, being a nofault
entry, subsequently panic with:

  panic: vm_fault_lookup: fault on nofault entry, addr: 0xffffffc004e00000

Reviewed by: markj
Approved by: markj
Differential Revision: https://reviews.freebsd.org/D24315

4 years agoRevert -r359612 as it can cause other panics.
Kirk McKusick [Mon, 6 Apr 2020 20:23:47 +0000 (20:23 +0000)]
Revert -r359612 as it can cause other panics.
An updated version will be made when the issue has been resolved.

Reported by: Peter Holm

4 years agoAdd hwpmc support for Intel Atom Goldmont microarchitecture
Marcin Wojtas [Mon, 6 Apr 2020 19:45:26 +0000 (19:45 +0000)]
Add hwpmc support for Intel Atom Goldmont microarchitecture

Recognize new micro-architecture in hwpmc_intel driver. Based on Intel
document 325462-071US. Tested with tools/test/hwpmc/pmctest.py
on Atom E3930 SoC.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Reviewed by: kib
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D24310

4 years agoRelax too strict SES element descriptors check in r355430.
Alexander Motin [Mon, 6 Apr 2020 18:42:01 +0000 (18:42 +0000)]
Relax too strict SES element descriptors check in r355430.

SES specifications allows the string to be NULL-terminated, while previous
code was considering it as invalid due to incorrectly ordered conditions.

MFC after:  1 week
Sponsored by: iXsystem, Inc.

4 years agoDo more argument validation under INVARIANTS when starting/stopping
Michael Tuexen [Mon, 6 Apr 2020 13:58:13 +0000 (13:58 +0000)]
Do more argument validation under INVARIANTS when starting/stopping
an SCTP timer.

MFC after: 1 week

4 years agoAdd Gordon Bergling to the authors section; remove trailing whitespace.
Christian Brueffer [Mon, 6 Apr 2020 09:59:21 +0000 (09:59 +0000)]
Add Gordon Bergling to the authors section; remove trailing whitespace.

Suggested by: rgrimes
Approved by: Gordon Bergling
X-MFC-with: r359633

4 years agoDon't drop packets having too many TCP option headers in mlx5en(4).
Hans Petter Selasky [Mon, 6 Apr 2020 09:50:20 +0000 (09:50 +0000)]
Don't drop packets having too many TCP option headers in mlx5en(4).

When using SACK it can happen there are multiple option headers.
Don't drop these packets, but instead limit the amount of inlining
to the maximum supported.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoEnsure a minimum inline size of 16 bytes in mlx5en(4).
Hans Petter Selasky [Mon, 6 Apr 2020 09:45:49 +0000 (09:45 +0000)]
Ensure a minimum inline size of 16 bytes in mlx5en(4).

This includes 14 bytes of ethernet header and 2 bytes of VLAN header.

This allows for making assumptions about the inline size limit
in the fast transmit path later on.

Use a signed integer variable to catch underflow.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoCount number of times transmit ring is out of buffers in mlx5en(4).
Hans Petter Selasky [Mon, 6 Apr 2020 09:41:22 +0000 (09:41 +0000)]
Count number of times transmit ring is out of buffers in mlx5en(4).

Differential Revision: https://reviews.freebsd.org/D24273
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoAdd MDIO PHY driver for NS2 ARM64 platform.
Wojciech Macek [Mon, 6 Apr 2020 05:48:58 +0000 (05:48 +0000)]
Add MDIO PHY driver for NS2 ARM64 platform.

Obtained from:         Semihalf
Authored by:           Kornel Duleba <mindal@semihalf.com>
Approved by:           wma
Differential Revision: https://reviews.freebsd.org/D21335

4 years agosrc.conf(5): re-roll after r359644 (LLVM_ASSERTIONS)
Kyle Evans [Mon, 6 Apr 2020 01:28:03 +0000 (01:28 +0000)]
src.conf(5): re-roll after r359644 (LLVM_ASSERTIONS)

4 years agollvm: add a build knob for enabling assertions
Kyle Evans [Mon, 6 Apr 2020 01:27:17 +0000 (01:27 +0000)]
llvm: add a build knob for enabling assertions

For head/, this will remain eternally default-on to maintain the status quo.
For stable/ branches, it should be flipped to default-off to maintain the
status quo.

There's value in being able to flip it one way or the other easily on head
or stable branches, whether you want to gain some performance back on head/
(for machines there's little chance you'll actually hit an assertion) or
potentially diagnose a problem with the version of llvm on an older branch.

Currently, stable branches get the CFLAGS+= -ndebug line uncommented; going
forward, they will instead have the default of LLVM_ASSERTIONS flipped.

Reviewed by: dim, emaste, re (gjb)
MFC after: 1 week
MFC note: flip the default of LLVM_ASSERTIONS
Differential Revision: https://reviews.freebsd.org/D24264

4 years agoChange the xid for client side krpc over UDP to a global value.
Rick Macklem [Sun, 5 Apr 2020 21:08:17 +0000 (21:08 +0000)]
Change the xid for client side krpc over UDP to a global value.

Without this patch, the xid used for the client side krpc requests over
UDP was initialized for each "connection". A "connection" for UDP is
rather sketchy and for the kernel NLM a new one is created every 2minutes.
A problem with client side interoperability with a Netapp server for the NLM
was reported and it is believed to be caused by reuse of the same xid.
Although this was never completely diagnosed by the reporter, I could see
how the same xid might get reused, since it is initialized to a value
based on the TOD clock every two minutes.
I suspect initializing the value for every "connection" was inherited from
userland library code, where having a global xid was not practical.
However, implementing a global "xid" for the kernel rpc is straightforward
and will ensure that an xid value is not reused for a long time. This
patch does that and is hoped it will fix the Netapp interoperability
problem.

PR: 245022
Reported by: danny@cs.huji.ac.il
MFC after: 2 weeks

4 years agoadduser: allow standard IFS characters in passwords
Kyle Evans [Sun, 5 Apr 2020 19:25:46 +0000 (19:25 +0000)]
adduser: allow standard IFS characters in passwords

Notably, the default IFS contains space/tab, thus any leading/trailing
whitespace characters tend to be removed.

Set IFS= for just the read lines to mitigate this, allowing the user to be
less surprised when their leading/trailing spaces weren't actually captured
in the password as they are with other means of setting a user's password.

PR: 245342
Submitted by: dereks_lifeofadishwasher.com
Reviewed by: jilles
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24292

4 years agobridge: Change lists to CK_LIST as a peparation for epochification
Kristof Provost [Sun, 5 Apr 2020 17:15:20 +0000 (17:15 +0000)]
bridge: Change lists to CK_LIST as a peparation for epochification

Prepare the ground for a rework of the bridge locking approach. We will
use an epoch-based approach in the datapath and making it safe to
iterate over the interface, span and rtnode lists without holding the
BRIDGE_LOCK. Replace the relevant lists by their ConcurrencyKit
equivalents.

No functional change in this commit.

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

4 years agoMake p_vaddr % p_align == p_offset % p_align for (some) TLS segments.
Konstantin Belousov [Sat, 4 Apr 2020 22:37:50 +0000 (22:37 +0000)]
Make p_vaddr % p_align == p_offset % p_align for (some) TLS segments.

See https://sourceware.org/bugzilla/show_bug.cgi?id=24606 for the test case.
See https://reviews.llvm.org/D64930 for the background and more discussion.

Also this fixes another bug in malloc_aligned() where total size of
the allocated memory might be not enough to fit the aligned requested
block after the initial pointer is incremented by the pointer size.

Reviewed by: bdragon
Tested by: antoine (exp-run PR 244866), bdragon, emaste
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D21163

4 years agoAdd a manpage for smbios(4).
Christian Brueffer [Sat, 4 Apr 2020 21:38:00 +0000 (21:38 +0000)]
Add a manpage for smbios(4).

Submitted by: Gordon Bergling
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23714

4 years agoRemove extra spaces for the load average of machines that are down.
Yoshihiro Takahashi [Sat, 4 Apr 2020 12:07:36 +0000 (12:07 +0000)]
Remove extra spaces for the load average of machines that are down.

PR: 245296
Submitted by: martin _at_ lispworks.com
MFC after: 1 week

4 years agoFix typo
Sergio Carlavilla Delgado [Sat, 4 Apr 2020 07:43:47 +0000 (07:43 +0000)]
Fix typo

4 years agomac_policy: Remove mac_policy_sx
Jason A. Harmening [Sat, 4 Apr 2020 04:03:10 +0000 (04:03 +0000)]
mac_policy: Remove mac_policy_sx

This lock was made unnecessary by the addition of mac_policy_rms in r356120.

Reviewed by: mjg, kib
Differential Revision: https://reviews.freebsd.org/D24283

4 years agoClean up global variable declarations in the dump and restore
Kirk McKusick [Sat, 4 Apr 2020 00:56:56 +0000 (00:56 +0000)]
Clean up global variable declarations in the dump and restore
utilities so that they will compile with -fno-common.

Started by:  Kyle Evans (kevans)
Reviewed by: Kyle Evans (kevans)
MFC after:   1 week
Differential Revision: https://reviews.freebsd.org/D24210

4 years agovt: avoid overrun when stride is not a multiple of bytes per pixel
Ed Maste [Sat, 4 Apr 2020 00:31:30 +0000 (00:31 +0000)]
vt: avoid overrun when stride is not a multiple of bytes per pixel

The reporter is developing a frame buffer driver for hardware using
3 bytes per pixel, but a stride that's a multiple of 256.  Previously
this resulted in writing beyond the end of each stride.  On the last
row this attempted to write past the end of the frame buffer, triggering
the assertion in vt_fb_mem_wr1().

PR: 243533
MFC after: 2 weeks
Submitted by: Thomas Skibo

4 years agoUpdate x86 counters
Matt Macy [Fri, 3 Apr 2020 22:36:22 +0000 (22:36 +0000)]
Update x86 counters

MFC after: 1 week

4 years agoANSIfy and KNF function arg definitions in libmd/md4.c
Ed Maste [Fri, 3 Apr 2020 20:56:43 +0000 (20:56 +0000)]
ANSIfy and KNF function arg definitions in libmd/md4.c

Reported by: bde, in 2017

4 years agopowerpc/amigaone: Add CPLD driver for AmigaOne A1222 "Tabor"
Justin Hibbits [Fri, 3 Apr 2020 20:45:16 +0000 (20:45 +0000)]
powerpc/amigaone: Add CPLD driver for AmigaOne A1222 "Tabor"

Like the X5000, the main CPLD on the A1222 is the communication medium
between the CPU and the GPIO CPLD.  It provides a mailbox communication
feature, along with dual-port RAM accessible from both the CPU and GPIO
CPLD, and 3 fan speed reporting registers.

4 years agoWhen shrinking the size of a directory it is sometimes necessary to
Kirk McKusick [Fri, 3 Apr 2020 20:43:25 +0000 (20:43 +0000)]
When shrinking the size of a directory it is sometimes necessary to
sync it to disk before shrinking it. Complete the sync before getting
the buffer for the block to be updated to do the shrink to avoid
panicing with a recursive lock on one of the directory's buffers.

Reviewed by:  Chuck Silvers (chs)
MFC after:    3 days
Sponsored by: Netflix

4 years agoConvert DOINGSOFTDEP, MOUNTEDSOFTDEP, DOINGSUJ, and MOUNTEDSUJ to being
Kirk McKusick [Fri, 3 Apr 2020 20:30:45 +0000 (20:30 +0000)]
Convert DOINGSOFTDEP, MOUNTEDSOFTDEP, DOINGSUJ, and MOUNTEDSUJ to being
boolean expressions so that their values are not lost when assigned to
`bool' or `int' variables.

Reviewed by:  Chuck Silvers (chs)
MFC after:    3 days
Sponsored by: Netflix

4 years agoelf.5: remove commented out leftovers
Ed Maste [Fri, 3 Apr 2020 19:42:16 +0000 (19:42 +0000)]
elf.5: remove commented out leftovers

4 years agoelf.5: expand on NT_FREEBSD_FEATURE_CTL bit definitions
Ed Maste [Fri, 3 Apr 2020 17:17:17 +0000 (17:17 +0000)]
elf.5: expand on NT_FREEBSD_FEATURE_CTL bit definitions

Based on suggestions from kib in review D23982.

Sponsored by: The FreeBSD Foundation

4 years agolldb: build and enable lua script bindings
Ed Maste [Fri, 3 Apr 2020 16:54:13 +0000 (16:54 +0000)]
lldb: build and enable lua script bindings

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24266

4 years agoPass the real value of MK_TESTS_SUPPORT to distribution.
Brooks Davis [Fri, 3 Apr 2020 16:19:07 +0000 (16:19 +0000)]
Pass the real value of MK_TESTS_SUPPORT to distribution.

This allows kyua's config file to actually be installed.

Reported by: arichardson
Reviewed by: arichardson
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24268

4 years agopmc: diable position-independent builds, they fail to link on amd64
Brooks Davis [Fri, 3 Apr 2020 16:10:42 +0000 (16:10 +0000)]
pmc: diable position-independent builds, they fail to link on amd64

PR: 245189
Reported by: Gordon Bergling
Sponsored by: DARPA

4 years agolldb: commit generated LLDBWrapLua.cpp
Ed Maste [Fri, 3 Apr 2020 15:55:58 +0000 (15:55 +0000)]
lldb: commit generated LLDBWrapLua.cpp

4 years agolldb: add rule to generate LLDBWrapLua.cpp
Ed Maste [Fri, 3 Apr 2020 15:52:44 +0000 (15:52 +0000)]
lldb: add rule to generate LLDBWrapLua.cpp

Building lldb's lua/python bindings requires swig, but we do not want to
include it in the FreeBSD base system (as a build tool) because it has
non-trivial dependencies.  As a workaround, add a make rule to generate
LLDBWrapLua.cpp, and we will commit the generated file.

Requires the swig30 package.

Reviewed by: brooks
Discussed with: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24265

4 years agoInstall a kyua.conf based on the one in devel/kyua.
Brooks Davis [Fri, 3 Apr 2020 15:47:15 +0000 (15:47 +0000)]
Install a kyua.conf based on the one in devel/kyua.

The kyua.conf from examples doesn't match the expected config and
contains a lot of undesirable entries such as setting the architecture
to amd64 explicitly.

Reported by: arichardson (missing config)
Reviewed by: emaste
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D24267

4 years agoFix up r359594: -m takes an argument.
Mark Johnston [Fri, 3 Apr 2020 14:47:40 +0000 (14:47 +0000)]
Fix up r359594: -m takes an argument.

PR: 244153
Reported by: 0mp
MFC with: r359594

4 years agoxargs: Fix exit status expression when a child process fails to exec.
Mark Johnston [Fri, 3 Apr 2020 14:03:58 +0000 (14:03 +0000)]
xargs: Fix exit status expression when a child process fails to exec.

PR: 244327
Submitted by: thomas.duffy.99@alumni.brown.edu
MFC after: 1 week

4 years agogeom_journal: Only stop the switcher process if one was started.
Mark Johnston [Fri, 3 Apr 2020 13:57:41 +0000 (13:57 +0000)]
geom_journal: Only stop the switcher process if one was started.

PR: 243196
MFC after: 1 week

4 years agoFix the description of the -m flag in top.1.
Mark Johnston [Fri, 3 Apr 2020 13:35:44 +0000 (13:35 +0000)]
Fix the description of the -m flag in top.1.

PR: 244153
Submitted by: fehmi noyan isi <fnoyanisi@yahoo.com>
MFC after: 3 days

4 years agoBump date after recent changes and lint
Mateusz Piotrowski [Fri, 3 Apr 2020 13:05:26 +0000 (13:05 +0000)]
Bump date after recent changes and lint

4 years agoRemove hardcoded US Election Day from calendar.usholiday
Oleksandr Tymoshenko [Fri, 3 Apr 2020 02:39:46 +0000 (02:39 +0000)]
Remove hardcoded US Election Day from calendar.usholiday

calendar(1) syntax is not capable of representing the rules for the
US Election Day. The hardcoded date was set in r15066 in 1996 and
hasn't changed since then.

PR: 173389
Reported by: Steve Ames <steve@energistic.com>
MFC after: 1 week

4 years agoFix calculation of the recurring weekdays
Oleksandr Tymoshenko [Fri, 3 Apr 2020 01:17:43 +0000 (01:17 +0000)]
Fix calculation of the recurring weekdays

Both the result of the first_dayofweek_of_year and the target
weekday are zero-based (0 fo sunday) while the target month-day
or year-day is 1-based. Adjust logic accordingly.

Also add testcase for this PR to the kyua test suite

PR: 201062
Submitted by: Richard Narron <comet.berkeley@gmail.com>
MFC after: 1 week

4 years agolldb: use lua as the default script language
Ed Maste [Thu, 2 Apr 2020 21:08:28 +0000 (21:08 +0000)]
lldb: use lua as the default script language

In the FreeBSD base system we do not have Python support in lldb, but
will have Lua support.  Make Lua the default.

This needs to be made into a configure-time option; that is being
discussed upstream and will appear in a future lldb import.  For now
carry this change as a tiny patch to our copy of lldb.

4 years agoddb(4): show lockchain: Don't dereference LK_KERNPROC
Conrad Meyer [Thu, 2 Apr 2020 20:47:51 +0000 (20:47 +0000)]
ddb(4): show lockchain: Don't dereference LK_KERNPROC

Also, print a little more information for otherwise unhandled inhibited states.

Finally, improve the grammar of some prints.  Some of the print statements
missing verb.

Sponsored by: Dell EMC Isilon

4 years agoUse interface fib for proxyarp checks.
Alexander V. Chernikov [Thu, 2 Apr 2020 20:06:37 +0000 (20:06 +0000)]
Use interface fib for proxyarp checks.

Before the change, proxyarp checks for src and dst addresses
 were performed using default fib, breaking multi-fib scenario.

PR: 245181
Submitted by: Scott Aitken (original version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24244

4 years agoAdd routing tests verifying basic RTM_CHANGE functionality.
Alexander V. Chernikov [Thu, 2 Apr 2020 20:02:33 +0000 (20:02 +0000)]
Add routing tests verifying basic RTM_CHANGE functionality.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24239

4 years agoMerge once more from ^/vendor/llvm-project/release-10.x, to get the
Dimitry Andric [Thu, 2 Apr 2020 19:56:43 +0000 (19:56 +0000)]
Merge once more from ^/vendor/llvm-project/release-10.x, to get the
lldb/bindings directory, which will be used to provide lua bindings for
lldb.

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

4 years agoAdd lldb/bindings to vendor area, since emaste is going to add support
Dimitry Andric [Thu, 2 Apr 2020 19:52:43 +0000 (19:52 +0000)]
Add lldb/bindings to vendor area, since emaste is going to add support
for lldb's lua bindings.

4 years agoAdd the Cadence GEM ethernet driver to NOTES so that it gets built with
Ian Lepore [Thu, 2 Apr 2020 19:06:05 +0000 (19:06 +0000)]
Add the Cadence GEM ethernet driver to NOTES so that it gets built with
LINT kernels.  Move the config for it from files.<arch> files into the
main config (conf/files), because it works on multiple platforms now.

4 years agoCadence GEM ethernet driver style clean-up, no functional changes.
Ian Lepore [Thu, 2 Apr 2020 17:57:40 +0000 (17:57 +0000)]
Cadence GEM ethernet driver style clean-up, no functional changes.

This is mostly indentation whitespace, and reflowing a few multiline
comments.  This gets a bunch of minor stuff out of the way so that the diffs
for style don't clutter up the diffs for some upcoming functional changes.

Submitted by: Thomas Skibo
Differential Revision: https://reviews.freebsd.org/D24226

4 years agoAvoid checking pointers that are never NULL.
John Baldwin [Thu, 2 Apr 2020 17:22:16 +0000 (17:22 +0000)]
Avoid checking pointers that are never NULL.

Coverity noted that cod pointer is always non-NULL at the end of
cryptodev_aead().  While here, fix cryptodev_op() to match by making
one earlier failure case before cod and crp are allocated just return
directly.

CID: 1422185
Reported by: Coverity

4 years agoRemove duplicate conditional.
John Baldwin [Thu, 2 Apr 2020 16:55:28 +0000 (16:55 +0000)]
Remove duplicate conditional.

CID: 1422192
Reported by: Coverity

4 years agoAdd two options to recoverdisk(1) inspired by a recent
Poul-Henning Kamp [Thu, 2 Apr 2020 15:17:53 +0000 (15:17 +0000)]
Add two options to recoverdisk(1) inspired by a recent
data-archæology project:

-u pattern

    Fill unread parts of the output with pattern.
    Default pattern is "_UNREAD_", empty pattern disables.

-v

    Fancy status reporting using ANSI escapes and UTF-8

4 years agoFix various Coverity-detected errors in nvmecontrol
David Bright [Thu, 2 Apr 2020 13:52:54 +0000 (13:52 +0000)]
Fix various Coverity-detected errors in nvmecontrol

This fixes several Coverity-detected errors in nvmecontrol. While in
here, a couple additional errors with shift/mask confusion that were
not diagnosed by Coverity are also fixed.

CIDs addressed: 104029910403001403972140397314039851403988,
1403990140437414044271404469140451014045341418118

CID 1403657 (resource leak of shared library handle) was marked
"intentional" in the Coverity scan database.

Reviewed by: vangyzen, robert.herndon_dell.com
Reviewed by: daniel.william.ryan_gmail.com (earlier version)
Reviewed by: rramsden_isilon.com (earlier version), imp
MFC after: 5 days
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D24203

4 years agoAdd NetBSD 8.2
Sevan Janiyan [Thu, 2 Apr 2020 11:08:19 +0000 (11:08 +0000)]
Add NetBSD 8.2

4 years agoFix mbuf handling in le advertize packet processing.
Takanori Watanabe [Thu, 2 Apr 2020 09:15:31 +0000 (09:15 +0000)]
Fix mbuf handling in le advertize  packet processing.

Submitted by: Marc Veldman <marc at bumblingdork.com>

4 years agoelf.5: correct and expand NT_FREEBSD_NOINIT_TAG description
Ed Maste [Thu, 2 Apr 2020 01:03:27 +0000 (01:03 +0000)]
elf.5: correct and expand NT_FREEBSD_NOINIT_TAG description

Reported by: kib

4 years agoriscv/sifive: add FE310 Always-on driver
Nick O'Brien [Thu, 2 Apr 2020 00:33:15 +0000 (00:33 +0000)]
riscv/sifive: add FE310 Always-on driver

This driver supports SiFive's FE310 Always-on (AON) peripheral's
Real-time clock (RTC) and Watchdog timer (WDT). AON has other
functionality that this driver could support such as the power
management unit (PMU) but that functionality hasn't been implemented.

Reviewed by: philip (mentor), kp (mentor)
Approved by: philip (mentor)
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D24170

4 years agoelf.5: minor update to FreeBSD ELF note descriptions
Ed Maste [Wed, 1 Apr 2020 23:36:16 +0000 (23:36 +0000)]
elf.5: minor update to FreeBSD ELF note descriptions

4 years agoNote some functions that appeared in First Edition Unix
Warner Losh [Wed, 1 Apr 2020 22:50:41 +0000 (22:50 +0000)]
Note some functions that appeared in First Edition Unix

These functions first appeared in the First Edition of Unix (or earlier in the
pdp-7 version). Just claim 1st Edition for all this. The pdp-7 code is too
fragmented at this point to extend history that far back.

4 years agoRetire procfs-based process debugging.
John Baldwin [Wed, 1 Apr 2020 19:22:09 +0000 (19:22 +0000)]
Retire procfs-based process debugging.

Modern debuggers and process tracers use ptrace() rather than procfs
for debugging.  ptrace() has a supserset of functionality available
via procfs and new debugging features are only added to ptrace().
While the two debugging services share some fields in struct proc,
they each use dedicated fields and separate code.  This results in
extra complexity to support a feature that hasn't been enabled in the
default install for several years.

PR: 244939 (exp-run)
Reviewed by: kib, mjg (earlier version)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D23837

4 years agoSet crp_ilen for crypto requests.
John Baldwin [Wed, 1 Apr 2020 17:09:21 +0000 (17:09 +0000)]
Set crp_ilen for crypto requests.

Assertions in crypto_dispatch() depend on this value being set to
verify that payload and AAD regions are in bounds.  Also, requests
that use a single kernel buffer rely on this to know how long the
buffer is for bus_dma, etc.

Reported by: kp

4 years agoRemove redundant development tag from include Makefile
Ed Maste [Wed, 1 Apr 2020 16:38:45 +0000 (16:38 +0000)]
Remove redundant development tag from include Makefile

Headers are placed in the -development package via install args in rules
in share/mk/bsd.incs.mk; there is no need to explicitly modify TAGS in
include/Makefile.  (Mentioned in review D24139.)

Discussed with: manu

4 years agoStart the retirement process for ufm
Warner Losh [Wed, 1 Apr 2020 16:22:31 +0000 (16:22 +0000)]
Start the retirement process for ufm

This driver hasn't been relevant in almost 15 years. It was for a product on the
shelves for about 6 months in 2003/2004. I've not updated the driver since then,
and have had nobody talk to me about it since maybe 2006 or 2007. It doesn't
implement a standard interface, and can be better done with libusb. All the
action has moved to webcamd for newer, more fully featured hardware. It makes no
appearances in the nycbug dmesg archive.

Relnotes: yes
MFC After: 3 days

4 years agox86 tsc: fall back to CPUID if calibration results looks unbelievable.
Konstantin Belousov [Wed, 1 Apr 2020 16:21:11 +0000 (16:21 +0000)]
x86 tsc: fall back to CPUID if calibration results looks unbelievable.

Teested and reviewed by: scottl
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D24247

4 years agopkgbase: remove more profile package leftovers
Ed Maste [Wed, 1 Apr 2020 16:03:06 +0000 (16:03 +0000)]
pkgbase: remove more profile package leftovers

As of r356797 we don't produce profile packages.  r358549 removed one
remnant of profile package support; clean up another now.

4 years agoAdd a makefile to build and run the tests for the bsnmp library.
Hartmut Brandt [Wed, 1 Apr 2020 15:39:02 +0000 (15:39 +0000)]
Add a makefile to build and run the tests for the bsnmp library.
This is not automatically built or run but must explicitly be built
with 'make' and run with 'make run'.

4 years agoelf.5: add definitions of FreeBSD notes
Ed Maste [Wed, 1 Apr 2020 15:34:10 +0000 (15:34 +0000)]
elf.5: add definitions of FreeBSD notes

I hope to extend this with some more detail in the future but it gives
a good starting point.

Thanks to 0mp for assistance with markup.

Reviewed by: jkoshy
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23982

4 years agoMerge release 1.14 of bsnmp.
Hartmut Brandt [Wed, 1 Apr 2020 15:25:16 +0000 (15:25 +0000)]
Merge release 1.14 of bsnmp.

4 years agoBump WARNS for sh(1).
Edward Tomasz Napierala [Wed, 1 Apr 2020 15:12:51 +0000 (15:12 +0000)]
Bump WARNS for sh(1).

Reviewed by: jilles
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24181

4 years agoStop hardcoding WARNS in uefisign(8).
Edward Tomasz Napierala [Wed, 1 Apr 2020 15:10:26 +0000 (15:10 +0000)]
Stop hardcoding WARNS in uefisign(8).

MFC after: 2 weeks
Sponsored by: DARPA

4 years agoStop hardcoding WARNS in iscsid(8).
Edward Tomasz Napierala [Wed, 1 Apr 2020 15:09:52 +0000 (15:09 +0000)]
Stop hardcoding WARNS in iscsid(8).

MFC after: 2 weeks
Sponsored by: DARPA

4 years agoStop hardcoding WARNS in iscsictl(8).
Edward Tomasz Napierala [Wed, 1 Apr 2020 15:08:53 +0000 (15:08 +0000)]
Stop hardcoding WARNS in iscsictl(8).

MFC after: 2 weeks
Sponsored by: DARPA

4 years agoStop hardcoding WARNS in automount(8) et al.
Edward Tomasz Napierala [Wed, 1 Apr 2020 15:08:13 +0000 (15:08 +0000)]
Stop hardcoding WARNS in automount(8) et al.

MFC after: 2 weeks
Sponsored by: DARPA

4 years agolldb: stop excluding bindings/ subdir
Ed Maste [Wed, 1 Apr 2020 13:18:01 +0000 (13:18 +0000)]
lldb: stop excluding bindings/ subdir

With liblua in the tree we should be able to enable lldb's lua
scripting.  We'll need the files in bindings/, so start by allowing them
to come in with the next import.

Approved by: dim
Sponsored by: The FreeBSD Foundation

4 years agoUse memmove to copy within a buffer
Andrew Turner [Wed, 1 Apr 2020 09:51:29 +0000 (09:51 +0000)]
Use memmove to copy within a buffer

jail(8) would try to use strcpy to remove the interface from the start of
an IP address. This is undefined, and on arm64 will result in unexpected
IPv6 addresses.

Fix this by using memmove top move the string.

PR: 245102
Reported by: sbruno
MFC after: 2 weeks
Sponsored by: Innovate UK

4 years agoUse proper mdoc(7) macros for literal text and do not use Tn
Mateusz Piotrowski [Wed, 1 Apr 2020 09:01:35 +0000 (09:01 +0000)]
Use proper mdoc(7) macros for literal text and do not use Tn

Tn is deprecated and upsets linters.

MFC after: 3 days

4 years agoDo not claim libbearssl et al are INTERNALLIB
Simon J. Gerraty [Wed, 1 Apr 2020 05:45:12 +0000 (05:45 +0000)]
Do not claim libbearssl et al are INTERNALLIB

If INTERNALLIB is defined we need PIE and bsd.incs.mk is
not included.

PR: 245189
Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org//D24233

4 years agodeadlkres: include thread name in panic messages
Jason A. Harmening [Wed, 1 Apr 2020 04:51:39 +0000 (04:51 +0000)]
deadlkres: include thread name in panic messages

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

4 years agoAdd support for AHCI BIOS/OS Handoff.
Alexander Motin [Wed, 1 Apr 2020 03:27:47 +0000 (03:27 +0000)]
Add support for AHCI BIOS/OS Handoff.

This allows clean handoff from BIOS implementing some asynchronous I/O to
the OS AHCI driver.  During attach driver declares OS ownership request
and waits from 25ms to 2s for BIOS to complete operation and release the
hardware.

MFC after: 2 weeks

4 years agoAdd ID for JMicron JMB582/JMB585 AHCI controller.
Alexander Motin [Wed, 1 Apr 2020 03:19:42 +0000 (03:19 +0000)]
Add ID for JMicron JMB582/JMB585 AHCI controller.

JMB582 has 2 6Gbps SATA ports and PCIe 3.0 x1.
JMB585 has 5 6Gbps SATA ports and PCIe 3.0 x2.

Both chips support AHCI v1.31, Port Multiplier with FBS and 8 MSI vectors.

MFC after: 2 weeks

4 years agoIgnore ND6 neighbor advertisement received for static link-layer entries.
Andrey V. Elsukov [Wed, 1 Apr 2020 02:13:01 +0000 (02:13 +0000)]
Ignore ND6 neighbor advertisement received for static link-layer entries.

Previously such NA could override manually created LLE.

Reported by: Martin Beran <martin at mber cz>
Reviewed by: melifaro
MFC after: 10 days

4 years agoAdd powerpcspe to the EXTRA_TARGETS
Warner Losh [Tue, 31 Mar 2020 22:41:57 +0000 (22:41 +0000)]
Add powerpcspe to the EXTRA_TARGETS

Currently, powerpcspe is broken with clang. Add it to the EXTRA_TARGETS until
that's fixed.

Reviewed by: brooks, bdrewery, emaste (LGTM)
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D24212

4 years agoDocument universe better
Warner Losh [Tue, 31 Mar 2020 22:41:53 +0000 (22:41 +0000)]
Document universe better

Document the kernels and worlds targets. Document the TARGETS and EXTRA_TARGETS
variables.

Reviewed by: brooks, bdrewery, emaste (LGTM)
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D24212

4 years agoFix make kernels to match original commit message
Warner Losh [Tue, 31 Mar 2020 22:41:48 +0000 (22:41 +0000)]
Fix make kernels to match original commit message

make kernels was originally documented (in commit r295099) as the same as make
universe -DJUST_BUILD_KERNELS. However, it used the UNIVERSE_TARGET=buildkernel
which is subtly different in that it also builds the toolchains and doesn't
build the LINT modules unless they happened to already exist in the tree. This
unbreaks POLA and just builds the kernels, including LINT, now rather than all
that other stuff as well. When the commit originally happened, the two just
differed by the LINT bug. r335711 introduced the universe dependency on the
toolchain that wasn't present before, which diverged the two further. This
restores the original intent of r295099.

Reviewed by: brooks, bdrewery, emaste (LGTM)
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D24212

4 years agoMake universe configuration more consistent with rest of system
Warner Losh [Tue, 31 Mar 2020 22:41:43 +0000 (22:41 +0000)]
Make universe configuration more consistent with rest of system

Add 'WITHOUT_WORLDS' and 'WITHOUT_KERNELS' as aliases for the inconsistently
named MAKE_JUST_KERNELS and MAKE_JUST_WORLDS respectively. I always forget the
MAKE_ part (or is it BUILD_), and it's inconsistent with everything
else. Document the new things, but leave speculation of any eventual MAKE_JUST_*
deprecation out of the manuals and comments.

Reviewed by: brooks, bdrewery, emaste (LGTM)
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D24212

4 years agoFix build for mips.XLP64 kernel, by re-ordering headers
Ravi Pokala [Tue, 31 Mar 2020 20:09:20 +0000 (20:09 +0000)]
Fix build for mips.XLP64 kernel, by re-ordering headers

The log for the failure contained errors like this:

| In file included from ${SRCTOP}/sys/mips/nlm/dev/net/xlpge.c:34:
| In file included from ${SRCTOP}/sys/sys/systm.h:44:
| In file included from ./machine/atomic.h:849:
| ${SRCTOP}/sys/sys/_atomic_subword.h:222:37: error: unknown type name 'u_long'; did you mean 'long'?
| atomic_testandset_acq_long(volatile u_long *p, u_int v)
|                                     ^~~~~~
|                                     long

And similar "unknown type name" errors for u_int, not recognizing bool as a type, etc.

This was caused by including <sys/param.h> too far down; move it up where it belongs.

While here, add a blank line after '__FBSDID()', in keeping with convention.

Reviewed by: emaste
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D24242

4 years agoImport version 1.14 of bsnmp. This mainly consists of bug fixes
Hartmut Brandt [Tue, 31 Mar 2020 17:50:32 +0000 (17:50 +0000)]
Import version 1.14 of bsnmp. This mainly consists of bug fixes
in the ASN.1 functions and comes with a test suite for these
functions.