Commit ef1c95f
vdpa/mlx5: Fix mlx5_vdpa_get_config() endianness on big-endian machines
[ Upstream commit 439252e ]
mlx5_vdpa_dev_add() doesn’t initialize mvdev->actual_features. It’s
initialized later by mlx5_vdpa_set_driver_features(). However,
mlx5_vdpa_get_config() depends on the VIRTIO_F_VERSION_1 flag in
actual_features, to return data with correct endianness. When it’s called
before mlx5_vdpa_set_driver_features(), the data are incorrectly returned
as big-endian on big-endian machines, while QEMU then interprets them as
little-endian.
The fix is to initialize this VIRTIO_F_VERSION_1 as early as possible,
especially considering that mlx5_vdpa_dev_add() insists on this flag to
always be set anyway.
Signed-off-by: Konstantin Shkolnyy <kshk@linux.ibm.com>
Message-Id: <20250204173127.166673-1-kshk@linux.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 48fd80f7d7b48c37bb310b0f5beacf7c025206d4)1 parent a24a4fe commit ef1c95f
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3420 | 3420 | | |
3421 | 3421 | | |
3422 | 3422 | | |
| 3423 | + | |
| 3424 | + | |
| 3425 | + | |
3423 | 3426 | | |
3424 | 3427 | | |
3425 | 3428 | | |
| |||
0 commit comments