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
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
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
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
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
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
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
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
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
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
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
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
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
No functional change intended.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D47152
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
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
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
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
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
No longer used.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D46522
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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