Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp262967rwb; Tue, 25 Jul 2023 15:38:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlHdO8+jH2TLX2k0C+sthW2Z2e7YTpdA9YYDP2MOI5qB6TvdCOtYDSMC/cK1uu4IEVQgan8p X-Received: by 2002:a05:6a20:440c:b0:121:e573:3680 with SMTP id ce12-20020a056a20440c00b00121e5733680mr429236pzb.62.1690324683111; Tue, 25 Jul 2023 15:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690324683; cv=none; d=google.com; s=arc-20160816; b=xtCrrKVztsIHLNWuRHG9TbC0HBGsW7Et13Z9wQN5sIM7apVzMb7o86dgDKyRgPCHlQ gEARdTriuQA2bXXikJqsHeozAg59CZGj1OutovF5CziQKNUqfLZeLHvftb2Nf8mpqX1l /xEaBCGb4hTuNHhJSKdVwCcq3fTftrIpp9yze/N4jJ72JHr0STNekIg1Yw7fIJrcX4zl XvZqOaibXh2PgDRqg9TEqGXpUk4SXakbVP3eq+1NabenirvcIhsoDBlgtsowWSgG8MS4 7ngMX66XC3XxgDr8SQflXAPkAVV8T3dxuP67cVDkvYrvS3BmSWfsssNTPalcqogkCskN ud+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=P0UoevbyWgxaHmhug2zvt+Bs7wyxMQKEUUrBQQm9v4Y=; fh=juxwNcA6iKwLISFgUCNwdoIYC0NKLUseq3xZdq25RR4=; b=HIy70oXxatQHhcXu3tyXKtT3LAdQF51K6/o4BWFbFoDrrMfeIBnVwEoriugExVUR0u 3/P++dhIj2dFdinwHt0+sB8S1lWQ+XBwsEMZHv2a2q2Qs2GZS9GnV3ur9phwUwIWN/T3 BfEOF5ES1CWXw/9ybCjMoy3uQOYifyZovE639SC/cI9zsIgBpyO2Ib368/cU7vqZcih0 52ndtOmSmQPsoanK0zDt7WHSUIjc3jGNyvt8KXFU9o7VIncagSw8GGqCPTg80UojQNk/ qisOh3YdshIzidQomtjsTNitSGZ3j8bv9N28npFVVeP+2Iv7AJWlrVLSucjPLnoMwROh lVOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D7AHKu1l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a17-20020a637051000000b00543b16ecfa7si12176560pgn.172.2023.07.25.15.37.50; Tue, 25 Jul 2023 15:38:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D7AHKu1l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232450AbjGYWUo (ORCPT + 99 others); Tue, 25 Jul 2023 18:20:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232394AbjGYWT0 (ORCPT ); Tue, 25 Jul 2023 18:19:26 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FC9944A1; Tue, 25 Jul 2023 15:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690323396; x=1721859396; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FnRel535juPIzcohaQT4gbTQVJFUznDwrWq/ooVWuIg=; b=D7AHKu1l3qfg6WWfHhI0Vpf5NjZhv1QItXmctsqwIyCLNegEAu1UIBKW scudz7saEzbup4HVVt0dC+3hLbsR/lmb/DC4XwurtB++CKu1XXPoBPhM9 dAIV8CmVeUEEXcQbEGc7P0pR/eMFYxZTHd2LCGn2t0k9B2+x6HDIljJoZ R2HVN8s1MRxe/usuh5jkw62nM7UXitF0k3Mp4Peong/hMci6G24bcMORm WoDdumsFBHFcBBEw9bVUaHcw2N1zANZnLh2PECXhAt2OwN/LSaRRpfK2B RXFwW5O7o3qF7S0hYbQ9HFVUAt11ReBi+f9shFcvJ6U7wFwgYAqTZj1j5 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="357863277" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="357863277" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2023 15:15:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="1056938934" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="1056938934" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2023 15:15:38 -0700 From: isaku.yamahata@intel.com To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar , David Matlack , Kai Huang , Zhi Wang , chen.bo@intel.com, hang.yuan@intel.com, tina.zhang@intel.com Subject: [PATCH v15 045/115] KVM: x86/tdp_mmu: Sprinkle __must_check Date: Tue, 25 Jul 2023 15:13:56 -0700 Message-Id: <4010ab10284b74d841d455d1b3e433376e8b6c4a.1690322424.git.isaku.yamahata@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Isaku Yamahata TDP MMU allows tdp_mmu_set_spte_atomic() and tdp_mmu_zap_spte_atomic() to return -EBUSY or -EAGAIN error. The caller must check the return value and retry. Sprinkle __must_check to guarantee it. Signed-off-by: Isaku Yamahata --- arch/x86/kvm/mmu/tdp_mmu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c index 643c7c65456c..d3788a414551 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -567,9 +567,9 @@ static void handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn, * no side-effects other than setting iter->old_spte to the last * known value of the spte. */ -static inline int tdp_mmu_set_spte_atomic(struct kvm *kvm, - struct tdp_iter *iter, - u64 new_spte) +static inline int __must_check tdp_mmu_set_spte_atomic(struct kvm *kvm, + struct tdp_iter *iter, + u64 new_spte) { u64 *sptep = rcu_dereference(iter->sptep); @@ -599,8 +599,8 @@ static inline int tdp_mmu_set_spte_atomic(struct kvm *kvm, return 0; } -static inline int tdp_mmu_zap_spte_atomic(struct kvm *kvm, - struct tdp_iter *iter) +static inline int __must_check tdp_mmu_zap_spte_atomic(struct kvm *kvm, + struct tdp_iter *iter) { int ret; -- 2.25.1