Commit graph

289001 commits

Author SHA1 Message Date
Mark Johnston
d27c35123b clang-format: Minor tweaks
Invert KeepEmptyLinesAtTheStartOfBlocks.  We used to require an empty
line at the beginning of functions with no local variables, which I
believe is the reason for this setting.  Now it is discouraged in new
code.

Tell clang-format to align consecutive macros, since we tend to do that.
clang-format's output isn't quite what we want here.  Typically we have
a tab after a #define for some reason, and clang-format doesn't appear
to have an option for that.  clang-format will also use a mix of tabs
and spaces to minimize indentation, which is also against our
convention.  However, the result looks better with this setting than
without.

Reviewed by:	emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29870

(cherry picked from commit 2c18289b72c8594bb5dbe22d54ff3434a56ec6c6)
2024-05-20 09:42:32 -04:00
Baptiste Daroussin
b454ede752 usb_vendors: update to 2024.03.18
(cherry picked from commit 79bffdf3f42e2e8e62223fcffd537d5d254ddbb7)
2024-05-20 13:24:45 +02:00
Baptiste Daroussin
5b609bbf91 pci_vendors: update to 2024.05.14
(cherry picked from commit b0b9435ef1ec64c21f7243dbd02ad10e7f612149)
2024-05-20 13:24:43 +02:00
Baptiste Daroussin
2c5c85cbcf nuageinit: by default to not enable nuageinit
MFC After:	1 day
Reported by:	karels@

(cherry picked from commit 5681636ead6790d5ad2c24a4712f010fcdfc926c)
2024-05-20 13:24:38 +02:00
Dag-Erling Smørgrav
7daf360284 ldns: Ignore commented-out lines in resolv.conf.
This merges upstream PR 238 + an additional bug fix.

PR:		278721
MFC after:	1 week

(cherry picked from commit 3b092e4936c433889cc668ea9563c8fd437d1a3e)
2024-05-20 09:04:54 +00:00
Dag-Erling Smørgrav
745ee87003 atf: Guard against multiple evaluation.
Note that the ATF-C++ macros have the same issue, but they are not as
easily fixed.

MFC after:	3 days
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D45148

(cherry picked from commit a7beca6fb113986839de73b7cf73d933464898c6)
2024-05-20 09:04:54 +00:00
Dag-Erling Smørgrav
dd1a16c9e2 ifconfig: Add format shortcuts.
MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D45166

(cherry picked from commit 847ef59d4b5eab234bd1f8eb947ad74bdab5614e)

ifconfig: Markup nits.

MFC after:	3 days
Reviewed by:	imp, allanjude
Differential Revision:	https://reviews.freebsd.org/D45209

(cherry picked from commit 42b28f815214aa582fe4ca707687d3af47850230)
2024-05-20 09:04:54 +00:00
Dimitry Andric
14efb9bb71 Merge commit 87f3407856e6 from llvm-project (by Phoebe Wang):
[X86][Driver] Do not add `-evex512` for `-march=native` when the target doesn't support AVX512 (#91694)

This prevents problems with ports that fail to build with
CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors
like:

  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512'
    197 |         const vec_t ones = VSET1_8(1);
        |                            ^
  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8'
    116 | #  define VSET1_8(a)            _mm512_set1_epi8(a)
        |                                 ^
  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI
  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8'
    116 | #  define VSET1_8(a)            _mm512_set1_epi8(a)
        |                                 ^

Ports known to be affected are: archivers/libdeflate, devel/highway,
www/node20, and lang/rust.

(For rust itself there is also a similar issue reported at
https://github.com/rust-lang/rust/pull/121088).

PR:		276104
Reported by:	netchild
MFC after:	3 days

(cherry picked from commit fcfb2d6393712dee3f1f8f0c3840d14817dea416)
2024-05-20 10:12:56 +02:00
Kristof Provost
18c38eda39 if_ovpn: cope with loops
User misconfiguration may lead to routing loops where we try to send the tunnel
packet into the tunnel. This eventually leads to stack overflows and panics.

Avoid this using if_tunnel_check_nesting(), which will drop the packet if we're
looping or we hit three layers of nested tunnels.

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

(cherry picked from commit 59a6666ec91d71f97aaae5195bbfafd9d422db2e)
2024-05-20 09:39:52 +02:00
Konstantin Belousov
ab135e19f7 tmpfs_destroy_vobject(): clear v_object under the object lock
(cherry picked from commit 46811949797b7e44521cd56cfa61b6c8378c4600)
2024-05-19 03:57:54 +03:00
Konstantin Belousov
f0d6377a3e swap-like pagers: assert that writemapping decrease does not pass zero
(cherry picked from commit 6ada4e8a0ae901f0012015c8d277d80aad7d8f37)
2024-05-19 03:57:54 +03:00
Konstantin Belousov
2ecfb14781 tmpfs: recalculate OBJ_TMPFS_VREF on reinstantiating node' vnode
(cherry picked from commit 58d7ac11e77db28640b8e47f9f9c1fe81d15baf5)
2024-05-19 03:57:54 +03:00
Konstantin Belousov
936aa8ec7c vfs_domount_update(): style, use space instead of tab
(cherry picked from commit 5a061a38cdfa151315051a1ca1400bb32e39cde2)
2024-05-19 03:57:54 +03:00
Konstantin Belousov
9ccd539412 devfs_allocv(): style
(cherry picked from commit 6d79564fe341c8dbf09405cae1a0a76460aaf8aa)
2024-05-19 03:57:54 +03:00
Konstantin Belousov
4018bcdea8 cdev_pager_allocate(): ensure that the cdev_pager_ops ctr is called only once
PR:	278826

(cherry picked from commit e93404065177d6c909cd64bf7d74fe0d8df35edf)
2024-05-19 03:57:54 +03:00
Christos Margiolis
a19d42b08a sound: Remove ncards variable from sound_oss_card_info()
The loop counter is also the card's index, so ncards is redundant.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45144

(cherry picked from commit 305db91d4b92a5d53826dcb6df39fc8a1f3b427e)
2024-05-17 21:30:36 +02:00
Christos Margiolis
7814ed2bd3 snd_hda: Rename LENOVO_I* to LENOVO_IDEAPAD*
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D45105

(cherry picked from commit 278953360e0e6187c3f7c688cb49254df1567f0b)
2024-05-17 21:30:36 +02:00
Christos Margiolis
9a620018af snd_hda: Add patch for Lenovo Ideapad 3
Reported by:	bsd-lists@bsdforge.com
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D45100

(cherry picked from commit 54cc353f505dbc5f19168b6b1417b6736433d9ae)
2024-05-17 21:30:36 +02:00
Christos Margiolis
15aa8688d0 sound: Rename oss_audioinfo->real_device to oss_audioinfo->legacy_device
The OSS manual now documents this field as "legacy_device".

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45138

(cherry picked from commit 24d5cc14dd60b49553ff3ee7830305621f782ff1)
2024-05-17 21:30:36 +02:00
Christos Margiolis
8bd14f511e sound: Add missing oss_mixerinfo devnode and legacy_device fields
They are missing from soundcard.h and are in fact used by some
applications, such as OSS' ossinfo(1):
http://manuals.opensound.com/developer/ossinfo.c.html

The new size for filler is chosen according to the most recent official
version of soundcard.h, which includes those 2 fields.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45137

(cherry picked from commit e6df8c379b0cf2f6d715d4903fcb1f279e38173e)
2024-05-17 21:30:36 +02:00
Christos Margiolis
2b36982887 sound: Fix oss_sysinfo->numcards
According to the OSS manual, oss_sysinfo->numcards holds the number of
detected audio devices in the system, while the current ncards variable,
whose value is assigned to oss_sysinfo->numcards, holds the number of
currently registered devices only.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	dev_submerge.ch, emaste
Differential Revision:	https://reviews.freebsd.org/D45136

(cherry picked from commit 59d98edae3e1a6fffd292e4393c49862d624f25f)
2024-05-17 21:30:36 +02:00
Christos Margiolis
8b4e2ba31d sound: Remove nmix variable from mixer_oss_mixerinfo()
nmix is used to compare against oss_mixerinfo->dev, which is a
user-supplied value to select the mixer device (if not -1, in which case
we'll select the default one) we want to fetch the information of. It is
also used to set oss_mixerinfo->dev in case it is -1.

However, nmix is at best redundant, since we have the loop counter
already (i), and confusing at worst.

For example, suppose a system with 3 mixer devices. We call
SNDCTL_MIXERINFO with oss_mixerinfo->dev=1, meaning we want to get
information for /dev/mixer1. Suppose /dev/mixer0 detaches while inside
the loop, so we'll hit the loop's "continue" case, and nmix won't get
incremented (i.e will stay 0 for now). At this point nmix counts 1
device less, so when it reaches 1, we'll be fetching /dev/mixer2's
information instead of /dev/mixer1's.

This is also true in case the mixer device disappears prior to the call
to mixer_oss_mixerinfo().

Simply remove nmix and use the loop counter to both set
oss_mixerinfo->dev and check against it in case a non -1 value is
supplied.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45135

(cherry picked from commit 2f31a5eb75f1e47b5c49f574e8ce48d2c863e9d3)
2024-05-17 21:30:36 +02:00
Christos Margiolis
71b9b8d34b arm: Remove stray references to dev/sound/chip.h
Fixes:		923e0040a59a ("sound: Move chip.h contents to pcm/sound.h")
Reported by:	Jenkins CI
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week

(cherry picked from commit a3513995f549e2e649b89a1fecbfb351d9825bac)
2024-05-17 21:30:36 +02:00
Christos Margiolis
00f9d84ee2 sound: Update pcm/vchan.c LICENSE header
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week

(cherry picked from commit 2b14465faa8dd9d228b764359672b38b4c8ca8c1)
2024-05-17 21:30:35 +02:00
Christos Margiolis
17a50abe0e sound: Remove unused "num" argument from chn_init() and related callers
It is always -1 (i.e unused).

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45095

(cherry picked from commit 3af2beb8b24ba21fb7e7fbd165a79b8eeff37712)
2024-05-17 21:30:35 +02:00
Christos Margiolis
99e372420d sound: Rename pcm_getparentchannel() to vchan_getparentchannel()
Follow the rest of the vchan.c naming convention.

No functional change intended.

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

(cherry picked from commit 77ab4263bc42a5dcc102bbea39ce4f7f46b8d4f8)
2024-05-17 21:30:35 +02:00
Christos Margiolis
ab7c01f9e8 sound: Move vchan-related code to pcm/vchan.*
pcm/sound.* contains code that should be part of pcm/vchan.*.

Changes:
- pcm_setvchans() -> vchan_setnew()
- pcm_setmaxautovchans() -> vchan_setmaxauto()
- hw.snd.maxautovchans moved to pcm/vchan.c
- snd_maxautovchans declaration moved to pcm/vchan.h and definition to
  pcm/vchan.c

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D45015

(cherry picked from commit 7ad5f383fcb507482d5606c8eb7a324b3621a9db)
2024-05-17 21:30:35 +02:00
Christos Margiolis
00b0cbf98b sound: Use nitems() where possible
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D45014

(cherry picked from commit c597c557923288eff527594619a692a44ade909a)
2024-05-17 21:30:35 +02:00
Christos Margiolis
6f6cc93241 sound: Remove unused dsp_cdevs[] fields and devices
These fields and devices are unused as of e8c0d15a64fa ("sound: Get rid
of snd_clone and use DEVFS_CDEVPRIV(9)").

While here, remove unused SND_DEV_* defines from pcm/sound.h and convert
the list to an enum.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D45013

(cherry picked from commit 72cbd381075a2eb22a070505334d1ce92ec2d7ad)
2024-05-17 21:30:35 +02:00
Christos Margiolis
e14f7d11cb sound: Move chip.h contents to pcm/sound.h
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D44997

(cherry picked from commit 923e0040a59af8ac2271d3e673fef1c641d0cce7)
2024-05-17 21:30:35 +02:00
Christos Margiolis
d1eaefde3b sound: Remove hw.snd.version and SND_DRV_VERSION
hw.snd.version and SND_DRV_VERSION define the sound driver version and
are meant to be used in bug reports, but because these values are
constant, there is not much useful information we can extract from them.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch, emaste
Differential Revision:	https://reviews.freebsd.org/D44996

(cherry picked from commit 7398d1ece5cfa2e6ce4997234a95115b49c9e818)
2024-05-17 21:30:35 +02:00
Christos Margiolis
2c53a4bbcb sound: Convert pcm_chn_add() to void
It always returns 0.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D44998

(cherry picked from commit 139bcec852cf2786ca839ca0bddbb2b78a23d6fa)
2024-05-17 21:30:34 +02:00
Christos Margiolis
e6e7bf7087 sound: Add __assert_unreachable() to default cases in pcm_chn_add() and pcm_chn_remove()
We should normally never enter these cases.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D44994

(cherry picked from commit 76f95bae092b7353ff82b7a0056ca5801bb98f76)
2024-05-17 21:30:34 +02:00
Christos Margiolis
13ee4d7f33 sound: Merge pcm_chn_create() and chn_init()
Follow-up of b3ea087c05d8c75978a302cbb3fa92ce1afa3e49 ("sound: Merge
pcm_chn_destroy() and chn_kill()")

While here, add device_printf()'s to all failure points. Also fix an
existing bug where we'd unlock an already unlocked channel, in case we
went to "out" (now "out2") before locking the channel.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D44993

(cherry picked from commit 2e9962ef57044b191431fe9228841e1415574d82)
2024-05-17 21:30:34 +02:00
Christos Margiolis
0baaaf8543 sound: Remove chn_timeout check from chn_init()
This check is not related to channel initializion, but is also
unnecessary, since sysctl_hw_snd_timeout() takes care of checking if
chn_timeout is within bounds.

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

(cherry picked from commit 7cc1afc5589000ac6ad7a908b07fad3401367bd1)
2024-05-17 21:30:34 +02:00
Christos Margiolis
930b5a3c07 sound: Move pcm_chnref() and pcm_chnrelease() to pcm/channel.c
Improve code layering. These are channel functions, and so they do not
belong in pcm/sound.c.

While here, assert in chn_ref() that new refcount won't be negative.

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

(cherry picked from commit a24050e2b784e13561da3ab731a1db92f2e3366c)
2024-05-17 21:30:34 +02:00
Christos Margiolis
532b1efd2d sound: Merge pcm_chn_destroy() and chn_kill()
pcm_chn_destroy() acts like a wrapper around chn_kill(), and
additionally calls a few more functions that should in fact be part of
chn_kill()'s logic. Merge pcm_chn_destroy()'s functionality in
chn_kill() to improve readability, as well as code layering.

While here, convert chn_kill() to void as it currently always returns 0.

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

(cherry picked from commit b3ea087c05d8c75978a302cbb3fa92ce1afa3e49)
2024-05-17 21:30:34 +02:00
Christos Margiolis
ad677fb457 sound: Retire unit.*
The unit.* code is largely obsolete and imposes limits that are no
longer needed nowadays.

- Capping the maximum allowed soundcards in a given machine. By default,
  the limit is 512 (snd_max_u() in unit.c), and the maximum possible is
  2048 (SND_UNIT_UMAX in unit.h). It can also be tuned through the
  hw.snd.maxunit loader(8) tunable. Even though these limits are large
  enough that they should never cause problems, there is no need for
  this limit to exist in the first place.
- Capping the available device/channel types. By default, this is 32
  (snd_max_d() in unit.c). However, these types are pre-defined in
  pcm/sound.h (see SND_DEV_*), so the cap is unnecessary when we know
  that their number is constant.
- Capping the number of channels per-device. By default, the limit 1024
  (snd_max_c() in unit.c). This is probably the most problematic of the
  limits mentioned, because this limit can never be reached, as the
  maximum is hard-capped at either hw.snd.maxautovchans (16 by default),
  or SND_MAXHWCHAN and SND_MAXVCHANS.

These limtits are encoded in masks (see SND_U_MASK, SND_D_MASK,
SND_C_MASK in unit.h) and are used to construct a bitfield of the form
[dsp_unit, type, channel_unit] in snd_mkunit() which is assigned to
pcm_channel->unit.

This patch gets rid of everything unit.*-related and makes a slightly
different use of the "unit" field to only contain the channel unit
number. The channel type is stored in a new pcm_channel->type field, and
the DSP unit number need not be stored at all, since we can fetch it
from device_get_unit(pcm_channel->dev). This change has the effect that
we no longer need to impose caps on the number of soundcards,
device/channel types and per-device channels. As a result the code is
noticeably simplified and more readable.

Apart from the fact that the hw.snd.maxunit loader(8) tunable is also
retired as a side-effect of this patch, sound(4)'s behavior remains the
same.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D44912

(cherry picked from commit 25723d66369fe6786e9e4f5f77381b944755f267)
2024-05-17 21:30:25 +02:00
Christos Margiolis
41dee63555 sound: Remove obsolete DV_F_* flags
The ISA sound drivers that used them are retired.

Last reference of DV_F_DRQ_MASK and DV_F_DUAL_DMA:
716924cb48 ("Retire snd_sbc ISA sound card
driver")

Last reference of DV_F_DEV_MASK and DV_F_DEV_SHIFT:
5126e5eeeb ("Retire snd_mss ISA sound card
driver")

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D44858

(cherry picked from commit 1b82d425ec0ac155765bcdf706040534309e9c94)
2024-05-17 21:30:01 +02:00
Christos Margiolis
9815728172 sound: Simplify unit fetching in dsp_oss_audioinfo()
"i" keeps the value of the current unit, so we do not have to call
PCMUNIT() and device_get_unit() to fetch it.

In the mixer case, I think it is more correct to do it like this, since
mixer and DSP device units have a 1-1 relationship (i.e the mixer unit
is always the same as the corresponding DSP device one) and that way we
can make it more clear.

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

(cherry picked from commit a44c45c7f597d67d37e09396b0778a2847a30981)
2024-05-17 21:30:01 +02:00
Christos Margiolis
decc224ab8 sound: Remove PCMMINOR()
It's a NO-OP.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D44854

(cherry picked from commit 8b97dce6973ca1b6c3407c34c76d459f43ca1061)
2024-05-17 21:30:01 +02:00
Christos Margiolis
d27972ec91 sound: Get rid of snddev_info->devcount
snddev_info->devcount keeps track of the total number of channels for a
given device. However, it is redundant to have it, since it is only used
in sound_oss_sysinfo() to populate the "numaudios" field, and we also
keep track of the channel counts in the playcount, pvchancount, reccount
and rvchancount fields anyway. We can simply sum those fields together
instead of updating a separate variable upon every channel
addition/deletion.

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

(cherry picked from commit 4d2be7be3837d66ba242a0a7fd51632c3f89285d)
2024-05-17 21:30:01 +02:00
Christos Margiolis
69707d9f50 sound: Call device_get_name() and device_get_unit() only once in mixer_init()
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D44840

(cherry picked from commit 41ab202ff74ea6af7e9125c9dfb430c729380f41)
2024-05-17 21:30:01 +02:00
Christos Margiolis
8771127d75 sound: Be more verbose with virtual channel descriptions
Non-virtual channel description denote "play" or "record", so do the
same for virtual ones as well.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D44839

(cherry picked from commit d0032e6a9e6596302bf129d7f68a627a02c6cd0a)
2024-05-17 21:30:01 +02:00
Zhenlei Huang
1652c9e29f boottrace: Use NULL for SYSINIT's last arg, which is a pointer type
MFC after:	3 days

(cherry picked from commit d9f1f0a901831ff960380fe82a2abe99a3721f87)
2024-05-17 12:06:50 +08:00
Kristof Provost
e73147fc7c pf: always mark states as unlinked before detaching them
Users have reported crashes in pf_test_state_udp() where at least one state key
is NULL.

That suggests that pf_detach_state() ran concurrently with pf_test_state_udp().
pf_test_state_udp() holds the state lock (aka the id lock), but
pf_detach_state() does not.
The intent is that detached states are not returned by STATE_LOOKUP/
pf_find_state(), as the state's timeout is set to PFTM_UNLINKED and thus
pf_find_state() does not find the state.

There are other paths to pf_detach_state() (outside of pf_unlink_state())
though, where we did not set the timeout to PFTM_UNLINKED. Fix those, and assert
that the timeout is set correctly when we enter pf_detach_state().

MFC after:	1 week
See also:	https://redmine.pfsense.org/issues/15413
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D45101

(cherry picked from commit 301ec2cebb6a3e472af39eb7b98c3b7ff88e04b0)
2024-05-16 09:41:02 +02:00
Kirk McKusick
7465f9fc06 Enable soft updates by default for UFS2 filesystems.
Differential Revision: https://reviews.freebsd.org/D45201

(cherry picked from commit 61dece6d27fb2436928ca93d65667b358e05aa7b)
2024-05-15 23:55:44 -07:00
Gordon Bergling
3e5219458f ipfw: Fix a typo in a source code comment
- s/defaul/default/

(cherry picked from commit 78e4dbc34559f7b18ea85cafd6663db4e6d54af9)
2024-05-16 07:59:09 +02:00
Ed Maste
18119e711f Increase IOAPIC_MAX_ID to 255 (from 254)
A test system provided by AMD panicked with "madt_parse_apics:
I/O APIC ID 255 too high".  I/O APIC ID 255 is acceptable, so increase
the limit.

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

(cherry picked from commit 4e3286818327453efd8e4c133928ba26a169567a)
2024-05-15 13:21:14 -04:00
Dag-Erling Smørgrav
db5aefb1ca adduser: Additional variable fixes.
One function used `_input` without making it local, causing its value to
leak into other functions.  This broke the `-f` case.  Fix that instance
and initialize all local variables that weren't already initialized.

Fixes:		170d0882903e
MFC after:	3 days
Reviewed by:	karels
Differential Revision:	https://reviews.freebsd.org/D45204

(cherry picked from commit 46a619c6d4cfc662069950baca16ec2a3b18b8a5)
2024-05-15 15:59:30 +00:00