<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/virtio/p9fs, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>p9fs: Remove the "cancel" transport method</title>
<updated>2026-06-24T17:26:39+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2026-06-24T16:54:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=94989248641a17f5c2afc367df4845e4113779a1'/>
<id>94989248641a17f5c2afc367df4845e4113779a1</id>
<content type='text'>
Nothing calls it, and the existing virtio transport doesn't implement
it.  No functional change intended.

MFC after:	1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Nothing calls it, and the existing virtio transport doesn't implement
it.  No functional change intended.

MFC after:	1 week
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio/p9fs: Define the channel list mutex as static</title>
<updated>2026-06-24T17:26:39+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2026-06-24T16:54:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2586f9f459adc6610957ba0d74a167b85fe24ac7'/>
<id>2586f9f459adc6610957ba0d74a167b85fe24ac7</id>
<content type='text'>
No functional change intended.

MFC after:	1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No functional change intended.

MFC after:	1 week
</pre>
</div>
</content>
</entry>
<entry>
<title>p9fs: Refactor buffer allocations to avoid zeroing large payloads</title>
<updated>2026-05-26T19:37:39+00:00</updated>
<author>
<name>Alex Richardson</name>
<email>arichardson@FreeBSD.org</email>
</author>
<published>2026-05-26T19:37:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=675382f12b67e8b7b2f35bd1f8dfd96b8d8e4aae'/>
<id>675382f12b67e8b7b2f35bd1f8dfd96b8d8e4aae</id>
<content type='text'>
Allocating large buffers with M_ZERO adds unnecessary overhead since
the data is immediately overwritten. This change embeds the tc and rc
p9_buffer structs directly into p9_req_t so we only zero the small
metadata headers. The actual data payload is allocated with M_NOWAIT.

Embedding the metadata headers by value also allows the p9fs_buf_zone
UMA items to be sized exactly to P9FS_MTU, ensuring they are nicely
aligned.

This also adds proper error handling to p9_get_request() to handle
UMA allocation failures.

Reviewed by:	markj
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D56495
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allocating large buffers with M_ZERO adds unnecessary overhead since
the data is immediately overwritten. This change embeds the tc and rc
p9_buffer structs directly into p9_req_t so we only zero the small
metadata headers. The actual data payload is allocated with M_NOWAIT.

Embedding the metadata headers by value also allows the p9fs_buf_zone
UMA items to be sized exactly to P9FS_MTU, ensuring they are nicely
aligned.

This also adds proper error handling to p9_get_request() to handle
UMA allocation failures.

Reviewed by:	markj
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D56495
</pre>
</div>
</content>
</entry>
<entry>
<title>p9fs: Move UMA zone initialization to VFS module lifecycle</title>
<updated>2026-05-07T04:23:04+00:00</updated>
<author>
<name>Alex Richardson</name>
<email>arichardson@FreeBSD.org</email>
</author>
<published>2026-05-07T04:21:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1ed2ef42e01771f5d8ca9be61e07dcf0fd47feba'/>
<id>1ed2ef42e01771f5d8ca9be61e07dcf0fd47feba</id>
<content type='text'>
Previously, the UMA zones required for 9P requests (p9fs_buf_zone,
p9fs_req_zone, etc.) were initialized and destroyed in the
virtio_p9fs transport module. This caused issues when unloading
the core p9fs module.

This change moves p9_init_zones() and p9_destroy_zones() into
p9fs_init() and p9fs_uninit() inside p9fs_vfsops.c so that they
are correctly bound to the VFS filesystem module lifecycle via
vfs_modevent, aligning p9fs with standard FreeBSD VFS semantics.

Found while fixing https://github.com/CTSRD-CHERI/cheribsd/issues/2617.

Reviewed by:	kib
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D56492
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the UMA zones required for 9P requests (p9fs_buf_zone,
p9fs_req_zone, etc.) were initialized and destroyed in the
virtio_p9fs transport module. This caused issues when unloading
the core p9fs module.

This change moves p9_init_zones() and p9_destroy_zones() into
p9fs_init() and p9fs_uninit() inside p9fs_vfsops.c so that they
are correctly bound to the VFS filesystem module lifecycle via
vfs_modevent, aligning p9fs with standard FreeBSD VFS semantics.

Found while fixing https://github.com/CTSRD-CHERI/cheribsd/issues/2617.

Reviewed by:	kib
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D56492
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio_p9fs: Fix kernel panic on module unload</title>
<updated>2026-05-07T04:23:03+00:00</updated>
<author>
<name>Alex Richardson</name>
<email>arichardson@FreeBSD.org</email>
</author>
<published>2026-05-07T04:21:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3fe5069ce2bf5b2702f3be6531ce6a05c584e64d'/>
<id>3fe5069ce2bf5b2702f3be6531ce6a05c584e64d</id>
<content type='text'>
The virtio_p9fs module event handler can be invoked multiple times.
Previously, this caused p9_init_zones() and p9_register_trans() to be
executed multiple times, leaking UMA zones and corrupting the transport
list. During module unload, p9_destroy_zones() was also called multiple
times on the same zone pointers, triggering a duplicate free kernel panic
in uma_zdestroy().

This patch introduces a static reference counter in vt9p_modevent() to
ensure the zones and transports are only initialized and destroyed exactly
once, aligning with the approach used by other virtio drivers like vtnet.

Reviewed by:	kib, markj
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D56497
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The virtio_p9fs module event handler can be invoked multiple times.
Previously, this caused p9_init_zones() and p9_register_trans() to be
executed multiple times, leaking UMA zones and corrupting the transport
list. During module unload, p9_destroy_zones() was also called multiple
times on the same zone pointers, triggering a duplicate free kernel panic
in uma_zdestroy().

This patch introduces a static reference counter in vt9p_modevent() to
ensure the zones and transports are only initialized and destroyed exactly
once, aligning with the approach used by other virtio drivers like vtnet.

Reviewed by:	kib, markj
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D56497
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio_p9fs: Use VIRTIO_SIMPLE_PNPINFO</title>
<updated>2026-02-03T17:13:35+00:00</updated>
<author>
<name>Andrew Turner</name>
<email>andrew@FreeBSD.org</email>
</author>
<published>2026-02-03T17:13:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2f3f5055e7f69567f7aaca2f5b77655df34c4bb0'/>
<id>2f3f5055e7f69567f7aaca2f5b77655df34c4bb0</id>
<content type='text'>
This allows us to also use the common VIRTIO_SIMPLE_PROBE and to have
devmatch load the driver when detected.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D54684
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows us to also use the common VIRTIO_SIMPLE_PROBE and to have
devmatch load the driver when detected.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D54684
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio_p9fs: Support attaching to pci and mmio</title>
<updated>2025-04-08T10:48:27+00:00</updated>
<author>
<name>Andrew Turner</name>
<email>andrew@FreeBSD.org</email>
</author>
<published>2025-04-08T10:27:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fd9f67e689e83f20e29edf63cc6488402de5901c'/>
<id>fd9f67e689e83f20e29edf63cc6488402de5901c</id>
<content type='text'>
Some implementations of the virtio 9p transport are implemented on
virtio_mmio, e.g. the Arm FVP. Use the correct macro so the driver
attaches when this is the case.

Reviewed by:	markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D49600
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some implementations of the virtio 9p transport are implemented on
virtio_mmio, e.g. the Arm FVP. Use the correct macro so the driver
attaches when this is the case.

Reviewed by:	markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D49600
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio_p9fs: Simplify vt9p_req_wait() a bit</title>
<updated>2024-10-25T17:54:39+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2024-10-25T17:52:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=28c9b13b236d25512cfe4e1902411ff421a14b64'/>
<id>28c9b13b236d25512cfe4e1902411ff421a14b64</id>
<content type='text'>
Remove an always-false check for whether the request has already
completed before sleeping.  Even if the request is complete, the
response tag is updated while holding the channel lock, which is also
held here.

No functional change intended.

Sponsored by:	Klara, Inc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove an always-false check for whether the request has already
completed before sleeping.  Even if the request is complete, the
response tag is updated while holding the channel lock, which is also
held here.

No functional change intended.

Sponsored by:	Klara, Inc.
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio_p9fs: Check for completions after enabling interrupts</title>
<updated>2024-10-25T17:53:11+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2024-10-25T17:52:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1f6f247b3526abd4d5927684735012220aefe373'/>
<id>1f6f247b3526abd4d5927684735012220aefe373</id>
<content type='text'>
Otherwise we can end up with a lost interrupt, causing lost request
completion wakeups and hangs in the filesystem layer.

Continue processing until we enable interrupts and then observe an empty
queue, like other virtio drivers do.

Sponsored by:	Klara, Inc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Otherwise we can end up with a lost interrupt, causing lost request
completion wakeups and hangs in the filesystem layer.

Continue processing until we enable interrupts and then observe an empty
queue, like other virtio drivers do.

Sponsored by:	Klara, Inc.
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio_p9fs: Fix handling of a full request queue</title>
<updated>2024-10-25T17:51:16+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2024-10-25T17:51:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fff518117b40cbc3bca49073eed85dc725ebae4c'/>
<id>fff518117b40cbc3bca49073eed85dc725ebae4c</id>
<content type='text'>
If, when submitting a request, the virtqueue is full, we sleep until an
interrupt has fired, then restart the request.  However, while sleeping
the channel lock is dropped, and in the meantime another thread may have
reset the per-channel SG list, so upon retrying we'd (re)submit whatever
happened to be left over in the previous request.

Fix the problem by rebuilding the SG list after sleeping.

Sponsored by:	Klara, Inc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If, when submitting a request, the virtqueue is full, we sleep until an
interrupt has fired, then restart the request.  However, while sleeping
the channel lock is dropped, and in the meantime another thread may have
reset the per-channel SG list, so upon retrying we'd (re)submit whatever
happened to be left over in the previous request.

Fix the problem by rebuilding the SG list after sleeping.

Sponsored by:	Klara, Inc.
</pre>
</div>
</content>
</entry>
</feed>
