Re: [PATCH v2] content: clarify feature negotiation terminology and init sequence

Stefan Hajnoczi <[email protected]> Mon, 27 Apr 2026 09:38:18 -0400
Newsgroups dev.linux.lists.virtio-comment
Message-ID <20260427133818.GA218226@fedora>
--dp0ghqQr6k4VQZMO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 23, 2026 at 06:24:12PM -0400, Michael S. Tsirkin wrote:
> Make several clarifications to the init sequence documentation:
>=20
> The Linux virtio core (drivers/virtio/virtio.c) initializes devices
> as follows:
>   1. Intersect driver and device feature bits
>   2. finalize_features() - write accepted features to the device
>   3. drv->validate() - read config space, may clear feature bits
>      (e.g. virtio-net clears VIRTIO_NET_F_MTU if mtu < MIN_MTU,
>      balloon clears PAGE_POISON if guest does not init pages)
>   4. If validate changed any features, finalize_features() again
>   5. virtio_features_ok() - set FEATURES_OK, confirm with device
>=20
> this allows the device to know which fields will be read:
> recommend this in the spec.
>=20
> Legacy driver detection is specified using a mechanism that
> does not work on all transports. Make it clear that it's an
> example: what matters is that devices do detection in some way
> and are compatible with legacy drivers.
>=20
> Define "negotiated" for features confirmed via FEATURES_OK.
>=20
> "acknowledged" is used as a synonym for "accepted", but only in two
> places. Just use "accepted" consistently.
>=20
> Spec describes multiple moving pieces then ends with "before accepting
> it" - vague, and is overloading "accept". Replace with a reference to
> FEATURES_OK.
>=20
> Fixes: https://github.com/oasis-tcs/virtio-spec/issues/241
> Signed-off-by: Michael S. Tsirkin <[email protected]>
> ---
>=20
> changes:
> address review comments by Stefan
>=20
>  content.tex | 28 +++++++++++++++++++++-------
>  1 file changed, 21 insertions(+), 7 deletions(-)

Reviewed-by: Stefan Hajnoczi <[email protected]>

--dp0ghqQr6k4VQZMO
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmnvZsoACgkQnKSrs4Gr
c8iJdQf+L0YV16stVkhBl+S0wBkyAqjaSSsOfzEtrzvIFv6MnsGOBpMNLKB8BoEt
4ds+3AoAHmybOWUqwVml/xW9N4ZJbhnfC1VeFRCBQ/jTc/qC7NcLgFOzOVjw7FCG
6d1sGMKNObIM40CF5VH1tyuImXzUtiP7jLjXCxx06lwPZRd4jaum7qQvPTu4Cz6/
aszMA87zom30vxJPzpKmp0BGthF3l0jrJzz6bZefbRbZ4Ox7Jwj4APPHKDdjk2Hc
TmtuMTTXcDC+r5rzd79AFTQcQPsqVBKRaegcbQVj+RE8F1TmFh9YFsgBgL/NGpwT
w7bHAUvzXkPqYWUYrOS+05QNMqVrvg==
=7jX/
-----END PGP SIGNATURE-----

--dp0ghqQr6k4VQZMO--