]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 months agocopy_file_range: require CAP_SEEK capability
Mariusz Zaborski [Thu, 28 Sep 2023 13:24:39 +0000 (15:24 +0200)]
copy_file_range: require CAP_SEEK capability

When using copy_file_range(2) with an offset parameter,
the CAP_SEEK capability should be required.
This requirement is similar to the behavior observed with
pread(2)/pwrite(2).

Reported by: theraven
Reviewed by:    emaste, theraven, kib, markj
Approved by: secteam
Differential Revision:  https://reviews.freebsd.org/D41967

8 months agocat: add CAP_SEEK capability
Mariusz Zaborski [Thu, 28 Sep 2023 13:20:47 +0000 (15:20 +0200)]
cat: add CAP_SEEK capability

The copy_file_range might require that.

Reviewed by: emaste, theraven, kib, markj
Differential Revision: https://reviews.freebsd.org/D41967

8 months agopf: add note about changes ported from OpenBSD after 4.5
Ed Maste [Wed, 27 Sep 2023 17:59:30 +0000 (13:59 -0400)]
pf: add note about changes ported from OpenBSD after 4.5

The last comprehensive sync with OpenBSD's pf corresponds to
OpenBSD 4.5, but many changes have been ported over since then.

Reviewed by: kp, gbe, Kajetan Staszkiewicz <vegeta@tuxpowered.net>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42002

8 months agobhyve: always generate ACPI tables
Corvin Köhne [Fri, 8 Sep 2023 06:56:41 +0000 (08:56 +0200)]
bhyve: always generate ACPI tables

Most systems don't work properly without sane ACPI tables. Therefore,
we're always generating them.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D41778

8 months agoipfw.8: Adjust section for loader tunables
Zhenlei Huang [Thu, 28 Sep 2023 04:58:44 +0000 (12:58 +0800)]
ipfw.8: Adjust section for loader tunables

Move the descriptions of loader tunables from section 'SYSCTL VARIABLES'
to section 'LOADER TUNABLES'.

See also 49197c391b3d (ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables).

MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D41981

8 months agonewvers: Add comment about why we need sccs, but deprecate it
Warner Losh [Wed, 27 Sep 2023 23:07:53 +0000 (17:07 -0600)]
newvers: Add comment about why we need sccs, but deprecate it

The SCCS ID is still the most reliable way to dig out the version
information from the kernel w/o false positives. Add a comment to that
effect. savecore(8) neglects to save the kerneldumpheader that would
have the version information at a fixed location. savecore(8) needs to
be augmented to have the right data in the right places, but until then
the old-school SCCS id needs to remain. Once that's fixed, we plan to
remove it.

The reason it needs to be in a fixed or easily findable location is
because if you have an arbitrary core and want to pull the source and
build artificts that went along with that core, you don't yet have the
symbols you need to read the version string. To solve the chicken / egg
problem, one needs an independent way to know what to use so that
automated analysis of cores can happen. The sccs id being in the kernel
ensures that it is in the core image written. The what(1) utility makes
extracting the version easy.

Sponsored by: Netflix
Reviewed by: cy, emaste
Differential Revision: https://reviews.freebsd.org/D41984

8 months agoRevert "sys/conf/newvers.sh: whack sccs tag"
Warner Losh [Wed, 27 Sep 2023 23:07:43 +0000 (17:07 -0600)]
Revert "sys/conf/newvers.sh: whack sccs tag"

This string is still in active use to find versions for core files
before we have symbols. This is premature.

This reverts commit e6dc6a27230f836a131118326731b7c5fd417723.

Sponsored by: Netflix

8 months agomakefs/zfs: Remove a nonsensical comment
Mark Johnston [Wed, 27 Sep 2023 22:21:37 +0000 (18:21 -0400)]
makefs/zfs: Remove a nonsensical comment

When populating files, makefs needs to copy their contents into
userspace in order to compute a checksum, so copy_file_range(2) is out
of the question.  Though, it could possibly be used when building other
types of filesystems.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 months agorelease/ec2: Remove references to portsnap
Mark Johnston [Wed, 27 Sep 2023 22:02:36 +0000 (18:02 -0400)]
release/ec2: Remove references to portsnap

We no longer install a default portsnap.conf, so the sed invocation just
generates an error.

Reviewed by: cperciva
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42003

8 months agofreebsd-update: handle file -> directory on upgrade
Ed Maste [Wed, 27 Sep 2023 13:36:33 +0000 (09:36 -0400)]
freebsd-update: handle file -> directory on upgrade

Upgrading from FreeBSD 13.2 to 14.0 failed with
  install: ///usr/include/c++/v1/__string exists but is not a directory
because __string changed from a file to a directory with an LLVM
upgrade.

Now, remove the existing file when the type conflicts.  Note that this
is only an interim fix to facilitate upgrades from 13.2 for 14.0 BETA
testing.  This change does not handle the directory -> file case and
further work is needed.

PR: 273661
Reviewed by: dim, gordon
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41893

8 months agopmcstat: fix duplicate event allocation on CPU 0
Mitchell Horne [Wed, 27 Sep 2023 16:37:46 +0000 (13:37 -0300)]
pmcstat: fix duplicate event allocation on CPU 0

Commit b6e28991bf3a modified the allocation path for system scope PMCs
so that the event was allocated early for CPU 0. The reason is so that
the PMC's capabilities could be checked, to determine if pmcstat should
allocate the event on every CPU, or just on one CPU in each NUMA domain.
In the current scheme, there is no way to determine this information
without performing the PMC allocation.

This broke the established use-case of log analysis, and so
0aa150775179a was committed to fix the assertion. The result was what
appeared to be functional, but in normal counter measurement pmcstat was
silently allocating two counters for CPU 0.

This cuts the total number of counters that can be allocated from a CPU
in half. Additionally, depending on the particular hardware/event, we
might not be able to allocate the same event twice on a single CPU.

The simplest solution is to release the early-allocated PMC once we have
obtained its capabilities, and reallocate it later on. This restores the
event list logic to behave as it has for many years, and partially
reverts commit b6e28991bf3a.

Reported by: alc, kevans
Reviewed by: jkoshy, ray
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41978

8 months agoUPDATING: add a note about EARLY_AP_STARTUP on x86
Ed Maste [Wed, 27 Sep 2023 16:34:07 +0000 (12:34 -0400)]
UPDATING: add a note about EARLY_AP_STARTUP on x86

Requested by: wollman (in D41351)

8 months agoip_mroute: Fix sysctl knobs
Zhenlei Huang [Wed, 27 Sep 2023 16:23:22 +0000 (00:23 +0800)]
ip_mroute: Fix sysctl knobs

The loader tunable `net.inet.ip.mfchashsize` does not have corresponding
sysctl MIB entry. Just add it.

While here, the sysctl variable `net.inet.pim.squelch_wholepkt` is actually
a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T`
will report it correctly.

Reviewed by: kp
Fixes: 443fc3176dee Introduce a number of changes to the MROUTING code
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41997

8 months agointrng: switch from MAXCPU to mp_ncpus
Elliott Mitchell [Tue, 26 Sep 2023 17:06:04 +0000 (13:06 -0400)]
intrng: switch from MAXCPU to mp_ncpus

MAXCPU could be on the large side, while the hardware may not have
many processors at all. As such only allocate counters for processors
which actually exist, rather than always allocating for the maximum
potentially allowed number.

Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D41462

8 months agonvi: import version 2.2.1
Baptiste Daroussin [Wed, 27 Sep 2023 16:01:58 +0000 (18:01 +0200)]
nvi: import version 2.2.1

8 months agomakefs/zfs tests: Run zdb prior to importing makefs-created pools
Mark Johnston [Wed, 27 Sep 2023 15:58:34 +0000 (11:58 -0400)]
makefs/zfs tests: Run zdb prior to importing makefs-created pools

zdb contains quite a few assertions that can help catch bugs.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 months agomakefs/zfs: Set the objset block pointer fill field correctly
Mark Johnston [Wed, 27 Sep 2023 15:56:33 +0000 (11:56 -0400)]
makefs/zfs: Set the objset block pointer fill field correctly

It is supposed to contain the number of objects allocated from the set,
excluding the meta dnode.

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

8 months agomakefs/zfs: Use unsigned integers for indirect block level counts
Mark Johnston [Wed, 27 Sep 2023 15:47:26 +0000 (11:47 -0400)]
makefs/zfs: Use unsigned integers for indirect block level counts

No functional change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 months agoprintenv: fix typo in a comment
Alan Somers [Wed, 27 Sep 2023 15:02:58 +0000 (09:02 -0600)]
printenv: fix typo in a comment

[skip ci]

Reported by: gbe
MFC with: c989957f28ef5b03f594265612e3437c1e826ed4
Sponsored by: Axcient

8 months agoflua: add fbsd module
Baptiste Daroussin [Wed, 13 Sep 2023 07:43:33 +0000 (09:43 +0200)]
flua: add fbsd module

This module is bundled into flua, it only provides for now the exec
function. The point of the function is to be able to execute a program
without actually executing a shell.

to use it:
fbsd.exec({"id", "bapt"})

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41840

8 months agoglabel.8: Warn against using generic labels on a shared device
Mark Johnston [Thu, 26 May 2022 13:48:17 +0000 (09:48 -0400)]
glabel.8: Warn against using generic labels on a shared device

Also suggest against creating a generic label on a device which already
contains a filesystem.

PR: 264166
Reviewed by: imp, delphij, Pau Amma <pauamma@gundo.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35326

8 months agosocket tests: Avoid a buffer leak
Mark Johnston [Wed, 27 Sep 2023 12:30:50 +0000 (08:30 -0400)]
socket tests: Avoid a buffer leak

Reported by: Coverity
Fixes: 38426b32e106 ("socket tests: Add a regression test for MSG_WAITALL")

8 months agoObsoleteFiles.inc: Fix the latest entry's date
Mark Johnston [Wed, 27 Sep 2023 12:27:31 +0000 (08:27 -0400)]
ObsoleteFiles.inc: Fix the latest entry's date

Fixes: 7736786b08e8 ("Retire old diskless setup scripts")

8 months agounix: Fix a lock order reveral
Mark Johnston [Wed, 27 Sep 2023 12:24:11 +0000 (08:24 -0400)]
unix: Fix a lock order reveral

Running the test suite yields:

lock order reversal:
 1st 0xfffff80004bc6700 unp (unp, sleep mutex) @ sys/kern/uipc_usrreq.c:390
 2nd 0xffffffff81a94b30 unp_link_rwlock (unp_link_rwlock, rw) @ sys/kern/uipc_usrreq.c:2934
lock order unp -> unp_link_rwlock attempted at:
0xffffffff80bc216e at witness_checkorder+0xbbe
0xffffffff80b493a5 at _rw_wlock_cookie+0x65
0xffffffff80c0a8e2 at unp_discard+0x22
0xffffffff80c0a888 at unp_freerights+0x38
0xffffffff80c09fdd at unp_scan+0x9d
0xffffffff80c0f9a7 at uipc_sosend_dgram+0x727
0xffffffff80c00a79 at sousrsend+0x79
0xffffffff80c072d0 at kern_sendit+0x1c0
0xffffffff80c074d7 at sendit+0xb7
0xffffffff80c076f3 at sys_sendmsg+0x63
0xffffffff8104d957 at amd64_syscall+0x6b7
0xffffffff8101f9eb at fast_syscall_common+0xf8

This happens when uipc_sosend_dgram() discards a control message because
the receive socket buffer is full.  The overflow handling frees
internalized file references in the socket buffer before freeing mbufs.
It does this with socket PCBs locked, leading to the LOR.  Defer
handling of file references until the PCBs are unlocked.

Reviewed by: glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41884

8 months agohdac: Defer interrupt allocation in hdac_attach()
Mark Johnston [Wed, 27 Sep 2023 12:23:58 +0000 (08:23 -0400)]
hdac: Defer interrupt allocation in hdac_attach()

hdac_attach() registers an interrupt handler before allocating various
driver resources which are accessed by the interrupt handler.  On some
platforms we observe what appear to be spurious interrupts upon a cold
boot, resulting in panics.

Partially work around the problem by deferring irq allocation until
after other resources are allocated.  I think this is not a complete
solution, but is correct and sufficient to work around the problems
reported in the PR.

PR: 268393
Tested by: Alexander Sherikov <asherikov@yandex.com>
Tested by: Oleh Hushchenkov <o.hushchenkov@gmail.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41883

8 months agostress2: Extent timeout limit to avoid false positive errors
Peter Holm [Wed, 27 Sep 2023 11:01:00 +0000 (13:01 +0200)]
stress2: Extent timeout limit to avoid false positive errors

8 months agostress2: Remove tests from the exclude list
Peter Holm [Wed, 27 Sep 2023 11:00:01 +0000 (13:00 +0200)]
stress2: Remove tests from the exclude list

8 months agostress2: Cap total runtime
Peter Holm [Wed, 27 Sep 2023 10:58:39 +0000 (12:58 +0200)]
stress2: Cap total runtime

8 months agoarch.7: fix final 12.x release as 12.4
Ed Maste [Tue, 26 Sep 2023 13:30:06 +0000 (09:30 -0400)]
arch.7: fix final 12.x release as 12.4

arm (pre-v6/v7) and sparc64 listed 12.x as the final release.  12.4 is
the final 12.x release so we can fix the version number.

8 months agolibc: Add a rudimentary test for quick_exit(3).
Dag-Erling Smørgrav [Tue, 26 Sep 2023 20:07:03 +0000 (22:07 +0200)]
libc: Add a rudimentary test for quick_exit(3).

Sponsored by: Klara, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D41937

8 months agolibc: Rewrite quick_exit() and at_quick_exit() using C11 atomics.
Dag-Erling Smørgrav [Tue, 26 Sep 2023 20:06:27 +0000 (22:06 +0200)]
libc: Rewrite quick_exit() and at_quick_exit() using C11 atomics.

Compiler memory barriers do not prevent the CPU from executing the code
out of order.  Switch to C11 atomics.  This also lets us get rid of the
mutex; instead, loop until the compare_exchange succeeds.

While here, change the return value of at_quick_exit() on failure to
the more traditional -1, matching atexit().

Sponsored by: Klara, Inc.
Reviewed by: Olivier Certner, kevans, kib
Differential Revision: https://reviews.freebsd.org/D41936

8 months agoAdd paragraph about kern.mqueue sysctls and their defaults.
Jens Schweikhardt [Tue, 26 Sep 2023 19:41:29 +0000 (21:41 +0200)]
Add paragraph about kern.mqueue sysctls and their defaults.

8 months agoi386 pmap: Adapt recent amd64/arm64 superpage improvements
Alan Cox [Sun, 24 Sep 2023 18:21:36 +0000 (13:21 -0500)]
i386 pmap: Adapt recent amd64/arm64 superpage improvements

Don't recompute mpte during promotion.

Optimize MADV_WILLNEED on existing superpages.

Standardize promotion conditions across amd64, arm64, and i386.

Stop requiring the accessed bit for superpage promotion.

Tidy up pmap_promote_pde() calls.

Retire PMAP_INLINE.  It's no longer used.

Note: Some of these changes are a prerequisite to fixing a panic that
arises when attempting to create a wired superpage mapping by
pmap_enter(psind=1) (as opposed to promotion).

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41944

8 months agodtc: Sync with upstream commit 26a0fe5
Jose Luis Duran [Tue, 26 Sep 2023 16:37:52 +0000 (12:37 -0400)]
dtc: Sync with upstream commit 26a0fe5

0206c0f ("Handle top-level /delete-node/ directives.")
d612a9e ("Remove C++11 standard constrain")
- Remove extra white lines after the $FreeBSD$ tag removal

Reviewed by: kevans (earlier), theraven, emaste
Differential Revision: https://reviews.freebsd.org/D41482

8 months agosys/conf/newvers.sh: whack sccs tag
Mateusz Guzik [Tue, 26 Sep 2023 14:36:51 +0000 (14:36 +0000)]
sys/conf/newvers.sh: whack sccs tag

In the same spirit as removing cvs $FreeBSD$ tags.

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

8 months agokernel: remove unused HWPMC_MIPS_BACKTRACE option
Ed Maste [Tue, 26 Sep 2023 13:27:14 +0000 (09:27 -0400)]
kernel: remove unused HWPMC_MIPS_BACKTRACE option

MIPS was removed before FreeBSD 13.

Reported by: andrew

8 months agonvi: import version 2.2.1
Baptiste Daroussin [Tue, 26 Sep 2023 07:08:15 +0000 (09:08 +0200)]
nvi: import version 2.2.1

8 months agoExplain the -d option.
Greg Lehey [Tue, 26 Sep 2023 05:05:16 +0000 (15:05 +1000)]
Explain the -d option.

8 months agonvme: Supress noise messages
Warner Losh [Tue, 26 Sep 2023 04:08:52 +0000 (22:08 -0600)]
nvme: Supress noise messages

When we're suspending, we get messages about waiting for the controller
to reset. These are in error: we're not waiting for it to reset. We put
the recovery state as part of suspending, so we should suppress these as
a false positive.

Also remove a stray debug that's left over from earlier versions of
the recovery code that no longer makes sense.

Sponsored by: Netflix

8 months agopf.4: Bump .Dd
Zhenlei Huang [Tue, 26 Sep 2023 04:01:01 +0000 (12:01 +0800)]
pf.4: Bump .Dd

Missed in c531c1d1462c (pf: Convert PF_DEFAULT_TO_DROP into a vnet loader
tunable 'net.pf.default_to_drop') .

MFC after: 10 days
MFC with: c531c1d1462c

8 months agoregcomp: use unsigned char when testing for escapes
Christos Zoulas [Wed, 30 Aug 2023 20:37:24 +0000 (20:37 +0000)]
regcomp: use unsigned char when testing for escapes

- cast GETNEXT to unsigned where it is being promoted to int to prevent
  sign-extension (really it would have been better for PEEK*() and
  GETNEXT() to return unsigned char; this would have removed a ton of
  (uch) casts, but it is too intrusive for now).
- fix an isalpha that should have been iswalpha

PR: 264275, 274032
Reviewed by: kevans, eugen (previous version)
Obtained from: NetBSD
Differential Revision: https://reviews.freebsd.org/D41947

8 months agomfc-candidates: search by committer only, not author
Ed Maste [Sun, 24 Sep 2023 13:13:15 +0000 (09:13 -0400)]
mfc-candidates: search by committer only, not author

When both --author and --committer are specified, `git log` requires
both to match.  Search only by committer, as it is typically the FreeBSD
committer who will perform the MFC.

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

8 months agoLinuxKPI: 802.11: fill regulatory_hint() with some life
Bjoern A. Zeeb [Mon, 25 Sep 2023 17:54:20 +0000 (17:54 +0000)]
LinuxKPI: 802.11: fill regulatory_hint() with some life

Start implementing regulatory_hint() using a .c file based allocation
helper function so we could change structures in the future with
better chances to keep compatibility.
This sets wiphy->regd needed by various LinuxKPI based WiFi drivers.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

8 months agoLiunxKPI: 802.11: move ieee80211_chanctx_conf into lkpi private struct
Bjoern A. Zeeb [Mon, 25 Sep 2023 16:57:23 +0000 (16:57 +0000)]
LiunxKPI: 802.11: move ieee80211_chanctx_conf into lkpi private struct

Factor out ieee80211_chanctx_conf into struct lkpi_chanctx in order to
keep local state as well.  In first instance that is added_to_drv
only.  For now we stay single-chanctx only but this paves the path
to make it a list.
Use the new information to implement ieee80211_iter_chan_contexts_atomic().

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

8 months agoLinuxKPI: 802.11: avoid symbol clash on UP to AC mapping
Bjoern A. Zeeb [Sun, 24 Sep 2023 11:55:11 +0000 (11:55 +0000)]
LinuxKPI: 802.11: avoid symbol clash on UP to AC mapping

tid_to_mac80211_ac is an exported symbol in and likely based on iwlwifi,
which leads to a symbol clash in NetBSD.  Rename our local LinuxKPI copy
to a better name and add a comment where to find a copy of the mapping
table.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reported by: Phil Nelson (phil netbsd org)

8 months agoprintenv: Add test for printenv.
Wang-Yan-Hao [Mon, 25 Sep 2023 16:02:14 +0000 (10:02 -0600)]
printenv: Add test for printenv.

Reviewed by: asomers
Differential Revision: https://reviews.freebsd.org/D41468

8 months agoopenssl: document the update process
Pierre Pronchery [Mon, 25 Sep 2023 15:40:26 +0000 (17:40 +0200)]
openssl: document the update process

This is directly inspired from the equivalent document for OpenSSH.

Sponsored by: The FreeBSD Foundation

8 months agosendmail: Drop $FreeBSD$ from .mc files
John Baldwin [Mon, 25 Sep 2023 14:56:02 +0000 (07:56 -0700)]
sendmail: Drop $FreeBSD$ from .mc files

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41960

8 months agoUpdate a few tools to not embed $FreeBSD$ in generated files
John Baldwin [Mon, 25 Sep 2023 14:55:43 +0000 (07:55 -0700)]
Update a few tools to not embed $FreeBSD$ in generated files

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41959

8 months agopowerpc/generate-hfs.sh: Don't include $FreeBSD$ in prefix to uuencoded image
John Baldwin [Mon, 25 Sep 2023 14:55:18 +0000 (07:55 -0700)]
powerpc/generate-hfs.sh: Don't include $FreeBSD$ in prefix to uuencoded image

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41958

8 months agoPurge more stray embedded $FreeBSD$ strings
John Baldwin [Mon, 25 Sep 2023 14:54:56 +0000 (07:54 -0700)]
Purge more stray embedded $FreeBSD$ strings

These do not use __FBSDID but instead use bare char arrays.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41957

8 months agolpr: Remove now unused fallback definition for __FBSDID
John Baldwin [Mon, 25 Sep 2023 14:50:33 +0000 (07:50 -0700)]
lpr: Remove now unused fallback definition for __FBSDID

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41956

8 months agoUpdate a couple of tools to not embed __FBSDID in generated files
John Baldwin [Mon, 25 Sep 2023 14:50:11 +0000 (07:50 -0700)]
Update a couple of tools to not embed __FBSDID in generated files

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41955

8 months agoRemove a few more stray __FBSDID uses
John Baldwin [Mon, 25 Sep 2023 14:49:52 +0000 (07:49 -0700)]
Remove a few more stray __FBSDID uses

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41954

8 months agovideomode: Regenerate files
John Baldwin [Mon, 25 Sep 2023 14:49:30 +0000 (07:49 -0700)]
videomode: Regenerate files

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41953

8 months agovideomode/devlist2h.awk: Don't include $FreeBSD$ in generated files
John Baldwin [Mon, 25 Sep 2023 14:46:53 +0000 (07:46 -0700)]
videomode/devlist2h.awk: Don't include $FreeBSD$ in generated files

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41952

8 months agoRetire old diskless setup scripts
John Baldwin [Mon, 25 Sep 2023 14:46:21 +0000 (07:46 -0700)]
Retire old diskless setup scripts

These scripts predate /etc/rc.diskless* and use a different scheme.  A
comment was added to them back in 2002 noting they were 3 years old at
that point.

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

8 months agomake_*_driver.sh: Don't include $FreeBSD$ in generated files
John Baldwin [Mon, 25 Sep 2023 14:46:09 +0000 (07:46 -0700)]
make_*_driver.sh: Don't include $FreeBSD$ in generated files

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41950

8 months agoarm: Don't advertise the virtual timer on arm
Andrew Turner [Mon, 25 Sep 2023 08:10:11 +0000 (09:10 +0100)]
arm: Don't advertise the virtual timer on arm

It may not be usable on all SoCs.

Sponsored by: Arm Ltd

8 months agoipfw: Add sysctl flag CTLFLAG_TUN to loader tunables
Zhenlei Huang [Mon, 25 Sep 2023 10:10:47 +0000 (18:10 +0800)]
ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables

The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

 1. net.inet.ip.fw.enable
 2. net.inet6.ip6.fw.enable
 3. net.link.ether.ipfw

No functional change intended.

Reviewed by: glebius
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41928

8 months agonetinet6: Add sysctl flag CTLFLAG_TUN to loader tunables
Zhenlei Huang [Mon, 25 Sep 2023 10:10:47 +0000 (18:10 +0800)]
netinet6: Add sysctl flag CTLFLAG_TUN to loader tunables

The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

 1. net.inet6.ip6.auto_linklocal
 2. net.inet6.ip6.accept_rtadv
 3. net.inet6.ip6.no_radr

No functional change intended.

Reviewed by: glebius
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41928

8 months agortsock: Add sysctl flag CTLFLAG_TUN to loader tunable
Zhenlei Huang [Mon, 25 Sep 2023 10:10:46 +0000 (18:10 +0800)]
rtsock: Add sysctl flag CTLFLAG_TUN to loader tunable

The sysctl variable `net.route.netisr_maxqlen` is actually a loader
tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will
report it correctly.

No functional change intended.

Reviewed by: glebius
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41928

8 months agolinux(4): Regen
Dmitry Chagin [Mon, 25 Sep 2023 09:26:34 +0000 (12:26 +0300)]
linux(4): Regen

MFC after: 1 week

8 months agolinux(4): Update syscalls.master to 6.5
Dmitry Chagin [Mon, 25 Sep 2023 09:24:58 +0000 (12:24 +0300)]
linux(4): Update syscalls.master to 6.5

MFC after: 1 week

8 months agojail: avoid a clash with /etc/jail.conf.d between rc and jail(8)
Jamie Gritton [Mon, 25 Sep 2023 00:03:09 +0000 (17:03 -0700)]
jail: avoid a clash with /etc/jail.conf.d between rc and jail(8)

Since 13.1, /etc/rc.d/jail has looked for a per-jail config file in
/etc/jail.conf.d. For RELENG 14, the ".include" directive was added to
jail(8), with a sample line in the jail.conf(5) man page that includes
"/etc/jail.conf.d/*.conf".

These two use cases don't work together. When the jail.conf.d files
are included from a master jail.conf, the files in jail.conf.d are
likely to hold only partial configurations, and shouldn't be directly
loaded by rc.d/jail. But there are existing configurations that depend
on the current rc.d behavior. While users could be advised not to
include from /etc/jail.conf.d, it's the natural choice even if not
mentioned in jail.conf.5.

The workaround is for rc.d/jail to continue to load the individual
files, but only when /etc/jail.conf doesn't include from that
directory (via a simple grep test), This allows the current use
while not breaking the previous use.
Reported by: antranigv at freebsd.am
Differential Revision: https://reviews.freebsd.org/D41962

8 months agosyscalls.master: Fix SAL annotation for getdirentires basep argument
Haoyu Gu [Sun, 24 Sep 2023 22:34:43 +0000 (18:34 -0400)]
syscalls.master: Fix SAL annotation for getdirentires basep argument

getdirentires last argument "off_t *basep" is an optional output
argument.  It returns the value only when the passed-in value(pointer)
is non-NULL.

This is a part of the research work at RCSLab, University of Waterloo.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41969

8 months agozfs: merge openzfs/zfs@2e2a46e0a
Martin Matuska [Sun, 24 Sep 2023 21:32:11 +0000 (23:32 +0200)]
zfs: merge openzfs/zfs@2e2a46e0a

Notable upstream pull request merges:
 #15243 b53077a9e Add zfs_prepare_disk script for disk firmware install
 #15298 2e2a46e0a Invoke zdb by guid to avoid import errors
 #15301 e5d70f467 ZIL: Avoid dbuf_read() in ztest_get_data()

Obtained from: OpenZFS
OpenZFS commit: 2e2a46e0a597b3ee606ea7dc5bc527459077322f

8 months agovge: correct pause_frames sysctl description
Priit Trees [Fri, 28 Jul 2023 21:41:22 +0000 (21:41 +0000)]
vge: correct pause_frames sysctl description

Reviewed by: emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/806

8 months agonvme: Fix locking protocol violation to fix suspend / resume
Warner Losh [Sun, 24 Sep 2023 12:57:07 +0000 (06:57 -0600)]
nvme: Fix locking protocol violation to fix suspend / resume

Currently, when we suspend, we need to tear down all the qpairs. We call
nvme_admin_qpair_abort_aers with the admin qpair lock held, but the
tracker it will call for the pending AER also locks it (recursively)
hitting an assert. This routine is called without the qpair lock held
when we destroy the device entirely in a number of places. Add an assert
to this effect and drop the qpair lock before calling it.
nvme_admin_qpair_abort_aers then locks the qpair lock to traverse the
list, dropping it around calls to nvme_qpair_complete_tracker, and
restarting the list scan after picking it back up.

Note: If interrupts are still running, there's a tiny window for these
AERs: If one fires just an instant after we manually complete it, then
we'll be fine: we set the state of the queue to 'waiting' and we ignore
interrupts while 'waiting'. We know we'll destroy all the queue state
with these pending interrupts before looking at them again and we know
all the TRs will have been completed or rescheduled. So either way we're
covered.

Also, tidy up the failure case as well: failing a queue is a superset of
disabling it, so no need to call disable first. This solves solves some
locking issues with recursion since we don't need to recurse.. Set the
qpair state of failed queues to RECOVERY_FAILED and stop scheduling the
watchdog. Assert we're not failed when we're enabling a qpair, since
failure currently is one-way. Make failure a little less verbose.

Next, kill the pre/post reset stuff. It's completely bogus since we
disable the qparis, we don't need to also hold the lock through the
reset: disabling will cause the ISR to return early. This keeps us from
recursing on the recovery lock when resuming. We only need the recovery
lock to avoid a specific race between the timer and the ISR.

Finally, kill NVME_RESET_2X. It'S been a major release since we put it
in and nobody has used it as far as I can tell. And it was a motivator
for the pre/post uglification.

These are all interrelated, so need to be done at the same time.

Sponsored by: Netflix
Reviewed by: jhb
Tested by: jhb (made sure suspend / resume worked)
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D41866

8 months agoUntie strchrnul() from gdb.
Alexander Motin [Sun, 24 Sep 2023 03:17:29 +0000 (23:17 -0400)]
Untie strchrnul() from gdb.

MFC after: 10 days

8 months agoports(7): Update the default setting of MASTER_SITE_INDEX
Li-Wen Hsu [Sun, 24 Sep 2023 02:58:33 +0000 (10:58 +0800)]
ports(7): Update the default setting of MASTER_SITE_INDEX

MFC after: 3 days

8 months agoGuard CROSS_TARGET_FLAGS from buildworld
Simon J. Gerraty [Sat, 23 Sep 2023 22:58:13 +0000 (15:58 -0700)]
Guard CROSS_TARGET_FLAGS from buildworld

Until a better arrangment is worked out, guard the setting of
CROSS_TARGET_FLAGS in local.sys.mk with check for DIRDEPS_BUILD.

Using a separate flag for CROSS_TARGET that can be reset by
bsd.compat.mk is probably the right thing.

8 months agofactor: Remove an empty #ifdef __FBSDID clause
John Baldwin [Sat, 23 Sep 2023 21:49:11 +0000 (14:49 -0700)]
factor: Remove an empty #ifdef __FBSDID clause

8 months agoifconfig/ifvlan.c: Whitespace fix
John Baldwin [Sat, 23 Sep 2023 20:27:49 +0000 (13:27 -0700)]
ifconfig/ifvlan.c: Whitespace fix

8 months agosh: implement PS1 \D to print current time
Piotr Pawel Stefaniak [Sun, 1 Jan 2023 19:38:35 +0000 (20:38 +0100)]
sh: implement PS1 \D to print current time

\D{format} yields the result of calling strftime(3) with the provided
format and the current time.

When PS4 can use this, it will enable us to easily generate timestamps
when tracing script execution.

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

8 months agokern_sysctl: Make name2oid() non-destructive to the name
Alexander Motin [Sat, 23 Sep 2023 16:13:46 +0000 (12:13 -0400)]
kern_sysctl: Make name2oid() non-destructive to the name

It is not the first time I see it panicking while trying to modify
const memory.  Lets make it safer and easier to use.  While there,
mark few functions using it also const.

MFC after: 10 days

8 months agong_eiface: switch VNETs when injecting mbufs into netgraph
Marko Zec [Sat, 23 Sep 2023 08:56:56 +0000 (10:56 +0200)]
ng_eiface: switch VNETs when injecting mbufs into netgraph

A ng_eiface instance may be on lease to a different vnet while
remaining tied to its parent vnet.  In such circumstances, before
injecting mbufs into netgraph, curvnet must be set to that of the
ng_eiface's netgraph node.  Mark the vnet transition as QUIET,
since otherwise it would be recorded as a curvnet recursion when
ng_eiface's ifnet resides in the same (parent) vnet as its
netgraph node.

PR: 274028
Reported by: Dancho Penev <dpslavov@hotmail.com>
MFC after: 1 week

8 months agoAdd support for host32 for DIRDEPS_BUILD
Simon J. Gerraty [Sat, 23 Sep 2023 06:27:37 +0000 (23:27 -0700)]
Add support for host32 for DIRDEPS_BUILD

Allow building 32bit libs for host.

Move CFLAGS additions from local.sys.dirdeps.mk (which is too early
and impacts CFLAGS defaults) to local.sys.mk

Reviewed by: stevek
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D41946

8 months agovfs cache: retire dothits and dotdothits counters
Mateusz Guzik [Sat, 23 Sep 2023 00:08:49 +0000 (00:08 +0000)]
vfs cache: retire dothits and dotdothits counters

They demonstrate nothing, and in case of dotdot they are not even hits.
This is just a count of lookups with "..", which are not worth
mentioniong.

8 months agoInvoke zdb by guid to avoid import errors
Paul Dagnelie [Fri, 22 Sep 2023 23:08:51 +0000 (16:08 -0700)]
Invoke zdb by guid to avoid import errors

The problem that was occurring is basically that a device was removed
by ztest and replaced with another device. It was then reguided. The
import then failed because there were two possible imports with the
same name; one with the new guid, and one with the old. This can
happen because the label writes from the device removal/replacement
can be subject to ztest's error injection.

The other ways to fix this would be to change the error injection to
not trigger on removals (which may not be technically feasible), or
to change the import code to not report configurations that are so
short on devices (which would potentially have unpleasant end-user
effects when trying to recover from data losses/device configuration
issues).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #15298

8 months agovfs cache: mark vfs.cache.param.size as read-only
Mateusz Guzik [Fri, 22 Sep 2023 21:32:23 +0000 (21:32 +0000)]
vfs cache: mark vfs.cache.param.size as read-only

It was not meant to be writable and writes don't work correctly as they
fail to resize the hash.

8 months agovfs cache: Drop known argument of internal cache_recalc_neg_min()
Olivier Certner [Fri, 22 Sep 2023 21:25:41 +0000 (21:25 +0000)]
vfs cache: Drop known argument of internal cache_recalc_neg_min()

'ncnegminpct' is to be passed always, so just drop the unneeded parameter.

Sponsored by:   The FreeBSD Foundation
Reviewed by: mjg

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

8 months agovfs: fix reference counting/locking on LK_UPGRADE error
Olivier Certner [Fri, 22 Sep 2023 20:57:20 +0000 (20:57 +0000)]
vfs: fix reference counting/locking on LK_UPGRADE error

Factoring out this code unfortunately introduced reference and lock leaks in
case of failure in the lock upgrade path under VV_CROSSLOCK. In terms of
practical use, this impacts unionfs (and nullfs in a corner case).

Fixes: 80bd5ef07025 ("vfs: factor out mount point traversal to a dedicated routine")
MFC after:      3 days
MFC to:         stable/14 releng/14.0
Sponsored by:   The FreeBSD Foundation
Reviewed by: mjg
[mjg: massaged the commit message a little bit]

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

8 months agolastcomm: update i386 tests for additional timestamp resolution
Ed Maste [Fri, 22 Sep 2023 18:46:52 +0000 (14:46 -0400)]
lastcomm: update i386 tests for additional timestamp resolution

Fixes: 6f4ce7e89ba4 ("lastcomm: improve timestamp display")
Sponsored by: The FreeBSD Foundation

8 months agolastcomm: update amd64 tests for additional timestamp resolution
Ed Maste [Fri, 22 Sep 2023 17:51:34 +0000 (13:51 -0400)]
lastcomm: update amd64 tests for additional timestamp resolution

Fixes: 6f4ce7e89ba4 ("lastcomm: improve timestamp display")
Sponsored by: The FreeBSD Foundation

8 months agoAdd BTI exceptions
Andrew Turner [Wed, 5 Apr 2023 12:28:46 +0000 (13:28 +0100)]
Add BTI exceptions

We could hit these when executing code marked as using BTI but jumps
to a non-branch target instruction.

Sponsored by: Arm Ltd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39450

8 months agoarm64: Export HWCAP_CPUID
Andrew Turner [Fri, 22 Sep 2023 16:20:17 +0000 (17:20 +0100)]
arm64: Export HWCAP_CPUID

We have export the CPUID registers since 2018 but never set the
HWCAP_CPUID flag to tell userspace it could use them. Fix this by
setting it.

Sponsored by: Arm Ltd

8 months agoossl: Update arm_arch.h from OpenSSL 1.1.1 to 3.0
Andrew Turner [Fri, 22 Sep 2023 15:11:27 +0000 (16:11 +0100)]
ossl: Update arm_arch.h from OpenSSL 1.1.1 to 3.0

Reviewed by: emaste
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41939

8 months agolibcrypto: Copy the arm64 header when building asm
Andrew Turner [Fri, 22 Sep 2023 11:34:08 +0000 (12:34 +0100)]
libcrypto: Copy the arm64 header when building asm

It may be needed when it's updated so is best to keep in sync with the
assembly files.

Reviewed by: emaste
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41938

8 months agoarm64: dtb: Add rk3568-nanopi-r5s.dts to the build
Emmanuel Vadot [Fri, 22 Sep 2023 16:50:31 +0000 (18:50 +0200)]
arm64: dtb: Add rk3568-nanopi-r5s.dts to the build

We can boot on this board.

8 months agoiicbus: pmic: rk8xx: Fix logic in clock-output-names detection
Emmanuel Vadot [Fri, 22 Sep 2023 16:47:16 +0000 (18:47 +0200)]
iicbus: pmic: rk8xx: Fix logic in clock-output-names detection

Pointy hat to: manu (probably)

8 months agolastcomm: improve timestamp display
Michael Paepcke [Thu, 27 Jul 2023 08:28:50 +0000 (08:28 +0000)]
lastcomm: improve timestamp display

Adjust the lastcomm command to output timestamps with a precision of
seconds.

Reported by: Dr. Andreas Longwitz
Reviewed by: emaste
Relnotes: Yes
Sponsored by: DSS Gmbh
Pull Request: https://github.com/freebsd/freebsd-src/pull/802

8 months agonetlink: add unregister call in cleanup
Lin Ma [Mon, 19 Jun 2023 09:32:59 +0000 (17:32 +0800)]
netlink: add unregister call in cleanup

For protocols that use netlink (generic and route for now), the unint
handler seems to have forgotten to call unregister, which will cause
the assertion the next time the module is loaded.

This patch adds unregister call to netlink_unregister_proto() for those
handlers to avoid bad things happen.

Reviewed-by: melifaro
Fixes: 7e5bf68495cc ("netlink: add netlink support")
Pull-request: https://github.com/freebsd/freebsd-src/pull/781
Signed-off-by: Lin Ma <linma@zju.edu.cn>
8 months agoUPDATING: add entry for the new loader tunnable net.pf.default_to_drop
Zhenlei Huang [Fri, 22 Sep 2023 10:19:33 +0000 (18:19 +0800)]
UPDATING: add entry for the new loader tunnable net.pf.default_to_drop

8 months agopf: Convert PF_DEFAULT_TO_DROP into a vnet loader tunable 'net.pf.default_to_drop'
Zhenlei Huang [Fri, 22 Sep 2023 10:05:02 +0000 (18:05 +0800)]
pf: Convert PF_DEFAULT_TO_DROP into a vnet loader tunable 'net.pf.default_to_drop'

7f7ef494f11d introduced a compile time option PF_DEFAULT_TO_DROP to make
the pf(4) default rule to drop. While this change exposes a vnet loader
tunable 'net.pf.default_to_drop' so that users can change the default
rule without re-compiling the pf(4) module.

This change is similiar to that for IPFW [1].

1. 5f17ebf94db5 Convert IPFW_DEFAULT_TO_ACCEPT into a loader tunable 'net.inet.ip.fw.default_to_accept'

Reviewed by: #network, kp
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D39866

8 months agopkgbase: Fix ucl for libcompiler_rt
Mikaël Urankar [Fri, 22 Sep 2023 09:41:09 +0000 (11:41 +0200)]
pkgbase: Fix ucl for libcompiler_rt

It's only a -dev package now so add it to the list of -dev package
that don't have non-dev package.

PR: 273859

8 months agoCreate namespace for the symbols added during 15-CURRENT cycle
Yuri Pankov [Fri, 22 Sep 2023 07:57:35 +0000 (09:57 +0200)]
Create namespace for the symbols added during 15-CURRENT cycle

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D41935

8 months agoFix typos in acl_get_entry(3) manual page.
Dag-Erling Smørgrav [Fri, 22 Sep 2023 07:43:01 +0000 (09:43 +0200)]
Fix typos in acl_get_entry(3) manual page.

Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D41924

8 months agoRemove mention of defunct mailing list from acl / mac man pages.
Dag-Erling Smørgrav [Fri, 22 Sep 2023 07:42:57 +0000 (09:42 +0200)]
Remove mention of defunct mailing list from acl / mac man pages.

Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D41923

8 months agolibprocstat: use elf_getphdrnum rather than deprecated elf_getphnum
John Hein [Thu, 21 Sep 2023 23:43:05 +0000 (17:43 -0600)]
libprocstat: use elf_getphdrnum rather than deprecated elf_getphnum

PR:             273966
Reviewed by: emaste