From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.8 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381832; b=rJO52cQPlzmxZ1+6frDlpXC/NTjbfR1q0PH0ll4eYekBznGu6SuQHJvSieHOHc6u0a+e /EmX6/S4qvcg8CHGVZL4QOent+g+bvPvlsylRNkUvbS79bWU+DJ7qpALOhh1IIs4qFASU dXPjjJGz0WKNj7QBM56ouWdPquUVCDONlYWdYOx0GkaWSoko+FD7ke8iYuQqxzDyruYOM Nr4BpuC0gNiZxKoC0UL8uFpnQGKlYWaWAzpkH1dOZqbVigm7x07hEOiiTjrhPmFKOLLhS SEckkTMBz3A/+P+ERHnxqs15bHllJCnanRsgSuDCMhmFATIFo6KjYnynBXEFjzdKRkw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381832; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=vhCGbLpzRyWotnCkcq+I8ObNxQq1/IBeh5Av+6Nn4Qk=; b=HduWyPqpRMipeXEHStCuGTzRVGQA3dUG2F8KSR2+9HuQJZs26lpMcv3LC4Jle4ZHNjNS 7jD3yWrtXSbAEfTbG5k/f0SxL+I/Rp3YnD+t4z2j6E5b87OimzhGgtemjHcdwci9psyaf tUcyNBPEy9qa+o1OxTFDhON3jzDWTodxuPP6fYkaqoK6BZ4MmRuwHb6SjeIETBlA2tqrC PDHC4f7FIQtbXE1ALHe2kQm+JgffhKSX/dapIudCYIVN1wST/rYlikJmbBXU/tAD0S87s jbL+jUlccfas82JkyWLt2Dbtvi8+16i1P8TLM/2yLmxwHLMoJO0iV5Zoii1J0Pg8XVg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Pg8KJJqB; arc=none smtp.remote-ip=192.198.163.8 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AF81606A32D for ; Fri, 4 Dec 2026 10:57:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3AF81606A32D 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Pg8KJJqB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796381832; x=1827917832; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=vhCGbLpzRyWotnCkcq+I8ObNxQq1/IBeh5Av+6Nn4Qk=; b=Pg8KJJqBZviOesmI+CSqqq45sZjQODC/7lsxoJenPSqm3oL15Uc5fD8Q SRhqaS4WHQgiExIMBqoNTRprAhK7zo2SfiMgnObPfhioyBNAyE4wrrFOd +kiOf/AB6IQlRSDLzyjnLP5B8xad6sSnm7rnEbG3ptgf9Rqj76iPLnwYe YwsxbScmFn9FS8QcKo1HS/eB+NuGLBoStLXTs0t5o289STmqNdCZ4v4p+ lEulf6cE8ghUCKgkHjW1uhEvuVyUALfyH0tUdpCfSvZyAZuz1sLeiQiWz uPhJ+1Qi3EXYLg9gzf5/g2fh18bZAV80IZGK4dffGjKJEgPxqGLMVVWTn g==; X-CSE-ConnectionGUID: f0RUQl46SWmppr5Z29c6+g== X-CSE-MsgGUID: o1u5gNrwQyexerSDwMIVVg== X-IronPort-AV: E=McAfee;i="6800,10657,11985"; a="5244591" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="5244591" Received: from fmviesa012.fm.intel.com ([10.60.135.152]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 02:57:11 -0800 X-CSE-ConnectionGUID: e+8rLP+TQ5qyfzevF4RSJw== X-CSE-MsgGUID: GhFgbq3ZR0GGMl7RKrcB0w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="15701089" Received: from 984fee019967.jf.intel.com ([10.23.153.244]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 02:57:11 -0800 From: Chao Gao To: x86@kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: yilun.xu@intel.com, arjan.van.de.ven@intel.com, binbin.wu@linux.intel.com, Chao Gao , Kiryl Shutsemau , Rick Edgecombe , Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: [PATCH v4 0/2] TDX: P-SEAMLDR: Support large TDX modules and sigstructs Date: Fri, 4 Dec 2026 02:59:46 -0800 Message-ID: <20261204105951.1811487-1-chao.gao@intel.com> X-Mailer: git-send-email 2.52.0 X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series lets TDX module updates handle large TDX modules and sigstructs. Dave, feel free to ignore this series for now. TDX developers, please take a look. I would like to collect Reviewed-by tags on this version. == Changes == Changes since v3: The biggest change is that 'struct seamldr_params' now matches the new ABI layout. In v3 it was one large array of module page addresses, and the pointers that chain the pages were written into that array wherever an entry fell at the end of a page. That kept the diff small, but the code did not show the layout. Now the structure spells it out: 495 addresses and a pointer in the first page, then pages of 511 addresses and a pointer each. - Make 'struct seamldr_params' follow the ABI layout [Dave/Rick] - Populate module page addresses in a new helper and leave populate_pa_list() untouched. - Add a diagram of the old and new layouts to patch 1. [Dave] - Describe the ABI changes in more detail in both changelogs. - Explain the design decisions in patch 1 and the reasons for them. v3: https://lore.kernel.org/all/20261119074925.3933804-1-chao.gao@intel.com/ v2: https://lore.kernel.org/all/20261106132159.1551365-1-chao.gao@intel.com/ v1: https://lore.kernel.org/kvm/20261030085304.3886520-1-chao.gao@intel.com/ === This series is a follow-up to the TDX module update series. As thanks for merging that series, we agreed to take on the TDX metadata cleanup [1]. With the cleanup converging, we are starting on this work and expect it to be merged after the cleanup. Today a TDX module binary can be at most 496 pages and its sigstruct at most one page. Both limits come from the P-SEAMLDR ABI. TDX modules are outgrowing them. A post-quantum signature algorithm pushes the sigstruct past 4KB, and new module features push the binary past 496 pages. The P-SEAMLDR ABI was extended for both. The kernel rejects any image over these limits. TDX modules for Diamond Rapids exceed them, so without this series, TDX module updates fail on Diamond Rapids. This series is all that is needed to make them work. The image format that userspace uploads ('struct tdx_image') is generic enough and needs no change. == AI Usage == AI was used under supervision to review code and refine commit messages. == Testing == Tested on a Diamond Rapids system. Updates with a module larger than 2MB and an 8KB sigstruct work, which exercises both the chained page list and version 1 of 'struct seamldr_params'. TDs keep running across updates. == P-SEAMLDR ABI changes == The public P-SEAMLDR specification will be updated to document these ABI extensions. Until then, here are the changes to 'struct seamldr_params' that this series relies on: - VERSION (offset 0) may now be 1. Version 1 support is enumerated by bit 8 of SEAMLDR_FEATURES0. - SIGSTRUCT_PA_1..3 (offsets 16, 24 and 32) are new. In version 1, they hold the addresses of the second to fourth sigstruct pages, or 0 if the sigstruct does not reach that page. In version 0, they must be 0. - RESERVED shrinks from 104 to 80 bytes and now starts at offset 40. - MOD_PAGES_PA_LIST (offset 128) can be chained. For a module over 495 pages, its last entry points to a 4KB page holding up to 511 more addresses. Each such page uses its last entry to point to the next page, until all module pages are listed. Chaining support is enumerated by bit 11 of SEAMLDR_FEATURES0. [1]: https://lore.kernel.org/kvm/20261012094754.27702-1-chao.gao@intel.com/ Chao Gao (2): x86/virt/seamldr: Support large TDX module binaries x86/virt/seamldr: Support multiple sigstruct pages arch/x86/virt/vmx/tdx/seamldr.c | 78 ++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 6 deletions(-) base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244 -- 2.52.0