Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BE07C6FD19 for ; Sun, 12 Mar 2023 18:00:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231350AbjCLSAw (ORCPT ); Sun, 12 Mar 2023 14:00:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbjCLSAA (ORCPT ); Sun, 12 Mar 2023 14:00:00 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B19D25294; Sun, 12 Mar 2023 10:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678643904; x=1710179904; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=riW3Gcu7IPNKVpcMLpnpvaQ0NboK3yKx0oYBpm0ALTM=; b=VSsSaa+ixdMQR/lLqcQgbyGZ25vCw9203Gnhp9X3G1CDGotcKL5R54Ka zuwphSczWXMEOgUwtFZSY3rctg+7BMiTKQ2A0l4WpUhawlZnXLDAIffKQ d5ogyE6w8VtHcWDCZodVfGU92RJhlzWGdxnLdnPal5sLUmw+4PL5COEC4 lDOMzXDm7lcK8U/RMSGqYJsOWENc7w6tnl0IFOHO/P+d+tQhtZThMLxVv TdmkzhJYlIZJ7Hs9W1bUsA7jgndR5s/r6saBBkrgwslJPq9IjSOBZ9bRU Suh4xHXZdhAETlamxWlAUtyM5HAYRrNBUSVsCSv0Rd1CvyE0FV0aqnhoO A==; X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="316659874" X-IronPort-AV: E=Sophos;i="5.98,254,1673942400"; d="scan'208";a="316659874" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2023 10:58:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="742596627" X-IronPort-AV: E=Sophos;i="5.98,254,1673942400"; d="scan'208";a="742596627" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2023 10:58:05 -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 Subject: [PATCH v13 045/113] KVM: x86/tdp_mmu: Sprinkle __must_check Date: Sun, 12 Mar 2023 10:56:09 -0700 Message-Id: <4797957ba06e6cbecde167ae426a0e4b61bd643e.1678643052.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 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 3e2575128739..67bc6084b497 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -628,9 +628,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); @@ -658,8 +658,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