<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/compat/linuxkpi/common/include/linux, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2026-05-06T19:51:46Z</updated>
<entry>
<title>sys/cdefs.h: Introduce __maybe_unused attribute</title>
<updated>2026-05-06T19:51:46Z</updated>
<author>
<name>Hans Rosenfeld</name>
<email>rosenfeld@grumpf.hope-2000.org</email>
</author>
<published>2026-04-16T18:22:44Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=84a95741805d84f0074a34d61b93ccf86f422cf3'/>
<id>urn:sha1:84a95741805d84f0074a34d61b93ccf86f422cf3</id>
<content type='text'>
The __maybe_unused attribute should be used for variables which may or
may not be used, such as when their only use is in an assertion. This
attribute is functionally identical to __unused, suppressing compiler
warnings for particular variable if it remains unused.

Reviewed by:	Minsoo Choo &lt;minsoo@minsoo.io&gt;, imp
Differential Revision:	https://reviews.freebsd.org/D56517
</content>
</entry>
<entry>
<title>linuxkpi: Implement `module_*()` APIs as static functions</title>
<updated>2026-05-04T19:13:43Z</updated>
<author>
<name>Jean-Sébastien Pédron</name>
<email>dumbbell@FreeBSD.org</email>
</author>
<published>2026-05-04T07:45:38Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=658bb99db9c7872f92ccb86ed2674c72636436d2'/>
<id>urn:sha1:658bb99db9c7872f92ccb86ed2674c72636436d2</id>
<content type='text'>
This fixes an "unused variable" warning when building DRM drivers.

Reviewed by:	emaste
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56780
</content>
</entry>
<entry>
<title>sx: Add `sx_has_waiters()` macro</title>
<updated>2026-04-30T11:40:05Z</updated>
<author>
<name>Jean-Sébastien Pédron</name>
<email>dumbbell@FreeBSD.org</email>
</author>
<published>2026-04-12T17:20:25Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=eebb643bb3799ae90dd248f0b5047ec481b26f68'/>
<id>urn:sha1:eebb643bb3799ae90dd248f0b5047ec481b26f68</id>
<content type='text'>
This macro will return non-zero if there are threads waiting for this
lock; otherwise, it will return zero.

The function assumes (but does not assert) that the caller already holds
the lock and that it is interested in other threads waiting for it to
release the lock.

The motivation to add this is the implementation of
`rwsem_is_contended()` in linuxkpi.

This Linux function indicates the same thing to the caller: if other
threads are waiting for this semaphore.

The amdgpu DRM driver started to use `rwsem_is_contended()` in Linux
6.12.

Reviewed by:	bz, olce
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56443
</content>
</entry>
<entry>
<title>linuxkpi: Add `copy_from_user_inatomic_nontemporal()` function</title>
<updated>2026-04-30T07:05:02Z</updated>
<author>
<name>Jean-Sébastien Pédron</name>
<email>dumbbell@FreeBSD.org</email>
</author>
<published>2026-04-29T22:14:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=713b4ce8ef46d7df4ffe50ab6733bb128dbe3cbd'/>
<id>urn:sha1:713b4ce8ef46d7df4ffe50ab6733bb128dbe3cbd</id>
<content type='text'>
In Linux 7.1, `__copy_from_user_inatomic_nocache()` was renamed to
`copy_from_user_inatomic_nontemporal()`. This change was backported to
several LTS branches.

This includes Linux 6.12.x and the i915 DRM driver started to use it in
that version.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56719
</content>
</entry>
<entry>
<title>linuxkpi: Define `DEFINE_XARRAY*()` macros</title>
<updated>2026-04-30T07:05:02Z</updated>
<author>
<name>Jean-Sébastien Pédron</name>
<email>dumbbell@FreeBSD.org</email>
</author>
<published>2026-04-13T21:44:16Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=796fff59a5d32bc3be14feaeb228fc15ef43eb32'/>
<id>urn:sha1:796fff59a5d32bc3be14feaeb228fc15ef43eb32</id>
<content type='text'>
The `DEFINE_XARRAY*()` macros are used to declare a static xarray.

As the structure embeds a mutex(9), we also need to declare the static
mutex after the `struct xarray`. Thus the slightly awkward definition
of `DEFINE_XARRAY_FLAGS()`.

The DRM generic code started to use `DEFINE_XARRAY_ALLOC()` in Linux
6.12.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56446
</content>
</entry>
<entry>
<title>linuxkpi: Add `struct xa_limit` support to xarray</title>
<updated>2026-04-30T07:05:01Z</updated>
<author>
<name>Jean-Sébastien Pédron</name>
<email>dumbbell@FreeBSD.org</email>
</author>
<published>2026-04-13T21:39:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=783d018cf954f99032a0a4f655af8916024598a8'/>
<id>urn:sha1:783d018cf954f99032a0a4f655af8916024598a8</id>
<content type='text'>
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.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56445
</content>
</entry>
<entry>
<title>PHYS_TO_DMAP: Return a void * instead of a vm_offset_t</title>
<updated>2026-04-23T17:05:54Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2026-04-23T17:05:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fe3e92e6868dce2ed94c98428b8df1f27ed3ef63'/>
<id>urn:sha1:fe3e92e6868dce2ed94c98428b8df1f27ed3ef63</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>sf_buf_kva: Return a pointer instead of a vm_offset_t</title>
<updated>2026-04-23T17:05:54Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2026-04-23T17:05:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=573e6313bc3b3d7d8da4531fbfaa2763dbe209a7'/>
<id>urn:sha1:573e6313bc3b3d7d8da4531fbfaa2763dbe209a7</id>
<content type='text'>
This removes the need for several casts to pointer in callers.

Effort:		CHERI upstreaming
Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2068
</content>
</entry>
<entry>
<title>pmap_change_attr: Use void * instead of vm_offset_t</title>
<updated>2026-04-23T17:05:53Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2026-04-23T17:05:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=dfb804eb57f1e50f5c84060007e3b1e9c1edf253'/>
<id>urn:sha1:dfb804eb57f1e50f5c84060007e3b1e9c1edf253</id>
<content type='text'>
Effort:		CHERI upstreaming
Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2068
</content>
</entry>
<entry>
<title>LinuxKPI: Update seq_file to properly implement the iterator interface</title>
<updated>2026-04-23T15:46:54Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2026-04-23T15:46:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f4418cf954c299fa0934f110d6f5e9d50f2d24c5'/>
<id>urn:sha1:f4418cf954c299fa0934f110d6f5e9d50f2d24c5</id>
<content type='text'>
The seq_file.rst documentation in the Linux kernel documents the
iterator interface for the seq_file structure.  In particular, the
ppos passed to seq_read is a logical offset into a seq_file managed by
the iterator interface, not an offset into the generated data.  For
example, if a seq_file outputs state for each node in a linked-list or
array, *ppos might be used as the index of the node to output, not a
byte offset.

Rewrite seq_read to honor this contract which fixes a few bugs:

- Treat *ppos as a logical iterator offset that is only updated by the
  next callback after outputting a single item via the show method.

- Use a loop to permit outputting descriptions of multiple items if
  the user buffer is large enough.

- Always invoke the stop method after terminating the loop to cleanup
  any state setup by start (e.g. if start allocated a buffer or
  obtained a lock, the stop method is called to cleanup).

While here, implement support for SEQ_SKIP as documented in the Linux
documentation even though it is not currently used in the tree.

Reviewed by:	bz
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D55899
</content>
</entry>
</feed>
