From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Hogan Subject: Re: [PATCH v2 11/23] MIPS: KVM: Fix timer race modifying guest CP0_Cause Date: Thu, 29 May 2014 11:55:40 +0100 Message-ID: <5387122C.2080203@imgtec.com> References: <1401355005-20370-1-git-send-email-james.hogan@imgtec.com> <1401355005-20370-12-git-send-email-james.hogan@imgtec.com> <53870D99.3030900@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit Cc: Andreas Herrmann , Gleb Natapov , , Ralf Baechle , , Sanjay Lal To: Paolo Bonzini Return-path: Received: from mailapp01.imgtec.com ([195.59.15.196]:36444 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932629AbaE2Kzo (ORCPT ); Thu, 29 May 2014 06:55:44 -0400 In-Reply-To: <53870D99.3030900@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Hi Paolo, On 29/05/14 11:36, Paolo Bonzini wrote: > Il 29/05/2014 11:16, James Hogan ha scritto: >> Currently this is the only asynchronous modification of guest registers, >> therefore it is fixed by adjusting the implementations of the >> kvm_set_c0_guest_cause(), kvm_clear_c0_guest_cause(), and >> kvm_change_c0_guest_cause() macros which are used for modifying the >> guest CP0_Cause register to use ll/sc to ensure atomic modification. > > Shouldn't you have a loop too around the ll/sc? Yes, it has a do {} while () look around the inline asm, although I didn't mention it in the commit message. It's modelled on arch/mips/include/asm/bitops.h. Cheers James