Commit Graph
308692 Commits
Author SHA1 Message Date
Colin Percival f6d2c8591c ena: Adjust ena_[rt]x_cleanup to return bool
The ena_[rt]x_cleanup functions are limited internally to a maximum
number of packets; this ensures that TX doesn't starve RX (or vice
versa) and also attempts to ensure that we get a chance to refill
the RX buffer ring before the device runs out of buffers and starts
dropping packets.

Historically these functions have returned the number of packets which
they processed which ena_cleanup compares to their respective budgets
to decide whether to reinvoke them.  This is unnecessary complication;
since the precise number of packets processed is never used, adjust
the APIs of those functions to return a bool indicating if they want
to be reinvoked (aka if they hit their limits).

Since ena_tx_cleanup now only uses work_done if diagnostics are
enabled (ena_log_io macros to nothing otherwise) eliminate that
variable and pass its value (ENA_TX_BUDGET - budget) to ena_log_io
directly.

No functional change intended; this will simplify a future commit.

Reviewed by:	akiyano
Sponsored by:	Amazon
MFC after:	6 days
Differential Revision:	https://reviews.freebsd.org/D56478
2026-04-24 15:29:57 -07:00
Raphael 'kena' Poss f31e6b198f speaker(4): move static data to text
Make this data const (it doesn't change) which will also move it to
a text section.

Signed-off-by: Raphael Poss <[email protected]>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
2026-04-24 16:04:43 -06:00
Warner Losh 45a12d8a26 Revert "speaker(4): move static data to bss"
This reverts commit 690ef95b33.

The commit message was wrong.
2026-04-24 16:04:14 -06:00
Enji Cooper af864dd4a2 hosts.equiv.5: correct nits to fix mandoc -T lint issues
- Rename `.Nm .rhosts` to `.Nm rhosts` to match the MLINK for the
  manpage.
- Use `.Pa` instead of `.Nm` when discussing the paths for `.rhosts` and
  `hosts.equiv.5` for explicitness and clarity.

Bump .Dd for the change.

MFC after:	1 week
2026-04-24 13:45:14 -07:00
Enji Cooper 573a9e5764 security(7): fix mandoc -T lint complaints
- Add `.Nm` section for securelevel(7) to match corresponding MLINKS entry.
- Fix the spelling for mac(4) (the actual subsystem manpage is spelled out in
  lowercase.

MFC after:	1 week
2026-04-24 13:45:14 -07:00
Enji Cooper 944a4de2d2 Remove cam.d when MK_DTRACE == no
MFC with:	efb77950fd
Fixes:	efb77950fd ("dtrace: Add definitiosn for the cam dtrace provider")
Differential Revision:	https://reviews.freebsd.org/D56588
2026-04-24 13:45:13 -07:00
Bjoern A. Zeeb 93d301d95a Remove -fms-extensions throughout the tree
During a discussion about using -fms-extensions jhb pointed out that
we have them enabled in the kernel for gcc by default (even multiple
times in one part). I had missed all that and clang still failed on
my use case (needing another option).

The original cause for enabling them for our tree back then was that
we needed to support C11 anonymous struct/unions.
Our in-tree gcc 4.2.1, despite later patches, needed the
-fms-extensions to support these even though this was not the expected
use case for that option ( cc4a90c445 enabled it globally for the
kernel).
clang at that time (or at least when it became default for 10.0)
already was fine (with C11).

Any later gcc (4.6.0 onwards) did not need that option anymore, even
when compiled for -std=iso9899:1990 (which does not support anonymous
structs/unions) unless one would add -pedantic (see gcc git 4bdd0a60b27a).
This is also the reason why userland cddl sources now compile with the
option removed despite CSTD=c99.

The only driver which needed the option recently was ccp, but that was
fixed in 8d3f41dbcb by jhb.

So cleanup all uses cases of -fms-extensions for the moment as they are
no longer needed given all compilers currently supported seem to be
fine without them and gcc-4.2.1 was removed from the tree in stable/13
in 2020 (a9854bc381).

Reported by:	jhb (all this but possibly the world CDDL parts)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste (earlier), imp, jhb, glebius
Differential Revision: https://reviews.freebsd.org/D55072
2026-04-24 20:36:15 +00:00
Andrew Gallatin 5923b363ca net: Fix collision between SIOCGI2CPB and IPSECGREQID
It turns out interface ioctls are defined not just in sockio.h, but are
spread among many files.  When I added SIOCGI2CPB at the bottom of the
file, the next number (160) collided with an ioctl (IPSECGREQID) that
I was unaware of in another file.  Fix this by moving to a number that
is unclaimed.

Fixes: cf1f215728 (net: Add SIOCGI2CPB ioctl & add page/bank fields to ifi2creq)
Reported by: dhw
Reviewed by: imp
2026-04-24 16:30:24 -04:00
Dag-Erling Smørgrav 76f642310d tzcode: Update to 2026b
MFC after:	1 week
2026-04-24 22:07:20 +02:00
Dag-Erling Smørgrav b17ccc1f45 Import tzcode 2026b 2026-04-24 21:54:03 +02:00
Warner Losh b40205855e nda: Filter non-storage nvme drives
Non-stroage drives have namespaces, but no storage attached. These
drives have a different interface type than storage drives, so ignore
them for the nvme_sim, which just handles storage.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D56461
2026-04-24 12:32:49 -06:00
Scott Long cb78764d47 cam: kern.cam.max_high_power tuneable / sysctl
Create a tunable for the maxinum number of 'high power' commands to
schedule, kern.cam.max_high_power.  Default remains at 4.

Differential Revision:	https://reviews.freebsd.org/D56462
2026-04-24 12:32:46 -06:00
Warner Losh 334adacbc1 cam: Document kern.cam.max_high_power.
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D56463
2026-04-24 12:32:42 -06:00
Warner Losh 3454d97aae cam: Set ccb_h.status on XPT_GDEVLIST early-return paths
XPT_GDEVLIST in xpt_action_default has two early-return paths (list
changed and index not found) that set cgdl->status but not ccb_h.status.
Since xpt_action sets ccb_h.status to CAM_REQ_INPROG before dispatching,
and XPT_GDEVLIST is an non-queued CCB, cam_periph_ccbwait skips the
sleep loop and immediately hits the KASSERT checking that status !=
CAM_REQ_INPROG, causing a panic.

Set ccb_h.status = CAM_REQ_CMP at the top of the code rather than the
bottom. Any future error paths will be right (since this command can't
fail at the command level, just in the status of the data level).

PR:			293899
Assisted-By:		Claude Opus 4.6 (1M context)
Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D56487
2026-04-24 12:32:24 -06:00
Warner Losh e1cff85499 pass(4): Allowlist CCB func_codes to harden passthrough ioctls
The pass(4) driver's CAMIOCOMMAND and CAMIOQUEUE ioctls accept arbitrary
CCBs from userland.  This device requires root to open, and thus send
these commands. Previously, the only func_code filter was a blocklist
check against the XPT_FC_XPT_ONLY flag.  This missed several dangerous
func_codes that lack that flag:

 - XPT_ABORT: the abort_ccb field is a raw kernel pointer from the
   user CCB payload.  xpt_action_default() dereferences it without
   validation, leading to kernel crashes or worse.

 - XPT_SASYNC_CB: the callback and callback_arg fields come directly
   from the user CCB payload and get registered as a kernel async
   callback, allowing arbitrary kernel code execution.

 - Target mode CCBs (XPT_EN_LUN, XPT_TARGET_IO, etc.) fall through
   directly to the SIM with user-controlled payloads.

Replace the XPT_FC_XPT_ONLY blocklist with an explicit allowlist of CCB
function codes that are known to be safe for userland to submit: I/O
operations (SCSI, ATA, NVMe, SMP, MMC), device queries, transport
settings, and a handful of safe control operations (NOOP, REL_SIMQ,
RESET_DEV, DEBUG). Normally, the /dev/pass* permissions only allow root
to access them, so this is only a safety issue by default.

Also reject CAM_DATA_PADDR and CAM_DATA_SG_PADDR, since these pass
user-supplied physical addresses directly to DMA with no validation,
which on systems without an IOMMU allows arbitrary host memory access.
Add `options PASS_UNSAFE_PADDR` to allow the old behavior.

Verified that camdd, camcontrol, smartmontools, and cdrtools use only
func_codes on the allowlist (XPT_SCSI_IO, XPT_ATA_IO, XPT_NVME_IO,
XPT_NVME_ADMIN, XPT_PATH_INQ, XPT_GDEV_TYPE, XPT_GET_TRAN_SETTINGS,
XPT_SET_TRAN_SETTINGS, XPT_RESET_DEV, XPT_DEBUG) and none use
CAM_DATA_PADDR.

PR:			293888, 293890
Assisted-By:		Claude Opus 4.6 (1M context)
Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D56486
2026-04-24 12:31:55 -06:00
Raphael 'kena' Poss d76523a318 speaker(4): enable concurrent opens from different threads
Prior to this patch, a thread would get EBUSY on open(2) if another
thread had the speaker open.

With this patch, two or more threads/processes can use the speaker
device at the same time. When two or more threads write to the speaker
concurrently, individual melodies--single strings, as written by
write(2) or ioctl(2) with command SPKRTONE/SPKRTUNE--are played
atomically.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
2026-04-24 10:23:07 -06:00
Raphael 'kena' Poss 690ef95b33 speaker(4): move static data to bss
Signed-off-by: Raphael Poss <[email protected]>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
2026-04-24 10:23:06 -06:00
Raphael 'kena' Poss e2199dc33f speaker(4): one ioctl / write at a time
If two processes are holding a spkr fd, we want orderly access to the
allocated tone buffer and the speaker itself.

Signed-off-by: Raphael Poss <[email protected]>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
2026-04-24 10:23:06 -06:00
Raphael 'kena' Poss a80ec2b51a speaker(4): make spkropen thread-safe
Signed-off-by: Raphael Poss <[email protected]>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
2026-04-24 10:23:06 -06:00
Raphael Poss 43b7cf42d4 speaker(4): drop NEEDGIANT
When the frequency configuration logic was moved to clock.c in 2008, a
mutex lock was added there (timer_spkr_setfreq) to serialize accesses
to the I/O register.

Since then, no more calls to disable/enable_intr were needed in spkr.c
than they were needed in the other callers to the same timer_spkr
functions in syscons / kern_cons, that is, not at all. This is because
there are no other accesses remaining in the kernel to the i8254
timers after boot than through clock.c.

For context, see commits
e465985885
and
93f5134aaf.

Signed-off-by: Raphael Poss <[email protected]>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
2026-04-24 10:23:06 -06:00
Raphael Poss 03a515e989 speaker(4): Update outdated comments
The comments in tone() were referring to pre-2000 logic that does not
exist any more. This patch updates them.

Signed-off-by: Raphael Poss <[email protected]>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
2026-04-24 10:23:06 -06:00
Ali Mashtizadeh 70ae0c4524 i386: Remove perfmon performance monitoring facility
Remove the perfmon performance monitoring facility that was for Intel
Pentium and Pentium Pro processors.

Reviewed by: imp,mhorne,emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/2155
2026-04-24 10:23:05 -06:00
Ali Mashtizadeh 576c6e9620 pmc: Implement the feature bits for recent Zen 4/5
Ensure that the optional MSRs and the user flags are guarded by the
cpuid feature flags.  This prevents the user from triggering undefined
behavior or crashes on AMD processors where some of these features are
not present.  As part of this, I added the branch target and DATA4 MSRs
to the IBS op state as those are only present on a subset of the Zen
chips that I have tested.

Reviewed by:	mhorne
Sponsored by:	Netflix
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2133
2026-04-24 12:33:42 -03:00
Vladimir Kondratyev 87ed6840a0 rtlbtfw(8): Load firmware from filesystem with mmap()
rather than with read() to alleviate concerns about partial reads.
2026-04-24 18:15:22 +03:00
Lexi Winter bb75b0d581 packages: Convert world to a subdir build
Instead of driving the world package build from Makefile.inc1,
use a subdir build where each package has a subdirectory under
packages/ using the new <bsd.pkg.mk>.

Convert some metadata that was previously in the UCL files (e.g.
sets and dependencies) to Makefile variables.

Build the packages under objdir (not repodir), and use the new
stagepackages target to copy them to repodir when creating the
repository.

Determine an explicit list of packages to build in packages/Makefile
based on enabled src.conf options, and add logic to abort the build
if we attempt to build an empty package.  This inverts the previous
logic in Makefile.inc1 which would simply skip empty packages.

There are a few advantages to doing it this way:

* The package build works more like the rest of the build system,
  so it's more accessible to developers.

* We can customise the packages we build based on src.conf options,
  e.g. skipping a package entirely, or adjusting its dependencies
  based on what it actually requires.

* We have a specific list of packages that we want to build, and an
  unexpectedly missing package results in a build error, instead of
  silently producing a broken repository.

* It's possible to build (and in the future, install) an individual
  package without having to rebuild the entire repository.

This doesn't apply to the dtb, kernel-* or src-* packages; those
have their own build systems in Makefile.inc1 and will be converted
later.

MFC after:	4 weeks (stable/15 only)
Reviewed by:	jlduran, sjg, brooks
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D56087
2026-04-24 15:10:01 +01:00
Mark Johnston 75c6621840 tests/posixshm: Check for hardware support in largepage_pkru
MFC after:	3 days
Fixes:		ca87c0b8e3 ("pkru: Fix handling of 1GB largepage mappings")
2026-04-24 13:23:03 +00:00
Mark Johnston e0751ae801 ip_mroute: Avoid leaking uninitialized bytes to the routing daemon
Reported by:	KMSAN
MFC after:	1 week
2026-04-24 13:22:51 +00:00
Johan Söllvander eb837cb8b2 ctld: normalize iSCSI TargetName on login
Case-insensitive TargetName matching on logins was accidentally removed,
let's fix that by normalizing TargetName again according to RFC 3722.

PR: 			294522
Fixes: 			4b1aac9314
Sponsored by: 		ConnectWise
MFC after: 		1 week
Reviewed by:		asomers, jhb
Approved by:		asomers (mentor)
Differential Revision:	https://reviews.freebsd.org/D56469
2026-04-24 09:44:43 +02:00
Justin Hibbits 74dff31069 pseries/llan: call init when ioctl sets interface UP
This should fix dhcp on an unitialized interface.  This solution was
found while comparing against another driver, SIOCSIFFLAGS is used by
dhclient to force the interface up before it has an IP address.
However, all setup work is done in llan_init(), so the interface would
not be enabled if configured via only the SIOCSIFFLAGS ioctl.  By
running llan_init() when the interface is forced up via SIOCSIFFLAGS,
the interface is initialized properly.

PR:		292164
2026-04-23 22:24:13 -04:00
Greg Lehey 32b0dfb326 Explain relationship between file storage size and EOF. 2026-04-24 12:14:20 +10:00
Pierre Pronchery c875afcbcd packages: Register pkgconf
This should fix the creation of the new packages introduced by the
import of pkgconf into the base system.

Fixes:		b8352da33f ("pkgconf: import into the base system")
PR:		294724
Reviewed by:	ivy, ngie
Approved by:	ngie
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D56589
2026-04-24 03:13:50 +02:00
Kyle Evans b675ff8eed mac_seeotheruids: allow specificgid to be a list of groups
The specificgid functionality has historically allowed only a single
group to be exempt, but in practice one might want a few services to
be exempt for reasons.  From a security perspective, we probably don't
want to encourage unrelated users to be grouped together solely for
this purpose, as that creates one point of shared access that could be
used for nefarious purposes.

Normalize the group list as we do cr_groups to allow for linear matching
rather than quadratic, we just need to account for the differences in
FreeBSD 15.0+ where cr_groups is entirely supplementary groups vs.
earlier versions, where cr_groups[0] is the egid and the rest is
sorted.

Reviewed by:	csjp, des (earlier version)
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D56592
2026-04-23 16:13:11 -05:00
Christian S.J. Peron a46205a100 Fix memory corruption bugs in BSM record parsing
fetch_newgroups_tok(3): clamp group count to AUDIT_MAX_GROUPS before the
loop to prevent a stack buffer overflow when a crafted record specifies
more than 16 groups.

fetch_execarg_tok(3), fetch_execenv_tok(3): add a bounds check at the
top of the string-walking loop to prevent an out-of-bounds read when the
previous string's nul byte is the last byte of the record buffer.

fetch_sock_unix_tok(3): clamp the memchr search length to the number of
bytes remaining in the buffer to prevent an out-of-bounds read on short
tokens. Also clamp slen to sizeof(path) to prevent a one-byte overflow
when no nul byte is found within the path data.

fetch_socket_tok: fix copy-paste error where the remote address was
written into l_addr instead of r_addr.
Previously reported by: @haginara

Define AU_UNIX_PATH_MAX as 108 (the largest sun_path across all
supported platforms) and use it in au_socketunix_t instead of the
hardcoded 104.

Update fetch_sock_unix_tok to derive its search bound from
sizeof(tok->tt.sockunix.path) so cross-platform records from Solaris and
Linux with paths up to 108 bytes parse correctly without truncation.

REF: https://github.com/openbsm/openbsm/pull/87

Reviewed by:	kevans, markj
Differential Revision:	https://reviews.freebsd.org/D56510
2026-04-23 15:26:50 -05:00
R. Christian McDonald 4578c15ab9 pf: Document broadcast/multicast forwarding through route-to
pf_route() and pf_route6() forward broadcast and multicast traffic
when a route-to rule matches, without any check against the output
interface's broadcast domain. This is a deliberate property of the
route option code path, but it is not documented and the workaround
is non-obvious.

Document the behavior in pf.conf(5) with example block-out rules on
the target interface, scoped with the received-on qualifier so that
only forwarded traffic is dropped while the router's own broadcast
and multicast traffic continues to pass.

Add regression tests covering the full broadcast/multicast and
forwarded/local matrix on both IPv4 and IPv6.

Reviewed by:	glebius, kp
Approved by:	kp (mentor)
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D56559
2026-04-23 15:23:59 -04:00
John Baldwin aad4fec5d7 ctld: Move the pidfile handle out to a global variable
This ensures it will be destroyed (removing the associated pidfile)
anytime the process exits, including from exit(3) calls.  This fixes
a few places that would "leak" the pidfile on certain errors.

This also removes the need for some convoluted logic where
configuration objects would hand-off ownership of the pidfile handle
from the old configuration to the new configuration.

Reviewed by:	asomers
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D56527
2026-04-23 15:17:05 -04:00
John Baldwin 3df5cc33d8 ctld: Ports without a portal group are not dummy ports
The default implementation of is_dummy should return false.  Only
portal group ports should possibly return true.

PR:		293076
Reported by:	Ken J. Thomson <[email protected]>
Fixes:		6acc7afa34 ("ctld: Convert struct port to a hierarchy of C++ classes")
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D56524
2026-04-23 15:16:08 -04:00
Ken J. Thomson 614ef71849 ctld: Don't add an iscsi port for targets with only kernel ports
PR:		293076
Reviewed by:	asomers
Fixes:		969876fcee ("ctld: parse config file independently of getting kernel info")
Differential Revision:	https://reviews.freebsd.org/D56523
2026-04-23 15:15:48 -04:00
Kyle Evans 7982985bdf kern: mac: bump the MAC_VERSION for 16.x
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D55703
2026-04-23 13:47:09 -05:00
Kyle Evans 28b0084af3 kern: mac: sprinkle a bit of const correctness
mpc_name and mpc_fullname are string literals in correct usage, so they
should really be const instead.

mpc_ops aren't typically const, but the framework shouldn't be doing
anything to clobber it; thus, good to constify it as a reminder.

Switch to using a slightly more semantically correct `void **` in the
fastpath bits while we're here, since we only do arithmetic on the outer
layer of pointer and compare the inner to a pointer-typed (NULL).

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D55702
2026-04-23 13:47:09 -05:00
Kyle Evans 0faa88f26c kern: vfs: add MAC checks for mount/unmount/update
The unmount check is straightforward and only really needs the
struct mount and flags used, in case a MAC policy wants to reject
force-unmounts or do special handling for FSID-based unmounts.

The mount check offers as much information as I think might be of
interest to a MAC policy: the vnode to be mounted on, vfsconf, and
applicable mount options.   XNU also has a later version that just takes
a struct mount for everything that VFS_MOUNT() has to offer, but my
draft policy doesn't need any of that.  It also doesn't really need the
unmount check, but it seems reasonable to add it while I'm here.

The update check similarly passes the flags/options for the operation,
along with the struct mount and label.

Reviewed by:	kib, olce
Differential Revision:	https://reviews.freebsd.org/D55601
2026-04-23 13:47:09 -05:00
John Baldwin 68d2339bc6 Bump __FreeBSD_version for changing various kernel APIs to use pointers
Effort:		CHERI upstreaming
Sponsored by:	AFRL, DARPA
2026-04-23 13:05:55 -04:00
John Baldwin 9a6e9d7799 VM_PAGE_TO_DMAP: Wrapper macro to return direct map address for a page
Effort:		CHERI upstreaming
Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2068
2026-04-23 13:05:55 -04:00
John Baldwin 120a5e3e19 DMAP_TO_VM_PAGE: Wrapper macro to map direct map address to a page
Effort:		CHERI upstreaming
Suggested by:	kib
Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2068
2026-04-23 13:05:55 -04:00
John Baldwin bee1aae0b3 ncsw: Allow pmap_kextract to handle direct map addresses
Effort:		CHERI upstreaming
Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2068
2026-04-23 13:05:55 -04:00
John Baldwin 496453e9de amd64/aarch64 pmap: Switch type of pmap_preinit_mapping.va to void *
Effort:		CHERI upstreaming
Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2068
2026-04-23 13:05:55 -04:00
John Baldwin 30af462bd2 kmap_alloc_wait/kmap_free_wakeup: Use void * instead of vm_offset_t
Effort:		CHERI upstreaming
Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2068
2026-04-23 13:05:55 -04:00
John Baldwin fe3e92e686 PHYS_TO_DMAP: Return a void * instead of a vm_offset_t
Add a new PHYS_TO_DMAP_ADDR that still returns an address for use in
places that only need an address and not a pointer.

Effort:		CHERI upstreaming
Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2068
2026-04-23 13:05:54 -04:00
John Baldwin c49cbf849d powerpc aim64: Return vm_paddr_t from moea64_bootstrap_alloc
Consistently use vm_paddr_t for the type returned from
moea64_bootstrap_alloc and avoid temporarily smuggling it via a
pointer.  Instead, be explicit in the places that assume a 1:1
mapping.

Effort:		CHERI upstreaming
Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2068
2026-04-23 13:05:54 -04:00
John Baldwin 2c6d8f15bd sys: Permit passing pointers to VIRT_IN_DMAP and DMAP_TO_PHYS
Add explicit uintptr_t casts to the arguments to these macros so that
the work both with virtual addresses (e.g. vm_offset_t) and pointers.

Drop no-longer-needed casts in various invocations of DMAP_TO_PHYS.

Effort:		CHERI upstreaming
Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2068
2026-04-23 13:05:54 -04:00
John Baldwin ac7d527402 pmap_map: Use void * for the return value instead of vm_offset_t
Effort:		CHERI upstreaming
Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2068
2026-04-23 13:05:54 -04:00