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]
Date:	Wed, 18 Jul 2012 15:42:09 -0300
From:	Marcelo Tosatti <mtosatti@...hat.com>
To:	"Michael S. Tsirkin" <mst@...hat.com>
Cc:	Alex Williamson <alex.williamson@...hat.com>,
	Gleb Natapov <gleb@...hat.com>, avi@...hat.com,
	kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
	jan.kiszka@...mens.com
Subject: Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

On Wed, Jul 18, 2012 at 06:58:24PM +0300, Michael S. Tsirkin wrote:
> > > > > > Back to original point though current
> > > > > > situation is that calling kvm_set_irq() under spinlock is not worse for
> > > > > > scalability than calling it not under one.
> > > > > 
> > > > > Yes. Still the specific use can just use an atomic flag,
> > > > > lock+bool is not needed, and we won't need to undo it later.
> > > > 
> > > > 
> > > > Actually, no, replacing it with an atomic is racy.
> > > > 
> > > > CPU0 (inject)                       CPU1 (EOI)
> > > > atomic_cmpxchg(&asserted, 0, 1)
> > > >                                     atomic_cmpxchg(&asserted, 1, 0)
> > > >                                     kvm_set_irq(0)
> > > > kvm_set_irq(1)
> > > >                                     eventfd_signal
> > > > 
> > > > The interrupt is now stuck on until another interrupt is injected.
> > > > 
> > > 
> > > Well EOI somehow happened here before interrupt so it's a bug somewhere
> > > else?
> > 
> > Interrupts can be shared.  We also can't guarantee that the guest won't
> > write a bogus EOI to the ioapic.  The irq ack notifier doesn't filter on
> > irq source id... I'm not sure it can.
> 
> I guess if Avi OKs adding another kvm_set_irq under spinlock that's
> the best we can do for now.

Why can't a mutex be used instead of a spinlock again?


--
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