Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2683983rwd; Sun, 28 May 2023 22:09:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6p91cFpHCkzY1LFPDTiiiqcZ6eduhHHVULjDY27trBDR20Gw3HRr1x1Yip1E77B+J9b211 X-Received: by 2002:a05:6a20:d49a:b0:10c:7676:73af with SMTP id im26-20020a056a20d49a00b0010c767673afmr7006080pzb.53.1685336947535; Sun, 28 May 2023 22:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685336947; cv=none; d=google.com; s=arc-20160816; b=QZMbAim8iTRcFmftiEEXYB/tz9JTZ9xEQo6zKKY0ByhYE2vobx3k/qlOcnbqQYvho8 ZXumWETaUPAb2RWQNBc3MWh86pQ2nVPGn/lA/HZj79UBd303ORVhXNc+uzPiaPjdNrfQ l7lskGqKAFFd+i1lCgS9lZIKwbELlX9MlGekwrxzsrDAwgCksgb+Ju4lDfPQner4/obB Z1MmSJVS0QxFYjBwmuuY+Abgk9ezt12UqRKrmY+czODVLXuLNbfrzAGVGRBxsvpfe4vn ttzlBCQdwLOPUHdqAZqtRyv5ZMlBKmII0CH8osGcgAL78RUzQUEmRI+AXsBLVoTaaGvw TjmA== 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=dpg3Tbpe9veRwrvZQbDGFiuEhv/Nz7mVwjj9uH346nc=; b=Tfb5vAg5QICqAhC/29Qkes9hDPqut8HSM/Fijhg03zrj8aZ6RQ60YW2Cv88zOgWvq2 okHRJzaAYHReyAWKiMOEBGqls/fxerfwizWAvcRsW3Ss01ZwzC0/yZpRxaiISrPNtM/h XSGXy6ueNgQ/kHjgfkmKLqV8dTfCd5jFGncOwoLw2G3hA/WY504Purp6aiFPUfAKa5S+ hQ24wgxg2Qlu2jEwmsu4mkXbmGZA2z9PodnHecRnmDzX7PQDDGbBjZ7lJtrG8qsdjwdt TUjSVBTb1AxA12wWFB5d+DrJoU0x7KhqTGIhQpLBSXhewepzU+/OseQAhR16/SSqT/PG hr+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VmJgn8jP; 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 ip14-20020a17090b314e00b00250cb2a2000si10135054pjb.113.2023.05.28.22.08.56; Sun, 28 May 2023 22:09:07 -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=VmJgn8jP; 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 S231920AbjE2EZ4 (ORCPT + 99 others); Mon, 29 May 2023 00:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231866AbjE2EZK (ORCPT ); Mon, 29 May 2023 00:25:10 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19DC91BDA; Sun, 28 May 2023 21:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685334181; x=1716870181; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WIDi2HtQlR++nj7itb3foujCHQr1iube8WvcPPt2raI=; b=VmJgn8jPsqKiD0Ri/kzyoWAnZzyIRrTokfHu6YWTByAO43Y0FT6FcBS2 sac5TSQF70+M1nA+e0XQegverz8wZZi5R6OC3QGu0xidDXdlOWdTL5Spu Vjfomy0HSURa4B4rHGZrgFiAL33zSfoKxMC/XjJAyjMDQLObbJp5Yt42R JKHfHkdmGFSG6wQ0Tg5F1Xg6AR3AbVcnoqLQibFIKAQeF4IsOdnU3nUUI goRyWRHYcCqYP11esEfpMr7C5eIhjlnM1rJUGBQPebg2nLgOtAt0iQrhH 3kX8iUvj+2QKhT4A3XtskVHTOGehg1sVtLX0O++Qlh0FnWPcf5Nh/cPMh Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="334965983" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="334965983" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2023 21:21:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="775784312" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="775784312" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2023 21:21:15 -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 Subject: [PATCH v14 045/113] KVM: x86/tdp_mmu: Sprinkle __must_check Date: Sun, 28 May 2023 21:19:27 -0700 Message-Id: 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.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 fb3e47293ffa..992f630c49b9 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); @@ -596,8 +596,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