amdsmu: Use devclass name instead of module name
The diagnostics array contained expected modules to be loaded but the
checking logic checked for if a devclass of that name existed instead.
Have the diagnostics array contain the devclass instead as well as the
module to load for the hint string.
Furthermore, check tha the number of devices is greater than 0 so that
leftover devclasses from unloaded modules don't skip the hint.
Reported by: emaste
Reviewed by: emaste
Fixes: 758578370f6b ("amdsmu: Hints on what to do if IP block blocking S0i3")
Sponsored by: The FreeBSD Foundation
Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/70
riscv: Map the DTB when it is outside the kernel's 1GB region
When the kernel is started directly by SBI firmware, locore.S maps only
the 1GB region that contains the kernel, and initriscv() reads the DTB
through that mapping at the physical address passed in a1. If the
firmware put the DTB in another 1GB region, as QEMU does with more than
1GB of RAM, fake_preload_metadata() faults before the console is up and
the kernel hangs.
Also map the 1GB region that contains the DTB.
This fixes direct kernel booting without FreeBSD loader(8).
PR: 299088
Reviewed by: mhorne
Fixes: bfb857546984 ("riscv: Construct an identity map in locore.S")
MFC after: 1 week
Signed-off-by: Rick Richard <rick at sloservers.com>
amdsmu: Update diagnostics comments for Krackan Point
Krackan Point has the same quirks as the Phoenix SMU it would seem.
Reported by: emaste
Sponsored by: The FreeBSD Foundation
libc: Add a man page caveat about the `w` modifier
In-tree Clang is unaware of the N2680 fixed-width modifier `w` and emits
a warning when used.
PR: 299631
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D60939
amdsmu: Print detailed stats for KRACKAN_POINT
Testing on a Dell AMD Ryzen AI 5 PRO 435 laptop shows that the same
diagnostic information is valid.
Reviewed by: obiwac
Sponsored by: The FreeBSD Foundation
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
(cherry picked from commit a03b051f238eb78cfccbe834b0cc206e66d566e5)
find.1: rewrite the -s flag section for clarity
Restructure the description of -s flag:
1. what the option does
2. why it is useful (deterministic order, streaming output)
3. how its results can differ from `find | sort'
Reviewed by: ziaee
MFC after: 3 days
(cherry picked from commit ad0f86694157c998fec500e9a553550976cbc100)
find.1: fix rendering of find -s example
The period here is part of the literal string in the example. Adding a
space caused the example to be quoted wrongly. Instead, a trailing
zero-width space keeps the linter mandoc -T happy.
Reviewed by: ziaee
Differential Revision: https://reviews.freebsd.org/D59353
(cherry picked from commit 3581b6db62b1a2146014b3196f18bde3fc33010d)
linux: Implement PTRACE_GETREGSET NT_PRFPREG and NT_X86_XSTATE
Implement NT_PRFPREG and NT_X86_XSTATE for PTRACE_GETREGSET on amd64.
Chrome's crashpad handler uses these to collect floating-point and
extended CPU register state for crash dumps.
Other architectures retain the previous EINVAL stub behavior.
Signed-off-by: Ricardo Branco <rbranco at suse.de>
PR: 289285
Reviewed by: kib
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2165
(cherry picked from commit c515e6040614434a9262ee8b5ac54b81476ec7ff)
linux: Add linux_pt_fpregset and bsd_to_linux_fpregset() for amd64
Add struct linux_pt_fpregset, the amd64 Linux NT_PRFPREG payload,
corresponding to user_i387_struct in Linux. The struct describes
the 512-byte FXSAVE area as exposed by PTRACE_GETREGSET.
Add bsd_to_linux_fpregset() to translate from FreeBSD's struct fpreg
to struct linux_pt_fpregset. Fields are extracted from the fpr_env[]
array which stores the FXSAVE environment packed as four 64-bit words.
The FP and XMM register banks are bulk-copied as opaque byte arrays.
Signed-off-by: Ricardo Branco <rbranco at suse.de>
Reviewed by: kib
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2165
(cherry picked from commit b84d31ee74535a0026ff83f2a34c07b7557f9785)
linux: Ignore sigaction(2) flags SA_UNSUPPORTED and SA_EXPOSE_TAGBITS
SA_UNSUPPORTED was introduced in Linux 5.11 to probe support
for other flags such as SA_EXPOSE_TAGBITS, introduced
at the same time. Ignore both.
Signed-off-by: Ricardo Branco <rbranco at suse.de>
PR: 289285
Reviewed by: pouria, kib
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2163
(cherry picked from commit fdea83a5f63b881ade91c6cc9dfbf173137512c5)
amd64/arm64 pmap: consistently clear PGA_WRITEABLE
We don't consistently clear PGA_WRITEABLE on fictitious, managed pages.
Some functions do, e.g., pmap_remove_all(), but several do not. At
worst, this is just a pessimization, but there is no good reason to be
inconsistent. Clear PGA_WRITEABLE in those that previously did not by
introducing (and using) the helper function pmap_page_is_mapped_locked()
that implements the correct test.
(cherry picked from commit 37321270b630d891e48851f81dd6d077ebd6b635)
rtld: fix leak in get_program_var_addr() on the error path
Fixes: 1e370f038778 ("rtld: stop using unbound alloca()")
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
dl_iterate_phdr(3): do not return garbage for objects not using TLS
For objects without a TLS segment, tlsindex is zero. tls_get_addr_slow()
then reads dtv_slots[-1], which is dtv_size, and returns it as the TLS
address. Set dlpi_tls_data to NULL for such objects instead.
Fixes: d36d68161517 ("rtld dl_iterate_phdr(): dlpi_tls_data is wrong")
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
rtld: some cosmetics in donelist_init()
Add a missing word in the comment.
Make each assignment a separate statement.
Fix formatting.
Fixes: 1e370f038778 ("rtld: stop using unbound alloca()")
Sponsored by: The FreeBSD Foundation
MFC after: 1 week