opnsense-src/cddl
Mark Johnston 9a30c8d347 libdtrace: Fix an off-by-one in CPU ID handling
The illumos-specific _SC_CPUID_MAX is the largest CPU ID in the system.  This
was mapped to _SC_NPROCESSORS_CONF, which is the total number of CPUs recognized
by the kernel.  If CPU IDs are contiguous, as is the case on amd64 and arm64,
this value is one greater than the maximum ID.   As a result, when consuming
per-CPU dtrace buffers, libdtrace tries to fetch from a non-existent CPU.  This
is mostly harmless in practice, but still wrong.

As we don't have a sysconf value for the maximum CPU ID, add a wrapper which
fetches it using the kern.smp.maxid sysctl.

MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D49243
2025-03-09 23:00:59 -04:00
..
compat/opensolaris Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
contrib/opensolaris libdtrace: Fix an off-by-one in CPU ID handling 2025-03-09 23:00:59 -04:00
lib zfs: merge openzfs/zfs@6a2f7b384 2025-02-20 17:40:55 +01:00
sbin zfs: merge openzfs/zfs@b10992582 2024-09-09 18:13:02 +02:00
share zfs: merge openzfs/zfs@b10992582 2024-10-11 08:43:49 +02:00
tests Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
usr.bin zstream: avoid absolute symlink 2024-10-26 08:53:16 -04:00
usr.libexec Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
usr.sbin dtrace tests: Fix the ATF config variable name 2025-01-23 19:09:56 +00:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.inc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00