From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [PATCH v2 2/5] KVM: add KVM request variants without barrier Date: Tue, 28 Feb 2017 15:34:24 +0800 Message-ID: <20170228073424.GL10022@pxdev.xzpeter.org> References: <20170224195002.28030-1-rkrcmar@redhat.com> <20170224195002.28030-3-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Andrew Jones , Marc Zyngier , Christian Borntraeger , Cornelia Huck , James Hogan , Paul Mackerras , Christoffer Dall , David Hildenbrand To: Radim =?utf-8?B?S3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47850 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751037AbdB1Hed (ORCPT ); Tue, 28 Feb 2017 02:34:33 -0500 Content-Disposition: inline In-Reply-To: <20170224195002.28030-3-rkrcmar@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Feb 24, 2017 at 08:49:59PM +0100, Radim Krčmář wrote: > The leading underscores denote that the call is just a bitop wrapper. > > Switch all users of open-coded set/check/test to kvm_request ones. > > Automated by coccinelle script: > @@ > expression VCPU, REQ; > @@ > -set_bit(REQ, &VCPU->requests) > +__kvm_request_set(REQ, VCPU) > > @@ > expression VCPU, REQ; > @@ > -clear_bit(REQ, &VCPU->requests) > +__kvm_request_clear(REQ, VCPU) > > @@ > expression VCPU, REQ; > @@ > -test_bit(REQ, &VCPU->requests) > +__kvm_request_test(REQ, VCPU) > > Signed-off-by: Radim Krčmář > --- > v2: clear_bit in __kvm_request_clear [Paolo] > --- > arch/mips/kvm/emulate.c | 2 +- > arch/powerpc/kvm/book3s_pr.c | 2 +- > arch/powerpc/kvm/book3s_pr_papr.c | 2 +- > arch/powerpc/kvm/booke.c | 4 ++-- > arch/powerpc/kvm/powerpc.c | 2 +- > arch/s390/kvm/kvm-s390.c | 2 +- > arch/x86/kvm/vmx.c | 2 +- > arch/x86/kvm/x86.c | 14 +++++++------- > include/linux/kvm_host.h | 23 ++++++++++++++++++++--- > 9 files changed, 35 insertions(+), 18 deletions(-) > > diff --git a/arch/mips/kvm/emulate.c b/arch/mips/kvm/emulate.c > index ee4af898bcf6..552ae2b5e911 100644 > --- a/arch/mips/kvm/emulate.c > +++ b/arch/mips/kvm/emulate.c > @@ -865,7 +865,7 @@ enum emulation_result kvm_mips_emul_wait(struct kvm_vcpu *vcpu) > * check if any I/O interrupts are pending. > */ > if (kvm_request_test_and_clear(KVM_REQ_UNHALT, vcpu)) { > - clear_bit(KVM_REQ_UNHALT, &vcpu->requests); > + __kvm_request_clear(KVM_REQ_UNHALT, vcpu); Shall we just remove above line since we cleared it already? -- peterx