Merge commit 4d7292e58078 from llvm-project (by Minsoo Choo):
[libunwind] Unwind through AArch64 FreeBSD signal trampolines (#235065)
Retried from https://reviews.llvm.org/D155066.
Recognize signal trampolines using KERN_PROC_SIGTRAMP when unwind
metadata is unavailable. Restore the interrupted PC, LR, SP, general
registers, and valid floating-point registers.
Add coverage for unwinding out of an interrupted leaf function on both
regular and alternate signal stacks.
Assisted-by: GPT
MFC after: 1 week
Merge commit fd4113508a64 from llvm-project (by Minsoo Choo):
[libunwind] Support extended amd64 segment registers (#229176)
Raise the amd64 DWARF register limit to 59 and add RFLAGS, all six
segment selectors, FS.base, and GS.base to the register model. Capture
the extended state and restore it when resuming, using sigreturn() on
FreeBSD to restore selectors and bases together. Pack the state into the
existing context buffers without changing their public sizes or the
Windows XMM offsets.
Add tests for register access, signal-frame CFI recovery, register
bounds, and resume behavior.
Assisted-by: GPT
MFC after: 1 week
snd_hda: Identify AMD Audio Coprocessor
This makes the driver attach, but the device is still not usable.
Reported by: Lukasz Wencki <lukasz at smail.net.pl>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
powerpc: keep the VSX halves of the FPRs across back-to-back signals
grab_mcontext() only put the second halves of vs0-31 into the context
while the thread owned the VSX unit, but sigreturn(2) gives ownership
up so that the next use reloads the registers lazily. A signal that
arrives right after a sigreturn, like one the handler's mask was
holding back, got a context without them and its own sigreturn then
zeroed them in the PCB.
The halves saved in the PCB are current whenever the FP state is, since
VSX instructions can't run without PCB_VSX and save_fpu() stores them
in that case, so export them together with the FP registers.
Reviewed by: jhibbits
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D60754
(cherry picked from commit 64b2fea9a2f90c2cc6097ed2d69acbfeeb13058d)
(cherry picked from commit 0e9af9fb72884e77de79e37069a162e1563ca86b)
powerpc: keep the VSX halves of the FPRs across back-to-back signals
grab_mcontext() only put the second halves of vs0-31 into the context
while the thread owned the VSX unit, but sigreturn(2) gives ownership
up so that the next use reloads the registers lazily. A signal that
arrives right after a sigreturn, like one the handler's mask was
holding back, got a context without them and its own sigreturn then
zeroed them in the PCB.
The halves saved in the PCB are current whenever the FP state is, since
VSX instructions can't run without PCB_VSX and save_fpu() stores them
in that case, so export them together with the FP registers.
Reviewed by: jhibbits
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D60754
(cherry picked from commit 64b2fea9a2f90c2cc6097ed2d69acbfeeb13058d)
share/mk/bsd.confs.mk: fix trivial typo in message
The error message noting that the file should not be included said
"bsd.conf.mk" before this change. Now it correctly says "bsd.confs.mk".
MFC after: 3 days
smsc: Allow 10BASE-T1L/-T1S media
These are Single-Pair Ethernet types (SPE) from 802.3cg. smsc sets the
link flag only if mii_media_active is one of a known set of media types.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60745
bhyve: add command to list config options
For a software built on top of bhyve(8) and/or managing bhyve(8),
it is very convenient to know what specific features the given binary supports.
Currently, bhyve(8) provides some of this information, and it could be
retrieved by parsing `bhyve -h`, `bhyve -s help`, `bhyve -l help`.
Sometimes it is not enough, for example, the recently added
"oemstrings" feature cannot be fully probed using these commands.
Over time, some workarounds were suggested. Specifically:
- Mapping features to __FreeBSD_version. I see at least two issues with
that:
* __FreeBSD_version does not directly map to bhyve(8) features,
so this is simply not accurate.
* bhyve(8) might be updated separately from the system, which
is not so uncommon, especially for development purposes.
Then such a probing will be inaccurate.
[32 lines not shown]
locate.1: clarify bytes vs. characters
The database stores bytes, not characters. Remove the historical
note about 7-bit storage. Also document that -i ignores case only
for ASCII letters.
Reviewed by: ziaee
MFC after: 3 days
arm64 linux: Allow FUTEX_REQUEUE on arm64 by setting the brand flag
Better change is to provide the dedicated musl brandinfo, as it is done
on amd64/i386, which should be done later.
PR: 299836
MFC after: 1 week
linux: correct errors from mremap(2)
Linux returns EFAULT when the range to be remapped is not mapped at all,
and ENOMEM only when it is mapped but cannot be grown in place. Callers
depend on that distinction: musl's pthread_getattr_np() measures the
main thread stack by growing a one page mapping and retries while errno
is ENOMEM. Returning ENOMEM for every growth request makes that loop
spin forever.
PR: 299835
MFC after: 1 week
wg: fix the LINT-NOIP build
We don't have anything to tunnel without INET or INET6, so just smack
it with the same config(5) hammer that ovpn uses and exclude it from
such builds.
Reported by: mjg
Reviewed by: emaste, markj
(cherry picked from commit 8430de47aa7c004e1330b8f6a3018c360425606e)
loader.efi: devinit() just after parsing args instead
c4640126f1160 ("loader.efi: Apply command-line DHCP overrides earlier")
was really good, but moving it just one statement earlier is even
better. polarian on Libera describes a GELI setup on a system that
doesn't advertise a serial console via ConOut. They don't have serial
input at the point that they would get prompted for the GELI passphrase,
but if we parse args just before devinit() then he can override the
console with `efibootmgr -e`. This gives UEFI one advantage over BIOS
loader, as /boot.config isn't available to provide that kind of override
if your impediment is GELI.
We also considered reading loader.env earlier, but we have a chicken/egg
problem in that we must have probed for the ESP to be able to open() it.
We would instead need a devinit_early() and devinit_late() scheme that
allows GELI probing to be deferred until the later pass, after reading
loader.env to pick up the console override. That's an idea I'd still
like to discuss because it's more robust than hoping that firmware won't
wipe out our efibootmgr(8) entries.
[5 lines not shown]
rc: add a backlight service to save/restore backlight levels
The default on my laptop is annoyingly bright, and this is a useful
feature to mitigate that. The backlight script is largely a copy of the
mixer service which provides the same value for mixers, but this one is
specifically dependant on kld to allow DRM drivers a chance to attach.
Note that it's off by default to avoid interference with DEs, and
document the capability in backlight(8). Set backlight_enable=YES in
rc.conf(5) to enable save/restore.
Relnotes: maybe
Reviewed by: bapt, ivy, manu, ziaee
(cherry picked from commit c45bdb39fe985b43afc63b7cbd989fe7a61673b7)
iuserboot: bump the interface to v6, add an accept_interpreter callback
If an explicit loader wasn't requested, then bhyveload(8) maintains a
/boot handle that it can use for swapping to a different flavor. This
means that we expose all of the host /boot to the sandbox for the
duration of script execution.
Add a callback to ack that we're OK with the interpreter so that
bhyveload(8) can release the bootfd. This is worth doing because it's
prior to guest script execution, so we're still running a reasonably
untainted process.
Reviewed by: imp, jhb
(cherry picked from commit 619d09217720cb82f562b51e98576438dc11c830)
snd_uaudio: recognize hardware sidetone as a monitor
The Logitech H390, for instance, has the following interface layout:
~~
7 INPUT 34 INPUT 10 INPUT
Mic (0x201) Mic (0x201) USB Stream (0x101)
| | |
v v |
19 FEATURE 35 FEATURE |
| | |
v v |
25 EXTENSION +------> 36 MIXER <---+
| |
v v
13 OUTPUT 22 FEATURE
USB Stream (0x101) |
v
16 OUTPUT
[30 lines not shown]
amdsmu: Don't rely on s0i3_last_entry_status metric
This metric seems unreliable and I have observed it occasionally report
1 (successful entry to S0i3) when the time_last_in_s0i3 metric was 0 on
Phoenix, which does not make sense.
So just rely on time_last_in_s0i3 instead.
Sponsored by: The FreeBSD Foundation
openssl: build libcrypto and libssl from upstream's source set
Compared the bmake source lists of libcrypto and libssl with upstream's
own build of 3.5.8 (configured with the options in
crypto/openssl/BSDmakefile), and fix the differences that are not
intentional.
libcrypto:
- aarch64: build bsaes-armv8.S and md5-aarch64.S, and define BSAES_ASM
and MD5_ASM, as upstream does. Both files have been generated into
sys/crypto/openssl/aarch64 since the 3.5.1 import, but were never
compiled.
- Stop compiling der_digests_gen.c, der_dsa_key.c and der_ec_key.c.
Upstream keeps them in libcommon.a, but the linker does not extract
them into libcrypto (checked with --why-extract) as nothing in
libcrypto references them.
libssl:
- Fix the "SRSC" typo that left out ssl3_cbc.c and tls_pad.c.
[17 lines not shown]
openssl: configure with --openssldir=/etc/ssl
BSDmakefile passed --openssldir=etc. A relative openssldir is taken
relative to the prefix, so the generated files described /usr/etc.
FreeBSD has always used /etc/ssl (OPENSSLDIR in
secure/lib/libcrypto/Makefile.common), so configure with that.
Regenerate tools/c_rehash, the only committed generated file that
depends on openssldir. It is not installed. No compiled code changes.
Reviewed by: ngie, markj
Differential Revision: https://reviews.freebsd.org/D60396
(cherry picked from commit cb3d3e5bb0c6bbb1f6ef3efe67e7a6e71bc20f0b)
smsc: Use read-modify-write to configure LEDs
After reset the driver enables three LED outputs by writing 1s to
the appropriate GPIO/LED configuration bits in the LED & GPIO
configuration register LED_GPIO_CFG.
The LED Select (LED_SEL) bit in LED_GPIO_CFG chooses between two LED
modes:
0: Speed, Link+Activity, Full Duplex
1: Speed, Link, Activity
If an EEPROM is present LED_SEL is initialized from bit 1 in the
EEPROM's configuration flags value. If no EEPROM is present this bit
defaults to zero.
Previously we wrote to all bits in the register, clearing LED_SEL. A
device with LED_SEL set by the EEPROM would thus not have correct LEDs.
[6 lines not shown]
smsc: Support external PHY
SMSC_HW_CFG_PSEL indicates that an external PHY is present. Skip the
internal PHY initialization when set and store the ID of the detected
PHY.
Reviewed by: br
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60744