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:	Fri, 19 Feb 2016 16:06:10 +0100
From:	Paolo Bonzini <pbonzini@...hat.com>
To:	Radim Krčmář <rkrcmar@...hat.com>
Cc:	linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
	Yuki Shibuya <shibuya.yk@...s.nec.co.jp>
Subject: Re: [PATCH v2 08/14] KVM: x86: remove notifiers from PIT discard
 policy



On 19/02/2016 16:04, Radim Krčmář wrote:
>> > 
>> > ... so in patch 7 concurrent _writes_ of reinject are protected by the
>> > lock, but reads are done outside it (in pit_timer_fn).  WDYT about
>> > making reinject an atomic_t?
> There was/is no harm in having reinject non-atomic.  This patch added
> notifiers, which is the reason for re-introducing a mutex.
> 
> Userspace can (and SHOULDN'T) call this function multiple times,
> concurrently, so the mutex prevents a situations where, e.g. only one
> notifier is registered in the end.

Yes, I understand why you added the mutex here; good catch indeed.  The
atomic_t is just to show that it's okay to read it outside the lock.
It's just for a bit of extra documentation.

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ