Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp939051rdb; Tue, 30 Jan 2024 03:20:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGArLNM1nUMWvZhCZnbyCrUkPax8IBVmkYNAxK5+YKR4cOCp54tRLbZt3UY6PfgwYmcknUA X-Received: by 2002:a17:90a:a384:b0:293:e310:20b2 with SMTP id x4-20020a17090aa38400b00293e31020b2mr4092062pjp.8.1706613656296; Tue, 30 Jan 2024 03:20:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706613656; cv=pass; d=google.com; s=arc-20160816; b=olnWNpKzBPOLvAjR5HgsGvuqXAY69dJIljEOKTO0AaE5n0d82YXu7Zoqb2qo+WtCcP NaQDIFTIP+OhvqjHC2ww+ScIivdusyCkdjj1wO+8BZIY9xLE25LnrykR9zdOOqqF/TkK tQnb15wXjF3Ng0jwi/Drv/2DUS56aAUYV70y6FdDEiEpb7rTnymqyT//6NaOXzsMFrKx NhPUjEcnb0naJZn40FqVQmnXremQGFgrq6608B6SmyKuZeMuakAoymSSkfOEurjQ9cOG M8uQcPMmxgOJCAmscydT4JS2UzurYtsdI+OdcyShFr7wGprxy0GX9eCvoq1mh9jU89De Tqvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=nCkfd0qhrbYxLPmdT1dtwlcg0IPo+8lMWJwN5XzpK3k=; fh=8scsGQn+hJ1HvbMI23kGOdGh/wtWpH4wdCi8Q1zCFc4=; b=CbfFqyqqedhXL6ptmbpDWV9NHleNRMGINjIgDAJWOQu8DLzYvfqIgX08y+HkDRPcku 6y5fG5JQPvOtclgqqOlbtrRJ1wNoRK6vZ1wo5TKOL4Lelb9CiTQeWio7Ck7uXYwtcsc8 4vyfQ9EAVOiJDfhGRzabb5rltwope9E5C9CX7nkXGqx7T/yL5deAZa3ft1hWPJPCgSSR D9QoFWoaHdyb5y+zvoJ4AuoOYfx1CmhW7JoyOOijfWogmoqfy0NiQ7conWWayhk9iyi8 pg8UqO/Kwffp2iNFn9i1xvZUjXYmw2zj9V5fvPRkImmxoEJYcyqWIYbg91+Ji2W5BG15 1TmA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=b4kF8FIm; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-44104-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44104-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 x4-20020a17090a9dc400b00290443272e3si9285392pjv.105.2024.01.30.03.20.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 03:20:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44104-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=b4kF8FIm; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-44104-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44104-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 D4808B259E2 for ; Tue, 30 Jan 2024 08:15:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 706EF59150; Tue, 30 Jan 2024 08:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="b4kF8FIm" 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 4282F5823A; Tue, 30 Jan 2024 08:14:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.55.52.88 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706602463; cv=none; b=ixOfQtJXoL36vAqlxTjK7qIYNI2mC6GNNPwR59U0CTYrVCVxBE68i0rjTm8UNijChRCUJXqp54fCW6U0XSiY1lGqFLk/iqxXEDpd6VeeGmmtu1qZfMG5pt5Gl5QdvEbI/WbfCREi3zW5t72Vqn+UaSnQGXGmwXqmeRBpXOltz8g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706602463; c=relaxed/simple; bh=E8RAqBrguK3vR29UWlT3SGFAVHtLTsrLAzb3l9M3J3c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=S5iU6cCkWPNUwlXqcgA1Yez1WTRn/ssH6MrtLOje1AjmCQvg6u6U6LM5YCDExp5TqA3Xg6CfIg8w9+p56q+uzaHBFc4OnrySP7DPQ28RXFakXkpL5Q05YAxoWp2qTfanw4s3mBWjKPquhfMwB0UYwlkuTEZdABToY0WO3S5ZpZU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=b4kF8FIm; arc=none smtp.client-ip=192.55.52.88 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=1706602462; x=1738138462; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=E8RAqBrguK3vR29UWlT3SGFAVHtLTsrLAzb3l9M3J3c=; b=b4kF8FImrRrTh1q251wn+SXmyA2zx10jvILfUixAmHrRe1isx5PsBN13 wmCAQcV55nWVy68LrbvIYtqz0T98vhIizU90ZBsroMb7XmE67rFQztcD2 5FxPdRp70SpmQpm7FHhNP/UYp+D2iIHt9OU5VaEVSRMWRG+pF+m5iaQPp 52KZq7sj+xDhLmEj/NMo2ciUISE2V0OQFiLb5Qt5fnm7x1M62c0PG83hH 2sQ6gT2TTDVCdQFzsoBMxy3Cyj/PL3DilwkHXVgjVo8y4TKwFpWg3/hnY +tL3lWi7Ud/FZChgegv3VGMazCro4i6NAQrculGpyCFCrvdnxopzaGfZQ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10968"; a="434376209" X-IronPort-AV: E=Sophos;i="6.05,707,1701158400"; d="scan'208";a="434376209" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 00:14:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,707,1701158400"; d="scan'208";a="36420080" Received: from binbinwu-mobl.ccr.corp.intel.com (HELO [10.238.10.49]) ([10.238.10.49]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 00:14:18 -0800 Message-ID: <3ef50211-7746-4054-84b6-6861d6a91341@linux.intel.com> Date: Tue, 30 Jan 2024 16:14:15 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v18 050/121] KVM: x86/tdp_mmu: Sprinkle __must_check To: isaku.yamahata@intel.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar , Kai Huang , chen.bo@intel.com, hang.yuan@intel.com, tina.zhang@intel.com References: <8f7d5a1b241bf5351eaab828d1a1efe5c17699ca.1705965635.git.isaku.yamahata@intel.com> From: Binbin Wu In-Reply-To: <8f7d5a1b241bf5351eaab828d1a1efe5c17699ca.1705965635.git.isaku.yamahata@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/23/2024 7:53 AM, isaku.yamahata@intel.com wrote: > 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. Reviewed-by: Binbin Wu > > 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 fdc6e2221c33..2aacfab25e93 100644 > --- a/arch/x86/kvm/mmu/tdp_mmu.c > +++ b/arch/x86/kvm/mmu/tdp_mmu.c > @@ -507,9 +507,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); > > @@ -539,8 +539,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; >