Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2609854rdg; Mon, 16 Oct 2023 09:18:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEz15sNABCd9E3m2N2DntIdLAUk5AyUTrLc8WAYQohteRr+63ByJkyYriYAl1Fn7FUDw80O X-Received: by 2002:a17:90b:8d1:b0:27c:ed8e:1840 with SMTP id ds17-20020a17090b08d100b0027ced8e1840mr14837268pjb.10.1697473091820; Mon, 16 Oct 2023 09:18:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697473091; cv=none; d=google.com; s=arc-20160816; b=yRZegA/o4QuB0VfbKivB+5pBQo1/LNARZSkdWpYPZAV/EFyhqbAWFR3FZ+yTV7BAs4 dxAq+R5YU1dmM04ZhJbkAJGIpUAr1ST4DQG3Hp5qg/Hjjkgez2+tI5NT80fJzKIhWx82 j4j6N760CUJA+s3dd1yUKzIKrkiNG1Ss6hG/t1RIUH5/MulHQEzTfCd5tGpW5ZxkfKrq XoEUYAjAKJkRi6wSIBck8pqSxMg/Kbrn06s01y8Rvggs4k1Ms5mMl/1ZQwz54BFADm/U QFqs8IhmlXugTqj4+74Gv8stT2cQk3xe39V3a9suo56jFoo7FaTzDb+/k2TaBN0aHsMD uYAg== 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=mpDQ7B37hI/m9qUQ0LxnswKYy4h1/GQ/dZgq/ydHKKk=; fh=lRdU2Q/1zx5DcPdZuWBjshA5VT5Oc9cEhB1tCFiV0Nw=; b=qkkPlORnzHE77P71DNc7p8uhiSFPYjM2jTGT3FU3u3tx8vg/nArAgKakGFBzFuhC2s 1OKMXV6hUsTp/QEl7pGykQKOf6FJMlV4+wzKwTkxeT9c+LWRd7EzqCKMlkL+ern2Bwll N1/EzG4s7iwATa+PdVW7jTsLlNoLI6ysAKsXxSOd0kiJ6gFGI2NG+WViLVsg+g43qN8B zH3ZGR/TiTnoTUVpPY05AcRa3jAbSJEfX9F/Uod+x+Lf8uIR5QNJYoqNjOJW0JJvXQre KZXHK6Q2GVLUxXp4qnX9eTFpIw+rR9pLSZ1Sg07MTymxGNha39q6i72p/gRW75vcBLg+ rcIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kGzw+m7e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id dw21-20020a17090b095500b0027b258f284esi6187931pjb.26.2023.10.16.09.18.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 09:18:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kGzw+m7e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id D62798022CCB; Mon, 16 Oct 2023 09:17:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233892AbjJPQRA (ORCPT + 99 others); Mon, 16 Oct 2023 12:17:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233759AbjJPQQt (ORCPT ); Mon, 16 Oct 2023 12:16:49 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99CB483; Mon, 16 Oct 2023 09:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697473007; x=1729009007; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Vcfo3VrFSXo0AcnEcqaWcF2T8gFYUDjrWL/o/03UKpc=; b=kGzw+m7ePZGqrf75dXakfwnaj5l0/7bFMRdVaPR4HtCDAPEzfW45jWO+ AXXZeg8dTNAC6rKCwIhwa4MqoOyuSRJ4sNVXEoM00AaitV4YarxOAevwy W0ehO1XChhRhwemL25hLz+YkmDoX7zkKO3IGeC1Hi9MuASMI/mxC+CFR4 j9KFgwEMvTEW8FvGfQessmYBv2wRut0LYVutVNjrpI2uHosL8qigJ4M3h D3Sc6E/rNiWfyxjM223Qq2eESfVMPiqmKFNkocUmHp/OjQcbLxEMTYQgp KxtX6wxBgJxOmuP4KGM5RD9vPC0jwFpBpvW1cDJ7LkvQo5FQODj5svIj4 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="364921753" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="364921753" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:15:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="846448110" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="846448110" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:15:42 -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 v16 045/116] KVM: x86/tdp_mmu: Sprinkle __must_check Date: Mon, 16 Oct 2023 09:13:57 -0700 Message-Id: <8018ce789f7bc0147af1f43804edbc945cebd5b9.1697471314.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=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 16 Oct 2023 09:17:58 -0700 (PDT) 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 d76c1ad44638..882848b24941 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