Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1181334rbb; Mon, 26 Feb 2024 00:58:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXK+aElCz7VSvQ1G/btYYEFTPWPOT48LMZ1s4UUEePB0u2jVeNh+KkIpprDbrH8bmmMFYe8QYBK8jE194jpz8lMosYR+yWy6LQL4tH1fg== X-Google-Smtp-Source: AGHT+IFbXpRMonJVEkvxWxJniU9UVsfn/0FRoGkcVQNIJBl5ydaMeFBSzHiw+EiNS3IT4jkeFxUA X-Received: by 2002:a81:b64f:0:b0:608:8a6b:b213 with SMTP id h15-20020a81b64f000000b006088a6bb213mr6592288ywk.33.1708937910056; Mon, 26 Feb 2024 00:58:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708937910; cv=pass; d=google.com; s=arc-20160816; b=y4eMk9W2BS9hfCmpkw/MViN8lQ5wZQ/Bqz1iI2vhtHaNADAIp20NUPFCibheIWAsnH 0J6eEfZtAT20jM3c14YxB2oqpBHQY+G9HdAjXFaPgqNG0tYEZ7Un2jFVjE3z6Q3mL1LS KPa/0Pcs4V5IcuTy4ElimzEN3FI3oQ2gaeoRSmUxKbhTNZmlUUvm02xpe0HpgiB2gxqh VJ9z8jf6FqmFK77Wos6ZQX02Ywm7tXMmCcIxifSNkWyZgdTPvrTx8xyuQjvsd51sRDjk GFG1RwWUbtQIiPXT+Yz/Nt1xI1T4wU8cepuqIt11nqj1j+IiwCcojxFyavhwWrQQKEX4 hKiA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=zASpqAWqcvAPNNvWf0o6HKvTtBDzGXVzhL1TGb+iTdA=; fh=GU4KR9NKf1qQHjmWlEi4zSAEAxyD6Pa0rUGDupPjr4Q=; b=ccReM2Balrp4e1SAS7Dg+NJZGWgtGRlhxl0w9LnJteE6RweCyljg6EmZoVNNDwFBVX LgD78+eP6Ep+i2m3dGxfZrmpirS2QLYa4Sa0Xm7u/DaEGCK3Q0kfAtY6MJ3OdC66Lh4o fqpVv9mM0/VZQwCeKF5vW3IRe2Vkm5xdSNinIHgmC02dL3yW6n6KjrZeYFIA7wyBwcyp Qe0ndA+reZgibXrBPdruKGIJtQ0E39ZfDUdJm2y5gOQPk1AAmsIGel/1ceX9jwQOpOD1 ipikyULSjN7TiaWVqFmF4OI/CbF4QKV0vfZfW/lrUI5x+yO0P10bOYgqJjBl6ygW3tp5 VlDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KrnSeZr8; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-80824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80824-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. [147.75.48.161]) by mx.google.com with ESMTPS id d23-20020a63f257000000b005dc82971737si3260490pgk.365.2024.02.26.00.58.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 00:58:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KrnSeZr8; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-80824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80824-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 DFA75B242A4 for ; Mon, 26 Feb 2024 08:47:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37CF6626A9; Mon, 26 Feb 2024 08:28:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KrnSeZr8" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 E234B60BA8; Mon, 26 Feb 2024 08:28:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708936105; cv=none; b=IkydHhxru7tIZWsZuhWJUefonMLI+liBkZKfT07A12/qdWfaa7lpbDdnfLHV72VYROwCnwtEJfcrEKN0ATYdTUMBJuHs66ko++F0nM72yMFLN9D9ZwQgwW4cXxvMcRjzFJG6ChqGLR8uktGHOZJYKiXaeDMXEpzjSxI1Xq1nNRE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708936105; c=relaxed/simple; bh=WUIyQRqsBA8fWp2BC5BUSOmDMUGqWMDNMhmPzCSRUbg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eeCNVLuXTMFnHMnPioKHkvI7sE3on+rV+NbAc0a0q0vAzmPRQF7JDkinIHycPrQ2xgsadqUFWmjAwqzZPPNz8aZgZ22WT6IJpRIh4nkzx3YJVHXfbAcGdkM2DapbP3jxO++JyLWuwZQF/3frECMLFNeJjxTWHghCvokQq+6j+6E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=KrnSeZr8; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708936104; x=1740472104; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WUIyQRqsBA8fWp2BC5BUSOmDMUGqWMDNMhmPzCSRUbg=; b=KrnSeZr8iGAXQOUuWkSiDSSnLKeXAg3QWYR8v2GOKnm+ZhWVBcZw3w/y 2azjPk+/luaTKbJJ+mbOfqzUH39tb4P4f8DOPhiYpmpR0yM5o/OiaaVwy a0rGN466rSN9K8Ze98XrQhIJf5OcKsErN7BrZrN5Pc7qNryUPT/Zozg0T q0D+kQfnNEXO668VTQcxEdMKbFfOeduqGcEqyBYXjo7m6Pj7+WRqrLTX8 1o9KMHPjNR1iVuBbzaM1wcBZqQ0NNvihBdiZ+id4ycQ4wwZo+QLidUUsd KWdUJZZaKDs6p/fmwjRZuMcbZfBAHtmUK94SMLnEAgVqEINH2P7P7kcKB g==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="6155447" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="6155447" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 00:28:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="6615914" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 00:28:19 -0800 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 , Kai Huang , chen.bo@intel.com, hang.yuan@intel.com, tina.zhang@intel.com, Binbin Wu Subject: [PATCH v19 061/130] KVM: x86/tdp_mmu: Sprinkle __must_check Date: Mon, 26 Feb 2024 00:26:03 -0800 Message-Id: <6dd201694cf2ce7f866e0634c3113db7a9024f8b.1708933498.git.isaku.yamahata@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Binbin Wu -- v19: - Added Reviewed-by: Binbin --- 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 10507920f36b..a90907b31c54 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; -- 2.25.1