Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1619850rdd; Thu, 11 Jan 2024 04:51:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSlTz42bkfcJhLt0Gzi0KXZXEWg3H8XyAZkXWHu7cLTnIS/rCe4Tyvsciav7ozp+XS5E8Z X-Received: by 2002:a17:902:e844:b0:1cf:b4bb:9bdc with SMTP id t4-20020a170902e84400b001cfb4bb9bdcmr1196420plg.9.1704977507992; Thu, 11 Jan 2024 04:51:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704977507; cv=none; d=google.com; s=arc-20160816; b=gAfx+KcklFHVAfLlXvlraezlXPqeNi1roi0xI/nbwN2OcIdZj4V/bJuL+CVtvVtY07 X7/o3GZ1W1VVJwGvn5u2gBQywyJAv53ewg+DBnAqDgut4GA6ku+URI/+cP0e1QA8VGKb qKW05Zmegye0LPsKKZUejbfTs2oRzbKgw4o8VrNjWxeixGyEZ/KdSyxnJsy/NKqtHBFa lA0ZBM69A1Ggrg/6rbxjgfyOhQUUQBeXosieBBpo8WeMuvdRhQoZ0x8aeILeeAT8DbiY +j+P/O4joWz5jG6phXjdiuXqGmVw69xLaSVVOaKp6Pxnk48MUjvLRJIAHnytvAycTJ61 06nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=ovqHdRh81Ay77jXpnjW+LxA5YX60OXwhpSf50QvpFBY=; fh=TdU2uh/YgCNbsUMQTg2WBgIlDkCy2MXSrlthNLdNUds=; b=rs0CpSdVsDzfCM0ffg8JV+d3Q+8V9yHRkQZ3wodi9c20nXLU/4ZqYtjY1EkZh24Qj6 MECgqFH/nh9aPJNZWLasPo+FORsZTJoYP3FbEJK/8WRu+KlBskaV8NYE4Q6n/O/+h4Jv o/o1GCCkP5M/X7RNqeTu34MrhzqCOjFgvvb9oPAYrn5Y72Kj/EtOhSUY+6Qb0DIpTTeQ xTU/psIE3LL3ARHEQoj8+ROXNeUTCqcxwauTe4cyHsrjzlOXVOkPV3IlGhBWngBIhupi Wg0lxNqfHsUSsH6N20FzJ7oshLBeurQdwcPUmMSYP3ej52C5hjmK9xkEavGK6xwclxgH DIBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FrOE4VmD; spf=pass (google.com: domain of linux-kernel+bounces-23605-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23605-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id kf7-20020a17090305c700b001d47fc3767bsi1023360plb.119.2024.01.11.04.51.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 04:51:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23605-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FrOE4VmD; spf=pass (google.com: domain of linux-kernel+bounces-23605-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23605-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4749AB236BB for ; Thu, 11 Jan 2024 12:50:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1306516412; Thu, 11 Jan 2024 12:49:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FrOE4VmD" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBF8716400; Thu, 11 Jan 2024 12:49:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704977389; x=1736513389; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=oIFCuUvPwoxvyeSdEWGklHOP+KJiBPUYcOtOvhrmoxA=; b=FrOE4VmDAVCwrWJE+p9yZbwM2jKGI8pIEwyT0gN0/351PaUIittQks0L ltHu+L5mAjkkV37du1Nvq5bs2HMlJfWoxxyZL42noUMkmWGKzIVJzMGgC CyaRaGdewPGzdovrJoYrRuY3Or54UcCmn2EGxzo0rEQSc7hoq2wTKERvE 2z3+e6o2mm6M74AXT2KGaBzmFpiz1KeJvtYBqsCnFZ6oxiLPfLdMzu2Vf p26e6UJsldEd+fFpSrocoKAFD/lHYZjB4kbRdy7K8O9C1+QEav+enN1Tm l4pI3RFfsBCtETMvVu79weRhU4rDZjHSoXdPFE5PlAnI8xW5WVgt7YJ40 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="430017252" X-IronPort-AV: E=Sophos;i="6.04,186,1695711600"; d="scan'208";a="430017252" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 04:49:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="816705049" X-IronPort-AV: E=Sophos;i="6.04,186,1695711600"; d="scan'208";a="816705049" Received: from yy-desk-7060.sh.intel.com (HELO localhost) ([10.239.159.76]) by orsmga001.jf.intel.com with ESMTP; 11 Jan 2024 04:49:46 -0800 Date: Thu, 11 Jan 2024 20:49:45 +0800 From: Yuan Yao To: Sean Christopherson Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Like Xu Subject: Re: [PATCH 3/4] KVM: x86: Clean up directed yield API for "has pending interrupt" Message-ID: <20240111124945.pto6bmvcl5saz53n@yy-desk-7060> References: <20240110003938.490206-1-seanjc@google.com> <20240110003938.490206-4-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240110003938.490206-4-seanjc@google.com> User-Agent: NeoMutt/20171215 On Tue, Jan 09, 2024 at 04:39:37PM -0800, Sean Christopherson wrote: > Directly return the boolean result of whether or not a vCPU has a pending > interrupt instead of effectively doing: > > if (true) > return true; > > return false; > > Signed-off-by: Sean Christopherson Reviewed-by: Yuan Yao > --- > arch/x86/kvm/x86.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 77494f9c8d49..b7996a75d9a3 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -13083,11 +13083,8 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) > > bool kvm_arch_dy_has_pending_interrupt(struct kvm_vcpu *vcpu) > { > - if (kvm_vcpu_apicv_active(vcpu) && > - static_call(kvm_x86_dy_apicv_has_pending_interrupt)(vcpu)) > - return true; > - > - return false; > + return kvm_vcpu_apicv_active(vcpu) && > + static_call(kvm_x86_dy_apicv_has_pending_interrupt)(vcpu); > } > > bool kvm_arch_vcpu_preempted_in_kernel(struct kvm_vcpu *vcpu) > -- > 2.43.0.472.g3155946c3a-goog > >