Revert "pcb.h: mark struct pcb to be preserved"
kgdb only uses the marked fields from dumppcb for initial frame
reconstruction.
This reverts commit 8f23665fed2fbaf4481359b4d2fcdd7b9feb40e3.
kern/vfs_unmount.c: promote flags to uint64_t
to prevent sign-extension, causing unexpected flags to be passed to
dounmount(). The mnt_flags and MNT_* constants are 64bit wide.
Suggested and reviewed by: jah
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55197
sysutils/try-rs: Add port
This is a cool tool (a reimagining of github.com/tobi/try) that creates,
searches, previews, and recalls all those little "what-if" terminal
experiments. Rather than deleting an experiment when you're done (guilty)
or putting all your experiments into one big directory with
incomprehensible names (guilty), it gives you a TUI to search, clone,
enter, edit, delete, etc. It can clone based on existing experiments, or
clone from git repos.
Perhaps most importantly, it comes with themes.
arm64/vmm: Simplify vmmpmap_remove()
This function handles invalid intermediate PTP entries, but there's no
reason for this: the passed range should be mapped. In particular, we
assert that all L3 entries encountered are mapped. So let's simplify
the code a bit. No functional change intended.
Reviewed by: andrew
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D54738
(cherry picked from commit 31e5decb18a6633f5137848b5734310b41fc3bdc)
pf tests: Set require.kmods in divert-to tests
Tests should declare their dependencies rather than testing for them at
runtime.
Reviewed by: igoro, kp, glebius
MFC after: 2 weeks
Sponsored by: OPNsense
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D54846
(cherry picked from commit 8934c3dc780d6631cb23e4d98c7b988da9a5b703)
pf: Rationalize the ip_divert_ptr test
If a rule has a divert port set, then we can reasonably predict that
ipdivert.ko is loaded, and in particular that ip_divert_ptr is set.
Moreover, in this case, if ipdivert.ko is not loaded we should just drop
the packet instead of ignoring the divert rule.
Reviewed by: igoro, kp, glebius
MFC after: 2 weeks
Sponsored by: OPNsense
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D54845
(cherry picked from commit 39878d24a690feb4da3fc223649c6a5fd166d09d)
makefs/zfs/tests: Force-destroy md devices
Most of these tests create a md(4) device backed by a makefs-generated
image, then import the pool, using the md device as a pool vdev. When
a test finishes, it destroys the pool, then destroys the md device.
Once in a while md device destruction fails with EBUSY. This happens
when a GEOM consumer is holding the device open; kern_mddetach_locked()
simply fails if any consumers are present. zpool destruction is
synchronous so ZFS is innocent, rather, the problem seems to be that
GEOM re-tastes the device after the zpool reference goes away. This
operation creates a transient reference that causes the spurious
failure.
Use "mdconfig -o force" to work around this.
MFC after: 2 weeks
(cherry picked from commit d6bc31f92991b6d67da54868f3563278015389ca)
syslogd/tests: Fix flakiness in forwarding tests
syslogd_start() waits for the local log socket to appear before
returning, to ensure that the daemon is ready to handle log messages.
Some tests start two daemons, so by default the socket already exists
when the second daemon is started, so syslogd_start() returns early.
The test subsequently sends a message to this second daemon, which
sometimes isn't ready.
Define a separate log socket for the second daemon. Add a check to
syslogd_start() to help catch this type of bug.
Reviewed by: jlduran
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54800
(cherry picked from commit 14dce731d70686e08ed689729f53c6a5e2225498)
syslogd/tests: Address races
I occasionally see failures in the syslogd test suite. The problem is
that the tests are racy: they send a message using logger(1), then
immediately check whether the message was logged to a log file. If the
syslogd instance under test doesn't get a chance to run before the
second step, the test fails.
This change reworks things to avoid the race while minimizing the amount
of time sleeping.
1) Each test uses a single logfile, so have them use a new common
variable, SYSLOGD_LOGFILE, instead of something test-specific.
2) In syslogd_start(), if the configuration references SYSLOGD_LOGFILE,
wait for it to be created by syslogd before returning.
3) Add a helper syslogd_check_log(), to check for a given log entry in
the last line of SYSLOGD_LOGFILE, instead of using atf_check
directly.
4) In syslogd_check_log(), poll the logfile until the desired log entry
appears, or the test times out.
[10 lines not shown]
atf_python: Fix a typo in a type annotation
No functional change intended.
MFC after: 1 week
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
(cherry picked from commit ef389b7f581b2500c0e18c0989a54465712cd175)
syslogd/tests: Use a helper function to log from within a jail
This is just for consistency with all other logger(1) invocations, which
happen from the syslogd_log() function.
No functional change intended.
Reviewed by: jlduran
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54778
(cherry picked from commit ffdbc1bc2170226547fcad036f01f379625886dd)
syslogd: Terminate pipe processes gracefully
Pipe actions spawn a process based on the command provided in the
syslogd configuration file. When a HUP signal is received, enter
the process into the deadq instead of immediately killing it.
This matches the behavior of syslogd prior to it being Capsicumized.
Fixes: d2d180fb7736
(cherry picked from commit 60ae4e52f33e3c67720b68a29e35f6c114a3386c)
ip_mroute: EVENTHANDLER_REGISTER does not fail
No functional change intended.
MFC after: 1 week
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
(cherry picked from commit 0f1e1350704af555a4b30136f5f3d16db6f2dc51)
netbsd-tests: Fix regcomp_too_big flakiness
The test sometimes crashes with ASLR enabled. This seems to happen when
regcomp() grows the process stack and happens to run into the virtual
memory limit set at the beginning of the test. ASLR triggers the
problem since it introduces a bit of fragmentation and thus introduces
cases where stack allocation can be the trigger of virtual memory
exhaustion, rather than dynamic memory allocation in regcomp().
Make the test stable by priming the stack before doing anything else.
This effectively reserves 16MB of virtual memory for the stack, which in
practice is enough to make the test stable on amd64.
PR: 259971
Reviewed by: ngie, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54880
(cherry picked from commit 938915a22c84af88afa587694e8d63ce9dd202f4)
amd64: Fix sys/pcpu.h usage in vmm_host.h and md_var.h
Include sys/pcpu in vmm_host.h as its structs and functions are used
there, and add a forward declaration of struct pcpu to md_var.h as it
is used in some function prototypes.
Reviewed by: corvink, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D51550
(cherry picked from commit 202e3109a9d6699cf78e83f9047cefeb07659767)
kqueue.2: Fix reference to unexisting kevent1()
kqueue1() was meant.
While here, make the wording in the AUTHORS section more clear.
PR: 291908
Fixes: 9b1585384d53 ("kqueue.2: Editorial pass")
Reviewed by: kib, dab
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54858
(cherry picked from commit 4efe75af0869dd71a26685c432e5284d71bf4dc8)
amd64: define and use STACKALIGN and REDZONE_SZ
Reviewed by: brooks, emaste, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55151
lagg: Make lagg_link_active() static
It is declared as static. Make the definition consistent with the
declaration.
It was ever fixed by commit 52e53e2de0ec, but the commit was reverted,
leaving it unfixed.
No functional change intended.
MFC after: 3 days
arm64: Have get_kernel_reg return void
It now panics when it's unable to find the register, so doesn't need
to return a status.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D55106
arm64: Assume get_kernel_reg returns true
It now only returns true so this can be assumed and doesn't need to be
checked.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D55105
arm64: Panic if the ID register isn't known
This will allow for callers to be simplified & not need to check the
return status.
Keep the return type for now so this can be MFCd without breaking the
KBI.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D55104
arm64: Move creating the ID register views earlier
These are needed when enabling CPU features so should be processed
earlier in the boot.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D55103