]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agolinux: implement sigaltstack(2) on arm64
Edward Tomasz Napierala [Mon, 26 Jul 2021 23:43:09 +0000 (23:43 +0000)]
linux: implement sigaltstack(2) on arm64

... by making it machine-independent.

Reviewed By: dchagin
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D31286

2 years ago/dev/pci: clarify meaning of writeable file descriptor
Konstantin Belousov [Tue, 27 Jul 2021 00:22:14 +0000 (03:22 +0300)]
/dev/pci: clarify meaning of writeable file descriptor

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31317

2 years agoRevert "loader: support.4th resets the read buffer incorrectly"
Warner Losh [Mon, 26 Jul 2021 22:40:41 +0000 (16:40 -0600)]
Revert "loader: support.4th resets the read buffer incorrectly"

This reverts commit 9c1c02093b90ae49745a174eb26ea85dd1990eec. It seems
to have broken all old nextboot.conf files causing hangs on boot.

Sponsored by: Netflix

2 years agonet tests: basic test case for bpf(4)'s ability to set vlan pcp
Kristof Provost [Thu, 22 Jul 2021 12:50:27 +0000 (14:50 +0200)]
net tests: basic test case for bpf(4)'s ability to set vlan pcp

Use dhclient with its 'vlan-pcp' option to set a VLAN PCP value and
verify that it actually gets set.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31276

2 years agovlan: deduplicate bpf_setpcp() and pf_ieee8021q_setpcp()
Kristof Provost [Thu, 22 Jul 2021 08:35:08 +0000 (10:35 +0200)]
vlan: deduplicate bpf_setpcp() and pf_ieee8021q_setpcp()

These two fuctions were identical, so move them into the common
vlan_set_pcp() function, exposed in the if_vlan_var.h header.

Reviewed by: donner
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31275

2 years agobpf: Add an ioctl to set the VLAN Priority on packets sent by bpf
Luiz Otavio O Souza [Wed, 21 Jul 2021 15:41:22 +0000 (17:41 +0200)]
bpf: Add an ioctl to set the VLAN Priority on packets sent by bpf

This allows the use of VLAN PCP in dhclient, which is required for
certain ISPs (such as Orange.fr).

Reviewed by: bcr (man page)
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31263

2 years agobridge tests: test linking bridges with a gif tunnel
Kristof Provost [Wed, 21 Jul 2021 15:32:24 +0000 (17:32 +0200)]
bridge tests: test linking bridges with a gif tunnel

Fairly basic test case for using gif(4)'s ability to tunnel Ethernet
traffic between bridges.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agom_dup: Handle unmapped mbufs as an input mbuf.
John Baldwin [Mon, 26 Jul 2021 21:03:28 +0000 (14:03 -0700)]
m_dup: Handle unmapped mbufs as an input mbuf.

Use m_copydata() instead of a direct bcopy() when copying data out of
a source mbuf into a newly-allocated mbuf.

PR:       256610
Reported by:  Niels Bakker <niels=freebsd@bakker.net>
Reviewed by:  markj
MFC after:    2 weeks

2 years agocrypto: Constify all transform descriptors
Mark Johnston [Mon, 26 Jul 2021 20:41:05 +0000 (16:41 -0400)]
crypto: Constify all transform descriptors

No functional change intended.

Reviewed by: ae, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31196

2 years agolibvmmapi: Fix warnings and stop overridding WARNS
Mark Johnston [Mon, 26 Jul 2021 20:40:16 +0000 (16:40 -0400)]
libvmmapi: Fix warnings and stop overridding WARNS

- Avoid shadowing the global optarg.
- Sprinkle __unused.
- Cast nitems() to int.
- Fix sign in vm_copy_setup().

Reviewed by: grehan
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31306

2 years agorip: Add missing minimum length validation in rip_output()
Mark Johnston [Mon, 26 Jul 2021 20:39:18 +0000 (16:39 -0400)]
rip: Add missing minimum length validation in rip_output()

If the socket is configured such that the sender is expected to supply
the IP header, then we need to verify that it actually did so.

Reported by: syzkaller+KMSAN
Reviewed by: donner
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31302

2 years agodumpon: Fix unconfiguring netdump with "off" and "/dev/null".
Bryan Drewery [Sat, 24 Jul 2021 21:18:23 +0000 (14:18 -0700)]
dumpon: Fix unconfiguring netdump with "off" and "/dev/null".

Netdump has its own configuration tracking such that
ioctl(/dev/null, DIOCSKERNELDUMP) does a dumper_remove() but does not
notify netdump about the removal. Simply sending the same ioctl to
/dev/netdump handles the situation.

Reviewed by: markj, cem
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D31300

2 years agodumpon: Fix -v causing error when configuring an encrypted dump
Bryan Drewery [Thu, 22 Jul 2021 00:37:03 +0000 (17:37 -0700)]
dumpon: Fix -v causing error when configuring an encrypted dump

If -v is specified when adding a new device then a full listing of
configured devices is displayed.  This requires sysctl access which
genkey()'s use of capability mode was blocking permission to access.
This leads to both confusing console spam but also incorrectly returning
an error status even if no other had been encountered.

dumpon: Sysctl get 'kern.shutdown.dumpdevname': Operation not permitted

Fix this by generating the key in a child process.

Reviewed by: markj
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D31266

2 years agolinux(4): Fix amd64 gcc build.
Dmitry Chagin [Mon, 26 Jul 2021 19:28:21 +0000 (22:28 +0300)]
linux(4): Fix amd64 gcc build.

Do not specify memory model and mregparm for amd64, it's only
available on IA-32 architecture.

Reported by: jhb, jrtc27
MFC after: 2 weeks

2 years agolinux(4): Fix i386 gcc build.
Dmitry Chagin [Mon, 26 Jul 2021 18:28:16 +0000 (21:28 +0300)]
linux(4): Fix i386 gcc build.

Do not specify memory model for i386. Seems that clang silencly
ignores -mcmodel unlike gcc.

Reported by: jhb
MFC after: 2 weeks

2 years agoCirrus-CI: report pkg version
Ed Maste [Mon, 26 Jul 2021 17:27:16 +0000 (13:27 -0400)]
Cirrus-CI: report pkg version

PR: 257422

2 years agohwpmc: fix powerpc/powerpcspe builds
Leandro Lupori [Mon, 26 Jul 2021 16:29:42 +0000 (13:29 -0300)]
hwpmc: fix powerpc/powerpcspe builds

Fix 32-bit PowerPC build errors introduced by b48a2770d48b.

2 years agoCirrus-CI: Temporarily skip package build + test
Ed Maste [Mon, 26 Jul 2021 14:33:09 +0000 (10:33 -0400)]
Cirrus-CI: Temporarily skip package build + test

The PKG_FORMAT=tar used by Cirrus CI's pkgbase build is failing after
6cafdee71d2b ("pkgbase: Track pkg 1.17").  Skip package build and test
in Cirrus-CI until new pkg is available.

PR: 257422
Sponsored by: The FreeBSD Foundation

2 years agopowerpc64: add Power8 and Power9 PMCs
Leandro Lupori [Fri, 23 Jul 2021 18:09:09 +0000 (15:09 -0300)]
powerpc64: add Power8 and Power9 PMCs

Add support to allocate Power8 and 9 PMCs.

Submitted by: Leonardo Bianconi <leonardo.bianconi@eldorado.org.br>
Reviewed by: mhorne
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D31109

2 years agopf: remove duplicate ERROUT_FUNCTION definition
Kristof Provost [Mon, 26 Jul 2021 05:56:04 +0000 (07:56 +0200)]
pf: remove duplicate ERROUT_FUNCTION definition

Sponsored by: Modirum MDPay

2 years agolinux: fix sigaltstack on amd64
Edward Tomasz Napierala [Mon, 26 Jul 2021 10:57:47 +0000 (11:57 +0100)]
linux: fix sigaltstack on amd64

To determine whether to use alternate signal stack or not,
we need to use the native signal number, not the one translated
with bsd_to_linux_signal().

In practical terms, this fixes golang.

Reviewed By: dchagin
Fixes: 135dd0cab51
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D31298

2 years agolinux: implement signal delivery on arm64
Edward Tomasz Napierala [Sun, 25 Jul 2021 06:22:47 +0000 (06:22 +0000)]
linux: implement signal delivery on arm64

Note that this still uses FreeBSD-style sigframe;
this will be addressed later.

Reviewed By: dchagin
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D31258

2 years agolibc/tests: Correctly compare si_status from wait6()
Jilles Tjoelker [Sun, 25 Jul 2021 20:19:18 +0000 (22:19 +0200)]
libc/tests: Correctly compare si_status from wait6()

Fix erroneous = that was meant to be ==.

Revision 1.10 from NetBSD t_wait.c

Obtained from: NetBSD

2 years agolib/csu: Get rid of unused fptr typedef on amd64.
Gleb Popov [Thu, 22 Jul 2021 15:28:21 +0000 (18:28 +0300)]
lib/csu: Get rid of unused fptr typedef on amd64.

Make i386 and riscv parts not use it.

Approved by: kib

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

2 years agoarm64: HWCAP/HWCAP2 aux args support for 32-bit ARM binaries.
Peter Grehan [Sun, 25 Jul 2021 09:34:14 +0000 (19:34 +1000)]
arm64: HWCAP/HWCAP2 aux args support for 32-bit ARM binaries.

This fixes build/run of golang under COMPAT32 emulation.

PR: 256897
Reviewed by: andrew, mmel, manu, jhb, cognet, Robert Clausecker
Tested by: brd, andrew, Robert Clausecker
MFC after: 3 weeks
Relnotes: yes
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31175

2 years agopf: batch critical section for several counters
Mateusz Guzik [Sat, 24 Jul 2021 07:47:40 +0000 (09:47 +0200)]
pf: batch critical section for several counters

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agopf: switch rule counters to pf_counter_u64
Mateusz Guzik [Thu, 22 Jul 2021 14:45:14 +0000 (16:45 +0200)]
pf: switch rule counters to pf_counter_u64

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agopf: switch kif counters to pf_counter_u64
Mateusz Guzik [Fri, 23 Jul 2021 10:29:46 +0000 (12:29 +0200)]
pf: switch kif counters to pf_counter_u64

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agopf: switch pf_status.fcounters to pf_counter_u64
Mateusz Guzik [Sat, 24 Jul 2021 05:33:52 +0000 (07:33 +0200)]
pf: switch pf_status.fcounters to pf_counter_u64

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agopf: add hybrid 32- an 64- bit counters
Mateusz Guzik [Thu, 22 Jul 2021 20:47:24 +0000 (22:47 +0200)]
pf: add hybrid 32- an 64- bit counters

Numerous counters got migrated from straight uint64_t to the counter(9)
API. Unfortunately the implementation comes with a significiant
performance hit on some platforms and cannot be easily fixed.

Work around the problem by implementing a pf-specific variant.

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agopf: drop redundant 'else' in pf_normalize_*
Mateusz Guzik [Sat, 24 Jul 2021 05:17:27 +0000 (07:17 +0200)]
pf: drop redundant 'else' in pf_normalize_*

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agostress2: Add another "mdconfig -d -o force" test scenario
Peter Holm [Sun, 25 Jul 2021 07:00:53 +0000 (09:00 +0200)]
stress2: Add another "mdconfig -d -o force" test scenario

2 years agoAdd myself to the calendar
Robert Wing [Sat, 24 Jul 2021 23:57:41 +0000 (15:57 -0800)]
Add myself to the calendar

2 years agoarm64: allwinner: dtbo: Add dtb overlays to disable mmc node
Emmanuel Vadot [Sat, 24 Jul 2021 20:05:55 +0000 (22:05 +0200)]
arm64: allwinner: dtbo: Add dtb overlays to disable mmc node

This is useful for development.
Sponsored by: Diablotin Systems

2 years agoAdd stress2 test to exercise FFS forcible unmount with stacked nullfs
Jason A. Harmening [Mon, 19 Jul 2021 15:33:02 +0000 (08:33 -0700)]
Add stress2 test to exercise FFS forcible unmount with stacked nullfs

Reviewed by: kib, mckusick
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D31016

2 years agoFFS: remove ffs_fsfail_task
Jason A. Harmening [Sun, 18 Jul 2021 05:35:42 +0000 (22:35 -0700)]
FFS: remove ffs_fsfail_task

Now that dounmount() supports a dedicated taskqueue, we can simply call
it with MNT_DEFERRED directly from the failing context.  This also
avoids blocking taskqueue_thread with a potentially-expensive unmount
operation.

Reviewed by: kib, mckusick
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D31016

2 years agoVFS: remove MNTK_MARKER
Jason A. Harmening [Sun, 18 Jul 2021 04:26:48 +0000 (21:26 -0700)]
VFS: remove MNTK_MARKER

We no longer allow upper filesystems to be unregistered from the base
mount while vfs_notify_upper() or any other upper operation is pending.
New upper mounts can still be registered during this period, but they
will be added at the end of the upper mount tailq.  We therefore no
longer need to allocate marker nodes during vfs_notify_upper() to keep
our place in the iteration.

Reviewed by: kib, mckusick
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D31016

2 years agoAllow stacked filesystems to be recursively unmounted
Jason A. Harmening [Sat, 12 Jun 2021 19:42:12 +0000 (12:42 -0700)]
Allow stacked filesystems to be recursively unmounted

In certain emergency cases such as media failure or removal, UFS will
initiate a forced unmount in order to prevent dirty buffers from
accumulating against the no-longer-usable filesystem.  The presence
of a stacked filesystem such as nullfs or unionfs above the UFS mount
will prevent this forced unmount from succeeding.

This change addreses the situation by allowing stacked filesystems to
be recursively unmounted on a taskqueue thread when the MNT_RECURSE
flag is specified to dounmount().  This call will block until all upper
mounts have been removed unless the caller specifies the MNT_DEFERRED
flag to indicate the base filesystem should also be unmounted from the
taskqueue.

To achieve this, the recently-added vfs_pin_from_vp()/vfs_unpin() KPIs
have been combined with the existing 'mnt_uppers' list used by nullfs
and renamed to vfs_register_upper_from_vp()/vfs_unregister_upper().
The format of the mnt_uppers list has also been changed to accommodate
filesystems such as unionfs in which a given mount may be stacked atop
more than one lower mount.  Additionally, management of lower FS
reclaim/unlink notifications has been split into a separate list
managed by a separate set of KPIs, as registration of an upper FS no
longer implies interest in these notifications.

Reviewed by: kib, mckusick
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D31016

2 years agoFix the pattern for changing PermitRootLogin
Jose Luis Duran [Fri, 16 Jul 2021 17:11:47 +0000 (14:11 -0300)]
Fix the pattern for changing PermitRootLogin

The previous pattern had the (harmless) side-effect of duplicating the
entry in the config file.

No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/510

2 years agoamd64: Don't repeat unnecessary tests when cmpset fails
Alan Cox [Sat, 24 Jul 2021 08:50:27 +0000 (03:50 -0500)]
amd64: Don't repeat unnecessary tests when cmpset fails

When a cmpset for removing the PG_RW bit in pmap_promote_pde() fails,
there is no need to repeat the alignment, PG_A, and PG_V tests just to
reload the PTE's value.  The only bit that we need be concerned with at
this point is PG_M.  Use fcmpset instead.

MFC after: 1 week

2 years agoarm64: allwinner: Remove sun50i-a64-opp
Emmanuel Vadot [Sat, 24 Jul 2021 15:53:57 +0000 (17:53 +0200)]
arm64: allwinner: Remove sun50i-a64-opp

This is unneeded now that the DTS have the opp.
MFC after: 1 week
Sponsored by: Diablotin Systems

2 years agoamd64: do not touch low memory in AP startup unless we used legacy boot
Konstantin Belousov [Thu, 22 Jul 2021 16:27:21 +0000 (19:27 +0300)]
amd64: do not touch low memory in AP startup unless we used legacy boot

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31121

2 years agoamd64: make efi_boot global
Konstantin Belousov [Thu, 22 Jul 2021 16:22:21 +0000 (19:22 +0300)]
amd64: make efi_boot global

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31121

2 years agoamd64: add pmap_alloc_page_below_4g()
Konstantin Belousov [Tue, 13 Jul 2021 15:00:54 +0000 (18:00 +0300)]
amd64: add pmap_alloc_page_below_4g()

Suggested and reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31121

2 years agoamd64 pti init: fix calculation of the kernel text start
Konstantin Belousov [Sat, 10 Jul 2021 19:51:16 +0000 (22:51 +0300)]
amd64 pti init: fix calculation of the kernel text start

Old expression happens to provide the correct answer, but assumes that
kernel is loaded at physical address zero, with 2M gap.  Do not use
kernphys to calculate KVA of kernel text start, just explicitly write
out KERNBASE and the hole size.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31121

2 years agoallwinner: rsb: Set the PMIC to RSB mode
Emmanuel Vadot [Sat, 24 Jul 2021 15:44:18 +0000 (17:44 +0200)]
allwinner: rsb: Set the PMIC to RSB mode

With recent ATF (v2.5) the PMIC is reset to I2C mode.
Without a PMIC no regulators can be changed/enabled/disabled
This fixes cpufreq on A64 (at least) and anything else that needs
regulators handled by the PMIC.

MFC after: 3 days
Sponsored by: Diablotin Systems

2 years agoawk: Make -F '' and -v FS="" behave the same
Warner Losh [Tue, 20 Jul 2021 04:47:30 +0000 (22:47 -0600)]
awk: Make -F '' and -v FS="" behave the same

IEEE Std 1003.1-2008 mandates that -F str be treated the same as -v
FS=str. For a null string, this was not the case. Since awk(1) documents
that a null string for FS has a specific behavior, make -F '' behave
consistently with -v FS="".

PR: 241441
Upstream issue: https://github.com/onetrueawk/awk/issues/127
Upstream pull request: https://github.com/onetrueawk/awk/pull/128
MFC After: 2 weeks
Sponsored by: Netflix

2 years agodevctl: don't publish the mount options
Warner Losh [Sat, 24 Jul 2021 15:03:53 +0000 (09:03 -0600)]
devctl: don't publish the mount options

Mount options aren't solely ASCII strings. In addition, experience to
date suggests that the mount options are much less useful than was
originally supposed and the mount flags suffice to make decisions. Drop
the reporting of options for the mount/remount/unmount events.

Reviewed by: markj
Reported by: KASAN
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D31287

2 years agolinux: implement rt_sigsuspend(2) on arm64
Edward Tomasz Napierala [Fri, 23 Jul 2021 20:11:06 +0000 (20:11 +0000)]
linux: implement rt_sigsuspend(2) on arm64

... by making it architecture-independent.

Reviewed By: dchagin
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D31259

2 years agoamd64: Eliminate a redundant test from pmap_enter_object()
Alan Cox [Sat, 24 Jul 2021 03:50:10 +0000 (22:50 -0500)]
amd64: Eliminate a redundant test from pmap_enter_object()

The call to pmap_allow_2m_x_page() in pmap_enter_object() is redundant.
Specifically, even without the call to pmap_allow_2m_x_page() in
pmap_enter_object(), pmap_allow_2m_x_page() is eventually called by
pmap_enter_pde(), so the outcome will be the same.  Essentially,
calling pmap_allow_2m_x_page() in pmap_enter_object() amounts to
"optimizing" for the unexpected case.

Reviewed by: kib
MFC after: 1 week

2 years agogeom_disk: use a preallocated geom_event for disk destruction.
Warner Losh [Fri, 23 Jul 2021 21:21:02 +0000 (15:21 -0600)]
geom_disk: use a preallocated geom_event for disk destruction.

Preallocate a geom_event (using the new geom_alloc_event) when we create
a disk. When we create the disk, we're going to be in a sleepable
context, so we can always allocate this extra bit of memory. Then use
this preallocated memory to free the disk. CAM can try to free the disk
from an unsleepable context if there was I/O outstanding when the disk
was destroyted (say because the SIM said it had gone away). The I/O
context isn't sleepable. Rather than trying to invent a retry mechanism
and making sure all the other geom_disk consumers did it properly,
preallocating the event ensure that the geom_disk will be properly torn
down, even when there's memory pressure when the disk departs.

Reviewd by: jhb
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30544

2 years agogeom: create an API to allocate events, and use that storage to send them
Warner Losh [Fri, 23 Jul 2021 21:16:57 +0000 (15:16 -0600)]
geom: create an API to allocate events, and use that storage to send them

g_alloc_event will allocate storage for an opaque event. g_post_event_ep
can use memory returned by g_alloc_event to send an event from a context
that might not be able to allocate the event. Occasionally, we can
alloate memory when we create an object, but not while we're destroy
it. This allows one to allocate at creation time memory to use when
destorying the object.

Reviewed by: jhb
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30544

2 years agoena: Remove redundant declaration of ena_log_level.
John Baldwin [Fri, 23 Jul 2021 22:31:32 +0000 (15:31 -0700)]
ena: Remove redundant declaration of ena_log_level.

GCC6 raises a -Wredundant-decl error due to duplicate declarations
in ena_fbsd_log.h and ena_plat.h.

Sponsored by: Chelsio Communications

2 years agoUse an ANSI C function declaration for journal_check_space.
John Baldwin [Fri, 23 Jul 2021 22:06:26 +0000 (15:06 -0700)]
Use an ANSI C function declaration for journal_check_space.

GCC6 fails to compile this due to a -Wstrict-prototypes error.

Sponsored by: Chelsio Communications

2 years agoimgact_elf: Avoid redefining suword()
Mark Johnston [Fri, 23 Jul 2021 19:40:54 +0000 (15:40 -0400)]
imgact_elf: Avoid redefining suword()

Otherwise this interferes with the definition for sanitizer
interceptors.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agokasan.9: Fix formatting in the synopsis
Mark Johnston [Fri, 23 Jul 2021 19:40:50 +0000 (15:40 -0400)]
kasan.9: Fix formatting in the synopsis

Sponsored by: The FreeBSD Foundation

2 years agoRemove sr_RS.UTF-8@latin from the list of targets
Mark Johnston [Fri, 23 Jul 2021 19:02:56 +0000 (15:02 -0400)]
Remove sr_RS.UTF-8@latin from the list of targets

It is installed with other unicode locales, from monetdef_unicode.

This is just a band-aid to fix the build, as it's not clear how to
regenerate this Makefile.

Fixes: 0a36787e4c1f

2 years agopf: consistently malloc rules with M_ZERO
Mateusz Guzik [Fri, 23 Jul 2021 15:01:29 +0000 (17:01 +0200)]
pf: consistently malloc rules with M_ZERO

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agopf: hide struct pf_kstatus behind ifdef _KERNEL
Mateusz Guzik [Fri, 23 Jul 2021 17:34:43 +0000 (17:34 +0000)]
pf: hide struct pf_kstatus behind ifdef _KERNEL

Reviewed by:    kp
Sponsored by:   Rubicon Communications, LLC ("Netgate")

2 years agovfs: Initialize "lastfail" in vfs_mountroot_wait()
Mark Johnston [Fri, 23 Jul 2021 16:04:02 +0000 (12:04 -0400)]
vfs: Initialize "lastfail" in vfs_mountroot_wait()

This variable is only used to rate-limit "Root mount waiting for: ..."
messages using ppsratecheck().

Reported by: KMSAN
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agolocale: Add Farsi/Persian locales
Faraz Vahedi [Fri, 23 Jul 2021 14:52:45 +0000 (16:52 +0200)]
locale: Add Farsi/Persian locales

MFC after: 3 weeks
Reviewed by: farrokhi
Differential Revision: https://reviews.freebsd.org/D24359

2 years agolocales: upgrade CLDR to 39.0 and Unicode to 13.0.0
Baptiste Daroussin [Fri, 23 Jul 2021 14:32:19 +0000 (16:32 +0200)]
locales: upgrade CLDR to 39.0 and Unicode to 13.0.0

MFC after: 3 weeks
Relnotes: yes

2 years agolocales: prepare CLDR update to v39.0 and Unicode to 13.0.0
Baptiste Daroussin [Fri, 23 Jul 2021 14:24:51 +0000 (16:24 +0200)]
locales: prepare CLDR update to v39.0 and Unicode to 13.0.0

Note that rebuilding the cldr tool is not necessary anymore, also note
that the sources are not anymore provided along with the other distfiles

2 years agolocales: only generate unicode locales
Baptiste Daroussin [Fri, 23 Jul 2021 14:10:24 +0000 (16:10 +0200)]
locales: only generate unicode locales

2 years agolocales: now that C.UTF-8 is the default locale, always install it
Baptiste Daroussin [Fri, 23 Jul 2021 12:15:04 +0000 (14:15 +0200)]
locales: now that C.UTF-8 is the default locale, always install it

MFC after: 3 weeks

2 years agolocales: separate unicode from other locales
Baptiste Daroussin [Thu, 22 Jul 2021 17:02:49 +0000 (19:02 +0200)]
locales: separate unicode from other locales

Unicode locales are maintained and to evolved in cldr.
Generating the other locales from the unicode gets more and more painful
over the time.

Let's freeze the other locales to cldr 34.0.

2 years agoLC_CTIME: has been removed from automatic generation long ago
Baptiste Daroussin [Thu, 22 Jul 2021 15:37:13 +0000 (17:37 +0200)]
LC_CTIME: has been removed from automatic generation long ago

due to too many mistakes in the data provided by cldr it was decided
to remove timedef from the automatic generation

2 years agoKASAN: Disable checking before triggering a panic
Mark Johnston [Fri, 23 Jul 2021 14:41:00 +0000 (10:41 -0400)]
KASAN: Disable checking before triggering a panic

KASAN hooks will not generate reports if panicstr != NULL, but then
there is a window after the initial panic() call where another report
may be raised.  This can happen if a false positive occurs; to simplify
debugging of such problems, avoid recursing.

Sponsored by: The FreeBSD Foundation

2 years agoAdd required sysctl name length checks to various handlers
Mark Johnston [Fri, 23 Jul 2021 14:37:11 +0000 (10:37 -0400)]
Add required sysctl name length checks to various handlers

Reported by: KMSAN
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agoselect: Define select_flags[] as const
Mark Johnston [Fri, 23 Jul 2021 14:30:32 +0000 (10:30 -0400)]
select: Define select_flags[] as const

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agoredzone: Raise a compile error if KASAN is configured
Mark Johnston [Fri, 23 Jul 2021 14:30:29 +0000 (10:30 -0400)]
redzone: Raise a compile error if KASAN is configured

redzone(9) does some munging of the allocation to insert redzones before
and after a valid memory buffer, but KASAN does not know about this and
will raise false positives if both are configured.  Until this is fixed,
do not allow both to be configured.  Note that KASAN provides similar
checking on its own but currently does not force the creation of
redzones for all UMA allocations; this should be addressed as well.

Sponsored by: The FreeBSD Foundation

2 years agoAnnotate amd64 stack unwinders with __nomemorysanitize
Mark Johnston [Fri, 23 Jul 2021 14:30:21 +0000 (10:30 -0400)]
Annotate amd64 stack unwinders with __nomemorysanitize

Sponsored by: The FreeBSD Foundation

2 years agocdefs: Add a default definition for __nosanitizememory
Mark Johnston [Fri, 23 Jul 2021 14:30:00 +0000 (10:30 -0400)]
cdefs: Add a default definition for __nosanitizememory

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agoacct: Zero pad bytes in accounting records
Mark Johnston [Fri, 23 Jul 2021 14:29:57 +0000 (10:29 -0400)]
acct: Zero pad bytes in accounting records

Reported by: KMSAN
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agoktrace: Zero request structures when populating the pool
Mark Johnston [Fri, 23 Jul 2021 14:29:53 +0000 (10:29 -0400)]
ktrace: Zero request structures when populating the pool

Otherwise uninitialized pad bytes may be copied into the ktrace log
file.

Reported by: KMSAN
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agoaio_md_test: label the md
Eric van Gyzen [Fri, 23 Jul 2021 13:57:44 +0000 (08:57 -0500)]
aio_md_test: label the md

Add a label to md devices created by this test.  The next time this
test leaks md devices, finding the culprit will be much easier.

Thanks to: sobomax, for adding labels in r322969
MFC after: 1 week
Sponsored by: Dell EMC Isilon

2 years agoaio_md_test: NUL-terminate result of readlink
Eric van Gyzen [Fri, 23 Jul 2021 13:49:55 +0000 (08:49 -0500)]
aio_md_test: NUL-terminate result of readlink

readlink does not NUL-terminate the output buffer.  This led to spurious
failures to destroy the md device because the unit number was garbage.
NUL-terminate the output buffer.

Reported by: ASLR
MFC after: 1 week
Sponsored by: Dell EMC Isilon

2 years agoaio_md_test: fix cleanup
Eric van Gyzen [Fri, 23 Jul 2021 13:24:52 +0000 (08:24 -0500)]
aio_md_test: fix cleanup

ATF cleanup functions cannot use functions such as ATF_REQUIRE
and atf_tc_fail.  These functions assert that a test case is
currently running, which is not true during cleanup, so the
process aborts.  Change the cleanup function to simply print
to stderr and return.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

2 years agoSwitch to an ifunc in the kernel for crc32c
Andrew Turner [Thu, 22 Jul 2021 10:24:33 +0000 (10:24 +0000)]
Switch to an ifunc in the kernel for crc32c

There is no need to read the same variable to check if the CPU supports
crc32c instructions.

Reviewed by: arichardson, kib, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31274

2 years agoinit: execute /etc/rc.final after all user processes have terminated
Kyle Evans [Tue, 20 Jul 2021 10:40:30 +0000 (05:40 -0500)]
init: execute /etc/rc.final after all user processes have terminated

This can be useful for, e.g., unmounting filesystems that were needed
for shutdown.

Reviewed by: kib
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
X-NetApp-PR: #63
Differential Revision: https://reviews.freebsd.org/D31230

2 years agozfs: update zfs_gitrev.h
Martin Matuska [Fri, 23 Jul 2021 01:22:30 +0000 (03:22 +0200)]
zfs: update zfs_gitrev.h

From now on, every merge from vendor/openzfs/master should come
with an updated zfs_config.h and zfs_gitrev.h

2 years agozfs: merge openzfs/zfs@14b43fbd9 (master) into main
Martin Matuska [Fri, 23 Jul 2021 00:50:13 +0000 (02:50 +0200)]
zfs: merge openzfs/zfs@14b43fbd9 (master) into main

Notable upstream pull request merges:
  #12271 Tinker with slop space accounting with dedup
  #12279 Fix ARC ghost states eviction accounting
  #12284 Add Module Parameter Regarding Log Size Limit
  #12300 Introduce dsl_dir_diduse_transfer_space()
  #12314 Optimize allocation throttling
  #12348 Minor ARC optimizations
  #12350 Detect HAVE_LARGE_STACKS at compile time
  #12356 Use SET_ERROR for more errors in FreeBSD vnops
  #12375 FreeBSD: Ignore make_dev_s() errors
  #12378 FreeBSD: Switch from MAXPHYS to maxphys on FreeBSD 13+

Obtained from: OpenZFS
OpenZFS commit: 14b43fbd9c13d802409ed886bb6b66fd528fb209

2 years agozloop: Add a max iterations option, use default run/pass times
Ryan Moeller [Thu, 22 Jul 2021 21:29:27 +0000 (17:29 -0400)]
zloop: Add a max iterations option, use default run/pass times

It is useful to have control over the number of iterations of zloop so
we can easily produce "x core dumps found *in y iterations*" metrics.

Using random values for run/pass times doesn't improve coverage in a
meaningful way.

Randomizing run time could be seen as a compromise between running a
greater variety of shorter tests versus a smaller variety of longer
tests within a fixed time span.  However, it is not desirable when
running a fixed number of iterations.

Pass time already incorporates randomness within ztest.

Either parameter can be passed to ztest explicitly if the defaults are
not satisfactory.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #12411

2 years agobsdinstall: Only show menu if there are more items to be installed
Renato Botelho [Thu, 22 Jul 2021 20:02:34 +0000 (16:02 -0400)]
bsdinstall: Only show menu if there are more items to be installed

MFC after: 3 days
Obtained from: Rubicon Communications, LLC ("Netgate")
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agopatch: cleanup variable initialization a bit.
Pedro F. Giffuni [Thu, 22 Jul 2021 19:09:17 +0000 (14:09 -0500)]
patch: cleanup variable initialization a bit.

musl libc fgetln is a bit more pickier.

Hinted by: chimera-linux (git 31491e1de2e1241885984cd9e4b978965f14eda4)

2 years agoriscv: Fix pmap_kextract racing with concurrent superpage promotion/demotion
Jessica Clarke [Thu, 22 Jul 2021 19:02:14 +0000 (20:02 +0100)]
riscv: Fix pmap_kextract racing with concurrent superpage promotion/demotion

This repeats amd64's cfcbf8c6fd3b (r180498) and i386's cf3508519c5e
(r202894) but for riscv; pmap_kextract must be lock-free and so it can
race with superpage promotion and demotion, thus the L2 entry must only
be loaded once to avoid using inconsistent state.

PR: 250866
Reviewed by: markj, mhorne
Tested by: David Gilbert <dgilbert@daveg.ca>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31253

2 years agommc: Drain the intrhook in mmc_detach()
Yang Zhong [Thu, 22 Jul 2021 17:16:01 +0000 (13:16 -0400)]
mmc: Drain the intrhook in mmc_detach()

Buggy SD card drivers may attach and detach a mmc(4) driver instance in
quick succession.  In this case mmc(4) must disestablish its intrhook
callback during detach.  Thus, this change adds a call to
config_intrhook_drain(), which blocks or does nothing if the intrhook is
running or has already ran (the SD card was plugged in), and
disestablishes the hook if it hasn't ran yet (the SD card was not
plugged in).

PR: 254373
Reviewed by: imp, manu, markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31262

2 years agoman9: Update guarantees for userspace fetch/store operations
Mark Johnston [Thu, 22 Jul 2021 17:08:42 +0000 (13:08 -0400)]
man9: Update guarantees for userspace fetch/store operations

Platforms may either silently handle unaligned accesses or return an
error.  Atomicity is not guaranteed in this case, however.

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31282

2 years agovmci(4): Shorten interrupt descriptions.
Alexander Motin [Thu, 22 Jul 2021 16:58:10 +0000 (12:58 -0400)]
vmci(4): Shorten interrupt descriptions.

We have no space there for such a long strings.  Also it makes no
sense to set description if there is only one interrupt.

MFC after: 2 weeks

2 years ago[skip ci] fix syntax in CODEOWNERS
Alan Somers [Mon, 21 Jun 2021 18:20:51 +0000 (12:20 -0600)]
[skip ci] fix syntax in CODEOWNERS

* Fix invalid usernames
  - Fix spelling of ngie-eign
  - Delete users who aren't members of the FreeBSD org
* Fix spelling of usr.bin/fetch in CODEOWNERS
* rm "a directory anywhere in the repo" patterns from CODEOWNERS
  Even though they're documented as working, in practice they don't.
  https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners#codeowners-file-location

MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D30849

2 years agoman9: Remove stray .In macros
Mark Johnston [Thu, 22 Jul 2021 16:47:43 +0000 (12:47 -0400)]
man9: Remove stray .In macros

Fixes: 9c11d8d483c4
MFC after: 1 week

2 years agoEscape any '.' characters in sysctl node names
Alan Somers [Wed, 21 Jul 2021 21:11:00 +0000 (15:11 -0600)]
Escape any '.' characters in sysctl node names

ZFS creates some sysctl nodes that include a pool name, and '.' is an
allowed character in pool names.  But it's the separator in the sysctl
tree, so it can't be included in a sysctl name.  Replace it with "%25".
Handily, "%" is illegal in ZFS pool names, so there's no ambiguity
there.

PR: 257316
MFC after: 3 weeks
Sponsored by: Axcient
Reviewed by: freqlabs
Differential Revision: https://reviews.freebsd.org/D31265

2 years agoFreeBSD: Ignore make_dev_s() errors
Alexander Motin [Thu, 22 Jul 2021 16:22:14 +0000 (12:22 -0400)]
FreeBSD: Ignore make_dev_s() errors

Since errors returned by zvol_create_minor_impl() are ignored by the
common code, it is more convenient to ignore make_dev_s() errors there.
It allows, for example, to get device created for the zvol after later
rename instead of having it further stuck in half-created state.
zvol_rename_minor() already ignores those errors.

While there, switch from MAXPHYS to maxphys in FreeBSD 13+.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12375

2 years agoman9/VOP_LISTEXTATTR.9: correct grammar in .Nd
Ceri Davies [Thu, 22 Jul 2021 15:22:05 +0000 (16:22 +0100)]
man9/VOP_LISTEXTATTR.9: correct grammar in .Nd

2 years agoman/man7/development.7: correct typo in manpage.
Ceri Davies [Thu, 22 Jul 2021 15:16:43 +0000 (16:16 +0100)]
man/man7/development.7: correct typo in manpage.

2 years agodwmmc: Fix MMCCAM block size support
Emmanuel Vadot [Wed, 14 Jul 2021 15:25:05 +0000 (17:25 +0200)]
dwmmc: Fix MMCCAM block size support

When using SDIO the block size if per function and most of the time
not equal to MMC_SECTOR_SIZE, fix sdio on dwmmc by setting the correct
block size in the mmc registers.

MFC after:    1 month
Sponsored by: Diablotin Systems

2 years agoarm: allwinner: cir: Reduce verbosity
Emmanuel Vadot [Thu, 1 Jul 2021 08:24:26 +0000 (10:24 +0200)]
arm: allwinner: cir: Reduce verbosity

IR can be noisy in dmesg if it "receive" some unwanted data.
Add a tunable hw.aw_cir.debug to enable those message that are
only useful if one wants to debug the driver.

Sponsored by: Diablotin Systems
Differential Revision:   https://reviews.freebsd.org/D30972
Reviewed by:    ganbold
MFC after:   1 month

2 years agofdt: Expose the model, compatible and freebsd dts brandind as sysctl
Emmanuel Vadot [Sat, 17 Jul 2021 15:19:22 +0000 (17:19 +0200)]
fdt: Expose the model, compatible and freebsd dts brandind as sysctl

This make it easier for script to get the hardware on which they are running.

MFC after: 1 month
Sponsored by: Diablotin Systems
Differential Revision:   https://reviews.freebsd.org/D31205
Reviewed by:    imp
Should be ok on powerpc:  jhibbits (over irc)

2 years agomlx5en: vxlan: do not report TCP inner packet as UDP for software parser
Konstantin Belousov [Thu, 22 Jul 2021 11:53:30 +0000 (14:53 +0300)]
mlx5en: vxlan: do not report TCP inner packet as UDP for software parser

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

2 years agoports.7: catchup with the package extension name since pkg 1.17
Baptiste Daroussin [Thu, 22 Jul 2021 08:49:45 +0000 (10:49 +0200)]
ports.7: catchup with the package extension name since pkg 1.17

MFC After: 3 days