From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796409898; b=RMJ1N4qHBxwCEwhhC3oqKKN9PXLMf/ZZswmcJ1U8Xy8XWFjpCrfAPjLTkiKJD1r9AyX9 oHMoSeRyC1lUcC6nCccu5zAvR16kvy6KVAa9Zvaeudm2COhJw7jqVg/tXCTIhPdQZbM/Y 8ZVzkInSX1q+Kom6iV5zpV2QJGqQJz/EvIRm2UDpnePgnrqDja7z5DtiHIzlV1HvZ0mwr I5JZMQm7vHlJzlq0o2Wim2WZilIYD/McfmRTFemATGBHS6Sc4SZiG+g55zJ4ug0rZBoVK gl3mM4mefSHrMmc1Q+G51VLHV6iRS0S+ZDMtRa5c53JTnh+Jx3iNpPnMmQX2boDetWQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796409898; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=VBYvX64swVapAyiODJH+b4Ai6+sf2xSA8EhTPXSGHaw=; b=yJHEhG+n8XeX/CveEo/GMNL0lWj3n4MDy7jGkLY59UJeqd4iZ37hR/B7E+HqCa+v61SB LsESKNbPjFb5fXenNfYs/fvSM837/YhPWnCffUNqhBh3jMAzketsf8Hj5gJsYiXqY5pkd OiKm45fGu8q5NTSoIQIvU502l1bc5ilEvNZtnwoymkoroHz9GCHeKVRL5UDwUuo1B6x7Y u9hLVOUfOPUWeRDOaq5lbOBrAGMaSB2wDZbJO3RavqZ+FI+2vnuZIGUPt9OXXWzmQELZe VWuiQYH0dmsdYGMdBc/nYhUa9Ugky/G1351aucqBxFU/ytpl7EzbzdAUu6Wgi39bUVw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Cze3RKOP; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD5F5606A334 for ; Fri, 4 Dec 2026 18:44:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Cze3RKOP Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D3421F00936; Fri, 4 Dec 2026 18:44:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796409897; bh=VBYvX64swVapAyiODJH+b4Ai6+sf2xSA8EhTPXSGHaw=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Cze3RKOPT3arpTxO43DTqlVY7YDvgAzlCBRsqPndt8NyX2wS4mqvwcnaTcNgC6hmC 4YqFa0BuXnk2SyHfRVyH2bCDU3b/qkmv8drAK4i7NfNCdRiKgw515fVfWeWK2NA0Yb MxemsopclrAEqjvzng9Xkpwwh02FFgM6xmzugbXKyV4kgCx6Zhoa5KAU9G4oWD7P+t yX+lmZhB0ReRNOYQ6iojDrH2q/dJGZ0ZFefsS+5UPcLVFbmzYSlUZO9O7urlhMqs0j JMrxlrC9ocUcSynX6P8A3919buoRm/CSTiqEsM00SItDFC042HZGlQbOVME/dY5Ejk BKkRzUB+V4sfg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 3/8] KVM: TDX: Require at least one quoting session and thread per CPU Reply-To: sashiko-reviews@lists.linux.dev To: "Peter Fang" Cc: kvm@vger.kernel.org In-Reply-To: <20261204182022.324230-4-peter.fang@intel.com> References: <20261204182022.324230-1-peter.fang@intel.com> <20261204182022.324230-4-peter.fang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 18:44:57 +0000 X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] KVM: TDX: quoting checks return -EINVAL and abort kvm-intel load -- commit ad2ff9af18e518d36b330f0d2e71d20814ddc017 Author: Peter Fang KVM: TDX: Require at least one quoting session and thread per CPU This commit checks that the TDX-Module provides at least as many quoting sessions and threads as present logical CPUs when quoting is enabled, returning -EINVAL from __tdx_hardware_setup() if either count is too small. Link: https://lore.kernel.org/all/arRXqpG_4hCrhQLM@intel.com/ # [1] Link: https://lore.kernel.org/all/DS4PPFA84FA90FC58F88D79B0EF19B34596E7832@= DS4PPFA84FA90FC.namprd11.prod.outlook.com/ # [2] > diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c > index 8a593159c9b7c..4ccb41f002dff 100644 > --- a/arch/x86/kvm/vmx/tdx.c > +++ b/arch/x86/kvm/vmx/tdx.c [ ... ] > @@ -3500,6 +3502,26 @@ static int __init __tdx_hardware_setup(void) > return -EINVAL; > } > =20 > + /* > + * KVM only allows one quoting session per TD. Make sure a free session > + * is always available as long as there is no oversubscription of TDs, > + * i.e. no more TDs than logical CPUs, and that a quoting thread can > + * always be scheduled on any logical CPU. > + */ > + if (tdx_quoting_enabled("ing_max_size, "ing_sessions, > + "ing_threads)) { > + if (quoting_sessions < num_present_cpus()) { > + pr_err("Disable TDX: QUOTING_NUM_SESSIONS (%u) smaller than number of= logical CPUs (%u).\n", > + quoting_sessions, num_present_cpus()); > + return -EINVAL; > + } > + if (quoting_threads < num_present_cpus()) { > + pr_err("Disable TDX: QUOTING_NUM_THREADS (%u) smaller than number of = logical CPUs (%u).\n", > + quoting_threads, num_present_cpus()); > + return -EINVAL; > + } > + } [Severity: Medium] Does returning -EINVAL here abort kvm-intel loading instead of only disabling TDX? In tdx_hardware_setup(), only -ENODEV from __tdx_hardware_setup() jumps to success_disable_tdx to clear enable_tdx and return 0. Any other error propagates through vt_hardware_setup() -> kvm_x86_vendor_init() and fails kvm-intel loading, breaking regular VMX guests as well. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204182022.3242= 30-1-peter.fang@intel.com?part=3D3