]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoNew Netgraph module ng_macfilter:
Nick Hibma [Tue, 8 Dec 2020 15:09:42 +0000 (15:09 +0000)]
New Netgraph module ng_macfilter:

Macfilter to route packets through different hooks based on sender MAC address.

Based on ng_macfilter written by Pekka Nikander

Sponsered by Retina b.v.

Reviewed by: afedorov
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27268

3 years agoregen src.conf.5 after r368441, WITHOUT_GDB default
Ed Maste [Tue, 8 Dec 2020 15:00:07 +0000 (15:00 +0000)]
regen src.conf.5 after r368441, WITHOUT_GDB default

3 years agoDefault to WITHOUT_GDB (GDB 6.1.1) for FreeBSD 13
Ed Maste [Tue, 8 Dec 2020 14:56:15 +0000 (14:56 +0000)]
Default to WITHOUT_GDB (GDB 6.1.1) for FreeBSD 13

As discussed on -current, -stable, -toolchain, and with jhb@ and imp@,
disable the obsolete in-tree GDB 6.1.1 by default.  This was kept only
to provide kgdb for the crashinfo tool, but is long-obsolete, does not
support all architectures that FreeBSD does, and held back other work
(such as forcing the use of DWARF2 for kernel debug).

Crashinfo will use kgdb from the gdb package or devel/gdb port, and will
privde a message referencing those if no kgdb is found.

Relnotes: Yes
Sponsored by: The FreeBSD Foundation

3 years agosrc.conf(5): regen after r368439 (WITH_BSD_GREP default)
Kyle Evans [Tue, 8 Dec 2020 14:05:54 +0000 (14:05 +0000)]
src.conf(5): regen after r368439 (WITH_BSD_GREP default)

3 years agosrc.opts.mk: switch to bsdgrep as /usr/bin/grep
Kyle Evans [Tue, 8 Dec 2020 14:05:25 +0000 (14:05 +0000)]
src.opts.mk: switch to bsdgrep as /usr/bin/grep

This has been years in the making, and we all knew it was bound to happen
some day. Switch to the BSDL grep implementation now that it's been a
little more thoroughly tested and theoretically supports all of the
extensions that gnugrep in base had with our libregex(3).

Folks shouldn't really notice much from this update; bsdgrep is slower than
gnugrep, but this is currently the price to pay for fewer bugs. Those
dissatisfied with the speed of grep and in need of a faster implementation
should check out what textproc/ripgrep and textproc/the_silver_searcher
can do for them.

I have some WIP to make bsdgrep faster, but do not consider it a blocker
when compared to the pros of switching now (aforementioned bugs, licensing).

PR: 228798 (exp-run)
PR: 128645, 156704, 166842, 166862, 180937, 193835, 201650
PR: 232565, 242308, 246000, 251081, 191086, 194397
Relnotes: yes, please

3 years agoextattr_get_file(20: bump .Dd
Enji Cooper [Tue, 8 Dec 2020 04:18:16 +0000 (04:18 +0000)]
extattr_get_file(20: bump .Dd

This is being done for the formatting and context changes. While the net content
hasn't been changed, the content/context changes were sufficient to warrant the
date bump.

MFC after: 1 week
MFC with: r368431, r368433, r368434, r368435
Sponsored by: DellEMC Isilon

3 years agoextattr_get_file(2): clarify RETURN VALUES
Enji Cooper [Tue, 8 Dec 2020 04:16:05 +0000 (04:16 +0000)]
extattr_get_file(2): clarify RETURN VALUES

While some of the syscalls' behavior were documented and implied in the
RETURN VALUES section by earlier, e.g., the DESCRIPTION sections, as having
behavior of the other calls (`*_fd` vs `*_file` vs `*_link`), there was a lot
of implied return value behavior in the section prior to this change.

Explicitly document the syscall behavior per the current implementation in
sys/kern/vfs_extattr.c so others can better develop based on its explicit
documented behavior instead of having to digest the context of the manpage to
understand the appropriate behavior.

MFC after: 1 week
MFC with: r368431, r368433, r368434
Sponsored by: DellEMC Isilon

3 years agoextattr_get_file(2): fix more formatting
Enji Cooper [Tue, 8 Dec 2020 04:05:19 +0000 (04:05 +0000)]
extattr_get_file(2): fix more formatting

- Remove an unnecessary trailing comma separating a two-item clause.
- Sort more function calls alphabetically (in the same vein as r368433).

MFC after: 1 week
Sponsored by: DellEMC Isilon

3 years agoextattr_get_file(2): sort syscalls alphabetically
Enji Cooper [Tue, 8 Dec 2020 04:01:03 +0000 (04:01 +0000)]
extattr_get_file(2): sort syscalls alphabetically

Although some sections of the manpage sort the syscalls alphabetically, many
core areas of the manpage do not. Sort the syscalls so it is easier to pick out
functional changes and to improve manpage readability.

This formatting change is also being done to make future functional changes
easier to spot.

MFC after: 1 week
Sponsored by: DellEMC Isilon

3 years agolio_listio(2): fix manlint error
Enji Cooper [Tue, 8 Dec 2020 03:48:05 +0000 (03:48 +0000)]
lio_listio(2): fix manlint error

The date with .Dd prior to this change isn't canonically spelled out: it
should have been "December", not "Dec".

MFC after: 1 week
Sponsored by: DellEMC Isilon

3 years agoextattr_get_fd(2): fix manlint errors
Enji Cooper [Tue, 8 Dec 2020 03:43:00 +0000 (03:43 +0000)]
extattr_get_fd(2): fix manlint errors

- The CAVEATS section was misspelled as "CAVEAT".
- The CAVEATS section should come before the "BUGS" section and after
  other existing sections by convention.

MFC after: 1 week
Reported by: make manlint
Sponsored by: DellEMC Isilon

3 years agoIn ext2fs, BA_CLRBUF is used in ext2_balloc() not UFS_BALLOC().
Kirk McKusick [Tue, 8 Dec 2020 00:49:31 +0000 (00:49 +0000)]
In ext2fs, BA_CLRBUF is used in ext2_balloc() not UFS_BALLOC().

Noted by:     kib
MFC after:    3 days
Sponsored by: Netflix

3 years agorelease: don't checksum images if there are none
Mitchell Horne [Tue, 8 Dec 2020 00:48:50 +0000 (00:48 +0000)]
release: don't checksum images if there are none

For platforms that don't have any of the memstick, cdrom, or dvdrom
release images (i.e. riscv64), the release-install target will trip up
when invoking md5(1) on the non-existent image files. Skipping this
allows the install to complete successfully.

3 years agoRISC-V release confs
Mitchell Horne [Tue, 8 Dec 2020 00:42:03 +0000 (00:42 +0000)]
RISC-V release confs

Add two release flavors for RISC-V. First, the traditional "big-iron"
images, capable of generating distribution sets and VM images. Installer
images won't be built yet, but can be trivially enabled in the future
with the addition of riscv/make-memstick.sh.

Second, a GENERICSD embedded image. I've opted for this instead of
board-specific SD card images as it allows users to just dd the u-boot
they want. The RISC-V hardware ecosystem is still young, so a
configuration for e.g. the new PolarFire SoC Icicle Kit would likely see
very few users.

Reviewed by: gjb
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D27045

3 years agoriscv: allow building virtual machine images
Mitchell Horne [Tue, 8 Dec 2020 00:37:11 +0000 (00:37 +0000)]
riscv: allow building virtual machine images

RISC-V has the same booting requirements as arm64 (loader.efi, no legacy
boot options), so generated images for both architectures have the same
partition layout.

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D27044

3 years agorelease.sh: add support for RISC-V embedded builds
Mitchell Horne [Tue, 8 Dec 2020 00:35:13 +0000 (00:35 +0000)]
release.sh: add support for RISC-V embedded builds

Since the few existing RISC-V hardware platforms are single board
computers, we can piggyback off of arm/arm64's embedded build support
for generating SD card images.

I don't see a pressing need to change the naming in this file at this
time.

Reviewed by: gjb, manu
Differential Revision: https://reviews.freebsd.org/D27043

3 years agoBump __FreeBSD_version for removal of crypto fd's in r368005.
John Baldwin [Mon, 7 Dec 2020 18:58:08 +0000 (18:58 +0000)]
Bump __FreeBSD_version for removal of crypto fd's in r368005.

Requested by: swills
Sponsored by: Chelsio Communications

3 years agoEnsure the boot CPU is CPU 0 on arm64
Andrew Turner [Mon, 7 Dec 2020 17:54:49 +0000 (17:54 +0000)]
Ensure the boot CPU is CPU 0 on arm64

We assume the boot CPU is always CPU 0 on arm64. To allow for this reserve
cpuid 0 for the boot CPU in the ACPI and FDT cases but otherwise start the
CPU as normal. We then check for the boot CPU in start_cpu and return as if
it was started.

While here extract the FDT CPU init code into a new function to simplify
cpu_mp_start and return FALSE from start_cpu when the CPU fails to start.

Reviewed by: mmel
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D27497

3 years agoProperly define the bool type in the BSD kernel shim.
Hans Petter Selasky [Mon, 7 Dec 2020 16:08:31 +0000 (16:08 +0000)]
Properly define the bool type in the BSD kernel shim.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoarm: Let the GDB stub write to SP, LR and GP registers
Mark Johnston [Mon, 7 Dec 2020 15:09:28 +0000 (15:09 +0000)]
arm: Let the GDB stub write to SP, LR and GP registers

This can be handy if gdb's stack unwinder fails, for example because of
a bug in kgdb's trap frame unwinder.

PR: 251463
Submitted by: Dmitry Salychev <dsl@mcusim.org>
MFC after: 1 week

3 years agoAdd missing refcount.9 MLINKS
Mark Johnston [Mon, 7 Dec 2020 14:53:34 +0000 (14:53 +0000)]
Add missing refcount.9 MLINKS

3 years agoiflib: Avoid leaking the freelist bitmaps upon driver detach
Mark Johnston [Mon, 7 Dec 2020 14:53:14 +0000 (14:53 +0000)]
iflib: Avoid leaking the freelist bitmaps upon driver detach

Submitted by: Sai Rajesh Tallamraju <stallamr@netapp.com>
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D27342

3 years agoiflib: Detach tasks upon device registration failure
Mark Johnston [Mon, 7 Dec 2020 14:52:57 +0000 (14:52 +0000)]
iflib: Detach tasks upon device registration failure

In some error paths we would fail to detach from the iflib taskqueue
groups.  Also move the detach code into its own subroutine instead of
duplicating it.

Submitted by: Sai Rajesh Tallamraju <stallamr@netapp.com>
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D27342

3 years agoloader: xdr_array is missing count
Toomas Soome [Mon, 7 Dec 2020 11:25:18 +0000 (11:25 +0000)]
loader: xdr_array is missing count

The integer arrays are encoded in nvlist as counted array <count, i0, i1...>,
loader xdr_array() is missing the count. This will affect the pool import when
there are hole devices in pool.

Also fix the new data add and print functions.

3 years agoFix compilation after r368397.
Hans Petter Selasky [Mon, 7 Dec 2020 11:18:51 +0000 (11:18 +0000)]
Fix compilation after r368397.

MFC after: 3 days
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoAdd missing busdma prototypes for load and unload and implement dummy sync
Hans Petter Selasky [Mon, 7 Dec 2020 10:51:19 +0000 (10:51 +0000)]
Add missing busdma prototypes for load and unload and implement dummy sync
function for kernel bootloader shim code.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoTidy up code a bit. Add missing section comments.
Hans Petter Selasky [Mon, 7 Dec 2020 10:21:01 +0000 (10:21 +0000)]
Tidy up code a bit. Add missing section comments.
No functional change.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoPrefer using the MIN() function macro over the min() inline function
Hans Petter Selasky [Mon, 7 Dec 2020 09:48:06 +0000 (09:48 +0000)]
Prefer using the MIN() function macro over the min() inline function
in the LinuxKPI. Linux defines min() to be a macro, while in FreeBSD
min() is a static inline function clamping its arguments to
"unsigned int".

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoAllow sys/refcount.h to be used by standalone builds.
Hans Petter Selasky [Mon, 7 Dec 2020 09:21:06 +0000 (09:21 +0000)]
Allow sys/refcount.h to be used by standalone builds.
No functional change.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoFix the source directory when installing the results. The install
Hiroki Sato [Mon, 7 Dec 2020 04:45:29 +0000 (04:45 +0000)]
Fix the source directory when installing the results.  The install
target did not install them actually.

Spotted by: Thomas Munro, bapt, yuripv

3 years agouma: Make uma_zone_set_maxcache() work better with small limits
Mark Johnston [Sun, 6 Dec 2020 22:45:50 +0000 (22:45 +0000)]
uma: Make uma_zone_set_maxcache() work better with small limits

The old implementation chose the largest bucket zone such that if the
per-CPU caches are fully populated, the total number of items cached is
no larger than the specified limit.  If no such zone existed, UMA would
not do any caching.

We can now use uz_bucket_size_max to set a precise limit on the number
of items in a zone's bucket, so the total size of per-CPU caches can be
bounded more easily.  Implement a new policy in uma_zone_set_maxcache():
choose a bucket size such that up to half of the limit can be cached in
per-CPU caches, with the rest going to the full bucket cache.  This
fixes a problem with the kstack_cache zone: the limit of 4 * mp_ncpus
items meant that the zone would not do any caching, defeating the whole
purpose of the zone.  That's because the smallest bucket size holds up
to 2 items and we may cache up to 3 full buckets per CPU, and
2 * 3 * mp_ncpus > 4 * mp_ncpus.

Reported by: mjg
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27168

3 years agouma: Enforce the use of uz_bucket_size_max in the free path
Mark Johnston [Sun, 6 Dec 2020 22:45:39 +0000 (22:45 +0000)]
uma: Enforce the use of uz_bucket_size_max in the free path

uz_bucket_size_max is the maximum permitted bucket size.  When filling a
new bucket to satisfy uma_zalloc(), the bucket is populated with at most
uz_bucket_size_max items.  The maximum number of entries in the bucket
may be larger.  When freeing items, however, we will fill per-CPPU
buckets up to their maximum number of entries, potentially exceeding
uz_bucket_size_max.  This makes it difficult to precisely limit the
number of items that may be cached in a zone.  For example, if one wants
to limit buckets to 1 entry for a particular zone, that's not possible
since the smallest bucket holds up to 2 entries.

Try to solve the problem by using uz_bucket_size_max to limit the number
of entries in a bucket.  Note that the ub_entries field is initialized
upon every bucket allocation.  Most zones are not affected since they do
not impose any specific limit on the maximum bucket size.

While here, remove the UMA_ZONE_MINBUCKET flag.  It was unused and we
now have uma_zone_set_maxcache() to control the zone's cache size more
precisely.

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

3 years agouma: Use atomic load for uz_sleepers
Mark Johnston [Sun, 6 Dec 2020 22:45:22 +0000 (22:45 +0000)]
uma: Use atomic load for uz_sleepers

This field is updated locklessly.

Sponsored by: The FreeBSD Foundation

3 years agoAdd deprecation notice to mn(4)
Ed Maste [Sun, 6 Dec 2020 21:34:04 +0000 (21:34 +0000)]
Add deprecation notice to mn(4)

Sync serial (T1/E1) interfaces are largely irrelevant today and phk
confirms this driver is unnecessary in review D23928.

This leaves ce(4) and cp(4) in the tree.  They're likely not relevant
either, but glebius contacted the manufacturer and those devices are
still available for purchase.  At glebius' suggestion leave them in
the tree as long as they do not impose a maintenace burden.

Approved by: phk
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

3 years agoDocument the BA_CLRBUF flag used in ufs and ext2fs filesystems.
Kirk McKusick [Sun, 6 Dec 2020 20:50:21 +0000 (20:50 +0000)]
Document the BA_CLRBUF flag used in ufs and ext2fs filesystems.

Suggested by: kib
MFC after:    3 days
Sponsored by: Netflix

3 years agovfs: add cleanup on error missed in r368375
Mateusz Guzik [Sun, 6 Dec 2020 19:24:38 +0000 (19:24 +0000)]
vfs: add cleanup on error missed in r368375

Noted by: jrtc27

3 years agoWhen dropping packets (RRQ or WRQ) for debugging, report the send
Michael Tuexen [Sun, 6 Dec 2020 18:43:12 +0000 (18:43 +0000)]
When dropping packets (RRQ or WRQ) for debugging, report the send
operation as successful. Reporting a failure stops the transfer
instead of using timeouts.

MFC after: 1 week

3 years agoufs: handle two more cases of possible VNON vnode returned from VFS_VGET().
Konstantin Belousov [Sun, 6 Dec 2020 18:09:14 +0000 (18:09 +0000)]
ufs: handle two more cases of possible VNON vnode returned from VFS_VGET().

Reported by: kevans
Reviewed by: mckusick, mjg
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D27457

3 years agobsdgrep: don't link against libregex for bootstrap
Kyle Evans [Sun, 6 Dec 2020 17:45:42 +0000 (17:45 +0000)]
bsdgrep: don't link against libregex for bootstrap

r368355 removed the GNU_GREP_COMPAT knob (off by default) and forgot that
bsdgrep may be built/used for bootstrap on some systems.

All base uses should strive to use only POSIX-compliant expressions anyways
and we haven't had libregex by default here up to this point, so just don't
do that if we're bootstrapping.

Note that the resulting binary has the wrong `grep -V` information as it
falsely claims to be GNU compatible, but it is only for bootstrap.

Reported by: GitHub cross-builds via yuripv

3 years agoif_em.ko: fix module build outside of kernel build environment
Eugene Grosbein [Sun, 6 Dec 2020 17:44:28 +0000 (17:44 +0000)]
if_em.ko: fix module build outside of kernel build environment

MFC after: 3 days

3 years agoupdate wcwidth data from utf8proc
Yuri Pankov [Sun, 6 Dec 2020 16:44:41 +0000 (16:44 +0000)]
update wcwidth data from utf8proc

Character width data being out of date is a constant source
of weird rendering issues and wasted time trying to diagnose
those, e.g. as reported by Jeremy Chadwick:

https://gitlab.com/muttmua/mutt/-/issues/67

Sadly, there is no real ("standard") wcwidth data source, so
this tries to rectify the problem using the utf8proc one (through
its C API) which would hopefully benefeat both FreeBSD and
utf8proc through bug reports (if any).

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D27259

3 years agobectl: simplify the tail end of the jail cmd
Kyle Evans [Sun, 6 Dec 2020 15:58:50 +0000 (15:58 +0000)]
bectl: simplify the tail end of the jail cmd

This has already confused me once (and I'm pretty sure I wrote it), so let's
clarify: unjailing after the command has completed will only happen if we're
interactive and -U has not been specified.

This just folds two conditionals together to make it obvious how -b/-U
interact with each other.

MFC after: 3 days

3 years agoUpgrade to version 3.2.3
Stefan Eßer [Sun, 6 Dec 2020 11:49:21 +0000 (11:49 +0000)]
Upgrade to version 3.2.3

3 years agoImport version 3.2.3
Stefan Eßer [Sun, 6 Dec 2020 11:38:46 +0000 (11:38 +0000)]
Import version 3.2.3

3 years agoMove V4L feature declarations and DTrace provider definitions from
Tijl Coosemans [Sun, 6 Dec 2020 10:58:55 +0000 (10:58 +0000)]
Move V4L feature declarations and DTrace provider definitions from
linux_common.c to linux_util.c so they become available on i386.

linux_common.c defines the linux_common kernel module but this module does
not exist on i386 and linux_common.c is not included in the linux module.
linux_util.c is included in the linux_common module on amd64 and the linux
module on i386.

Remove linux_common.c from files.i386 again.  It was added recently in
r367433 when the DTrace provider definitions were moved.

The V4L feature declarations were moved to linux_common in r283423.

3 years agovfs: factor buffer allocation/copyin out of namei
Mateusz Guzik [Sun, 6 Dec 2020 04:59:24 +0000 (04:59 +0000)]
vfs: factor buffer allocation/copyin out of namei

3 years agoatkbd(4): Just use nitems() for quirk enumeration
Conrad Meyer [Sat, 5 Dec 2020 22:04:30 +0000 (22:04 +0000)]
atkbd(4): Just use nitems() for quirk enumeration

Reviewed by: imp, wulf
X-MFC-With: r368365
Differential Revision: https://reviews.freebsd.org/D27489

3 years agoRemove remaning definition of GFB_<foo> options.
Michal Meloun [Sat, 5 Dec 2020 19:44:00 +0000 (19:44 +0000)]
Remove remaning definition of GFB_<foo> options.
They are not used in source files.
This fixes build of some arm boards after r368159.

Reported by: mjg

3 years agoFix i386 linux module after r367395.
Tijl Coosemans [Sat, 5 Dec 2020 14:53:24 +0000 (14:53 +0000)]
Fix i386 linux module after r367395.

In r367395 parts of machine dependent linux_dummy.c were moved to a new
machine independent file sys/compat/linux/linux_dummy.c and the existing
linux_dummy.c was renamed to linux_dummy_machdep.c.

Add linux_dummy_machdep.c to the linux module for i386.
Rename sys/amd64/linux32/linux_dummy.c for consistency.
Add the new linux_dummy.c to the linux module for i386.

3 years agolibc: regex: partial revert of r368358
Kyle Evans [Sat, 5 Dec 2020 14:38:46 +0000 (14:38 +0000)]
libc: regex: partial revert of r368358

Part of the libregex functionality leaked into the tests it shares with
the standard regex(3). Introduce a P flag to set the REG_POSIX cflag to
indicate that libc regex should effectively do nothing while libregex should
specifically run it in non-extended mode.

This unbreaks the libc/regex test run.

Reported by: Jenkins

3 years agoSimplify startup of secondary cores and store MPIDR register to pcpu.
Michal Meloun [Sat, 5 Dec 2020 14:06:01 +0000 (14:06 +0000)]
Simplify startup of secondary cores and store MPIDR register to pcpu.

 - record MPIDR for all started cores in pcpu, they will be used as link
   between physical locality of given core, ID in external description
   (FDT or ACPI) and cupid.
 - because of above, cpuid can (and should) be freely assigned, only boot
   CPU  must have cpuid 0. Simplify startup code according this.

Please note that pure cpuid is not sufficient instrument to hold any
information about core or cluster topology, nor to determistically iterate
over subpart of cores in CPU (iterate over all cores in single cluster for
example). Situation is more complicated by fact that PSCI can reject start
of core without reporting error (because power budget for example), or by
fact that is possible that we booted on non-first core in cluster (thus with
cpuid 0 assigned to random core).

Given cores topology should be exhibited to other parts of system
(for example to scheduler for big.little or multicluster systems) by using
smp_topo interface.

Differential Revision:  https://reviews.freebsd.org/D13863

3 years agoAdd basic support for Freescale LX2160A SoC.
Michal Meloun [Sat, 5 Dec 2020 12:08:37 +0000 (12:08 +0000)]
Add basic support for Freescale LX2160A SoC.
All peripherals but the network processor are supported.

3 years agoepoch(9): Fix a few mandoc related issues
Gordon Bergling [Sat, 5 Dec 2020 11:18:37 +0000 (11:18 +0000)]
epoch(9): Fix a few mandoc related issues

- sections out of conventional order: Sh EXAMPLES
- sections out of conventional order: Sh SEE ALSO
- skipping end of block that is not open: El

3 years agoConnect DTB files based on LX2160A SoC to build.
Michal Meloun [Sat, 5 Dec 2020 11:17:54 +0000 (11:17 +0000)]
Connect DTB files based on LX2160A SoC to build.
Mainly LX2K Honeycomb and ClearFog-CX boards.

3 years agoig4(4): Add PCI IDs for Intel Tiger Lake
Vladimir Kondratyev [Sat, 5 Dec 2020 10:57:15 +0000 (10:57 +0000)]
ig4(4): Add PCI IDs for Intel Tiger Lake

Submitted by: Neel Chauhan <neel AT neelc DOT org>
Differential Revision: https://reviews.freebsd.org/D27483

3 years agoatkbd(4): Change quirk table end-of-list marker to NULL vendor/maker/product
Vladimir Kondratyev [Sat, 5 Dec 2020 10:55:14 +0000 (10:55 +0000)]
atkbd(4): Change quirk table end-of-list marker to NULL vendor/maker/product

This fixes regression introduced in r367349 which effectively resulted in
truncation of quirk table.

PR: 250711
Submitted by: grembo
Reported by: Matthias Apitz <guru@unixarea.de>
X-MFC with: r367349

3 years agoDesignWare PCIe driver: Don't call bus_generic_attach() twice.
Michal Meloun [Sat, 5 Dec 2020 10:55:09 +0000 (10:55 +0000)]
DesignWare PCIe driver: Don't call bus_generic_attach() twice.
bus_generic_attach() should be called from the attach function of the real
implementation, not from the common init function.

MFC after: 1 week

3 years agoConnect RK3288 to GENERIC kernel.
Michal Meloun [Sat, 5 Dec 2020 10:10:25 +0000 (10:10 +0000)]
Connect RK3288 to GENERIC kernel.

3 years agoAlso build DTB files for Asus Tinker board (RK3288 based).
Michal Meloun [Sat, 5 Dec 2020 10:00:39 +0000 (10:00 +0000)]
Also build DTB files for Asus Tinker board (RK3288 based).

3 years agovfs: keep bad ops on vnode reclaim
Mateusz Guzik [Sat, 5 Dec 2020 05:56:23 +0000 (05:56 +0000)]
vfs: keep bad ops on vnode reclaim

They were only modified to accomodate a redundant assertion.

This runs into problems as lockless lookup can still try to use the vnode
and crash instead of getting an error.

The bug was only present in kernels with INVARIANTS.

Reported by: kevans

3 years agolibc: regex: retire internal EMPTBR ("Empty branch present")
Kyle Evans [Sat, 5 Dec 2020 03:18:48 +0000 (03:18 +0000)]
libc: regex: retire internal EMPTBR ("Empty branch present")

It was realized just a little too late that this was a hack that belonged in
individual regex(3)-using applications. It was surrounded in NOTYET and not
implemented in the engine, so remove it.

3 years agolibregex: implement \b and \B (word boundary, not word boundary)
Kyle Evans [Sat, 5 Dec 2020 03:16:05 +0000 (03:16 +0000)]
libregex: implement \b and \B (word boundary, not word boundary)

This is the last of the needed GNU expressions before we can unleash bsdgrep
by default. \b is effectively an agnostic equivalent of \< and \>, while
\B will match every space that isn't making a transition from
nonchar -> char or char -> nonchar.

3 years agolibregex: implement \` and \' (begin-of-subj, end-of-subj)
Kyle Evans [Sat, 5 Dec 2020 03:13:47 +0000 (03:13 +0000)]
libregex: implement \` and \' (begin-of-subj, end-of-subj)

These are GNU extensions, generally equivalent to ^ and $ except that the
new syntax will not match beginning of line after the first in a multi-line
expression or the end of line before absolute last in a multi-line
expression.

3 years agolibc: regex: factor out ISBOW/ISEOW macros
Kyle Evans [Sat, 5 Dec 2020 02:23:11 +0000 (02:23 +0000)]
libc: regex: factor out ISBOW/ISEOW macros

These will be reused for \b (word boundary, which matches both sides).

No functional change.

3 years agoRetire GNU_GREP_COMPAT knob
Kyle Evans [Sat, 5 Dec 2020 02:21:58 +0000 (02:21 +0000)]
Retire GNU_GREP_COMPAT knob

This was introduced and then disabled by default primarily to avoid dealing
with bugs in libgnuregex. rS363823 switched to using libregex for it, so
let's just rip the option out now so we can make sure we're getting tested
with libregex via bsdgrep.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D27476

3 years agoAdd CFI start/end proc directives to arm64, i386, and ppc
Conrad Meyer [Sat, 5 Dec 2020 00:33:28 +0000 (00:33 +0000)]
Add CFI start/end proc directives to arm64, i386, and ppc

Follow-up to r353959 and r368070: do the same for other architectures.

arm32 already seems to use its own .fnstart/.fnend directives, which
appear to be ARM-specific variants of the same thing.  Likewise, MIPS
uses .frame directives.

Reviewed by: arichardson
Differential Revision: https://reviews.freebsd.org/D27387

3 years agoExpose nonstandard IPv6 kernel definitions to standalone builds.
Hans Petter Selasky [Fri, 4 Dec 2020 21:51:47 +0000 (21:51 +0000)]
Expose nonstandard IPv6 kernel definitions to standalone builds.
No functional change.

Reviewed by: bz@
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agonvme: Remove a wmb() that's not necessary.
Warner Losh [Fri, 4 Dec 2020 21:34:48 +0000 (21:34 +0000)]
nvme: Remove a wmb() that's not necessary.

bus_dmamap_sync() ensures that memory that's prepared for PREWRITE can
be DMA'd immediately after it returns. The details differ, but this
mirrors atomic thread release semantics, at least for the buffers
synced.

For non-x86 platforms, bus_dmamap_sync() has the right syncing and
fences. So in the past, wmb() had been omitted for them.

For x86 platforms, the memory ordering is already strong enough to
ensure DMA to the device sees the current contents. As such, we don't
need the wmb() here. It translates to an sfence which is only needed
for writes to regions that have the write combining attribute set or
when some exotic opcodes are used. The nvme driver does neither of
these. Since bus_dmamap_sync() includes atomic_thread_fence_rel, we
can be assured any optimizer won't reorder the bus_dmamap_sync and the
bus_space_write operations. The wmb() was a vestiage of the pre-busdma
version initially committed to the tree.

Reviewed by: kib@, gallatin@, chuck@, mav@
Differential Revision: https://reviews.freebsd.org/D27448

3 years agobusdma: Annotate bus_dmamap_sync() with fence
Warner Losh [Fri, 4 Dec 2020 21:34:04 +0000 (21:34 +0000)]
busdma: Annotate bus_dmamap_sync() with fence

Add an explicit thread fence release before returning from
bus_dmamap_sync. This should be a no-op in practice, but makes
explicit that all ordinary stores will be completed before subsequent
reads/writes to ordinary device memory. On x86, normal memory ordering
is strong enough to generally guarantee this. The fence keeps the
optimizer (likely LTO) from reordering other calls around this.
The other architectures already have calls, as appropriate, that
are equivalent.

Note: On x86, there is one exception to this rule. If you've mapped
memory as write combining, then you will need to add a sfence or
similar. Normally, though, busdma doesn't operate on such memory, and
drivers that do already cope appropriately.

Reviewed by: kib@, gallatin@, chuck@, mav@
Differential Revision: https://reviews.freebsd.org/D27448

3 years agoossl: port to arm64
Mitchell Horne [Fri, 4 Dec 2020 21:12:17 +0000 (21:12 +0000)]
ossl: port to arm64

Enable in-kernel acceleration of SHA1 and SHA2 operations on arm64 by adding
support for the ossl(4) crypto driver. This uses OpenSSL's assembly routines
under the hood, which will detect and use SHA intrinsics if they are
supported by the CPU.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27390

3 years agoossl: split out x86 bits to x86/ossl_cpuid.c
Mitchell Horne [Fri, 4 Dec 2020 20:54:20 +0000 (20:54 +0000)]
ossl: split out x86 bits to x86/ossl_cpuid.c

Make room for adding arm64 support to this driver by moving the
x86-specific feature parsing to a separate file.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27388

3 years agoping(8): Fix a few mandoc related issues
Gordon Bergling [Fri, 4 Dec 2020 20:47:56 +0000 (20:47 +0000)]
ping(8): Fix a few mandoc related issues

- new sentence, new line

3 years agoVarious fixes for the MIPS DDB stack unwinder.
John Baldwin [Fri, 4 Dec 2020 20:14:25 +0000 (20:14 +0000)]
Various fixes for the MIPS DDB stack unwinder.

- Fix kernel stack unwinding end-of-function false-positive

  The kernel stack unwinder assumes that any jr $ra indicates the end
  of the current function. However, modern compilers generate code
  that contains jr $ra at various places inside the function.

- Handle LLD inter-function padding when looking for the start of a
  function.

- Use call site for symbol name/offset when unwinding

  Currently we use the return address, which will normally just give
  an output that's off by 8 from the actual call site.  However, for
  tail calls, this is particularly bad, as we end up printing the
  symbol name for the function that comes after the one that made the
  call.  Instead we should go back two instructions from the return
  address for the unwound program counter.

Submitted by:   arichardson (1, 2), jrtc27 (3)
Reviewed by: arichardson
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D27363

3 years agoRevert r366857.
Cy Schubert [Fri, 4 Dec 2020 19:31:16 +0000 (19:31 +0000)]
Revert r366857.

r366857 created a number of problems, tearing down interfaces too
early in shutdown. This resulted in:

- hung ssh sessions when shutting down or rebooting remotely using
  shutdown (I've used exec shutdown, for years, as apposed to simply
  shutdown).

- NFS mounted filesystems "disappear" prior to unmount.

- dhclient attached to a VLAN on an interface who's parent interface
  has already shut down prints errors.

The path forward is to teach lagg(4) and vlan(4) about WOL.

PR: 251531, 251540
PR: 158734, 109980 are broken again
Reported by: jhb, emaste, jtl, Helge Oldach<freebsd_oldach.net>
Martin Birgmeier <d8zNeCFG_aon.at>
MFC after:      Immediately
Discussion at: https://reviews.freebsd.org/D27459

3 years agoRegen
Konstantin Belousov [Fri, 4 Dec 2020 18:58:27 +0000 (18:58 +0000)]
Regen

3 years agoFix compat32 for ntp_adjtime(2).
Konstantin Belousov [Fri, 4 Dec 2020 18:57:58 +0000 (18:57 +0000)]
Fix compat32 for ntp_adjtime(2).

struct timex is not 32-bit safe, it uses longs for members.
Provide translation.

Reviewed by: brooks, cy
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D27471

3 years agoAdd kern_ntp_adjtime(9).
Konstantin Belousov [Fri, 4 Dec 2020 18:56:44 +0000 (18:56 +0000)]
Add kern_ntp_adjtime(9).

Reviewed by: brooks, cy
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D27471

3 years agoFix mis-spelled macro in the kernel shim.
Hans Petter Selasky [Fri, 4 Dec 2020 16:51:59 +0000 (16:51 +0000)]
Fix mis-spelled macro in the kernel shim.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoAdd support for RK3288 SoC.
Michal Meloun [Fri, 4 Dec 2020 16:24:44 +0000 (16:24 +0000)]
Add support for RK3288 SoC.

3 years agomake.py: Also pass STRIPBIN
Alex Richardson [Fri, 4 Dec 2020 15:53:44 +0000 (15:53 +0000)]
make.py: Also pass STRIPBIN

This is required for cross-building to allow stripping the installed binaries.

Submitted By: Henry Vogt <hv@tue.mpg.de>

3 years agocrunchgen: fix NULL-deref bug introduced in r364647
Alex Richardson [Fri, 4 Dec 2020 15:53:37 +0000 (15:53 +0000)]
crunchgen: fix NULL-deref bug introduced in r364647

While porting over the local changes from CheriBSD for upstreaming, I
accidentally committed a broken version of find_entry_point(): we have to
return NULL if the value is not found instead of a value with
ep->name == NULL, since the checks in main were changed to check ep instead
of ep->name for NULL.

This only matters if the crunched tool cannot be found using normal lookup
and one of the fallback paths is used, so it's unlikely to be triggered
in rescue. However, I noticed that one of our CheriBSD test scripts was
failing to run commands under `su` on minimal disk images where all
binaries are hardlinks to a `cheribsdbox` tool generated with crunchgen.

This also updates the bootstrapping check in Makefile.inc1 to bootstrap
crunchgen up to the next version bump.

Reviewed By: kevans
Differential Revision: https://reviews.freebsd.org/D27474

3 years agoAllow the rbtree header file in the LinuxKPI to be used in standalone code.
Hans Petter Selasky [Fri, 4 Dec 2020 15:50:44 +0000 (15:50 +0000)]
Allow the rbtree header file in the LinuxKPI to be used in standalone code.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoAllow the list header file in the LinuxKPI to be used in standalone code.
Hans Petter Selasky [Fri, 4 Dec 2020 15:46:48 +0000 (15:46 +0000)]
Allow the list header file in the LinuxKPI to be used in standalone code.
Some style and spelling nits while at it.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoAdd a driver for FAN53555 based PMIC.
Michal Meloun [Fri, 4 Dec 2020 15:23:43 +0000 (15:23 +0000)]
Add a driver for FAN53555 based PMIC.

3 years agognu: don't build libgnuregex for WITH_GNU_GREP_COMPAT
Kyle Evans [Fri, 4 Dec 2020 15:21:12 +0000 (15:21 +0000)]
gnu: don't build libgnuregex for WITH_GNU_GREP_COMPAT

bsdgrep switched over to libregex back in r363823 to fill
WITH_GNU_GREP_COMPAT, since libgnuregex in base is quite buggy and libregex
is somewhat functional. Don't build libgnuregex on our account, please.

3 years agoAdd a driver for HYM8563 based RTC.
Michal Meloun [Fri, 4 Dec 2020 15:09:42 +0000 (15:09 +0000)]
Add a driver for HYM8563 based RTC.

3 years agoAdd a driver for ACT8846 used as PMIC for RK3288 SoC.
Michal Meloun [Fri, 4 Dec 2020 14:57:12 +0000 (14:57 +0000)]
Add a driver for ACT8846 used as PMIC for RK3288 SoC.

3 years agoAdd more macros, types and prototypes for building kernel code into bootloaders.
Hans Petter Selasky [Fri, 4 Dec 2020 14:52:41 +0000 (14:52 +0000)]
Add more macros, types and prototypes for building kernel code into bootloaders.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoFix definition of int64_t and uint64_t when long is 64-bit. This gets the kernel
Hans Petter Selasky [Fri, 4 Dec 2020 14:50:55 +0000 (14:50 +0000)]
Fix definition of int64_t and uint64_t when long is 64-bit. This gets the kernel
shim code in line with the rest of the kernel, sys/x86/include/_types.h.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoAdd TCP feature Proportional Rate Reduction (PRR) - RFC6937
Richard Scheffenegger [Fri, 4 Dec 2020 11:29:27 +0000 (11:29 +0000)]
Add TCP feature Proportional Rate Reduction (PRR) - RFC6937

PRR improves loss recovery and avoids RTOs in a wide range
of scenarios (ACK thinning) over regular SACK loss recovery.

PRR is disabled by default, enable by net.inet.tcp.do_prr = 1.
Performance may be impeded by token bucket rate policers at
the bottleneck, where net.inet.tcp.do_prr_conservate = 1
should be enabled in addition.

Submitted by: Aris Angelogiannopoulos
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D18892

3 years agokern: soclose: don't sleep on SO_LINGER w/ timeout=0
Kyle Evans [Fri, 4 Dec 2020 04:39:48 +0000 (04:39 +0000)]
kern: soclose: don't sleep on SO_LINGER w/ timeout=0

This is a valid scenario that's handled in the various protocol layers where
it makes sense (e.g., tcp_disconnect and sctp_disconnect). Given that it
indicates we should immediately drop the connection, it makes little sense
to sleep on it.

This could lead to panics with INVARIANTS. On non-INVARIANTS kernels, this
could result in the thread hanging until a signal interrupts it if the
protocol does not mark the socket as disconnected for whatever reason.

Reported by: syzbot+e625d92c1dd74e402c81@syzkaller.appspotmail.com
Reviewed by: glebius, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27407

3 years agoAdd IPv4/IPv6 rtentry prefix accessors.
Alexander V. Chernikov [Thu, 3 Dec 2020 22:23:57 +0000 (22:23 +0000)]
Add IPv4/IPv6 rtentry prefix accessors.

Multiple consumers like ipfw, netflow or new route lookup algorithms
 need to get the prefix data out of struct rtentry.
Instead of providing direct access to the rtentry, create IPv4/IPv6
 accessors to abstract struct rtentry internals and avoid including
 internal routing headers for external consumers.

While here, move struct route_nhop_data to the public header, so external
 customers can actually use lookup functions returning rt&nhop data.

Differential Revision: https://reviews.freebsd.org/D27416

3 years agoClear TLS offload mode if a TLS socket hangs without receiving data.
John Baldwin [Thu, 3 Dec 2020 22:06:08 +0000 (22:06 +0000)]
Clear TLS offload mode if a TLS socket hangs without receiving data.

By default, if a TOE TLS socket stops receiving data for more than 5
seconds, revert the connection back to plain TOE mode.  This provides
a fallback if the userland SSL library does not support KTLS.  In
addition, for client TLS 1.3 sockets using connect(), the TOE socket
blocks before the handshake has completed since the socket option is
only invoked for the final handshake.

The timeout defaults to 5 seconds, but can be changed at boot via the
hw.cxgbe.toe.tls_rx_timeout tunable or for an individual interface via
the dev.<nexus>.toe.tls_rx_timeout sysctl.

Reviewed by: np
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27470

3 years agocxgbe(4): Fix vertical alignment in sysctl_cpl_stats.
Navdeep Parhar [Thu, 3 Dec 2020 22:04:23 +0000 (22:04 +0000)]
cxgbe(4): Fix vertical alignment in sysctl_cpl_stats.

MFC after: 3 days
Sponsored by: Chelsio Communications

3 years agoDon't transmit mbufs that aren't yet ready on TOE sockets.
John Baldwin [Thu, 3 Dec 2020 22:01:13 +0000 (22:01 +0000)]
Don't transmit mbufs that aren't yet ready on TOE sockets.

This includes mbufs waiting for data from sendfile() I/O requests, or
mbufs awaiting encryption for KTLS.

Reviewed by: np
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27469

3 years agocxgbe(4): two new debug sysctls.
Navdeep Parhar [Thu, 3 Dec 2020 22:00:41 +0000 (22:00 +0000)]
cxgbe(4): two new debug sysctls.

dev.<nexus>.<instance>.misc.tid_stats
dev.<nexus>.<instance>.misc.tnl_stats

MFC after: 3 days
Sponsored by: Chelsio Communications

3 years agoClear TLS offload mode for unsupported cipher suites and versions.
John Baldwin [Thu, 3 Dec 2020 21:59:47 +0000 (21:59 +0000)]
Clear TLS offload mode for unsupported cipher suites and versions.

If TOE TLS is requested for an unsupported cipher suite or TLS
version, disable TLS processing and fall back to plain TOE.  In
addition, if an error occurs when saving the decryption keys in the
card's memory, disable TLS processing and fall back to plain TOE.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27468

3 years agoFix downgrading of TOE TLS sockets to plain TOE.
John Baldwin [Thu, 3 Dec 2020 21:49:20 +0000 (21:49 +0000)]
Fix downgrading of TOE TLS sockets to plain TOE.

If a TOE TLS socket ends up using an unsupported TLS version or
ciphersuite, it must be downgraded to a "plain" TOE socket with TLS
encryption/decryption performed on the host.  The previous
implementation of this fallback was incomplete and resulted in hung
connections.

Reviewed by: np
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27467

3 years agoFix typo in kern_testfrwk.9.
Navdeep Parhar [Thu, 3 Dec 2020 21:38:00 +0000 (21:38 +0000)]
Fix typo in kern_testfrwk.9.

3 years agoMerge commit d989ffd10 from llvm git (by Dimitry Andric):
Dimitry Andric [Thu, 3 Dec 2020 19:29:18 +0000 (19:29 +0000)]
Merge commit d989ffd10 from llvm git (by Dimitry Andric):

  Implement computeHostNumHardwareThreads() for FreeBSD

  This retrieves CPU affinity via FreeBSD's cpuset(2) API, and makes
  LLVM respect affinity settings configured by the user via the
  cpuset(1) command.

  In particular, this allows to reduce the number of threads used on
  machines with high core counts, which can interact badly with
  parallelized build systems. This is particularly noticable with lld,
  which spawns lots of threads even for linking e.g. hello_world!

  This fix is related to PR48193, but does not adress the more
  fundamental problem, which is that LLVM by default grabs as many CPUs
  and/or threads as possible.

  Reviewed By: MaskRay

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

Originally by: mjg
MFC after: 1 week