Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751714AbbHLT5b (ORCPT ); Wed, 12 Aug 2015 15:57:31 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:53461 "EHLO e06smtp16.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751524AbbHLT53 (ORCPT ); Wed, 12 Aug 2015 15:57:29 -0400 X-Helo: d06dlp01.portsmouth.uk.ibm.com X-MailFrom: borntraeger@de.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Message-ID: <55CBA523.3010007@de.ibm.com> Date: Wed, 12 Aug 2015 21:57:23 +0200 From: Christian Borntraeger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org CC: kvm@vger.kernel.org, Paolo Bonzini Subject: Re: [PATCH v2 1/5] KVM: add kvm_has_request wrapper References: <1438792381-19453-1-git-send-email-rkrcmar@redhat.com> <1438792381-19453-2-git-send-email-rkrcmar@redhat.com> In-Reply-To: <1438792381-19453-2-git-send-email-rkrcmar@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15081219-0025-0000-0000-000006674D8F Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2001 Lines: 58 Am 05.08.2015 um 18:32 schrieb Radim Krčmář: > We want to have requests abstracted from bit operations. > > Signed-off-by: Radim Krčmář > --- kvm_check_request is now somewhat a misnomer (what is the difference between test and check?) but still Acked-by: Christian Borntraeger for the new interface. maybe we can rename kvm_check_request in a separate patch somewhen. > arch/x86/kvm/vmx.c | 2 +- > include/linux/kvm_host.h | 7 ++++++- > 2 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 217f66343dc8..17514fe7d2cb 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -5879,7 +5879,7 @@ static int handle_invalid_guest_state(struct kvm_vcpu *vcpu) > if (intr_window_requested && vmx_interrupt_allowed(vcpu)) > return handle_interrupt_window(&vmx->vcpu); > > - if (test_bit(KVM_REQ_EVENT, &vcpu->requests)) > + if (kvm_has_request(KVM_REQ_EVENT, vcpu)) > return 1; > > err = emulate_instruction(vcpu, EMULTYPE_NO_REEXECUTE); > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index 27ccdf91a465..52e388367a26 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -1089,9 +1089,14 @@ static inline void kvm_make_request(int req, struct kvm_vcpu *vcpu) > set_bit(req, &vcpu->requests); > } > > +static inline bool kvm_has_request(int req, struct kvm_vcpu *vcpu) > +{ > + return test_bit(req, &vcpu->requests); > +} > + > static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu) > { > - if (test_bit(req, &vcpu->requests)) { > + if (kvm_has_request(req, vcpu)) { > clear_bit(req, &vcpu->requests); > return true; > } else { > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/