qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@linaro.org>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: peter.maydell@linaro.org, eric.auger@st.com,
	qemu-devel@nongnu.org, christoffer.dall@linaro.org,
	patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH 2/2] hw/vfio/platform: do not set resamplefd for edge-sensitive IRQS
Date: Thu, 24 Sep 2015 19:35:13 +0200	[thread overview]
Message-ID: <56043451.10308@linaro.org> (raw)
In-Reply-To: <1443036490.23936.506.camel@redhat.com>

On 09/23/2015 09:28 PM, Alex Williamson wrote:
> On Wed, 2015-09-23 at 00:00 +0100, Eric Auger wrote:
>> In irqfd mode, current code attempts to set a resamplefd whatever
>> the type of the IRQ. For an edge-sensitive IRQ this attempt fails
>> and as a consequence the whole irqfd setup fails and we fall back
>> to the slow mode. This patch bypasses the resamplefd setting for
>> non level-sentive IRQs.
>>
>> Signed-off-by: Eric Auger <eric.auger@linaro.org>
>> ---
>>  hw/vfio/platform.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
>> index 38eaccf..2c91650 100644
>> --- a/hw/vfio/platform.c
>> +++ b/hw/vfio/platform.c
>> @@ -352,6 +352,10 @@ static int vfio_set_resample_eventfd(VFIOINTp *intp)
>>      int argsz, ret;
>>      int32_t *pfd;
>>  
>> +    if (!(intp->flags & VFIO_IRQ_INFO_AUTOMASKED)) {
>> +        return 0;
>> +    }
>> +
>>      argsz = sizeof(*irq_set) + sizeof(*pfd);
>>      irq_set = g_malloc0(argsz);
>>      irq_set->argsz = argsz;
> 
> Aren't we also wasting a file descriptor for intp->unmask on edge IRQs
> as well?  I'd be tempted to make a helper function that does this test
> and use it both to avoid calling this in vfio_start_irqfd_injection()
> and also to avoid creating the unused eventfd in vfio_init_intp().
> Thanks,

Makes sense

Thanks

Eric
> 
> Alex
> 

      reply	other threads:[~2015-09-24 17:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 23:00 [Qemu-devel] [PATCH 0/2] hw/vfio/platform: irqfd setup changes Eric Auger
2015-09-22 23:00 ` [Qemu-devel] [PATCH 1/2] hw/vfio/platform: irqfd setup sequence update Eric Auger
2015-09-22 23:00 ` [Qemu-devel] [PATCH 2/2] hw/vfio/platform: do not set resamplefd for edge-sensitive IRQS Eric Auger
2015-09-23 19:28   ` Alex Williamson
2015-09-24 17:35     ` Eric Auger [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=56043451.10308@linaro.org \
    --to=eric.auger@linaro.org \
    --cc=alex.williamson@redhat.com \
    --cc=christoffer.dall@linaro.org \
    --cc=eric.auger@st.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).