Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] The MSHV_CREATE_DEVICE ioctl handler is missing in the core MSHV 
framework, rendering the VFIO-MSHV bridge device completely unreachable.
--

--- Patch [3]: [PATCH V4 3/9] mshv: Introduce basic mshv bridge device for VFIO 
to build upon ---
commit 58c1a16396f01cf3f0ff1eb2d7b11c08f90ca678
Author: Mukesh R <[email protected]>

mshv: Introduce basic mshv bridge device for VFIO to build upon

This commit introduces a basic VFIO-MSHV bridge pseudo device based on the
VFIO-KVM bridge. It adds the mshv_vfio.c implementation and a new UAPI ioctl
MSHV_CREATE_DEVICE.

> diff --git a/drivers/hv/mshv_vfio.c b/drivers/hv/mshv_vfio.c
> new file mode 100644
> index 0000000000000..a770b508f0800
> --- /dev/null
> +++ b/drivers/hv/mshv_vfio.c

[ ... ]

> +struct mshv_device_ops mshv_vfio_device_ops = {
> +     .device_name = "mshv-vfio",
> +     .device_create = mshv_vfio_create_device,
> +     .device_release = mshv_vfio_release_device,
> +     .device_set_attr = mshv_vfio_set_attr,
> +     .device_has_attr = mshv_vfio_has_attr,
> +};

[Severity: Medium]
Since the ioctl to create this device is missing from the core ioctl 
handlers, does this device operations struct and the rest of the VFIO-MSHV 
bridge implementation become unreachable dead code?

> diff --git a/include/uapi/linux/mshv.h b/include/uapi/linux/mshv.h
> index be6fe3ee87078..b038a79786d2d 100644
> --- a/include/uapi/linux/mshv.h
> +++ b/include/uapi/linux/mshv.h
> @@ -254,6 +254,7 @@ struct mshv_root_hvcall {
>  #define MSHV_GET_GPAP_ACCESS_BITMAP  _IOWR(MSHV_IOCTL, 0x06, struct 
> mshv_gpap_access_bitmap)
>  /* Generic hypercall */
>  #define MSHV_ROOT_HVCALL             _IOWR(MSHV_IOCTL, 0x07, struct 
> mshv_root_hvcall)
> +#define MSHV_CREATE_DEVICE             _IOWR(MSHV_IOCTL, 0x08, struct 
> mshv_create_device)

[Severity: Medium]
Is this ioctl actually wired up anywhere in the core MSHV framework? 

I can't find an implementation for MSHV_CREATE_DEVICE in any ioctl 
dispatcher (like mshv_partition_ioctl()). Will userspace simply receive 
-ENOTTY when attempting to use this command?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=3

Reply via email to