RE: [Patch v2 3/4] uio_hv_generic: Adjust ring size according to system page alignment

From: Michael Kelley
Date: Wed Apr 30 2025 - 21:56:21 EST


From: longli@xxxxxxxxxxxxxxxxx <longli@xxxxxxxxxxxxxxxxx> Sent: Wednesday, April 30, 2025 3:06 PM
>
> Following the ring header, the ring data should align to system page
> boundary. Adjust the size if necessary.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 95096f2fbd10 ("uio-hv-generic: new userspace i/o driver for VMBus")
> Signed-off-by: Long Li <longli@xxxxxxxxxxxxx>
> ---
> drivers/uio/uio_hv_generic.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
> index 08385b04c4ab..dfc5f0e1a254 100644
> --- a/drivers/uio/uio_hv_generic.c
> +++ b/drivers/uio/uio_hv_generic.c
> @@ -256,6 +256,12 @@ hv_uio_probe(struct hv_device *dev,
> if (!ring_size)
> ring_size = SZ_2M;
>
> + /*
> + * Adjust ring size if necessary to have the ring data region page
> + * aligned
> + */
> + ring_size = VMBUS_RING_SIZE(ring_size);
> +
> pdata = devm_kzalloc(&dev->device, sizeof(*pdata), GFP_KERNEL);
> if (!pdata)
> return -ENOMEM;
> --
> 2.34.1
>

Reviewed-by: Michael Kelley <mhklinux@xxxxxxxxxxx>