1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00
Commit Graph

295003 Commits

Author SHA1 Message Date
Enji Cooper
ba23ab2168 Update the expat version referenced in libbsdxml.3
This change updates the version of expat referenced from 2.6.0 to 2.6.3,
correcting documentation post-ffd294a1f4c23863c3e515d16dce31d5509bcb01.

Bump .Dd for the change.

MFC with:	ffd294a1f4
Differential Revision:	https://reviews.freebsd.org/D46865
2024-10-18 17:44:42 -07:00
Jessica Clarke
9684658e35 libc/csu: Unify INIT_RELOCS across architectures
Some architectures don't need any arguments, whilst others need auxargs,
which they get by passing in env thanks to INIT_RELOCS referencing the
local variable in __libc_start1(_gcrt) by name. This is unnecessarily
confusing, fragile (one has to look at INIT_IRELOCS's definition to see
that it uses env) and duplicates code between architectures.

Instead, implement it more like rtld-elf. Each architecture provides an
ifunc_init that takes the auxargs directly, and those that don't need it
can just ignore it.

Reviewed by:	kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D47188
2024-10-19 00:48:52 +01:00
Gleb Smirnoff
b8007cfdb7 mididump: fix gcc build 2024-10-18 14:38:04 -07:00
Kyle Evans
8306900075 cross-build: fix missing <sys/md4.h> the proper way
Add it to tools/build/Makefile with a short note of where it's needed,
rather than hamfistedly copying it into the tools/build hierarchy.

Reported by:	jrtc27
Reviewed by:	jrtc27
Fixes:	aad507854e ("Fix the cross-build after recent commits")
Differential Revision:	https://reviews.freebsd.org/D46854
2024-10-18 15:53:15 -05:00
Jessica Clarke
0bdf2535d4 tools/build/cross-build: Don't include sys/uio.h from linux limits.h
This creates a circular dependency for OpenZFS's libspl in sys/uio.h,
and it shouldn't be needed since the system limits.h already defines
IOV_MAX, so delete it, and unconditionally assert that to be the case.
Otherwise the re-include of libspl's sys/uio.h tries to use PAGESIZE
before it has been defined by OpenZFS's own sys/param.h.

Fixes:		7a7741af18 ("zfs: merge openzfs/zfs@b10992582")
MFC after:	1 week
2024-10-18 21:39:37 +01:00
Gleb Smirnoff
b75e32a466 ipmi: fix powerpc build
Fixes:	366d6a424e
2024-10-18 13:30:44 -07:00
Ka Ho Ng
599c4399e9 libkldelf: use warnx instead of printf
Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46893
2024-10-18 20:21:44 +00:00
Ka Ho Ng
43628a31e3 libkldelf: add elf_lookup_symbol function
The elf_lookup_symbol function looks up the symbol with a given symbol
name. A pointer to the GElf_Sym of the symbol is returned if the symbol
exists in the opened ELF file.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46764
2024-10-18 20:21:44 +00:00
Ka Ho Ng
968bcca262 libkldelf: add a private library for kernel/kld-related ELF parsing
The libkldelf library was originally a part of kldxref(8). It exposed
ELF parsing helpers specialized in parsing KLDs and the kernel
executable. The library can be used to read metadata such as linker_set,
mod_depend, mod_version and PNP match info, and raw data from the ELF.

To promote the reuse of the facilities the ELF parsing code is separated
from kldxref(8) into a new private library.

For now, libkldelf's source files will be compiled into kldxref(8)
directly if kldxref is built during bootstrapping phase. The reason is
linking kldxref(8) against the libkldelf static library has an unwanted
side effect which renders the linker sets inside the libkldelf
implementation empty if the static library is not build by ld -r all the
.o files into a single .o before producing the static library.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Suggested by:	jrtc27, markj
Differential Revision:	https://reviews.freebsd.org/D46719
2024-10-18 20:20:13 +00:00
Gleb Smirnoff
366d6a424e ipmi: remove timeout from the ipmi_driver_request method
Driver requests are done with stack allocated request.  The request is
put on the tailq and then we msleep(9) until kernel process processes it.
If we timeout from this sleep, the kernel process may still read the
request from our stack, which may already be reused by some other code.

Make this sleep unbound and rely on the kernel process that does all its
I/O with timouts and will eventually wake us up.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D47179
2024-10-18 12:30:09 -07:00
Konstantin Belousov
3b2cf9381e amd64: do not pass -z rodynamic to ld.bfd when building vdso
Apparently newer versions of binutils complain instead of silently
ignoring the unknown -z option.

Reported by:	bz
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D47176
2024-10-18 21:48:56 +03:00
Jessica Clarke
d41a40f484 depend-cleanup.sh: Clean up after riscv static binary IFUNC addition
reloc.c is conditionally included by libc_start1.c so existing builds
don't feature it in the .depend file and won't know they need to rebuild
libc_start1.c.

MFC after:	1 week
2024-10-18 19:15:30 +01:00
Jessica Clarke
1363acbf25 libc/csu: Support IFUNCs on riscv
When adding support to rtld-elf I neglected the fact that static
binaries can have IFUNCs. Add support for this too.

Fixes:		729d2b16b7 ("rtld-elf: Support IFUNCs on riscv")
MFC after:	1 week
2024-10-18 19:14:58 +01:00
Gleb Smirnoff
994a82a019 tcp: garbage collect unused macros
Fixes:	d40c0d47cd
2024-10-18 10:35:38 -07:00
Igor Ostapenko
8829d4cb09 pf tests: Lower chances of false positives for mbuf:inet6_in_mbuf_len
Reviewed by:	kp
Approved by:	kp (mentor)
Differential Revision:	https://reviews.freebsd.org/D47175
2024-10-18 16:24:11 +00:00
Cy Schubert
0c2af19e78 unbound: Remove testcode and testdata
The testcode and testdata directories are not used by FreeBSD.
Remove them.

MFC after:	1 week
2024-10-18 07:14:41 -07:00
Cy Schubert
46d2f61818 unbound: Vendor import 1.22.0
Release notes at
	https://nlnetlabs.nl/news/2024/Oct/17/unbound-1.22.0-released/

MFC after:	1 week

Merge commit '0a6d797cf6eb751d7eb613900cd19803e05d905f' into main
2024-10-18 07:14:21 -07:00
Cy Schubert
0a6d797cf6 unbound: Vendor import 1.20.0
Release notes at
	https://nlnetlabs.nl/news/2024/Oct/17/unbound-1.22.0-released/
2024-10-18 06:52:55 -07:00
Jessica Clarke
7aa6667623 lib/clang: Commit cleaned-up workaround for building on RISC-V
There is a long-standing issue on RISC-V around --gc-sections when
statically linking, which affects the bootstrap build of LLVM. Since
fixing this properly has remained a TODO for years, commit the
workaround with documentation so that building natively from source
works out of the box.

PR:		258358
MFC after:	1 week
2024-10-18 13:59:48 +01:00
Keith White
167bfde705 ftime.3: fix typo in spelling of libutil
PR:	282171
MFC after:	3 days
2024-10-18 15:50:24 +03:00
Christos Margiolis
f57efe95cc mididump(1): Initial revision
A new utility which dumps MIDI 1.0 events in real-time.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46418
2024-10-18 10:42:12 +02:00
Christos Margiolis
9ad2891558 vmm.4: Add ppt device detach example
Showcase how to detach ppt from a PCI device and attach a host driver,
and vice-versa.

MFC after:	2 days
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46811
2024-10-18 10:42:05 +02:00
Christos Margiolis
6f96ef84b3 onyx: Remove unreachable if condition
Both conditions are the same, so the second one is unreachable.

PR:		229550
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	andreast, markj
Differential Revision:	https://reviews.freebsd.org/D47167
2024-10-18 10:41:55 +02:00
Jani Salonen
d643e82356 snd_hda: Identify NVIDIA GM204
PR:		228615
MFC after:	2 days
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D47166
2024-10-18 10:41:44 +02:00
Christos Margiolis
de009cf68b snd_hda: Remove duplicate HDA_INTEL_CMLK* entries
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D47152
2024-10-18 10:41:36 +02:00
Christos Margiolis
0ff0a8234f sound: Improve /dev/sndstat channel info readability
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, zlei
Differential Revision:	https://reviews.freebsd.org/D46857
2024-10-18 10:41:23 +02:00
Christos Margiolis
aaf84d0e96 sound: Do not check for NULL if sbuf is allocated with SBUF_AUTOEXTEND
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D46846
2024-10-18 10:41:16 +02:00
Christos Margiolis
5e33eca8e8 sound: Use M_WAITOK where possible
These malloc(9) calls are in contexts where sleeping is permitted.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, zlei, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D46845
2024-10-18 10:41:05 +02:00
Christos Margiolis
3cc01caa26 sound: Do not cast return value of malloc(9)
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, zlei, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D46844
2024-10-18 10:40:57 +02:00
Christos Margiolis
c30f531ddb sound: Shorten channel names
The current channel naming convention is:
pcmX:[virtual_]play|record:dspX.[v]p|rY

- pcmX and dspX share the same unit numbers
- "[v]p|r" gives us the same information as "[virtual_]play|record"

Remove the redundant information, so that the channel names become more
readable: dspX.[virtual_]play|record.Y

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46836
2024-10-18 10:40:50 +02:00
Christos Margiolis
9263f854e9 sound: Simplify channel creation and deletion process
Currently we create and destroy channels with the following consistent
pattern:

- chn_init() -> pcm_chn_add()
- pcm_chn_remove() -> chn_kill()

Instead of calling two separate functions, merge pcm_chn_add() with
chn_init(), and pcm_chn_remove() with chn_kill().

Another benefit of this change is that we avoid the confusion caused by
having pcm_chn_add(), as well as pcm_addchan().

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D46835
2024-10-18 10:40:41 +02:00
Christos Margiolis
f3092614bc sound: Remove useless newspd check in sysctl_dev_pcm_vchanrate()
feeder_rate_min functions as the lower boundary.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D46834
2024-10-18 10:40:33 +02:00
Christos Margiolis
3cab66d12d sound: Simplify vchan_create() error paths
Instead of checking the value of "ret" multiple times, just set a goto
label and jump there immediately in case of an error.

While here, remove a redundant assignment to "d".

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D46833
2024-10-18 10:40:23 +02:00
Christos Margiolis
248aced26e sound: Retire SND_MAXHWCHAN
No longer used.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46522
2024-10-18 10:40:16 +02:00
Christos Margiolis
e42c826782 snd_dummy: Drain callout during detach
If we do not enter dummy_chan_trigger() before detaching, we'll get a
use-after-free since the callout(9) callback might be called after
having been detached.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D46715
2024-10-18 10:40:08 +02:00
Christos Margiolis
97570db05c sound: Move root feeder initialization to separate function
feeder_register() is currently a SYSINIT in order to create the root
feeder, which happens only when feedercnt is 0. Separating the root
feeder registration makes the code more readable.

No functional change intended.

While here, fix some style errors.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, zlei, markj
Differential Revision:	https://reviews.freebsd.org/D46821
2024-10-18 10:39:58 +02:00
Christos Margiolis
0a0301deb5 sound: Move global variable initialization to sound_modevent()
There is no reason to initialize global variables in feeder_register(),
as these variables are unrelated to what the function does. Instead,
initialize them during sound(4) load.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	zlei
Differential Revision:	https://reviews.freebsd.org/D46749
2024-10-18 10:39:46 +02:00
Christos Margiolis
41ff417761 sound: Fix indendation in sound_modevent() switch statement
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D46856
2024-10-18 10:39:15 +02:00
Christos Margiolis
ad4c8671bd sound: Use unr(9) to produce unique channel unit numbers
Currently it is possible to assign a unit number that already exists.
Suppose the following channel list:

[vp2]

If we create 3 channels, we'll end up with the following list:

[vp0, vp1, vp2, vp2]

This happens because chn_init() does not check if the unit number we are
assigning already exists. While fixing this is trivial when the channel
list is sorted in ascending order, it is way more involved when sorted
in descending order. Even though sorting the list in descending order
would require deliberately modifying pcm_chn_add(), and is most likely
not going to happen, make the mechanism more robust by using a unr(9)
allocator for each channel type.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46680
2024-10-18 10:39:08 +02:00
Christos Margiolis
142aca25b0 sound: Sort channels by unit number as well
Refactor CHN_INSERT_SORT() to also take into account the unit number of
each channel, while still prioritizing the type, to make the channel
list easier to work with.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46549
2024-10-18 10:39:00 +02:00
Christos Margiolis
b973a14d35 sound: Simplify pcm_chnalloc() and fix infinite loop bug
Simplify logic to execute the following algorithm:

1. Search for a free (i.e not busy) channel and return successfully.
2. If no channel was found, either return an ENOTSUP if no VCHAN can be
   created (disabled or we reached the limit), or create one more VCHAN
   and scan for it again.
3. If the second scan failed again, return EBUSY.

This patch also solves a bug where we'd end up in an infinite loop,
calling vchan_setnew() with the same `newcnt` value indefinitely, after
the following scenario:

1. Plug device.
2. Spawn X channels.
3. Kill all channels except _last_ opened.
4. Clean up all unused VCHANs.
5. Spawn X+1 channels.
6. Infinite loop in pcm_chnalloc().

I am not exactly sure which part of pcm_chnalloc() caused this bug, but
the patch fixes it at least...

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46548
2024-10-18 10:38:50 +02:00
Christos Margiolis
de8ee33338 sound: Get rid of pnum and max variables in chn_init()
The VCHAN count is checked in vchan_setnew(), and there is no reason to
cap the hardware channels in the first place.

This is part of a series of follow-up patches.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46521
2024-10-18 10:38:41 +02:00
Christos Margiolis
998de46c51 sound: Remove KASSERT from vchan_setnew()
This check is not really useful, and can in fact break things, if
sysctl_dev_pcm_vchans() calls vchan_setnew() with a value that will not
satisfy the KASSERT condition.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, emaste
Differential Revision:	https://reviews.freebsd.org/D46545
2024-10-18 10:38:31 +02:00
Alexander Ziaee
fa573868f1 wpi.4: move hardware to HARDWARE + minor cleanup
Add devices supported by this driver to a HARDWARE section
for generation in the Hardware Compatibility Notes.

While here:
- describe more consistently with product doc and rest of manual
- consolidate basics in first paragraph of description
- mention boot time configuration
- cross-ref networking(7) quick start guide
- zap deprecated Tn, macro in list width, and "Dq Li" => "Ql"
- markup some unmarked elements
- add SPDX tag

MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D47170
2024-10-17 19:48:16 +00:00
Alexander Ziaee
545dbf9d5f iwn.4: move hardware to HARDWARE + minor cleanup
Add devices supported by this driver to a HARDWARE section
for inclusion in the release Hardware Compatibility Notes.
While here:
- add SPDX tag
- add networking(7) cross-ref quick start guide
- tweak examples for consistency

MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D47168
2024-10-17 19:48:16 +00:00
Warner Losh
f11c79fc00 Revert "modules: Add missing opt_*.h files for stand-alone compile"
This reverts commit 1a37caeb07.

I'd overlooked 06c07e1203 when I updated a
branch I'd previously committed but not updated. My search for this in
my tree before the commit was to a stale file...

Sponsored by:		Netflix
2024-10-17 12:52:32 -06:00
Navdeep Parhar
f48fb131c2 cxgbe/t4_tom: Change stid allocation strategy to be more IPv6 friendly.
A hardware IPv6 server needs 2 consecutive stids (server tids) starting
from a 2-aligned stid whereas an IPv4 server needs only 1 stid without
any constraint.  The allocator used to grab the first free stid(s) for
both but this can fragment the stid space leaving nothing suitable for
IPv6 even when lots of stids are available.  Change the allocator to
prefer stids for IPv4 from the ones that cannot be used for IPv6.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D47042
2024-10-17 10:40:38 -07:00
Bjoern A. Zeeb
96190b4fef LinuxKPI based WiFi drivers: scripts to extract fwget(8) and port details
Add a "zzz_fw_ports_fwget.sh" script to each LinuxKPI based wireless
driver which in essential are all the same and in detail all different.
The scripts have been referenced in fwget(8) sources since d33f5a0afa
but were never committed.

The scripts do the full job compared to `single-line-scripts` I tried to
use before to ease maintainance life.  Some use hacks like calling cpp
and extracting bits from the output to piece them together over multiple
files.  It will be left as an exercise for the future to see if what was
done (a longer while ago) for iwlwifi(4) would be a good idea for some
other drivers too, to have a FreeBSD-specific sysctl to export some of
the accumulated data in an easily processable way.
The scripts are written in the "perl spirit" -- "to get the job done" --
and not to be nice or neat or efficient.  For that we do not need them
often enough or in any critical path.  People are welcome to improve
them if they feel like.
I've used them for two version updates now and even if ports enforce
some other (manual) editing to keep support for multiple branches for
now they worked extremly well.

For the most the scripts extract 2 parts: PCI IDs and firmware name;
then they add "flavor"s to both and put the information together.

That output is then separated into:
- fwget(8) lines of PCI ID to port/package
  wifi-firmware-${name}-kmod-${flavor} mappings and
- distfiles per flavor for the ports.
- For iwlwififw(4) we also generate the tables for the man page
  (and the wiki) and hopefully the .Sh HARDWARE section for iwlwifi.4
  soon too.

Depending on driver various other checks are done, e.g.,
- does the PCI ID have one or more firmware files/flavors associated,
- does the referenced firmware exist in the linux-firmware.git repo,
- are there duplicates,
- find the latest version of the firmware API.

Sponsored by:	The FreeBSD Foundation
Suggested by:	imp (to have automation in D44918)
MFC after:	3 days
2024-10-17 17:26:28 +00:00
Bjoern A. Zeeb
b4c8f251d6 iwlwifi: FreeBSD specific sysctl export update
Update the sysctl export (also adding a mapping function) to also
print (1) for all lines the "flavor" (device_family) name and (2)
also print lines where we only have the trans cfg and not iwl cfg
as with the flavor we can match PCI IDs to firmware package and so
we can have an increased number of matches.
A side effect is that we can also have fwget(8) PCI ID matches for
firmware (flavors) not yet (publicly) existing.  That will allow
us to add them at a later point while a previous release already
supports the chipsets and knows how to get the firmware for them.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-10-17 17:26:24 +00:00
John Baldwin
d1516ec33e nvmf: Fail pass through commands while a controller is not associated
Previously this just dereferenced NULL qp pointers and panicked.
Instead, use a shared lock on the connection lock to protect access to
the qp pointers and allocate a request.  If the controller is not
associated, fail the request with ECONNABORTED.

Possibly this should be honoring kern.nvmf.fail_on_disconnection and
block waiting for a reconnect request while disconnected if that
tunable is false.

Reported by:	Suhas Lokesha <suhas@chelsio.com>
Sponsored by:	Chelsio Communications
2024-10-17 12:09:27 -04:00