<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/virtio, branch v5.17</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.17</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.17'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-03-06T11:06:50Z</updated>
<entry>
<title>virtio: drop default for virtio-mem</title>
<updated>2022-03-06T11:06:50Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2022-02-25T11:46:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e7c552ec897894ec421867059e48474eb7f1ff6d'/>
<id>urn:sha1:e7c552ec897894ec421867059e48474eb7f1ff6d</id>
<content type='text'>
There's no special reason why virtio-mem needs a default that's
different from what kconfig provides, any more than e.g. virtio blk.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: David Hildenbrand &lt;david@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa: factor out vdpa_set_features_unlocked for vdpa internal use</title>
<updated>2022-03-04T16:56:33Z</updated>
<author>
<name>Si-Wei Liu</name>
<email>si-wei.liu@oracle.com</email>
</author>
<published>2022-01-15T00:27:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e0077cc13b831f8fad5557442f73bf7728683713'/>
<id>urn:sha1:e0077cc13b831f8fad5557442f73bf7728683713</id>
<content type='text'>
No functional change introduced. vdpa bus driver such as virtio_vdpa
or vhost_vdpa is not supposed to take care of the locking for core
by its own. The locked API vdpa_set_features should suffice the
bus driver's need.

Signed-off-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Reviewed-by: Eli Cohen &lt;elic@nvidia.com&gt;
Link: https://lore.kernel.org/r/1642206481-30721-2-git-send-email-si-wei.liu@oracle.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio: document virtio_reset_device</title>
<updated>2022-03-04T13:33:22Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2022-01-14T20:54:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c46eccdaadabb7822080a04e633f81b2ad37f358'/>
<id>urn:sha1:c46eccdaadabb7822080a04e633f81b2ad37f358</id>
<content type='text'>
Looks like most callers get driver/device removal wrong.
Document what's expected of callers.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio: acknowledge all features before access</title>
<updated>2022-03-04T13:33:21Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2022-01-14T19:58:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4fa59ede95195f267101a1b8916992cf3f245cdb'/>
<id>urn:sha1:4fa59ede95195f267101a1b8916992cf3f245cdb</id>
<content type='text'>
The feature negotiation was designed in a way that
makes it possible for devices to know which config
fields will be accessed by drivers.

This is broken since commit 404123c2db79 ("virtio: allow drivers to
validate features") with fallout in at least block and net.  We have a
partial work-around in commit 2f9a174f918e ("virtio: write back
F_VERSION_1 before validate") which at least lets devices find out which
format should config space have, but this is a partial fix: guests
should not access config space without acknowledging features since
otherwise we'll never be able to change the config space format.

To fix, split finalize_features from virtio_finalize_features and
call finalize_features with all feature bits before validation,
and then - if validation changed any bits - once again after.

Since virtio_finalize_features no longer writes out features
rename it to virtio_features_ok - since that is what it does:
checks that features are ok with the device.

As a side effect, this also reduces the amount of hypervisor accesses -
we now only acknowledge features once unless we are clearing any
features when validating (which is uncommon).

IRC I think that this was more or less always the intent in the spec but
unfortunately the way the spec is worded does not say this explicitly, I
plan to address this at the spec level, too.

Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Cc: stable@vger.kernel.org
Fixes: 404123c2db79 ("virtio: allow drivers to validate features")
Fixes: 2f9a174f918e ("virtio: write back F_VERSION_1 before validate")
Cc: "Halil Pasic" &lt;pasic@linux.ibm.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio: unexport virtio_finalize_features</title>
<updated>2022-03-04T13:33:21Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2022-01-14T19:56:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=838d6d3461db0fdbf33fc5f8a69c27b50b4a46da'/>
<id>urn:sha1:838d6d3461db0fdbf33fc5f8a69c27b50b4a46da</id>
<content type='text'>
virtio_finalize_features is only used internally within virtio.
No reason to export it.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa: Allow to configure max data virtqueues</title>
<updated>2022-01-14T23:50:53Z</updated>
<author>
<name>Eli Cohen</name>
<email>elic@nvidia.com</email>
</author>
<published>2022-01-05T11:46:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aba21aff772b8622e08f07219069be793429a48f'/>
<id>urn:sha1:aba21aff772b8622e08f07219069be793429a48f</id>
<content type='text'>
Add netlink support to configure the max virtqueue pairs for a device.
At least one pair is required. The maximum is dictated by the device.

Example:
$ vdpa dev add name vdpa-a mgmtdev auxiliary/mlx5_core.sf.1 max_vqp 4

Signed-off-by: Eli Cohen &lt;elic@nvidia.com&gt;
Link: https://lore.kernel.org/r/20220105114646.577224-6-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa: Sync calls set/get config/status with cf_mutex</title>
<updated>2022-01-14T23:50:53Z</updated>
<author>
<name>Eli Cohen</name>
<email>elic@nvidia.com</email>
</author>
<published>2022-01-05T11:46:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=73bc0dbb591baea322a7319c735e5f6c7dba9cfb'/>
<id>urn:sha1:73bc0dbb591baea322a7319c735e5f6c7dba9cfb</id>
<content type='text'>
Add wrappers to get/set status and protect these operations with
cf_mutex to serialize these operations with respect to get/set config
operations.

Signed-off-by: Eli Cohen &lt;elic@nvidia.com&gt;
Link: https://lore.kernel.org/r/20220105114646.577224-4-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa: Provide interface to read driver features</title>
<updated>2022-01-14T23:50:53Z</updated>
<author>
<name>Eli Cohen</name>
<email>elic@nvidia.com</email>
</author>
<published>2022-01-05T11:46:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a64917bc2e9b1e0aa716b783c4ec879fdd280300'/>
<id>urn:sha1:a64917bc2e9b1e0aa716b783c4ec879fdd280300</id>
<content type='text'>
Provide an interface to read the negotiated features. This is needed
when building the netlink message in vdpa_dev_net_config_fill().

Also fix the implementation of vdpa_dev_net_config_fill() to use the
negotiated features instead of the device features.

To make APIs clearer, make the following name changes to struct
vdpa_config_ops so they better describe their operations:

get_features -&gt; get_device_features
set_features -&gt; set_driver_features

Finally, add get_driver_features to return the negotiated features and
add implementation to all the upstream drivers.

Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Eli Cohen &lt;elic@nvidia.com&gt;
Link: https://lore.kernel.org/r/20220105114646.577224-2-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_ring: mark ring unused on error</title>
<updated>2022-01-14T23:50:53Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2022-01-06T12:57:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1861ba626ae9b98136f3e504208cdef6b29cd3ec'/>
<id>urn:sha1:1861ba626ae9b98136f3e504208cdef6b29cd3ec</id>
<content type='text'>
A recently added error path does not mark ring unused when exiting on
OOM, which will lead to BUG on the next entry in debug builds.

TODO: refactor code so we have START_USE and END_USE in the same function.

Fixes: fc6d70f40b3d ("virtio_ring: check desc == NULL when using indirect with packed")
Cc: "Xuan Zhuo" &lt;xuanzhuo@linux.alibaba.com&gt;
Cc: Jiasheng Jiang &lt;jiasheng@iscas.ac.cn&gt;
Reviewed-by: Xuan Zhuo &lt;xuanzhuo@linux.alibaba.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio/virtio_pci_legacy_dev: ensure the correct return value</title>
<updated>2022-01-14T23:50:53Z</updated>
<author>
<name>Peng Hao</name>
<email>flyingpenghao@gmail.com</email>
</author>
<published>2021-12-22T11:20:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=49814ce9e21a8b6d6158b2e502fe6bacef4d99b6'/>
<id>urn:sha1:49814ce9e21a8b6d6158b2e502fe6bacef4d99b6</id>
<content type='text'>
When pci_iomap return NULL, the return value is zero.

Signed-off-by: Peng Hao &lt;flyingpeng@tencent.com&gt;
Link: https://lore.kernel.org/r/20211222112014.87394-1-flyingpeng@tencent.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
</feed>
