<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/virtio/block/virtio_blk.c, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>virtio_blk: Fix initialisation of dump request structure</title>
<updated>2026-04-09T14:13:31+00:00</updated>
<author>
<name>Sarah Walker</name>
<email>sarah.walker2@arm.com</email>
</author>
<published>2026-04-09T10:52:05+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f54209510b1b30b1445792db7d33401f7c7a97d6'/>
<id>f54209510b1b30b1445792db7d33401f7c7a97d6</id>
<content type='text'>
Commit c8c37141 ("virtio_blk: Use bus_dma for command/ack buffer
allocations") failed to update initialisation of the dedicated dump
request structure. This caused a panic on attempting to dump core to a
virtio_blk device.

Reviewed by:	asomers
Sponsored by:	Arm Ltd
Pull Request:	https://reviews.freebsd.org/D56156
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit c8c37141 ("virtio_blk: Use bus_dma for command/ack buffer
allocations") failed to update initialisation of the dedicated dump
request structure. This caused a panic on attempting to dump core to a
virtio_blk device.

Reviewed by:	asomers
Sponsored by:	Arm Ltd
Pull Request:	https://reviews.freebsd.org/D56156
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio_blk: Use bus_dma for command/ack buffer allocations</title>
<updated>2026-03-03T16:29:15+00:00</updated>
<author>
<name>Sarah Walker</name>
<email>sarah.walker2@arm.com</email>
</author>
<published>2026-03-03T16:27:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c8c37141a661cc9a6a51e43599d1afc8a3f0ef46'/>
<id>c8c37141a661cc9a6a51e43599d1afc8a3f0ef46</id>
<content type='text'>
While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.

The virtio buffers are marked as coherent; this should ensure that sync
calls are no-ops in the common cases.

Reviewed by:	andrew, br
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D54960
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.

The virtio buffers are marked as coherent; this should ensure that sync
calls are no-ops in the common cases.

Reviewed by:	andrew, br
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D54960
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio_blk: Limit use of indirect descriptors</title>
<updated>2025-06-23T12:55:24+00:00</updated>
<author>
<name>Andrew Turner</name>
<email>andrew@FreeBSD.org</email>
</author>
<published>2025-06-23T12:27:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=cbc2e34613c48c0b7955d5d970dcc08cd52da9b4'/>
<id>cbc2e34613c48c0b7955d5d970dcc08cd52da9b4</id>
<content type='text'>
Pass 0 as the number of indirect descriptors when they are not
supported.

This fixes an issue on the Arm FVP model where we don't negotiate
them, however pass a number of segments greater than
VIRTIO_MAX_INDIRECT. This leads to virtqueue_alloc failing and
virtio_blk failing to attach.

Reviewed by:	Harry Moulton &lt;harry.moulton@arm.com&gt;
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D50909
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pass 0 as the number of indirect descriptors when they are not
supported.

This fixes an issue on the Arm FVP model where we don't negotiate
them, however pass a number of segments greater than
VIRTIO_MAX_INDIRECT. This leads to virtqueue_alloc failing and
virtio_blk failing to attach.

Reviewed by:	Harry Moulton &lt;harry.moulton@arm.com&gt;
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D50909
</pre>
</div>
</content>
</entry>
<entry>
<title>diskinfo: print attachment field for virtio_blk devices</title>
<updated>2025-05-27T02:18:32+00:00</updated>
<author>
<name>Robert Wing</name>
<email>rew@FreeBSD.org</email>
</author>
<published>2025-05-27T02:18:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=dec24dbb29e4cfb28df8323c2368d1c8504239a9'/>
<id>dec24dbb29e4cfb28df8323c2368d1c8504239a9</id>
<content type='text'>
PR:             286280
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D50489
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR:             286280
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D50489
</pre>
</div>
</content>
</entry>
<entry>
<title>vtblk: Invoke busdma completion callbacks when polling</title>
<updated>2024-07-04T14:15:33+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2024-07-04T14:15:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b1dd067032747c12ae237d2f7aeed6d81285c121'/>
<id>b1dd067032747c12ae237d2f7aeed6d81285c121</id>
<content type='text'>
vtblk_poll_request() is used for kernel dumps and for fetching the block
device's identifier string during device probing.  In the latter case,
it was not calling bus_dmamap_sync() after completing the I/O, but this
is required in general.

Thus:
- Factor out per-request code from vtblk_queue_completed().
- Use it in vtblk_poll_request() once virtqueue_poll() finishes.
- While here, assert that virtqueue_poll() returns the request that we
  expect.

Reported by:	KMSAN
Fixes:		782105f7c898 ("vtblk: Use busdma")
Reviewed by:	cperciva, imp
Sponsored by:	Klara, Inc.
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D45665
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vtblk_poll_request() is used for kernel dumps and for fetching the block
device's identifier string during device probing.  In the latter case,
it was not calling bus_dmamap_sync() after completing the I/O, but this
is required in general.

Thus:
- Factor out per-request code from vtblk_queue_completed().
- Use it in vtblk_poll_request() once virtqueue_poll() finishes.
- While here, assert that virtqueue_poll() returns the request that we
  expect.

Reported by:	KMSAN
Fixes:		782105f7c898 ("vtblk: Use busdma")
Reviewed by:	cperciva, imp
Sponsored by:	Klara, Inc.
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D45665
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Automated cleanup of cdefs and other formatting</title>
<updated>2023-11-27T05:24:00+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-11-24T20:12:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fdafd315ad0d0f28a11b9fb4476a9ab059c62b92'/>
<id>fdafd315ad0d0f28a11b9fb4476a9ab059c62b92</id>
<content type='text'>
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+&lt;sys/cdefs.h&gt;.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/types.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/param.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/capsicum.h&gt;/

Sponsored by:		Netflix
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+&lt;sys/cdefs.h&gt;.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/types.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/param.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/capsicum.h&gt;/

Sponsored by:		Netflix
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: remove virtio_alloc_virtqueues' flags arg</title>
<updated>2023-09-18T20:03:31+00:00</updated>
<author>
<name>Mina Galić</name>
<email>freebsd@igalic.co</email>
</author>
<published>2023-09-18T20:02:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=180c02405b12e08bbb69bb693a38077db0c85e9b'/>
<id>180c02405b12e08bbb69bb693a38077db0c85e9b</id>
<content type='text'>
Summary:
the flags argument is unused.
Its initial design idea has been superceded by the addition of
virtio_setup_intr and related APIs.

Sponsored by: The FreeBSD Foundation

Reviewers: bryanv

Reviewed By: bryanv

Subscribers: cognet, imp

Differential Revision: https://reviews.freebsd.org/D41850
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
the flags argument is unused.
Its initial design idea has been superceded by the addition of
virtio_setup_intr and related APIs.

Sponsored by: The FreeBSD Foundation

Reviewers: bryanv

Reviewed By: bryanv

Subscribers: cognet, imp

Differential Revision: https://reviews.freebsd.org/D41850
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:36+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=685dc743dc3b5645e34836464128e1c0558b404b'/>
<id>685dc743dc3b5645e34836464128e1c0558b404b</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD</title>
<updated>2023-05-12T16:44:03+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-05-10T15:40:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4d846d260e2b9a3d4d0a701462568268cbfe7a5b'/>
<id>4d846d260e2b9a3d4d0a701462568268cbfe7a5b</id>
<content type='text'>
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
</pre>
</div>
</content>
</entry>
<entry>
<title>vtblk: secondary fix for dumping</title>
<updated>2023-01-23T19:21:36+00:00</updated>
<author>
<name>Mitchell Horne</name>
<email>mhorne@FreeBSD.org</email>
</author>
<published>2023-01-09T17:14:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=6f5141456ed07a24097c2cf3d6c389bf971d78d2'/>
<id>6f5141456ed07a24097c2cf3d6c389bf971d78d2</id>
<content type='text'>
The code paths while dumping do not got through busdma. As such,
safeguard against calling bus_dmamap_sync() with a NULL map. The x86
implementation tolerates this but others do not, resulting in a
NULL dereference panic when dumping to a vtblk device on arm64, riscv,
etc.

Fixes:		782105f7c898 ("vtblk: Use busdma")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37990
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code paths while dumping do not got through busdma. As such,
safeguard against calling bus_dmamap_sync() with a NULL map. The x86
implementation tolerates this but others do not, resulting in a
NULL dereference panic when dumping to a vtblk device on arm64, riscv,
etc.

Fixes:		782105f7c898 ("vtblk: Use busdma")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37990
</pre>
</div>
</content>
</entry>
</feed>
