From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934257AbdBQO72 (ORCPT ); Fri, 17 Feb 2017 09:59:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57806 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933885AbdBQO7Z (ORCPT ); Fri, 17 Feb 2017 09:59:25 -0500 Date: Fri, 17 Feb 2017 15:59:21 +0100 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Andrew Jones Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Marc Zyngier , Christian Borntraeger , Cornelia Huck , James Hogan , Paul Mackerras , Christoffer Dall Subject: Re: [PATCH 5/5] KVM: add kvm_request_pending Message-ID: <20170217145920.GA28391@potion> References: <20170216160449.13094-1-rkrcmar@redhat.com> <20170216160449.13094-6-rkrcmar@redhat.com> <20170217095146.xmp4e5m22qozhq2i@kamzik.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170217095146.xmp4e5m22qozhq2i@kamzik.brq.redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 17 Feb 2017 14:59:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-02-17 10:51+0100, Andrew Jones: > On Thu, Feb 16, 2017 at 05:04:49PM +0100, Radim Krčmář wrote: > ... >> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h >> index 2cc438685af8..563cf964dc5c 100644 >> --- a/include/linux/kvm_host.h >> +++ b/include/linux/kvm_host.h >> @@ -1101,6 +1101,11 @@ static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) >> * should contain kvm_vcpu_kick(). >> */ >> >> +static inline bool kvm_request_pending(struct kvm_vcpu *vcpu) >> +{ >> + return vcpu->requests; > > How about wrapping this with READ_ONCE for good measure? Sounds good; I don't think that callers would want stale values, thanks.