Commit Graph

249366 Commits

Author SHA1 Message Date
Brooks Davis
f382bac49b 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
2020-04-06 23:38:46 +00:00
Kyle Evans
a86ddfe8c7 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
2020-04-06 23:28:24 +00:00
Rick Macklem
76fd19b0a2 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
2020-04-06 23:21:39 +00:00
Kyle Evans
02bde5cf13 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
2020-04-06 23:20:20 +00:00
Kyle Evans
3a166b3323 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
2020-04-06 23:16:05 +00:00
Kyle Evans
302ab0eb27 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
2020-04-06 23:11:43 +00:00
Kyle Evans
ce6a89e27c 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
2020-04-06 23:08:07 +00:00
Conrad Meyer
2750f1b954 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
2020-04-06 23:07:56 +00:00
Mitchell Horne
24891abdb2 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
2020-04-06 22:48:43 +00:00
Jessica Clarke
44c27d70a5 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
2020-04-06 22:31:30 +00:00
Jessica Clarke
1dc32a6d77 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
2020-04-06 22:29:15 +00:00
Kirk McKusick
c79f5a4328 Revert -r359612 as it can cause other panics.
An updated version will be made when the issue has been resolved.

Reported by: Peter Holm
2020-04-06 20:23:47 +00:00
Marcin Wojtas
8e6d2a15f0 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
2020-04-06 19:45:26 +00:00
Alexander Motin
12fec4c35d 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.
2020-04-06 18:42:01 +00:00
Michael Tuexen
f4cb790a35 Do more argument validation under INVARIANTS when starting/stopping
an SCTP timer.

MFC after:		1 week
2020-04-06 13:58:13 +00:00
Christian Brueffer
147052684d Add Gordon Bergling to the authors section; remove trailing whitespace.
Suggested by:	rgrimes
Approved by:	Gordon Bergling
X-MFC-with:	r359633
2020-04-06 09:59:21 +00:00
Hans Petter Selasky
cd1442c0ff 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
2020-04-06 09:50:20 +00:00
Hans Petter Selasky
9c9b73403c 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
2020-04-06 09:45:49 +00:00
Hans Petter Selasky
f504949065 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
2020-04-06 09:41:22 +00:00
Wojciech Macek
36c1a37655 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
2020-04-06 05:48:58 +00:00
Kyle Evans
a870eaa408 src.conf(5): re-roll after r359644 (LLVM_ASSERTIONS) 2020-04-06 01:28:03 +00:00
Kyle Evans
147d7b567f 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
2020-04-06 01:27:17 +00:00
Rick Macklem
9c2065607f 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
2020-04-05 21:08:17 +00:00
Kyle Evans
f5339b097a 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
2020-04-05 19:25:46 +00:00
Kristof Provost
dd00a42a6b 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
2020-04-05 17:15:20 +00:00
Konstantin Belousov
2f06c66ad5 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
2020-04-04 22:37:50 +00:00
Christian Brueffer
ff595bc3cd Add a manpage for smbios(4).
Submitted by:	Gordon Bergling
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23714
2020-04-04 21:38:00 +00:00
Yoshihiro Takahashi
ba2c1f62af Remove extra spaces for the load average of machines that are down.
PR:		245296
Submitted by:	martin _at_ lispworks.com
MFC after:	1 week
2020-04-04 12:07:36 +00:00
Sergio Carlavilla Delgado
d2034aedc1 Fix typo 2020-04-04 07:43:47 +00:00
Jason A. Harmening
407a5b7953 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
2020-04-04 04:03:10 +00:00
Kirk McKusick
33ceb489d3 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
2020-04-04 00:56:56 +00:00
Ed Maste
2efe3be95e 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
2020-04-04 00:31:30 +00:00
Matt Macy
92b14858b4 Update x86 counters
MFC after:	1 week
2020-04-03 22:36:22 +00:00
Ed Maste
6e46e45f97 ANSIfy and KNF function arg definitions in libmd/md4.c
Reported by:	bde, in 2017
2020-04-03 20:56:43 +00:00
Justin Hibbits
ccb1ebe01c 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.
2020-04-03 20:45:16 +00:00
Kirk McKusick
2baca88584 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
2020-04-03 20:43:25 +00:00
Kirk McKusick
aedb9cc662 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
2020-04-03 20:30:45 +00:00
Ed Maste
233c4ed93a elf.5: remove commented out leftovers 2020-04-03 19:42:16 +00:00
Ed Maste
bf38482033 elf.5: expand on NT_FREEBSD_FEATURE_CTL bit definitions
Based on suggestions from kib in review D23982.

Sponsored by:	The FreeBSD Foundation
2020-04-03 17:17:17 +00:00
Ed Maste
652a974885 lldb: build and enable lua script bindings
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24266
2020-04-03 16:54:13 +00:00
Brooks Davis
e40fa28f1a 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
2020-04-03 16:19:07 +00:00
Brooks Davis
415a606e17 pmc: diable position-independent builds, they fail to link on amd64
PR:		245189
Reported by:	Gordon Bergling
Sponsored by:	DARPA
2020-04-03 16:10:42 +00:00
Ed Maste
31c5c437cc lldb: commit generated LLDBWrapLua.cpp 2020-04-03 15:55:58 +00:00
Ed Maste
f0d060f91b 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
2020-04-03 15:52:44 +00:00
Brooks Davis
317111316d 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
2020-04-03 15:47:15 +00:00
Mark Johnston
fb979f0db2 Fix up r359594: -m takes an argument.
PR:		244153
Reported by:	0mp
MFC with:	r359594
2020-04-03 14:47:40 +00:00
Mark Johnston
ab82560638 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
2020-04-03 14:03:58 +00:00
Mark Johnston
c205ac921b geom_journal: Only stop the switcher process if one was started.
PR:		243196
MFC after:	1 week
2020-04-03 13:57:41 +00:00
Mark Johnston
3035d538a4 Fix the description of the -m flag in top.1.
PR:		244153
Submitted by:	fehmi noyan isi <fnoyanisi@yahoo.com>
MFC after:	3 days
2020-04-03 13:35:44 +00:00
Mateusz Piotrowski
b75ab02f57 Bump date after recent changes and lint 2020-04-03 13:05:26 +00:00