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: <172bead3-6b65-4598-9d5d-a560da4b153e@amd.com>
Date: Mon, 4 Mar 2024 17:00:16 +0530
From: "Gupta, Nipun" <nipun.gupta@....com>
To: Alex Williamson <alex.williamson@...hat.com>
Cc: tglx@...utronix.de, gregkh@...uxfoundation.org,
 linux-kernel@...r.kernel.org, kvm@...r.kernel.org, maz@...nel.org,
 git@....com, harpreet.anand@....com, pieter.jansen-van-vuuren@....com,
 nikhil.agarwal@....com, michal.simek@....com, abhijit.gangurde@....com,
 srivatsa@...il.mit.edu
Subject: Re: [PATCH v3 2/2] vfio/cdx: add interrupt support



On 3/1/2024 11:15 PM, Alex Williamson wrote:
> On Mon, 26 Feb 2024 14:18:13 +0530
> Nipun Gupta <nipun.gupta@....com> wrote:
> 
>> Support the following ioctls for CDX devices:
>> - VFIO_DEVICE_GET_IRQ_INFO
>> - VFIO_DEVICE_SET_IRQS
>>
>> This allows user to set an eventfd for cdx device interrupts and
>> trigger this interrupt eventfd from userspace.
>> All CDX device interrupts are MSIs. The MSIs are allocated from the
>> CDX-MSI domain.
>>
>> Signed-off-by: Nipun Gupta <nipun.gupta@....com>
>> Reviewed-by: Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@....com>
>> ---
>>

<snip>

>> +static int vfio_cdx_ioctl_get_irq_info(struct vfio_cdx_device *vdev,
>> +				       struct vfio_irq_info __user *arg)
>> +{
>> +	unsigned long minsz = offsetofend(struct vfio_irq_info, count);
>> +	struct cdx_device *cdx_dev = to_cdx_device(vdev->vdev.dev);
>> +	struct vfio_irq_info info;
>> +
>> +	if (copy_from_user(&info, arg, minsz))
>> +		return -EFAULT;
>> +
>> +	if (info.argsz < minsz)
>> +		return -EINVAL;
>> +
>> +	if (info.index >= 1)
>> +		return -EINVAL;
>> +
>> +	info.flags = VFIO_IRQ_INFO_EVENTFD;
> 
> 
> I think the way you're using this you'd also need the
> VFIO_IRQ_INFO_NORESIZE to indicate the MSI range cannot be expanded
> from the initial setting.  Thanks,

Yes, agree. Will update the flags in the next spin.

Thanks,
Nipun

> 
> Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ