Commit d6e4e3d4 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Pengyuan Zhao
Browse files

virtio_pci_modern: correct sparse tags for notify

stable inclusion
from stable-v5.13
commit d7bce85a
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5WXCZ
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d7bce85aa7b92b5de8f69b3bcedfe51d7b1aabe1


----------------------------------------------------------------------

When switching virtio_pci_modern to use a helper for mappings we lost an
__iomem tag. Restore it.

Reported-by: default avatarkernel test robot <lkp@intel.com>
Fixes: 9e3bb9b7 ("virtio_pci_modern: introduce helper to map vq notify area")
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarPengyuan Zhao <zhaopengyuan@hisilicon.com>
parent ed967d43
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -630,7 +630,7 @@ EXPORT_SYMBOL_GPL(vp_modern_get_queue_notify_off);
 *
 * Returns the address of the notification area
 */
void *vp_modern_map_vq_notify(struct virtio_pci_modern_device *mdev,
void __iomem *vp_modern_map_vq_notify(struct virtio_pci_modern_device *mdev,
				      u16 index, resource_size_t *pa)
{
	u16 off = vp_modern_get_queue_notify_off(mdev, index);
@@ -649,10 +649,9 @@ void *vp_modern_map_vq_notify(struct virtio_pci_modern_device *mdev,
		if (pa)
			*pa = mdev->notify_pa +
			      off * mdev->notify_offset_multiplier;
		return (void __force *)mdev->notify_base +
			off * mdev->notify_offset_multiplier;
		return mdev->notify_base + off * mdev->notify_offset_multiplier;
	} else {
		return (void __force *)vp_modern_map_capability(mdev,
		return vp_modern_map_capability(mdev,
				       mdev->notify_map_cap, 2, 2,
				       off * mdev->notify_offset_multiplier, 2,
				       NULL, pa);
+2 −2
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ void __iomem *vp_modern_map_capability(struct virtio_pci_modern_device *mdev, in
				       u32 align,
				       u32 start, u32 size,
				       size_t *len, resource_size_t *pa);
void *vp_modern_map_vq_notify(struct virtio_pci_modern_device *mdev,
void __iomem *vp_modern_map_vq_notify(struct virtio_pci_modern_device *mdev,
				      u16 index, resource_size_t *pa);
int vp_modern_probe(struct virtio_pci_modern_device *mdev);
void vp_modern_remove(struct virtio_pci_modern_device *mdev);