Commit Graph

267467 Commits

Author SHA1 Message Date
Emmanuel Vadot
86c71e97d1 pkgbase: locales: Also tag the files dir
Otherwise bsd.dirs.mk will create the directory with the default
package (utilities) and we end up with a bunch of empty dirs managed
by this package while it shouldn't be the case.
2021-08-06 14:37:45 +02:00
Emmanuel Vadot
e06b8f1128 pkgbase: Add nfsiod to the FreeBSD-nfs package
Missed in 081fb64492
2021-08-06 14:37:35 +02:00
Andrey V. Elsukov
d477a7feed Fix panic in IPv6 multicast code.
Add check that ifp supports IPv6 multicasts in in6_getmulti.
This fixes panic when user application tries to join into multicast
group on an interface that doesn't support IPv6 multicasts, like
IFT_PFLOG interfaces.

PR:             257302
Reviewed by:	melifaro
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D31420
2021-08-06 12:57:59 +03:00
Hans Petter Selasky
bb5cd80e8b Update the TCP LRO code to handle both encrypted and un-encrypted traffic.
Encrypted and un-encrypted traffic needs to be coalesced separately.
Split the 16-bit lro_type field in the address information into two
8-bit fields, and then use the last 8-bit field for flags, which among
other indicate if the received mbuf is encrypted or un-encrypted.

Differential Revision:	https://reviews.freebsd.org/D31377
Reviewed by:	gallatin
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2021-08-06 11:28:44 +02:00
Hans Petter Selasky
ed2196e5df sound(4): Implement playback and recording mode sysctl(8).
The dev.pcm.<N>.mode sysctl(8) gives information if a sound device
supports hardware mixing, playback or recording.

Submitted by:	Christos Margiolis <christos@freebsd.org>
Differential Revision:	https://reviews.freebsd.org/D31320
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2021-08-06 11:28:44 +02:00
Hans Petter Selasky
132fca6335 sound(4): Fix typos.
Submitted by:	Christos Margiolis <christos@freebsd.org>
Differential Revision:	https://reviews.freebsd.org/D31320
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2021-08-06 11:28:43 +02:00
Kyle Evans
b3e87f1334 ctypedef: fix installation of C.UTF-8
The appropriate directory and name were assigned to the FILESDIR
grouping, but not the ALWAYS grouping where C.UTF-8 is actually
assigned. Add the appropriate bits for ALWAYSDIR, and remove an
obsolete *PACKAGE= assignment since C.UTF-8 is explicitly not included
in FILES.

Prior to this change, C.UTF-8 was being installed as
/usr/share/C.UTF-8.LC_CTYPE.

Reviewed by:	manu
Fixes:	0fa5403d49 ("pkgbase: move locales into their own package")
Differential Revision:	https://reviews.freebsd.org/D31429
2021-08-05 22:31:40 -05:00
Kyle Evans
645b46d379 pkgbase: fix locale packages
Most places spelled it -locales, but numericdef spelled it as -locale
in just this one place. Pluralize it.

Reviewed by:	emaste, manu
Fixes:	0fa5403d49 ("pkgbase: move locales into their own package")
Differential Revision:	https://reviews.freebsd.org/D31428
2021-08-05 22:31:40 -05:00
Andrew Gallatin
739de953ec ktls: Move KERN_TLS ifdef to tcp_var.h
This allows us to remove stubs in ktls.h and allows us
to sort the function prototypes.

Reviewed by: jhb
Sponsored by: Netflix
2021-08-05 19:17:35 -04:00
Andrew Gallatin
09066b9866 ktls: Use the new PNOLOCK flag
Use the new PNOLOCK flag to tsleep() to indicate that
we are managing potential races, and don't need to
sleep with a lock, or have a backstop timeout.

Reviewed by: jhb
Sponsored by: Netflix
2021-08-05 17:19:12 -04:00
Andrew Gallatin
1b97a054f3 tsleep: Add a PNOLOCK flag
Add a PNOLOCK flag so that, in the race circumstance where
wakeup races are externally mitigated, tsleep() can be
called with a sleep time of 0 without triggering an
an assertion.

Reviewed by: jhb
Sponsored by: Netflix
2021-08-05 17:16:30 -04:00
Alexander V. Chernikov
8482aa7748 Use lltable calculated header when sending lle holdchain after successful lle resolution.
Subscribers: imp, ae, bz

Differential Revision: https://reviews.freebsd.org/D31391
2021-08-05 20:44:36 +00:00
John Baldwin
87322a9075 iscsi: Remove icl_soft-only fields from struct icl_conn.
Create a struct icl_soft_conn which extends struct icl_conn and
move fields only used by icl_soft from struct icl_conn to
struct icl_soft_conn.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D31414
2021-08-05 12:05:30 -07:00
Ceri Davies
383dbdb2eb fork.2: correct minor typo in manpage. 2021-08-05 19:36:33 +01:00
Andrew Gallatin
2694c869ff ktls: fix a panic with INVARIANTS
98215005b7 introduced a new
thread that uses tsleep(..0) to sleep forever.  This hit
an assert due to sleeping with a 0 timeout.

So spell "forever" using SBT_MAX instead, which does not
trigger the assert.

Pointy hat to: gallatin
Pointed out by: emaste
Sponsored by: Netflix
2021-08-05 13:09:06 -04:00
Konstantin Belousov
4cc6fe1e5b coretemp: use x86_msr_op for thermal MSR access
Reviewed by:	markj
Discussed with:	mav
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31386
2021-08-05 18:47:07 +03:00
Konstantin Belousov
d0bc4b4666 x86_msr_op: extend the KPI to allow MSR read and single-CPU operations
Reivewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31386
2021-08-05 18:46:37 +03:00
Ka Ho Ng
245ec7651e param.h: Bump __FreeBSD_version to 1400029 for commit 0dc332bff2
Commit 0dc332bff2 changes fileops layout and adds VOP_DEALLOCATE VOP
call. LinuxKPI kmods and file system modules need to be rebuilt at
least.

Sponsored by:	The FreeBSD Foundation
2021-08-05 23:22:07 +08:00
Ka Ho Ng
da9fe3529b Regen after 0dc332bff2 2021-08-05 23:22:02 +08:00
Ka Ho Ng
0dc332bff2 Add fspacectl(2), vn_deallocate(9) and VOP_DEALLOCATE(9).
fspacectl(2) is a system call to provide space management support to
userspace applications. VOP_DEALLOCATE(9) is a VOP call to perform the
deallocation. vn_deallocate(9) is a public KPI for kmods' use.

The purpose of proposing a new system call, a KPI and a VOP call is to
allow bhyve or other hypervisor monitors to emulate the behavior of SCSI
UNMAP/NVMe DEALLOCATE on a plain file.

fspacectl(2) comprises of cmd and flags parameters to specify the
space management operation to be performed. Currently cmd has to be
SPACECTL_DEALLOC, and flags has to be 0.

fo_fspacectl is added to fileops.
VOP_DEALLOCATE(9) is added as a new VOP call. A trivial implementation
of VOP_DEALLOCATE(9) is provided.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D28347
2021-08-05 23:20:42 +08:00
Ka Ho Ng
abbb57d5a6 vfs: Introduce vn_bmap_seekhole_locked()
vn_bmap_seekhole_locked() is factored out version of vn_bmap_seekhole().
This variant requires shared vnode lock being held around the call.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D31404
2021-08-05 22:52:26 +08:00
Ka Ho Ng
de2e152959 Add vnode_pager_purge_range(9) KPI
This KPI is created in addition to the existing vnode_pager_setsize(9)
KPI. The KPI is intended for file systems that are able to turn a range
of file into sparse range, also known as hole-punching.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D27194
2021-08-05 22:52:26 +08:00
Andrew Gallatin
98215005b7 ktls: start a thread to keep the 16k ktls buffer zone populated
Ktls recently received an optimization where we allocate 16k
physically contiguous crypto destination buffers. This provides a
large (more than 5%) reduction in CPU use in our
workload. However, after several days of uptime, the performance
benefit disappears because we have frequent allocation failures
from the ktls buffer zone.

It turns out that when load drops off, the ktls buffer zone is
trimmed, and some 16k buffers are freed back to the OS. When load
picks back up again, re-allocating those 16k buffers fails after
some number of days of uptime because physical memory has become
fragmented. This causes allocations to fail, because they are
intentionally done without M_NORECLAIM, so as to avoid pausing
the ktls crytpo work thread while the VM system defragments
memory.

To work around this, this change starts one thread per VM domain
to allocate ktls buffers with M_NORECLAIM, as we don't care if
this thread is paused while memory is defragged. The thread then
frees the buffers back into the ktls buffer zone, thus allowing
future allocations to succeed.

Note that waking up the thread is intentionally racy, but neither
of the races really matter. In the worst case, we could have
either spurious wakeups or we could have to wait 1 second until
the next rate-limited allocation failure to wake up the thread.

This patch has been in use at Netflix on a handful of servers,
and seems to fix the issue.

Differential Revision: https://reviews.freebsd.org/D31260
Reviewed by: jhb, markj,  (jtl, rrs, and dhw reviewed earlier version)
Sponsored by: Netflix
2021-08-05 10:19:12 -04:00
Michael Tuexen
3f1f6b6ef7 tcp, udp: improve input validation in handling bind()
Reported by:		syzbot+24fcfd8057e9bc339295@syzkaller.appspotmail.com
Reported by:		syzbot+6e90ceb5c89285b2655b@syzkaller.appspotmail.com
Reviewed by:		markj, rscheff
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D31422
2021-08-05 13:48:44 +02:00
Ed Maste
89ed2ecb14 Disable compressed debug by default
In c910570e75 I enabled compressed debug sections, but it broke mips
and powerpc.  Disable it for now.

Reported by:	jenkins, manu
Sponsored by:	The FreeBSD Foundation
2021-08-05 08:36:00 -04:00
Emmanuel Vadot
589951c76a arm64: conf: std.broadcom: Add dwcotg and smsc
Add the dwcotg and smsc usb to ethernet driver to std.broadcom.
Those are used in RPI3

PR:   257593
2021-08-05 13:16:23 +02:00
Andrew Turner
dcfd605871 Add more arm64 external abort sources
These will be used when we support the Arm Reliability, Availability,
and Serviceability extension.

Sponsored by:	The FreeBSD Foundation
2021-08-04 18:50:42 +00:00
Alexander V. Chernikov
f3a3b06121 [lltable] Unify datapath feedback mechamism.
Use newly-create llentry_request_feedback(),
 llentry_mark_used() and llentry_get_hittime() to
 request datapatch usage check and fetch the results
 in the same fashion both in IPv4 and IPv6.

While here, simplify llentry_provide_feedback() wrapper
 by eliminating 1 condition check.

MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D31390
2021-08-04 22:52:43 +00:00
Phil Shafer
cd2401cdd5 add blank line between variables (testing git commit) 2021-08-04 16:56:55 -04:00
Ed Maste
c910570e75 Use compressed debug in standalone userland debug files by default
The compiler supports CFLAGS=-gz=zlib to compress .debug sections in
object files, libraries, and binaries.  Enable it to reduce disk usage
for standalone debug files (and /usr/obj).

Reviewed by:	dim, kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29002
2021-08-04 16:08:40 -04:00
Ed Maste
a0d701f614 vtfontcvt: minor style(9) fixes from clang-format
Found during clang-format experiments (in D26340).

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30237
2021-08-04 15:08:21 -04:00
Ed Maste
62174eaf46 Install ipmi man page also on arm64
Fixes:		40d0971bbe ("arm64: enable build of the ipmi module")
Sponsored by:	The FreeBSD Foundation
2021-08-04 15:04:24 -04:00
Ed Maste
77013d11e6 Cirrus-CI: add some timing info on pkg install failure
Sponsored by:	The FreeBSD Foundation
2021-08-04 15:02:00 -04:00
John Baldwin
c51e4962a3 Document kern.log_wakeups_per_second.
PR:		148680
MFC after:	2 weeks
2021-08-04 11:50:34 -07:00
Mitchell Horne
61ed578ee6 Prefer MK_SSP=no to SSP_CFLAGS=
It is more idiomatic. CFLAGS is only augmented with $SSP_CFLAGS when
$MK_SSP != "no".

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31401
2021-08-04 15:23:22 -03:00
Mitchell Horne
1b8db4b4e3 arm: enable stack-smashing protection
With current generation clang/llvm it can pass all of our tests in
libc/ssp.

While here, remove the extra MACHINE_CPUARCH check for mips. SSP is
included in BROKEN_OPTIONS for this architecture in src.opts.mk, which
is enough to ensure normal builds won't set SSP_CFLAGS.

Reviewed by:	kevans, imp, emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D31400
2021-08-04 15:23:22 -03:00
Mitchell Horne
bcd2f41f7d mk: format some option lists
Alphabetize and give each option its own line, ahead of making another
change to these lists. This makes future diffs easier to read.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31399
2021-08-04 15:23:22 -03:00
Mitchell Horne
8399d923a5 hwpmc_intel: assert for correct nclasses value
This variable is set based on the exact CPU model detected. If this
value is set too small, it could lead to a NULL-dereference from an
improperly initialized pmc_rowindex_to_classdep array.

Though it has been fixed, this was previously the case for Broadwell.
Add two asserts to catch this in DEBUG kernels, as it represents a
configuration error that may be hard to uncover otherwise.

PR:		253687
Reported by:	Zhenlei Huang <zlei.huang@gmail.com>
Sponsored by:	The FreeBSD Foundation
2021-08-04 15:23:22 -03:00
Mitchell Horne
4f35e8cba2 hwpmc: disable uncore class on Sandy Bridge and newer
It was written for Nehalem and Westmere, with minor but incomplete
updates for Sandy Bridge in 78d763a29b. The uncore architecture
changed significantly with this generation, bringing new layouts and
locations for some MSRs.

Misprogramming these MSRs in ucp_start_pmc() may panic the system, and
this is trivially reproducible via pmcstat(8) on at least Broadwell and
Haswell. Disable the class on these CPUs until it can be updated more
completely and leave a TODO comment detailing some of the work required.
Note that the nclasses value for Broadwell was already incorrect and
doesn't need changing.

The result is that any uncore events listed by pmcstat -L will no longer
be allocatable, but this is already the case for newer generations of
Intel CPUs.

PR:		253687
Reported by:	Zhenlei Huang <zlei.huang@gmail.com>
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31389
2021-08-04 15:23:22 -03:00
Konstantin Belousov
0ef5eee9d9 Add vn_lktype_write()
and remove repetetive code that calculates vnode locking type for write.

Reviewed by:	khng, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31405
2021-08-04 19:40:13 +03:00
Goran Mekić
21d8546588 sound: Add an example of basic sound application
This is an example demonstrating the usage of the OSS-compatible APIs
provided by the sound(4) subsystem. It reads frames from a dsp node and
writes them to the same dsp node.

MFC after:	2 weeks
Reviewed by:	hselasky, bcr
Differential revision:	https://reviews.freebsd.org/D30149
2021-08-04 18:11:54 +08:00
Warner Losh
e94f1a0a37 Revert "arm: remove fslsdma from GENERIC"
The firmware was already in the tree when I did this commit, and I
missed the message. The bug was obsolete.

This reverts commit 9e3761d126.

PR:		237466
Sponsored by:	Netflix
2021-08-03 20:10:32 -06:00
Konstantin Belousov
49ad342cc1 Add _Fork()
Current POSIX standard requires fork() to be async-signal safe.  Neither
our implementation, nor implementations in other operating systems are,
and practically it is impossible to make fork() async-signal safe without
too much efforts.  Also, that would put undue requirement that all atfork
handlers should be async-signal safe as well, which contradicts its main
use.

As result, Austin Group dropped the requirement, and added a new function
_Fork() that should be async-signal safe, but it does not call atfork
handlers.  Basically, _Fork() can be implemented as a raw syscall.

Release of glibc 2.34 added _Fork(), do the same for FreeBSD.
Clarify threading behavior for fork() in the manpage.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D31378
2021-08-03 21:19:32 +03:00
Konstantin Belousov
2d319ebe5c Style
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31378
2021-08-03 21:19:32 +03:00
Bryan Drewery
b60770fceb Fix native-xtools build
Fixes		https://github.com/freebsd/poudriere/issues/894
Fixes:		d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX command-line")
X-MFC-With:	d0c737e18
2021-08-03 10:00:28 -07:00
Bryan Drewery
2482ea42fb Revert "Fix native-xtools build"
This reverts commit 36269b8231.

This had an unintended change included.
2021-08-03 10:00:28 -07:00
Baptiste Daroussin
0fa5403d49 pkgbase: move locales into their own package
The only exception here being C.UTF-8 as this is the default
locales so it needs to always be installed

Reviewed by:	pkgbase (emaste)
Differential Revision:	https://reviews.freebsd.org/D31397
2021-08-03 18:35:26 +02:00
Baptiste Daroussin
30e1773fde locales: fix abuse of bsd.dirs.mk
the way SAMEDIRS was defined was an abuse of bsd.dirs.mk resulting in
all the directory to be created in one single command, but DESTDIR is
only prepend once on the first element of the list

Switch to the properway to use bsd.dirs.mk
2021-08-03 18:02:15 +02:00
Andrew Turner
8b3bd5a2b5 Only store the arm64 ID registers in the cpu_desc
There is no need to store a pointer to the CPU implementer and part
strings. Switch to load them directly into the sbuf used to print them
on boot.

While here print the machine ID register when we fail to determine the
implementer or part we are booting on.

Reviewed by:	markj, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31346
2021-08-03 01:42:40 +00:00
Andrew Turner
1a78f44cd2 Move setting arm64 HWCAP values to the ID tables
The HWCAPS values are based on the ID registers. Move setting these
to the existing ID register parsing code.

Previously we would need to handle all possible ID field values where
a HWCAP is set, however as most ID fields follow a scheme where when
the field increments it will only add new features meaning we only
need to check if the field is greater than when the HWCAP feature
was added.

While here stop setting HWCAP value that need kernel support, but this
support is missing.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31201
2021-08-03 01:42:39 +00:00