mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gupta, Nipun" <nipun.gupta@amd.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: tglx@linutronix.de, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	maz@kernel.org, git@amd.com, harpreet.anand@amd.com,
	pieter.jansen-van-vuuren@amd.com, nikhil.agarwal@amd.com,
	michal.simek@amd.com, abhijit.gangurde@amd.com,
	srivatsa@csail.mit.edu
Subject: Re: [PATCH v3 2/2] vfio/cdx: add interrupt support
Date: Mon, 4 Mar 2024 17:00:16 +0530	[thread overview]
Message-ID: <172bead3-6b65-4598-9d5d-a560da4b153e@amd.com> (raw)
In-Reply-To: <20240301104521.228f8e84.alex.williamson@redhat.com>



On 3/1/2024 11:15 PM, Alex Williamson wrote:
> On Mon, 26 Feb 2024 14:18:13 +0530
> Nipun Gupta <nipun.gupta@amd.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@amd.com>
>> Reviewed-by: Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@amd.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

      reply	other threads:[~2024-03-04 11:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26  8:48 [PATCH v3 1/2] genirq/msi: add wrapper msi allocation API and export msi functions Nipun Gupta
2024-02-26  8:48 ` [PATCH v3 2/2] vfio/cdx: add interrupt support Nipun Gupta
2024-03-01 17:45   ` Alex Williamson
2024-03-04 11:30     ` Gupta, Nipun [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=172bead3-6b65-4598-9d5d-a560da4b153e@amd.com \
    --to=nipun.gupta@amd.com \
    --cc=abhijit.gangurde@amd.com \
    --cc=alex.williamson@redhat.com \
    --cc=git@amd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=harpreet.anand@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=michal.simek@amd.com \
    --cc=nikhil.agarwal@amd.com \
    --cc=pieter.jansen-van-vuuren@amd.com \
    --cc=srivatsa@csail.mit.edu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®