Compare commits

...
13 Commits
Author SHA1 Message Date
Aymeric Wibo 9a4bb77040 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:	758578370f ("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
2026-10-26 16:35:18 +00:00
Rick Richard 509d65fae5 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:		bfb8575469 ("riscv: Construct an identity map in locore.S")
MFC after:	1 week
Signed-off-by:	Rick Richard <[email protected]>
2026-10-26 12:01:39 -03:00
Aymeric Wibo b86f3d6ae8 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
2026-10-26 14:08:52 +00:00
Ed Maste 7ea9ac99e1 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
2026-10-26 09:46:02 -04:00
Ed Maste ce9de516ee 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
2026-10-26 09:34:41 -04:00
Wolfram Schneider 13d222bd83 manpages: Fix unusual Xr order 2026-10-26 10:53:02 +00:00
Wolfram Schneider 029466808f manpages: Fix unusual Xr order 2026-10-26 10:46:28 +00:00
Wolfram Schneider fb4f233466 manpages: Fix unusual Xr order 2026-10-26 10:44:08 +00:00
Wolfram Schneider 2ba2623414 manpages: Fix unusual Xr order 2026-10-26 10:41:28 +00:00
Wolfram Schneider f5b6c8f5c2 manpages: Fix unusual Xr order 2026-10-26 10:35:42 +00:00
Wolfram Schneider 3208a17f96 manpages: Fix unusual Xr order 2026-10-26 10:32:42 +00:00
Wolfram Schneider afe20e82f9 manpages: Fix unusual Xr order 2026-10-26 10:29:10 +00:00
Wolfram Schneider 4560b19ff4 manpages: Fix unusual Xr order 2026-10-26 10:27:43 +00:00
32 changed files with 112 additions and 82 deletions

No files matched your search

+1 -1
View File
@@ -59,8 +59,8 @@ and setting
.Va errno
to the corresponding value.
.Sh SEE ALSO
.Xr errno 3 ,
.Xr err 3 ,
.Xr errno 3 ,
.Xr exterror 9
.Sh STANDARDS
The
+1 -1
View File
@@ -118,8 +118,8 @@ was not compiled with the
.Cd NO_UEXTERR_STRINGS
macro defined.
.Sh SEE ALSO
.Xr errno 3 ,
.Xr err 3 ,
.Xr errno 3 ,
.Xr uexterr_gettext 3 ,
.Xr exterror 9
.Sh HISTORY
+2 -2
View File
@@ -72,9 +72,9 @@ is zero), zero is returned.
.Sh SEE ALSO
.Xr fls 3 ,
.Xr stdbit 3 ,
.Xr stdc_leading_zeros 3 ,
.Xr stdc_first_leading_zero 3 ,
.Xr stdc_first_trailing_one 3
.Xr stdc_first_trailing_one 3 ,
.Xr stdc_leading_zeros 3
.Sh STANDARDS
The
.Nm stdc_first_leading_one_ Ns Em type Ns ()
+2 -2
View File
@@ -71,9 +71,9 @@ If no bits are clear in
is the bitwise complement of zero), zero is returned.
.Sh SEE ALSO
.Xr stdbit 3 ,
.Xr stdc_leading_ones 3 ,
.Xr stdc_first_leading_ones 3 ,
.Xr stdc_first_trailing_zero 3
.Xr stdc_first_trailing_zero 3 ,
.Xr stdc_leading_ones 3
.Sh STANDARDS
The
.Nm stdc_first_leading_zero_ Ns Em type Ns ()
+2 -2
View File
@@ -89,9 +89,9 @@ is zero), one is returned.
.Xr ffsl 3 ,
.Xr ffsll 3 ,
.Xr stdbit 3 ,
.Xr stdc_trailing_zeros 3 ,
.Xr stdc_first_leading_one 3 ,
.Xr stdc_first_trailing_zero 3 ,
.Xr stdc_first_leading_one 3
.Xr stdc_trailing_zeros 3
.Sh STANDARDS
The
.Nm stdc_first_trailing_one_ Ns Em type Ns ()
+2 -2
View File
@@ -72,9 +72,9 @@ is the bitwise complement of zero), zero is returned.
.Sh SEE ALSO
.Xr bit_ffc 3 ,
.Xr stdbit 3 ,
.Xr stdc_trailing_ones 3 ,
.Xr stdc_first_leading_zero 3 ,
.Xr stdc_first_trailing_ones 3 ,
.Xr stdc_first_leading_zero 3
.Xr stdc_trailing_ones 3
.Sh STANDARDS
The
.Nm stdc_first_trailing_zero_ Ns Em type Ns ()
+2 -2
View File
@@ -65,9 +65,9 @@ the total number of bits in the type of
is returned.
.Sh SEE ALSO
.Xr stdbit 3 ,
.Xr stdc_first_leading_zero 3 ,
.Xr stdc_leading_zeros 3 ,
.Xr stdc_trailing_ones 3 ,
.Xr stdc_first_leading_zero 3
.Xr stdc_trailing_ones 3
.Sh STANDARDS
The
.Nm stdc_leading_ones_ Ns Em type Ns ()
+2 -2
View File
@@ -65,9 +65,9 @@ the total number of bits in the type of
is returned.
.Sh SEE ALSO
.Xr stdbit 3 ,
.Xr stdc_first_leading_one 3 ,
.Xr stdc_leading_ones 3 ,
.Xr stdc_trailing_zeros 3 ,
.Xr stdc_first_leading_one 3
.Xr stdc_trailing_zeros 3
.Sh STANDARDS
The
.Nm stdc_leading_zeros_ Ns Em type Ns ()
+2 -2
View File
@@ -65,9 +65,9 @@ the total number of bits in the type of
is returned.
.Sh SEE ALSO
.Xr stdbit 3 ,
.Xr stdc_first_trailing_zero 3 ,
.Xr stdc_leading_ones 3 ,
.Xr stdc_trailing_zeros 3 ,
.Xr stdc_first_trailing_zero 3
.Xr stdc_trailing_zeros 3
.Sh STANDARDS
The
.Nm stdc_trailing_ones_ Ns Em type Ns ()
+2 -2
View File
@@ -66,9 +66,9 @@ is returned.
.Sh SEE ALSO
.Xr ffs 3 ,
.Xr stdbit 3 ,
.Xr stdc_first_trailing_one 3 ,
.Xr stdc_leading_zeros 3 ,
.Xr stdc_trailing_ones 3 ,
.Xr stdc_first_trailing_one 3
.Xr stdc_trailing_ones 3
.Sh STANDARDS
The
.Nm stdc_trailing_zeros_ Ns Em type Ns ()
+6
View File
@@ -392,6 +392,12 @@ conversion:
.It Sy Modifier Ta Cm c Ta Cm s
.It Cm l No (ell) Ta Vt wint_t Ta Vt "wchar_t *"
.El
.Pp
Compiler support for the
.Cm w
fixed-width integer type modifier is limited, and compilers may produce a
warning when used (depending on compiler version and language standard
settings).
.It
A character that specifies the type of conversion to be applied.
.El
+5 -5
View File
@@ -83,12 +83,12 @@ hints are used for performance and security benefits.
That behaviour conforms to the practice recommended for each function in the
C standard.
.Sh SEE ALSO
.Xr free 3 ,
.Xr malloc 3 ,
.Xr calloc 3 ,
.Xr realloc 3 ,
.Xr aligned_alloc 3 ,
.Xr jemalloc 3
.Xr calloc 3 ,
.Xr free 3 ,
.Xr jemalloc 3 ,
.Xr malloc 3 ,
.Xr realloc 3
.Sh STANDARDS
The
.Fn free_sized
+2 -2
View File
@@ -258,7 +258,6 @@ Full memory dumps have to be explicitly enabled by setting the
.Xr sysctl 8
to 0.
.Sh SEE ALSO
.Xr dumpon 8 ,
.Xr close 2 ,
.Xr open 2 ,
.Xr kvm 3 ,
@@ -271,7 +270,8 @@ to 0.
.Xr kvm_read 3 ,
.Xr kvm_write 3 ,
.Xr kmem 4 ,
.Xr mem 4
.Xr mem 4 ,
.Xr dumpon 8
.Sh BUGS
There should not be three open calls.
The ill-defined error semantics
+1 -1
View File
@@ -488,13 +488,13 @@ The socket type is not supported by the protocol.
.Xr send 2 ,
.Xr sendmsg 2 ,
.Xr sendto 2 ,
.Xr signal 3 ,
.Xr shutdown 2 ,
.Xr socketpair 2 ,
.Xr write 2 ,
.Xr CMSG_DATA 3 ,
.Xr getprotoent 3 ,
.Xr netgraph 3 ,
.Xr signal 3 ,
.Xr divert 4 ,
.Xr genetlink 4 ,
.Xr icmp 4 ,
+2 -2
View File
@@ -63,10 +63,10 @@ If
.Fn acospi x
raise an invalid exception and returns an \*(Na.
.Sh SEE ALSO
.Xr acos 3 ,
.Xr asinpi 3 ,
.Xr atanpi 3 ,
.Xr acos 3 ,
.Xr cospi 3 ,
.Xr cospi 3
.Sh STANDARDS
The
.Fn acospi ,
+2 -2
View File
@@ -64,9 +64,9 @@ If
raises an invalid exception and returns an \*(Na.
.Sh SEE ALSO
.Xr acospi 3 ,
.Xr atanpi 3 ,
.Xr asin 3 ,
.Xr sinpi 3 ,
.Xr atanpi 3 ,
.Xr sinpi 3
.Sh STANDARDS
The
.Fn asinpi ,
+1 -1
View File
@@ -55,8 +55,8 @@ and
functions return 0 if they succeed, and non-zero otherwise;
however, the present implementation always succeeds.
.Sh SEE ALSO
.Xr fenv 3 ,
.Xr fegetround 3 ,
.Xr fenv 3 ,
.Xr fesetround 3
.Sh STANDARDS
The
+1 -1
View File
@@ -61,8 +61,8 @@ The
function returns 0 on success and non-zero otherwise;
however, the present implementation always succeeds.
.Sh SEE ALSO
.Xr fenv 3 ,
.Xr fegetmode 3 ,
.Xr fenv 3 ,
.Xr fesetmode 3 ,
.Xr fpgetround 3 ,
.Xr fpsetround 3
+1 -1
View File
@@ -84,8 +84,8 @@ is an \*(Na, then the result is an \*(Na.
These routines do not raise any floating-point exceptions.
.Sh SEE ALSO
.Xr fmax 3 ,
.Xr fmaximum_num 3 ,
.Xr fmaximum_mag 3 ,
.Xr fmaximum_num 3 ,
.Xr math 3
.Sh STANDARDS
The
+2 -2
View File
@@ -77,5 +77,5 @@ There are no errors reported by the functions.
.Sh SEE ALSO
.Xr sigfastblock 2 ,
.Xr sigprocmask 2 ,
.Xr pthread_sigmask 3 ,
.Xr pthread_np 3
.Xr pthread_np 3 ,
.Xr pthread_sigmask 3
+14 -14
View File
@@ -88,24 +88,24 @@ based on the type of
.Fa value
is provided.
.Sh SEE ALSO
.Xr arch 7 ,
.Xr bitstring 3 ,
.Xr ffs 3 ,
.Xr fls 3 ,
.Xr stdc_count_leading_zeros 3 ,
.Xr stdc_count_leading_ones 3 ,
.Xr stdc_count_trailing_zeros 3 ,
.Xr stdc_count_trailing_ones 3 ,
.Xr stdc_first_leading_zero 3 ,
.Xr stdc_first_leading_one 3 ,
.Xr stdc_first_trailing_zero 3 ,
.Xr stdc_first_trailing_one 3 ,
.Xr stdc_count_zeros 3 ,
.Xr stdc_count_ones 3 ,
.Xr stdc_has_single_bit 3 ,
.Xr stdc_bit_width 3 ,
.Xr stdc_bit_ceil 3 ,
.Xr stdc_bit_floor 3 ,
.Xr stdc_bit_ceil 3
.Xr stdc_bit_width 3 ,
.Xr stdc_count_leading_ones 3 ,
.Xr stdc_count_leading_zeros 3 ,
.Xr stdc_count_ones 3 ,
.Xr stdc_count_trailing_ones 3 ,
.Xr stdc_count_trailing_zeros 3 ,
.Xr stdc_count_zeros 3 ,
.Xr stdc_first_leading_one 3 ,
.Xr stdc_first_leading_zero 3 ,
.Xr stdc_first_trailing_one 3 ,
.Xr stdc_first_trailing_zero 3 ,
.Xr stdc_has_single_bit 3 ,
.Xr arch 7
.Sh STANDARDS
The macros and functions of the
.In stdbit.h
+1 -1
View File
@@ -73,8 +73,8 @@ Check what lookups failed to be handled in a lockless manner:
.Sh SEE ALSO
.Xr dtrace 1 ,
.Xr d 7 ,
.Xr SDT 9 ,
.Xr namei 9 ,
.Xr SDT 9 ,
.Xr VFS 9
.Rs
.%A Brendan Gregg
+1 -1
View File
@@ -222,9 +222,9 @@ man page.
.Xr mac_test 4 ,
.Xr login.conf 5 ,
.Xr maclabel 7 ,
.Xr jail 8 ,
.Xr getfmac 8 ,
.Xr getpmac 8 ,
.Xr jail 8 ,
.Xr setfmac 8 ,
.Xr setpmac 8 ,
.Xr mac 9
+2 -2
View File
@@ -74,8 +74,8 @@ Default is 0.
.El
.Sh SEE ALSO
.Xr uhid 4 ,
.Xr usbhid 4 ,
.Xr usb 4
.Xr usb 4 ,
.Xr usbhid 4
.Sh HISTORY
The
.Nm
+1 -1
View File
@@ -310,12 +310,12 @@ built-in command in
.Xr cd 1 ,
.Xr csh 1 ,
.Xr env 1 ,
.Xr err 3 ,
.Xr ex 1 ,
.Xr login 1 ,
.Xr printenv 1 ,
.Xr sh 1 ,
.Xr execve 2 ,
.Xr err 3 ,
.Xr execle 3 ,
.Xr getbsize 3 ,
.Xr getenv 3 ,
+2 -2
View File
@@ -273,9 +273,9 @@ This is a destructive action
which will prevent updating the base system via
.Xr pkg 8 .
.Sh SEE ALSO
.Xr src.conf 5 ,
.Xr build 7 ,
.Xr pkg 8 ,
.Xr src.conf 5
.Xr pkg 8
.Sh HISTORY
Support for installing the base system as packages was introduced in
.Fx 15.0 .
+2 -2
View File
@@ -241,10 +241,10 @@ They pass
.Vt kexterr
from the failed request back to the thread that create the request.
.Sh SEE ALSO
.Xr errno 3 ,
.Xr err 3 ,
.Xr errno 3 ,
.Xr uexterr 3 ,
.Xr uexterr_gettext 3
.Xr uexterr 3
.Sh HISTORY
The
.Nm
+2 -2
View File
@@ -293,12 +293,12 @@ TAILQ_INSERT_HEAD(&table[hash].head, foo, next);
hashfree(table, &args);
.Ed
.Sh SEE ALSO
.Xr queue 3 ,
.Xr malloc 9 ,
.Xr mutex 9 ,
.Xr rmlock 9 ,
.Xr rwlock 9 ,
.Xr sx 9 ,
.Xr queue 3
.Xr sx 9
.Sh HISTORY
The
.Nm
+1 -1
View File
@@ -184,8 +184,8 @@ pointed to by
.Fa hashtbl
is not empty.
.Sh SEE ALSO
.Xr hashalloc 9 ,
.Xr LIST_HEAD 3 ,
.Xr hashalloc 9 ,
.Xr malloc 9
.Sh BUGS
There is no
+13 -6
View File
@@ -320,6 +320,7 @@ amdsmu_resume_check(device_t dev, enum power_stype stype)
struct amdsmu_metrics *m = &sc->metrics;
bool any_blocking = false;
const struct amdsmu_diagnostics *d;
devclass_t dc;
if (stype != POWER_STYPE_SUSPEND_TO_IDLE)
return;
@@ -338,7 +339,11 @@ amdsmu_resume_check(device_t dev, enum power_stype stype)
"failed to enter S0i3 during last suspend; "
"battery drain will be excessive\n");
if (sc->product->amdsmu_deviceid != PCI_DEVICEID_AMD_PHOENIX_ROOT) {
switch (sc->product->amdsmu_deviceid) {
case PCI_DEVICEID_AMD_PHOENIX_ROOT:
case PCI_DEVICEID_AMD_KRACKAN_POINT_ROOT:
break;
default:
device_printf(dev, "only limited diagnostic information "
"available for %x:%x; check dev.amdsmu.0 sysctl tree\n",
sc->product->amdsmu_vendorid,
@@ -376,11 +381,13 @@ amdsmu_resume_check(device_t dev, enum power_stype stype)
if (d == NULL)
continue;
if (d->expected_module != NULL &&
devclass_find(d->expected_module) == NULL)
device_printf(dev,
" hint: load %s to allow this block to "
"suspend\n", d->expected_module);
if (d->expected_devclass != NULL) {
dc = devclass_find(d->expected_devclass);
if (dc == NULL || devclass_get_count(dc) == 0)
device_printf(dev,
" hint: load %s to allow this block to "
"suspend\n", d->mod_to_load);
}
if (d->extra != NULL)
device_printf(dev, " hint: %s\n", d->extra);
}
+17 -12
View File
@@ -123,23 +123,28 @@ static const struct amdsmu_product {
static const struct amdsmu_diagnostics {
const char *blocking_ip_block;
bool ignore;
const char *expected_module;
const char *expected_devclass;
/* mod_to_load must not be NULL if expected_devclass is not NULL. */
const char *mod_to_load;
const char *extra;
} amdsmu_diagnostics[] = {
{ "CPU", false, NULL, "this can happen due to other IP blocks or "
{ "CPU", false, NULL, NULL, "this can happen due to other IP blocks or "
"because the system was on AC power" },
{ "MPM", false, NULL, "this can happen due to other IP blocks or "
"because the system was on AC power" },
{ "GFX", false, "amdgpu", NULL },
{ "DISPLAY", false, "amdgpu", NULL },
{ "MPM", false, NULL, NULL, "this can happen due to other IP blocks or "
"because the CPU didn't properly idle" },
{ "GFX", false, "drmn", "amdgpu", NULL },
{ "DISPLAY", false, "drmn", "amdgpu", NULL },
/*
* On Phoenix, these seem to report USB4, not USB3 as their names would
* suggest.
* On Phoenix and Krackan Point, these seem to report USB4, not USB3 as
* their names would suggest.
*/
{ "USB3_0", false, "tb", "see thunderbolt(4)" },
{ "USB3_1", false, "tb", "see thunderbolt(4)" },
/* On Phoenix, the SMU seems to report garbage for this IP block. */
{ "USB4_0", true, NULL, NULL },
{ "USB3_0", false, "nhi", "tb", "see thunderbolt(4)" },
{ "USB3_1", false, "nhi", "tb", "see thunderbolt(4)" },
/*
* On Phoenix and Krackan Point, the SMU seems to report garbage for
* this IP block.
*/
{ "USB4_0", true, NULL, NULL, NULL },
};
struct amdsmu_softc {
+15 -3
View File
@@ -127,7 +127,8 @@ _start:
* starting from the first 2MB physical page into which the kernel was
* loaded.
*
* We also use an L1 entry to create a 1GB identity map (1:1 PA->VA).
* We also use L1 entries to create 1GB identity maps (1:1 PA->VA)
* of the regions holding the kernel and the DTB.
* This is useful for two reasons:
* - handling the DTB pointer passed from SBI firmware (physical addr)
* - simpler construction of pagetables in pmap_bootstrap()
@@ -162,6 +163,17 @@ pagetables:
add t0, s1, a5
sd t6, (t0) /* Store new PTE */
/* Identity map the DTB's 1GB region too, if we were given a DTB */
beqz s4, 1f
srli s2, s4, L1_SHIFT /* dtbp >> L1_SHIFT */
andi a5, s2, Ln_ADDR_MASK /* & Ln_ADDR_MASK */
slli s2, s2, PTE_PPN2_S /* (s2 << PTE_PPN2_S) */
or t6, t4, s2
mulw a5, a5, a6 /* calculate L1 slot */
add t0, s1, a5
sd t6, (t0) /* Store new PTE */
1:
/* Construct the virtual address space at KERNBASE */
/* Add L1 entry for kernel */
@@ -189,14 +201,14 @@ pagetables:
add t3, t4, t2
li t0, (PTE_KERN | PTE_X)
or t0, t0, s8 /* t0 |= pte bits */
1:
2:
slli t2, t4, PTE_PPN1_S /* << PTE_PPN1_S */
or t5, t0, t2
sd t5, (s1) /* Store PTE entry to position */
addi s1, s1, PTE_SIZE
addi t4, t4, 1
bltu t4, t3, 1b
bltu t4, t3, 2b
/* Page tables END */