From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [PATCH] bitops: add _local bitops Date: Fri, 11 May 2012 09:02:34 +1000 Message-ID: <1336690954.3881.66.camel@pasglop> References: <20120509134528.GA18044@redhat.com> <20120509121940.459e93ba.akpm@linux-foundation.org> <20120509200735.GA22743@redhat.com> <4FAACF1C.2060504@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: "Michael S. Tsirkin" , Andrew Morton , Rob Landley , Thomas Gleixner , Ingo Molnar , x86@kernel.org, Arnd Bergmann , David Howells , Akinobu Mita , Alexey Dobriyan , Herbert Xu , Stephen Rothwell , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Gleb Natapov , Paolo Bonzini , kvm@vger.kernel.org, Avi Kivity , Marcelo Tosatti , Linus Torvalds To: "H. Peter Anvin" Return-path: In-Reply-To: <4FAACF1C.2060504@zytor.com> Sender: linux-arch-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Wed, 2012-05-09 at 13:10 -0700, H. Peter Anvin wrote: > On 05/09/2012 01:07 PM, Michael S. Tsirkin wrote: > > > > In practice ATM any of the above will work. We probably don't even need > > to add barrier() calls since what we do afterwards is apic access which > > has an optimization barrier anyway. But I'm fine with adding them in > > there just in case if that's what people want. > > > > If you have the optimization barrier anyway, then I'd be fine with you > just using __test_and_clear_bit() and add to a comment in > arch/x86/include/asm/bitops.h that KVM needs it to be locally atomic. > > What is it used for ? IE. Is this strictly a requirement of x86 KVM ? Cheers, Ben.