From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796247270; b=cXMQP2VdVbgdUu8QFK4JW0uRHuo+GiLXWSk9aABpfSfH8WmEUX8DYN3W1cm68Oxb2rGW +62D3VKIy8vtCzsbfH0dr/1g8eQ2P1U/WS9uJo0VoDE3EuZVklJfuSvtqLKOvVJzTnw6p 6+UFLFvDWpXLHQ51N6Ph85uIAWwK4vvwhpSWLw0LuC/0hsCUyigMgmla5Lhgfy3U0b0k4 iHFQITkBp1jsYzcc2ppcQgY7N/eP/EV3EeW0gJByf9qK7iMf+P2A1PhK+0FlebJJaVW5F VTYqFhuVJDMciiabKpGsvrR9TZLaQNCWJ1lJwtbOMgTq88uvzWmqbCdG6GHGMDUEW9w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796247270; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Date:From: To:Cc:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer: MIME-Version:Content-Type:Content-Transfer-Encoding: X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Info:X-Proofpoint-GUID: X-Authority-Analysis:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=omqYWhVqMOT50g1k6P+qZSjcEmapQunIcBNENfkNHQM=; b=2iWOicUMuVMnGc1Oe4HQxW6KKpHdBflCUf8QvFtHxXUDdu3r+LZfebhtyQxQhU9lF+NE zuTpFoEElT1LZUoFHCHIdXuEBU6vjr25K3IejzcTKw3Nb09agCKLBq8n1VoxxlceF7l9Z sbyK3V0ji0W2/p+SJ6wSuwYJW0AuX8wz70PKUMg9knmjLF0gXEnuU8JgBfaMvJ1bwM1+w c9sZKAdtlZHZRdt7X821spC7FEHXc/8j/yAX5Pm3AsdJ24avoTDSCaKTsoLrY/SJKGY33 b5A2pU3VGmzh4VCvFKO0Bo1xqKPa4OUaIB9z3rb4bCOk2AFN8E8LJjhkfV/JyzTJp2w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=gvGkwi2S; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=BbIJALJD; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06593606A32C for ; Wed, 2 Dec 2026 21:34:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 06593606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=gvGkwi2S; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=BbIJALJD Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B2LGsib1854399 for ; Wed, 2 Dec 2026 21:34:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= omqYWhVqMOT50g1k6P+qZSjcEmapQunIcBNENfkNHQM=; b=gvGkwi2SR3qzO3WZ t1FnAT0htujBdlcOcrcWa8gI5WW+pCDOW8KUPk3NzsAjMenWbR5nQnjUYTeWZ2MZ M7kUP1ecLoTJk0eWaG6p7ChTB9ncssUYgVyGq0uDXikGwuAaUPkEX6kOJ4UGKtXD OlNGHru8wTg9FugIzFERTyGaYwXzK7Hw8av0ugjSBanzhiM5Hw4jjnp6DaXXCWMG /EtZPzBbun9qI94fAQjwxSsyXsV+41D8KQMOjwC+1C3sao+aV86qAF6YYL6QqgxW lq3lGVW1I+euUYIBneHIPPXH8nZ87jSwBoWql9DtUL0WDiB0JjGI3O0kHvvQNEsH 21FEgg== Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jahwjtg2e-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 02 Dec 2026 21:34:28 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-386ad819860so11929215eec.0 for ; Wed, 02 Dec 2026 13:34:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796247267; x=1796852067; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:organization :references:in-reply-to:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to:content-type; bh=omqYWhVqMOT50g1k6P+qZSjcEmapQunIcBNENfkNHQM=; b=BbIJALJDCKy6EpTnqMCExfnOmKCqYtmbzyCjN+oBL5b1ALxMw5iEHgDMtP9bfxAVg1 Od3aFobOAykBq79hB2uphi9+VmK1oNvvJD1HYVFRGgI70s6WAucPKj9JdmgmnFuhM1W0 PuvmB4jI6TpslQfKIcJK6wNcqDKBiyH2OfIoX72iYmVaFwIHljQK751qiuRQ9xbvCfLb dnSrCkDwE1j7T37MSrcje3E6WN8e2R4PV5kwWF/vDO9weShN8gCk+XQvTz6IrQzzMO/+ bS+MAYNs6mMf5WoXXqbkWiRz+O8WKYM9JBqzkptJmrDWtlvFnzVibLqkytoxAfZz6DyC KVNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796247267; x=1796852067; h=content-transfer-encoding:content-type:mime-version:organization :references:in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=omqYWhVqMOT50g1k6P+qZSjcEmapQunIcBNENfkNHQM=; b=HTwXJBl+epsyD/yXgH/QxJYJUo8btru9vFKaUTuJu5/WG0VVoiNKJWtdkW4oYYwTK0 oRPJzGUFJutwa9Qtx2n5AtA1cZApMzs2VIwDG7viW9Fkyq9ziuJvOlvH41nxsdQaVW/2 WPMe4HJpE8PWEGcRBpIf5/KuKDWSgnIQLjZQiGm/k7W0DRgB5CD9Dyro5YZRe2jxw+l0 frDQBMY2iKKYwokUeRhLTfGlSGtdY8xshFdJMNegf69k6uFcQGYrf+N/EDR4t1NlRrod PA/CBHOX63biEbfNeYleL10QQAcbSfrXoLObEZV2SyNqAPJr6pbrVR/9Pu63S6PaQrE9 5eRA== X-Forwarded-Encrypted: i=1; AL+hErFBOsXV+xtk+YUF2cNssubJyHPN0+xBFVlrTQEOZd3mfnLJ3aRtMklweh4Ob02GAkIhkdldM461Brw=@vger.kernel.org X-Gm-Message-State: APuU4Z9bfnEokLUi+RWnwIgUBvA8gLLUyaKIuKTnvbsGoN7B0n0K+l2A tDI/1akaa6OvFQfJM+Inu85ravKXQUpLxjockUZVuD6k3/GdwoAsgQHaShK4bjtE3AETPzpm7lm HrUOTvTiDMZJcAwTlMEbLoOldFik1cUDipC7smTckU4yyIwrt5vTAh3uAzCjLGGU= X-Gm-Gg: AZFdTZdWADkULwjaDjP7RfwXmvLVBP3I7Bslr8pAA6ymdMTybR4abaPLLjJbX0yfFN4 7PWR6iPe8+KYieKCLh7+WQH1VLF0E4ToNCf3agyHJCw4yPA5/DfxschyAg0zzt1eCg3nJf0ZHKT FVZZMAO1NhNsOaPTlSCaovt5kVuPOQkfcfxMc6vNgY5nvQSPEaZ/jlH8dVV8M6xuB7ezYmRyZpR 1PfCFQrnmE/neEWs3a5QHSKM3fb/dYRw/Eha94kk/Aepv7KjorhVMno3Xrc23eDF7Vd0l338Ygi f30XQXVfePU833vnFlnAAWbM0hrsou3l1LYsESJJomEsWZijrWtusJfIss+OtWEJq+ASMsq7fnr eNSWpmO4K40wVCLqaZhDGW3tqXfqbYp6m6IMXFZYxvpBICu1fcGGMfzAA4TKX15+OUHQevyJ9Gg XNZdkmsi98x6W9hoFqivELaOd8P7s= X-Received: by 2002:a05:7300:d108:b0:386:c6dd:2616 with SMTP id 5a478bee46e88-386c6dd29ffmr26366021eec.41.1796247267421; Wed, 02 Dec 2026 13:34:27 -0800 (PST) X-Received: by 2002:a05:7300:d108:b0:386:c6dd:2616 with SMTP id 5a478bee46e88-386c6dd29ffmr26366007eec.41.1796247266979; Wed, 02 Dec 2026 13:34:26 -0800 (PST) Received: from localhost (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386f6651e2asm47454691eec.27.2026.12.02.13.34.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 13:34:26 -0800 (PST) Date: Wed, 2 Dec 2026 13:34:21 -0800 From: Jonathan Cameron To: Jason Gunthorpe Cc: Alexandre Ghiti , Albert Ou , Ard Biesheuvel , Catalin Marinas , Jonathan Corbet , Ilias Apalodimas , Justin Stitt , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-efi@vger.kernel.org, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, Mark Rutland , Bill Wendling , Nathan Chancellor , Nick Desaulniers , Palmer Dabbelt , Paul Walmsley , Randy Dunlap , Shuah Khan , Will Deacon , linux-integrity@vger.kernel.org, patches@lists.linux.dev, Piotr =?ISO-8859-1?Q?Kr=F3l?= , Ross Philipson Subject: Re: [PATCH v3 11/11] efi/arm64: Implement ARM64 DRTM in the stub Message-ID: <20261202133421.00005177@oss.qualcomm.com> In-Reply-To: <11-v3-22d1a1eb7d2e+17de-arm64_drtm_jgg@nvidia.com> References: <0-v3-22d1a1eb7d2e+17de-arm64_drtm_jgg@nvidia.com> <11-v3-22d1a1eb7d2e+17de-arm64_drtm_jgg@nvidia.com> Organization: Qualcomm X-Mailer: Claws Mail 4.4.0 (GTK 3.24.51; x86_64-w64-mingw32) X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: 8ewUmYOeFfgUdS8WhQ_evQ3xtU5Jgt3U X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDA4NSBTYWx0ZWRfX2SYqGYz+lrnH dcIYHRHA7TQH21mSZS/KZPP9mHHkv8XI38xIeW+TdJxZ+KkhuSGhhOrhXAfTc3qZ49elLV9FURe yIMvGcUP0QlJuy86fYsdAfQyyx30wyg= X-Proofpoint-GUID: 8ewUmYOeFfgUdS8WhQ_evQ3xtU5Jgt3U X-Authority-Analysis: v=2.4 cv=JLuuIMKb c=1 sm=1 tr=0 ts=6b108ee4 cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=kj9zAlcOel0A:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=Ikd4Dj_1AAAA:8 a=EUspDBNiAAAA:8 a=RkTgK740hJReAd0VgacA:9 a=CjuIK1q_8ugA:10 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA4NSBTYWx0ZWRfX9zq30NkfjFze k5+QLAuGfFzTWn9npwvfMNslP9F/Fjk7iFglJHWfK1fzfEZ4akOb0mjoRfaX8NHL79ttZmXAAoj iePZTV9iVSnuDKXIaI49FWVNnWMEHEXUonDaA/L54tVSWIlcqdx30AJUsEUE0tDbjtYMWA1O/PH 4lvjtLIKeXaBk+T/kpzdu1SdUTGhQR35WdvnqjRsAaXrfw70ux9EPjshkhyLoNC3c33Q83je0e8 lmhBy3VSOO9+4rdNHtPCdewGcKI360J/REUCnAWt+1alo14CwuMghi5Gm4qwAAgI9NRS89X1Wds bxYIKUzyBEbAIUmhq+iDIb3J2NNmhScf+r6xT9JeNWIvh8J0clfGNjaAXyRWlRVAAoNtRtuRfQJ jxBablqVKTqb+KH3cL/CO/ovGVFlZ+tUBh0WHf8DglMLDdJEtP9HdEhPXoRUWjRSVRPDtHey4Di A4ileIgrS42TCyFIMCw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-02_06,2026-12-02_07,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 phishscore=0 clxscore=1015 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020085 On Fri, 20 Nov 2026 13:52:04 -0400 Jason Gunthorpe wrote: > Provide an implementation of the CONFIG_EFI_STUB_DRTM protocol for ARM64 > DEN0113 >= v1.1. > > First, it queries the FW for support and collects all the > information. This is needed to compute the extra_size, which comes > from FW reporting how much memory it needs during the launch for the > DLME Data and DCE-owned data. The generic stub ensures there is > trailing memory after Image for this. > > Then the DRTM_PARAMETERS launch structure is computed using the > offsets in the efi_info. > > Finally, the stub does ExitBootServices and calls the actual launch. > > The feature discovery process is deliberately fairly verbose to help > debug any FW weirdness in the field. Enable it with efi=debug > > It looks something like: > > EFI stub: DRTM: interface version 1.4 > EFI stub: DEBUG: DRTM: TPM algorithm 0xc, TPM hashing unavailable, PCR schemas 0x1 > EFI stub: DEBUG: DRTM: minimum DLME data 73728 bytes, Normal-world DCE 0 bytes > EFI stub: Decompressing Linux Kernel... > EFI stub: Generating empty DTB > EFI stub: Exiting boot services... > EFI stub: DEBUG: DRTM: will launch, selected launch features 0x0 > [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x000f0510] > > Eventually the launch'd kernel is going to require built in crypto > libraries that match what the FW is using so it can validate some of the > information left behind during early boot. Refuse to launch if these are > not built in and build in the most common ones from the ARM64_DRTM > kconfig. > > Signed-off-by: Jason Gunthorpe Naturally I focused on the important stuff - see below. Reviewed-by: Jonathan Cameron > + > +efi_status_t efi_drtm_prepare_launch(const struct efi_image_info *image_info, > + unsigned long fdt_addr) > +{ > + struct arm64_drtm_handoff *handoff = > + efistub_drtm_handoff(image_info); That is under 80 chars on one line. > + struct arm_drtm_parameters *params; > + unsigned long measured_offset;