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=1796382673; b=V2Y8sCzw2NrGLblSxtTkapLuxvKTRD8MPJEbFcCEePfO0i4E9aEv09Dv5kp6oQI1p7Bv M1+xksBjZY/Uty0Dd79pxj9ytt044cB+0VUU6XIEKrQcrExkyVXSFIbu20d+h3v0NbW1m vLJmy2YpYeZsjFCsYolG3tAVI6Mdl79Me/JvO8OQ9nPl96BEURoxB3h/Sw+iUQol9JzDi CliyiezIjKZGa+/w+X/WYV7J15Z7oT/iLIn7ZUixkJBwEsXHRnkIE2wIxfh2R+9Qc9mOj JLc4zLkk6i+qJ9YTNoK1i8AAiO+kO2HGQy4vZ55p3Ft1Fqf4U4RbOCre/tRT+VVL1ig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382673; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=YoPaaGMQPcNsBy+o9kaBC4TBz6DnhxGJqSJOyENlrHw=; b=0f3OPSx/t3ENaEIjYQ9fusEqzyXfP1w+rUTONGfioSIR4uS0zPP68yr38C9rXShMwOA9 jPrxqY2NpP1Dyrw1OWwBZciOutb02fK6QHWWi3IPjaHGAAVbxQjeIBoAPtwXyqMDMyiO6 FAG2syS07itj3Dn+TZulV+tVyrUz8NNbDSuI3zlOkTxwJDZtSiAa5MD4i5ndkFUPUy++g Qn89oAfBtbq4WBL1Wf2tfVMzeI9rOZcDoOyTCwy0kmjDQvcVzWaH6uKsgz1IzFJYhv6oy d44fkM3gdvUkeLeg/5qONfeubG+vlPbn36R6RYaGV0SYYNG7JrNLG8TX4zrUvJnoyfQ== 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=jP7z0Nba; 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 ED0BE606A322 for ; Fri, 4 Dec 2026 11:11:12 +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=jP7z0Nba Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8F911F000C2; Fri, 4 Dec 2026 11:11:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796382672; bh=YoPaaGMQPcNsBy+o9kaBC4TBz6DnhxGJqSJOyENlrHw=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=jP7z0NbarXeZ3WM6XNXNROBuAx/vc3sV3HuLheps1N+m8PNj6fdGC/KR6wzz4g1fB qapG0QYde7denxk+nnpQWLxTKe2N1mE73YwrWk/ScNbWzG5mCegTk+Tjq74wVC89TF C4GFosAoPnILciGCwDutQ+b7xhsWwbaNj0QJO/WJkCWUKDEZWsWx9PW55sBcqYT36O t5uun1GzIuE2mhb4ITjAKHVkYFZ03LQxZl3bKmcbS57Rpz/YxxCAoT0iX+rZgXxY6v ED/oDAmACV8bEUjMLyIIAOI9a+Uzfg3bUhWsF1cI5o/NHD23CDYJJgUdWfbnKbzOIw w9jh96J5wgS5A== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4 1/2] x86/virt/seamldr: Support large TDX module binaries Reply-To: sashiko-reviews@lists.linux.dev To: "Chao Gao" , kvm@vger.kernel.org In-Reply-To: <20261204105951.1811487-2-chao.gao@intel.com> References: <20261204105951.1811487-1-chao.gao@intel.com> <20261204105951.1811487-2-chao.gao@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 11:11:12 +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] x86/virt/seamldr: costly order-4 kzalloc_obj() in seamldr_install_module() -- commit 3d3e8627ca619b4725aef21c808f3c7dcc4e909c Author: Chao Gao x86/virt/seamldr: Support large TDX module binaries This commit extends struct seamldr_params to 16 pages using P-SEAMLDR's chained page-list layout so the kernel can load TDX modules larger than 2MB. > diff --git a/arch/x86/virt/vmx/tdx/seamldr.c b/arch/x86/virt/vmx/tdx/seam= ldr.c > index b1137ca6150d4..5678309624ab9 100644 > --- a/arch/x86/virt/vmx/tdx/seamldr.c > +++ b/arch/x86/virt/vmx/tdx/seamldr.c > @@ -24,7 +24,23 @@ > #define P_SEAMLDR_INFO 0x8000000000000000 > #define P_SEAMLDR_INSTALL 0x8000000000000001 > =20 > -#define SEAMLDR_MAX_NR_MODULE_PAGES 496 > +/* > + * The number of pages in 'struct seamldr_params'. The value is arbitrary > + * and can be increased to fit larger modules. > + */ > +#define SEAMLDR_PARAMS_NR_PAGES 16 [Severity: Medium] Can setting SEAMLDR_PARAMS_NR_PAGES to 16 cause kzalloc_obj(*params) in seamldr_install_module() to fail under memory fragmentation? Growing struct seamldr_params from 4KB to 64KB turns every runtime module update into an order-4 GFP_KERNEL allocation, above PAGE_ALLOC_COSTLY_ORDER (order 3). On a long-running TDX host fragmented by unmovable guest TD private memory, this triggers direct compaction and fails with -ENOMEM. tdx_fw_write() maps -ENOMEM to FW_UPLOAD_ERR_FW_INVALID, blocking live TDX module updates even for small modules that previously needed one page. Since P-SEAMLDR chains 4KB pages by physical address, using kvzalloc_obj() with slow_virt_to_phys() instead of __pa() would avoid order-4 allocations. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204105951.1811= 487-1-chao.gao@intel.com?part=3D1