Page MenuHomeFreeBSD

linuxkpi: Add `struct xa_limit` support to xarray
ClosedPublic

Authored by dumbbell on Apr 16 2026, 9:07 PM.
Tags
None
Referenced Files
F167599032: D56445.diff
Sun, Aug 23, 12:33 AM
F167506452: D56445.id.diff
Sat, Aug 22, 9:03 AM
F167494137: D56445.id176866.diff
Sat, Aug 22, 6:37 AM
Unknown Object (File)
Wed, Aug 19, 9:54 PM
Unknown Object (File)
Tue, Aug 18, 3:33 PM
Unknown Object (File)
Tue, Aug 18, 1:28 PM
Unknown Object (File)
Mon, Aug 17, 12:19 PM
Unknown Object (File)
Wed, Aug 12, 11:43 PM
Subscribers

Details

Summary

The xa_alloc*() functions family takes a struct xa_limit to describe the range of IDs the caller wants to allocate. We were using a single mask to qualify a maximum ID only.

This commit changes that to use the same struct xa_limit. The logic did not change, except it now supports a minimum ID as well. The definition of XA_LIMIT() macro is adapted, as well as the definitions of xa_limit_* (only xa_limit_32b existed, the other two are added with this commit).

The DRM generic code started to use this struct xa_limit in Linux 6.12.

This is part of the update of DRM drivers to Linux 6.12.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This will definitively need a recompile. I hope really all callers used the xa_limit_32b macro before and no hard coded numbers. Thankfully we don't support any pre-5.1 drm-kmod so should be fine. I wonder how hps ended up implementing the old KPI there...

I believe its fine but a 2nd pair of eyes wouldn't hurt, especially on __xa_alloc_cyclic.

This revision is now accepted and ready to land.Apr 29 2026, 11:08 PM