Commit Graph

267196 Commits

Author SHA1 Message Date
Bryan Drewery
accff08c2f 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
2021-07-26 13:08:59 -07:00
Bryan Drewery
372557d8c3 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
2021-07-26 13:08:59 -07:00
Dmitry Chagin
b0fa09a0a7 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
2021-07-26 22:28:21 +03:00
Dmitry Chagin
de273c83a1 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
2021-07-26 21:28:16 +03:00
Ed Maste
a077a4e3b4 Cirrus-CI: report pkg version
PR:		257422
2021-07-26 14:17:59 -04:00
Leandro Lupori
0f47f91681 hwpmc: fix powerpc/powerpcspe builds
Fix 32-bit PowerPC build errors introduced by b48a2770d4.
2021-07-26 13:29:42 -03:00
Ed Maste
2bfba2a04b Cirrus-CI: Temporarily skip package build + test
The PKG_FORMAT=tar used by Cirrus CI's pkgbase build is failing after
6cafdee71d ("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
2021-07-26 10:36:39 -04:00
Leandro Lupori
b48a2770d4 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
2021-07-26 10:27:23 -03:00
Kristof Provost
d2dc4548eb pf: remove duplicate ERROUT_FUNCTION definition
Sponsored by:	Modirum MDPay
2021-07-26 12:31:10 +02:00
Edward Tomasz Napierala
b54838003c 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:		135dd0cab5
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D31298
2021-07-26 11:57:52 +01:00
Edward Tomasz Napierala
ccc510b463 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
2021-07-25 06:22:57 +00:00
Jilles Tjoelker
0c47338023 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
2021-07-25 22:19:18 +02:00
Gleb Popov
feac06569a 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
2021-07-25 13:51:09 +03:00
Peter Grehan
bbe80bff7c 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
2021-07-25 19:39:32 +10:00
Mateusz Guzik
87c010e6e3 pf: batch critical section for several counters
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-25 10:22:17 +02:00
Mateusz Guzik
02cf67ccf6 pf: switch rule counters to pf_counter_u64
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-25 10:22:17 +02:00
Mateusz Guzik
d40d4b3ed7 pf: switch kif counters to pf_counter_u64
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-25 10:22:17 +02:00
Mateusz Guzik
fc4c42ce0b pf: switch pf_status.fcounters to pf_counter_u64
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-25 10:22:16 +02:00
Mateusz Guzik
defdcdd564 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")
2021-07-25 10:22:16 +02:00
Mateusz Guzik
6f1fb65612 pf: drop redundant 'else' in pf_normalize_*
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-25 10:22:16 +02:00
Peter Holm
0d60235ecd stress2: Add another "mdconfig -d -o force" test scenario 2021-07-25 09:00:53 +02:00
Robert Wing
0626b0a89c Add myself to the calendar 2021-07-24 16:12:17 -08:00
Emmanuel Vadot
40cb9b4357 arm64: allwinner: dtbo: Add dtb overlays to disable mmc node
This is useful for development.
Sponsored by:	Diablotin Systems
2021-07-24 22:53:33 +02:00
Jason A. Harmening
c446857328 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
2021-07-24 12:52:56 -07:00
Jason A. Harmening
211ec9b7d6 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
2021-07-24 12:52:41 -07:00
Jason A. Harmening
2bc16e8aaf 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
2021-07-24 12:52:32 -07:00
Jason A. Harmening
c746ed724d 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
2021-07-24 12:52:00 -07:00
Jose Luis Duran
73358cd2cf 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
2021-07-24 12:19:19 -06:00
Alan Cox
3687797618 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
2021-07-24 13:06:47 -05:00
Emmanuel Vadot
735041a613 arm64: allwinner: Remove sun50i-a64-opp
This is unneeded now that the DTS have the opp.
MFC after:	1 week
Sponsored by:	Diablotin Systems
2021-07-24 17:59:35 +02:00
Konstantin Belousov
48216088b1 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
2021-07-24 18:52:45 +03:00
Konstantin Belousov
6a3821369f amd64: make efi_boot global
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31121
2021-07-24 18:52:44 +03:00
Konstantin Belousov
c8bae074d9 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
2021-07-24 18:52:44 +03:00
Konstantin Belousov
34516d4ad1 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
2021-07-24 18:52:44 +03:00
Emmanuel Vadot
12faeba995 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
2021-07-24 17:46:25 +02:00
Warner Losh
a2e3e11873 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
2021-07-24 09:08:16 -06:00
Warner Losh
6475667f7b 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
2021-07-24 09:03:53 -06:00
Edward Tomasz Napierala
72f7ddb587 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
2021-07-23 20:13:00 +00:00
Alan Cox
b7de535288 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
2021-07-23 23:15:42 -05:00
Warner Losh
47aeda7b70 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
2021-07-23 18:08:52 -06:00
Warner Losh
380710a5c8 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
2021-07-23 18:08:45 -06:00
John Baldwin
8843787aa1 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
2021-07-23 16:07:35 -07:00
John Baldwin
58109a87d4 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
2021-07-23 15:59:11 -07:00
Mark Johnston
ebf9886654 imgact_elf: Avoid redefining suword()
Otherwise this interferes with the definition for sanitizer
interceptors.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-07-23 15:40:54 -04:00
Mark Johnston
93d8b4da7b kasan.9: Fix formatting in the synopsis
Sponsored by:	The FreeBSD Foundation
2021-07-23 15:40:50 -04:00
Mark Johnston
f4e67f18bd 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:		0a36787e4c
2021-07-23 15:05:28 -04:00
Mateusz Guzik
49a7d47235 pf: consistently malloc rules with M_ZERO
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-23 17:35:32 +00:00
Mateusz Guzik
d9cc6ea270 pf: hide struct pf_kstatus behind ifdef _KERNEL
Reviewed by:    kp
Sponsored by:   Rubicon Communications, LLC ("Netgate")
2021-07-23 17:34:43 +00:00
Mark Johnston
048cd371f3 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
2021-07-23 12:04:02 -04:00
Faraz Vahedi
bd90d8bbb1 locale: Add Farsi/Persian locales
MFC after:	3 weeks
Reviewed by:	farrokhi
Differential Revision:	https://reviews.freebsd.org/D24359
2021-07-23 16:58:20 +02:00