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=1796247269; b=OzOVGCK9NLfqBQc6p7raqO/bVHeKYGwt+qyzaIaXgrhZ5Vro4YiFtAAsJHmnPMJ2kcSu ObdD//1xE0BMeQa3Riav89Iew4WqVmOxJdPsBocH6tIE8iPw/toPNT2AjqK2QK20v+qlF 8NvvopwyzZg89pIGrfITTtHuUPwSUKJJiOFxBCc6DpJviwEjdXZkqCNIVFsFu68wOlMKA dZhNYuOxv94lc0gDXTWsSQx9dV/2B41v7bSgFztM5BkwS9g1KFkIWggkxRNVRtyUgQOZ+ bMMXyQgUz6ydyxWAz8sE7bv3GrQCmpyp5nXDTwPizqK4Zq8puWP7IbqbNDIxkLkKqZQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796247269; 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-Spam-Info:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-GUID:X-Proofpoint-ORIG-GUID:X-Authority-Analysis: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=omqYWhVqMOT50g1k6P+qZSjcEmapQunIcBNENfkNHQM=; b=KcovHxEVw1Hb0pBxstAKJAArgVP+bno+Pwws0jgca4n2Nz7YLx2Q7ZAQJ83TH256v9xA v9M2bAFfD4GddcajluhLVj+bv2S3f0arfbJ5XfxB7oIMKHIkOScAr/dmb+0bL7P9uFtC2 LPU+Mql0CCZqtCL2G6ci/y8NrDY3uHoZ8e91WIxmuS/7lqtPUnzugj6VA2FqGHIZN6Dh1 b1G0wE+fe31JP0aJxipQbXcDJT47BCb00YHaXCJxGxSserzTem4kMMnYX09+vHJ7CY5jy 0/Rs+KNSiUNJIHXysGJ7pkWXycH+3KeWJYVY3rhW8cJHZTWWrC4soLpCNAwN5mBuEhA== 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=HNsTvGIC; 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 065EA606A32D for ; Wed, 2 Dec 2026 21:34:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 065EA606A32D 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=HNsTvGIC Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B2LH0Mn125039 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-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jam9ehvku-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-f200.google.com with SMTP id 5a478bee46e88-386b8624cf7so3408328eec.1 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=lists.linux.dev; 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=HNsTvGICIqmaIQB9frfobBXzzkzf4E4b3BYVuJKs7uGvUSXvNgcNLFdhm+HrWr+3qL YSiGIzsft3/3yTHU1RWX6QRQkRk8pcZxGDVga2lD8sfYRADX8bGSxqTbLzry0tcwpdXy n+0YsObRZMBfBMX0ck1JuUC97UvjTfQF24a67+98+S3x3YKkcxx8c1UvN/HNVqmXN0+5 FDaOWQb4ATLEZmSY3WhjyzgA00m0BVlkH1AFn0BKUyfMMAq8m6q2ZMJfr+MzmYv8p4gt KU4jIMtp2Kxjo1enxjcc1gU9a86YFtnbnN/VrJw7WpB6oSwzZV6N33IkgGlsK/5PsaNX A/Bg== 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=dAYany2oQw1s5bFUumNTEz+JljpO5rDkHzSozxz6l+poozRT5jD9039c6tbWAfsYUq PR4oQPSNlyRFgwIZ5Mjd7BV+Lx+s5BXLEkM/MODQL+MNclOtAcyQ5sd6qxNK+2mOP1QP RzbUtWyPgz/c4JAzCxfIgjknigIh0E2BfpXId2sVR7LvpddoJ1n9f0oYOmzyA0cI/X6+ 7L+z1t58WDPMUR8oUzk+fHeNA5ERSSCrlJkIIg05kHoXvdq8D3zETy8xMIe3rm8qXF01 knu52oRBOMycfWNoov+ZprumDxMyzS/gPuM3eTc4Qc/YogngyNn/DQSlLbNV6LaxGqV/ uhKw== X-Forwarded-Encrypted: i=1; AL+hErHu3Ctxs0xCviwLvpG9InN0f1yOoF/Lo+7Vx+IXBNIC1/8yudYuAhh5R4CeONxiOdM7dZLX2rmn@lists.linux.dev X-Gm-Message-State: APuU4Z8piwUktynnuGxS143+VzohvA+t/ZDcf2WAJp+dS+kL/h7eumUm 1CJRR85Ld/2YtImb3EKS21m90sUTn6Z0wjAt4vEnEQT1dUa/PIKx2HfsUWpxMhNmt+oO1KzqY+H UdHNFddrRtwaODLogYOeyxbgctk24MeiASPptPyWeRURk3IVpBkIT3jh0l8O5 X-Gm-Gg: AZFdTZeDhgPKUgZRWheiscLM29GKGU5/hS32SKKgjAVtmuCe3uxNJ4WdDMgZucrOfKX lOUx778bH2dMosweEhpAZ+nrQMjFHTGaQpTgGSkwMHvNgwG4/t6RaXtnsuDswFAv00VDe3C7ab3 U70+WyQxs14T1jMkp74N61IQnXqRNx1xX9DXbjDCqSC7VJhGartUZX2mRJUXcOr2S7TTcAmBmpi gRfzBC2tYldNXOgE3LIv3bbB66cSIDGV1sN5QXCFzVMS0ebMDzEh62wA6EtSIMvCeUVpOWhoZcP YxQ4WGhcoBdGLzLMxFFryCXamLsnhz9+P5KmvG3RpDOAlg09KB47o0464czu5sH6xeTiQf9/ykw kTLodPLEppje81BtwTWYxzXI/D00bcZGN+vPZFCuiTcs9r9WSuhaucaaz9YCi5XDKYfZqCqVBP7 Q8N7tFjn3GFTNwz7r0+5By3PopULA= X-Received: by 2002:a05:7300:d108:b0:386:c6dd:2616 with SMTP id 5a478bee46e88-386c6dd29ffmr26366019eec.41.1796247267391; 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: patches@lists.linux.dev 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-Spam-Info: AW1haW4tMjYxMjAyMDA4NSBTYWx0ZWRfX8jK29NVnJmOa oO5hvmLcxFO+HqrVrc7uUj2hFibJoTz0vLnw7cZPezkCFGzfxOW4FE0hXrJCnqJMvD22yyNCni7 T4kP6TAxiYWAjy1XjEc50NyieTK6CCw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA4NSBTYWx0ZWRfX3kT3CwDodBY0 6PnPJMM/sDRUwcmr0E8CYaGAWl0K3Oc/ONCGkro8wlKWghMSBtx/mUmsvsV2//GYUX8kZkB0mn9 OJqB/X/xZNmFDl/mxc4w486Xv/jQ2j5aV61L8kUC9ZYYlBH8h3ZZDk2BRIOHs6a+b0Y8fYTNNt7 TsDBTwwBdi1+FUsBpAACT42icIcqMzT3J5FyVDS4b+LU2jXagMKrRfu14uVqgyOOwdXgxCR3Aq4 rCO9h4KZiXNyPVujVo6is2EnBNhPtcxLesKIw7riITQNKo7v0twCpe1wkHARGY/ayZYEqnZ8yHh z2P6NfxR8q6+DDDNAq3/XyOVgUUSYSlKzCC0beTZbMvQIX+RRwm34KeMIJMhoBeRnHf8w+j6Y/j NugVphVioXr/dELBL2HuNC1S3Grf3ykfy4uv7rbhuOKIvQecjrD1Mfd2Ou+1d5G2zMraPZi7zvz va87rTqouJS0+ZR7cuA== X-Proofpoint-GUID: JGlmY3b41t8MFT66Ru-vGpR9dfbGTtrH X-Proofpoint-ORIG-GUID: JGlmY3b41t8MFT66Ru-vGpR9dfbGTtrH X-Authority-Analysis: v=2.4 cv=NZdzRGD4 c=1 sm=1 tr=0 ts=6b108ee4 cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=kj9zAlcOel0A:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=Ikd4Dj_1AAAA:8 a=EUspDBNiAAAA:8 a=RkTgK740hJReAd0VgacA:9 a=CjuIK1q_8ugA:10 a=6Ab_bkdmUrQuMsNx7PHu:22 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 malwarescore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 impostorscore=0 clxscore=1015 spamscore=0 bulkscore=0 adultscore=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;