* [PATCH] vdpa/pds: check virtqueue notify mapping
@ 2026-08-04 8:53 Xiong Weimin
2026-08-05 20:40 ` Creeley, Brett
2026-08-06 0:58 ` Xiong Weimin
0 siblings, 2 replies; 6+ messages in thread
From: Xiong Weimin @ 2026-08-04 8:53 UTC (permalink / raw)
To: Brett Creeley, Michael S. Tsirkin, Jason Wang
Cc: Xuan Zhuo, Eugenio Pérez, virtualization, linux-kernel,
Xiong Weimin
vp_modern_map_vq_notify() can fail and return NULL. Check the notify
mapping while adding a pds vDPA device and use the existing teardown path
instead of storing a NULL doorbell pointer in the virtqueue state.
Signed-off-by: Xiong Weimin <xiongweimin@kylinos.cn>
---
drivers/vdpa/pds/vdpa_dev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/vdpa/pds/vdpa_dev.c b/drivers/vdpa/pds/vdpa_dev.c
index 43426bd97..df53cfce9 100644
--- a/drivers/vdpa/pds/vdpa_dev.c
+++ b/drivers/vdpa/pds/vdpa_dev.c
@@ -731,6 +731,12 @@ static int pds_vdpa_dev_add(struct vdpa_mgmt_dev *mdev, const char *name,
notify = vp_modern_map_vq_notify(&pdsv->vdpa_aux->vd_mdev,
i, &pdsv->vqs[i].notify_pa);
+ if (!notify) {
+ err = -EINVAL;
+ dev_warn(dev, "Fail to map vq notify %d\n", i);
+ goto err_unmap;
+ }
+
pds_vdpa_init_vqs_entry(pdsv, i, notify);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] vdpa/pds: check virtqueue notify mapping
2026-08-04 8:53 [PATCH] vdpa/pds: check virtqueue notify mapping Xiong Weimin
@ 2026-08-05 20:40 ` Creeley, Brett
2026-08-06 0:58 ` Xiong Weimin
1 sibling, 0 replies; 6+ messages in thread
From: Creeley, Brett @ 2026-08-05 20:40 UTC (permalink / raw)
To: Xiong Weimin, Brett Creeley, Michael S. Tsirkin, Jason Wang
Cc: Xuan Zhuo, Eugenio Pérez, virtualization, linux-kernel
On 8/4/2026 1:53 AM, Xiong Weimin wrote:
> [You don't often get email from xiongweimin@kylinos.cn. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> vp_modern_map_vq_notify() can fail and return NULL. Check the notify
> mapping while adding a pds vDPA device and use the existing teardown path
> instead of storing a NULL doorbell pointer in the virtqueue state.
>
> Signed-off-by: Xiong Weimin <xiongweimin@kylinos.cn>
> ---
> drivers/vdpa/pds/vdpa_dev.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/vdpa/pds/vdpa_dev.c b/drivers/vdpa/pds/vdpa_dev.c
> index 43426bd97..df53cfce9 100644
> --- a/drivers/vdpa/pds/vdpa_dev.c
> +++ b/drivers/vdpa/pds/vdpa_dev.c
> @@ -731,6 +731,12 @@ static int pds_vdpa_dev_add(struct vdpa_mgmt_dev *mdev, const char *name,
>
> notify = vp_modern_map_vq_notify(&pdsv->vdpa_aux->vd_mdev,
> i, &pdsv->vqs[i].notify_pa);
> + if (!notify) {
> + err = -EINVAL;
> + dev_warn(dev, "Fail to map vq notify %d\n", i);
Nit, but why dev_warn() instead of dev_err()? It looks like this was
copied, but I wonder if the other spot should be a dev_err() instead of
dev_warn too?
Other than that, LGTM.
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
> + goto err_unmap;
> + }
> +
> pds_vdpa_init_vqs_entry(pdsv, i, notify);
> }
>
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] vdpa/pds: check virtqueue notify mapping
2026-08-04 8:53 [PATCH] vdpa/pds: check virtqueue notify mapping Xiong Weimin
2026-08-05 20:40 ` Creeley, Brett
@ 2026-08-06 0:58 ` Xiong Weimin
2026-08-06 16:21 ` Creeley, Brett
1 sibling, 1 reply; 6+ messages in thread
From: Xiong Weimin @ 2026-08-06 0:58 UTC (permalink / raw)
To: Brett Creeley
Cc: Michael S. Tsirkin, Jason Wang, Jason Wang, Xuan Zhuo,
Eugenio Perez, virtualization, linux-kernel
On Tue, Aug 04, 2026, Brett Creeley wrote:
> Nit, but why dev_warn() instead of dev_err()? It looks like this was
> copied, but I wonder if the other spot should be a dev_err() instead of
> a dev_warn too?
>
> Other than that, LGTM.
>
> Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Thanks for the review. Agreed — this is a hard failure on the device
add path, and the rest of pds_vdpa_dev_add() already uses dev_err().
I'll send a standalone [PATCH v2] with that change and your
Reviewed-by.
The matching "Fail to map vq notify" in vp_vdpa.c is pre-existing; I
can clean that up in a separate patch if you prefer.
Thanks,
Xiong
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] vdpa/pds: check virtqueue notify mapping
2026-08-06 0:58 ` Xiong Weimin
@ 2026-08-06 16:21 ` Creeley, Brett
2026-08-07 1:58 ` Xiong Weimin
0 siblings, 1 reply; 6+ messages in thread
From: Creeley, Brett @ 2026-08-06 16:21 UTC (permalink / raw)
To: Xiong Weimin, Brett Creeley
Cc: Michael S. Tsirkin, Jason Wang, Jason Wang, Xuan Zhuo,
Eugenio Perez, virtualization, linux-kernel
On 8/5/2026 5:58 PM, Xiong Weimin wrote:
> [You don't often get email from xiongweimin@kylinos.cn. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> On Tue, Aug 04, 2026, Brett Creeley wrote:
>> Nit, but why dev_warn() instead of dev_err()? It looks like this was
>> copied, but I wonder if the other spot should be a dev_err() instead of
>> a dev_warn too?
>>
>> Other than that, LGTM.
>>
>> Reviewed-by: Brett Creeley <brett.creeley@amd.com>
> Thanks for the review. Agreed — this is a hard failure on the device
> add path, and the rest of pds_vdpa_dev_add() already uses dev_err().
> I'll send a standalone [PATCH v2] with that change and your
> Reviewed-by.
>
> The matching "Fail to map vq notify" in vp_vdpa.c is pre-existing; I
> can clean that up in a separate patch if you prefer.
You could try sending as a separate patch. I was just pointing out that,
at least for pds_vdpa, this isn't a warning, but an error. I believe
that's the case for vp_vdpa.c too.
Thanks,
Brett
>
> Thanks,
> Xiong
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] vdpa/pds: check virtqueue notify mapping
2026-08-06 16:21 ` Creeley, Brett
@ 2026-08-07 1:58 ` Xiong Weimin
2026-08-07 1:58 ` [PATCH] vdpa/virtio_pci: use dev_err for vq notify map failure Xiong Weimin
0 siblings, 1 reply; 6+ messages in thread
From: Xiong Weimin @ 2026-08-07 1:58 UTC (permalink / raw)
To: Brett Creeley
Cc: Michael S. Tsirkin, Jason Wang, Jason Wang, Xuan Zhuo,
Eugenio Perez, virtualization, linux-kernel
Thanks, will do. I'll send a separate patch for vp_vdpa.c as well.
Thanks,
Xiong
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] vdpa/virtio_pci: use dev_err for vq notify map failure
2026-08-07 1:58 ` Xiong Weimin
@ 2026-08-07 1:58 ` Xiong Weimin
0 siblings, 0 replies; 6+ messages in thread
From: Xiong Weimin @ 2026-08-07 1:58 UTC (permalink / raw)
To: Brett Creeley, Michael S. Tsirkin, virtualization, linux-kernel
Cc: Jason Wang, Jason Wang, Xuan Zhuo, Eugenio Pérez
Mapping failure on the device add path is a hard error and already
returns -EINVAL. Use dev_err() to match that, same as pds_vdpa.
Signed-off-by: Xiong Weimin <xiongweimin@kylinos.cn>
---
drivers/vdpa/virtio_pci/vp_vdpa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c
index 51ffc245a..26841f03b 100644
--- a/drivers/vdpa/virtio_pci/vp_vdpa.c
+++ b/drivers/vdpa/virtio_pci/vp_vdpa.c
@@ -562,7 +562,7 @@ static int vp_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name,
&vp_vdpa->vring[i].notify_pa);
if (!vp_vdpa->vring[i].notify) {
ret = -EINVAL;
- dev_warn(&pdev->dev, "Fail to map vq notify %d\n", i);
+ dev_err(&pdev->dev, "Fail to map vq notify %d\n", i);
goto err;
}
}
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-08-07 1:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04 8:53 [PATCH] vdpa/pds: check virtqueue notify mapping Xiong Weimin
2026-08-05 20:40 ` Creeley, Brett
2026-08-06 0:58 ` Xiong Weimin
2026-08-06 16:21 ` Creeley, Brett
2026-08-07 1:58 ` Xiong Weimin
2026-08-07 1:58 ` [PATCH] vdpa/virtio_pci: use dev_err for vq notify map failure Xiong Weimin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox