diff options
author | Feng Liu <feliu@nvidia.com> | 2023-07-19 18:45:50 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-08-10 22:24:28 +0300 |
commit | 13f3efaca024e16ccfab0e8b2cf29d66489d8d54 (patch) | |
tree | 930f23b9e9d31800cb22047e0d61bf07497f3ce5 /drivers/vdpa | |
parent | 8d4bdf11f096e5b343ee0f9aaa8c262dc16d2e1e (diff) | |
download | linux-13f3efaca024e16ccfab0e8b2cf29d66489d8d54.tar.xz |
virtio-pci: Fix legacy device flag setting error in probe
The 'is_legacy' flag is used to differentiate between legacy vs modern
device. Currently, it is based on the value of vp_dev->ldev.ioaddr.
However, due to the shared memory of the union between struct
virtio_pci_legacy_device and struct virtio_pci_modern_device, when
virtio_pci_modern_probe modifies the content of struct
virtio_pci_modern_device, it affects the content of struct
virtio_pci_legacy_device, and ldev.ioaddr is no longer zero, causing
the 'is_legacy' flag to be set as true. To resolve issue, when legacy
device is probed, mark 'is_legacy' as true, when modern device is
probed, keep 'is_legacy' as false.
Fixes: 4f0fc22534e3 ("virtio_pci: Optimize virtio_pci_device structure size")
Signed-off-by: Feng Liu <feliu@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Message-Id: <20230719154550.79536-1-feliu@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'drivers/vdpa')
0 files changed, 0 insertions, 0 deletions