lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250825084155.10088e2a.alex.williamson@redhat.com>
Date: Mon, 25 Aug 2025 08:41:55 -0600
From: Alex Williamson <alex.williamson@...hat.com>
To: Nipun Gupta <nipun.gupta@....com>
Cc: <arnd@...db.de>, <gregkh@...uxfoundation.org>, <nikhil.agarwal@....com>,
 <kvm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
 <llvm@...ts.linux.dev>, <oe-kbuild-all@...ts.linux.dev>,
 <robin.murphy@....com>, <krzk@...nel.org>, <tglx@...utronix.de>,
 <maz@...nel.org>, <linux@...ssschuh.net>, <chenqiuji666@...il.com>,
 <peterz@...radead.org>, <robh@...nel.org>, <abhijit.gangurde@....com>,
 <nathan@...nel.org>, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v3 2/2] vfio/cdx: update driver to build without
 CONFIG_GENERIC_MSI_IRQ

On Mon, 25 Aug 2025 10:01:22 +0530
Nipun Gupta <nipun.gupta@....com> wrote:

> Define dummy MSI related APIs in VFIO CDX driver to build the
> driver without enabling CONFIG_GENERIC_MSI_IRQ flag.
> 
> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202508070308.opy5dIFX-lkp@intel.com/
> Reviewed-by: Nikhil Agarwal <nikhil.agarwal@....com>
> Signed-off-by: Nipun Gupta <nipun.gupta@....com>
> ---
> 
> Changes v1->v2:
> - fix linking intr.c file in Makefile
> Changes v2->v3:
> - return error from vfio_cdx_set_irqs_ioctl() when CONFIG_GENERIC_MSI_IRQ
>   is disabled
> 
>  drivers/vfio/cdx/Makefile  |  6 +++++-
>  drivers/vfio/cdx/private.h | 14 ++++++++++++++
>  2 files changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/vfio/cdx/Makefile b/drivers/vfio/cdx/Makefile
> index df92b320122a..dadbef2419ea 100644
> --- a/drivers/vfio/cdx/Makefile
> +++ b/drivers/vfio/cdx/Makefile
> @@ -5,4 +5,8 @@
>  
>  obj-$(CONFIG_VFIO_CDX) += vfio-cdx.o
>  
> -vfio-cdx-objs := main.o intr.o
> +vfio-cdx-objs := main.o
> +
> +ifdef CONFIG_GENERIC_MSI_IRQ
> +vfio-cdx-objs += intr.o
> +endif
> diff --git a/drivers/vfio/cdx/private.h b/drivers/vfio/cdx/private.h
> index dc56729b3114..5343eb61bec4 100644
> --- a/drivers/vfio/cdx/private.h
> +++ b/drivers/vfio/cdx/private.h
> @@ -38,11 +38,25 @@ struct vfio_cdx_device {
>  	u8			config_msi;
>  };
>  
> +#ifdef CONFIG_GENERIC_MSI_IRQ
>  int vfio_cdx_set_irqs_ioctl(struct vfio_cdx_device *vdev,
>  			    u32 flags, unsigned int index,
>  			    unsigned int start, unsigned int count,
>  			    void *data);
>  
>  void vfio_cdx_irqs_cleanup(struct vfio_cdx_device *vdev);
> +#else
> +static int vfio_cdx_set_irqs_ioctl(struct vfio_cdx_device *vdev,
> +				   u32 flags, unsigned int index,
> +				   unsigned int start, unsigned int count,
> +				   void *data)
> +{
> +	return -ENODEV;

With the fix to patch 1/, the device info ioctl should be returning
that there are no irqs available, so this should use the same errno as
any other case of the user trying to set an out-of-bounds irq, -EINVAL.

With that change

Reviewed-by: Alex Williamson <alex.williamson@...hat.com>

> +}
> +
> +static void vfio_cdx_irqs_cleanup(struct vfio_cdx_device *vdev)
> +{
> +}
> +#endif
>  
>  #endif /* VFIO_CDX_PRIVATE_H */


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ