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] [thread-next>] [day] [month] [year] [list]
Message-ID: <50476BC4.4050807@redhat.com>
Date:	Wed, 05 Sep 2012 18:12:04 +0300
From:	Avi Kivity <avi@...hat.com>
To:	"Michael S. Tsirkin" <mst@...hat.com>
CC:	Alex Williamson <alex.williamson@...hat.com>, gleb@...hat.com,
	kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v9 1/2] kvm: Use a reserved IRQ source ID for irqfd

On 09/05/2012 06:09 PM, Michael S. Tsirkin wrote:
> On Wed, Sep 05, 2012 at 05:51:53PM +0300, Michael S. Tsirkin wrote:
>> On Wed, Sep 05, 2012 at 05:35:43PM +0300, Avi Kivity wrote:
>> > On 08/22/2012 03:41 AM, Michael S. Tsirkin wrote:
>> > >> 
>> > >> I assumed you were pointing out the level vs edge interaction.  If we
>> > >> call that a userspace bug, I can just drop this.  Thanks,
>> > >> 
>> > >> Alex
>> > > 
>> > > level is userspace bug I think :)
>> > 
>> > I don't see how it's a bug.  Suppose we have a vfio device that shares a
>> > gsi with an emulated device.  The emulated device naturally uses
>> > KVM_IRQ_LINE (it has no need to re-sample on ADN), while vfio naturally
>> > has to use irqfd.
>> 
>> Absolutely. But vfio needs to use irqfd with the new flag.
>> Using existing irqfd for level is a bug.
>> 
>> > Note one would expect that each irqfd gets its own irq source id, since
>> > they are all independent level sources.  The reason they don't is that
>> > we shut them down anyway and let the sources re-trigger (it is more
>> > accurate to say that they have no irq source id, but that would just
>> > muddle the implementation).
>> > 
>> > Alex, if the conclusion is that we do need this patch, then please add a
>> > comment explaining why we can share the source id among all irqfd users.
> 
> Something along the lines of
> 
> /* 
>    For resample irqfds, level is a logical OR of all inputs;
>    to support this, track state for RESAMPLE irqfds separately
>    from userspace. We do not need to track state for each input since
>    they are all deasserted at the same time, before resampling.
>    */

Well the comment style is wrong.

To expand a little more, irqfd only sends assert events, so assigning
the level is equivalent to an OR.  Clearing an resampling simply builds
the state again.

btw, there can be other irq source IDs if the lines are shared with the
PIT or kvm assigned devices.

-- 
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ