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=OjkDCCe0AfOK8iIcOttUdyt/UNpL+pJyZeOdh/p6CJ5HtNc6xafCLidD+REmTEdxdv9n uYs4JxvBrq8A1FEM6Tep9siaQfSkFeACAAWtkMve5XPJssn14fSNm52Fx4L8DLqc9wnLZ gbtR5ok102rFPB7IF8qOfdraaYVNJHx3NBPXuaVbq+s8zRCd9zZOCMgimjQ/hA8cM5Nuq LXL9Zk4xE0xDyZXlnqaiRq1TaIAttSr4uAQJwX/HYMW7GTHS93q4cIM6989iey85mmfEn O6i25sWunwwEEsP2cCLr2c6bYqvUmZOCm/kGnGFBvXR+HwR2hmN6AfsHs0y+jeN+4TQ== 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-Authority-Analysis:X-Proofpoint-Spam-Info:X-Proofpoint-ORIG-GUID: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-GUID: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=omqYWhVqMOT50g1k6P+qZSjcEmapQunIcBNENfkNHQM=; b=rW306QETC/rtlX0Y1ynfNv7aRReDvffj/fobllB9Tqw+zbejMMkjo3vwcpQYnicBWmyh HE7BqGjXemMxjgG7vZZv+toUvXnqjsxbjYBRygi7HoDTNrp0lp98TC8vMNLpUl/FqybQ0 NJnWWV7nwF4JDvcWOLjsfNnyAVdnuVEwFNaCcCyzeB8fBfuLOLpBoqZg8vWh8bL1YpO+h va+6DzU7YEbpebbF6wo6LNk4zJGjiQlZD1RF668Oj3dYXQ1njtCiJztC/HAR/Zu9PixTz lKi6vAaFUTV4p/hqCF9cEegRfL8hPMRb8DZYJKYNAXpbtKsQdphmk6Wut2jWMNFzYNg== 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 064DE606A322 for ; Wed, 2 Dec 2026 21:34:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 064DE606A322 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 (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B2LGhmt2795237 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-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jajuq29sm-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-f198.google.com with SMTP id 5a478bee46e88-386b8624cf7so3408339eec.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=VHGNMpq/xHZ9gREDzI9eczbcM41j32eOTD4VSTjjFymYY7+hEO0Iz9wF84dylJarf3 Kf4Pg/Go+8Kh782bhvzpt+/7FYEI5lmL0WkKXo+Gpf1hOKJrYz5qyut6Y2eMbsbdITZa Q0SHbNusk7mgGFkaSwGUs8wUwEKvWAhehsR3iQyC/spDw9MWDCR1KHhs3qkmHdZCh9vT o5Of3WYOs2axHqqg9033OJoAc0clG5FC3xArGQza+tJxZ/AlZkVy9TOTtOPgoCsCI9P+ gtSPGAFpWL5/StHUNrt1ylsDu7gc393keNRr4uzpBNPpAgtRsdxAdypIrZw9JoHGQoed fddg== X-Forwarded-Encrypted: i=1; AL+hErFESWmfq3FYc1lTFJ0RY2wJ5iWCW9znG+04c459SmUOfBb73WyjvWcoKJELrD0ZJhOs9x8B@lists.linux.dev X-Gm-Message-State: APuU4Z/BcAJ1Y0CKabR7WqlVYrp6a1DsDPvHJvplCyf1uY+iidyLD50b +Fm0Vdwh9CxU9UKissEUeZpu1ZvZpybZWnCsqDLnFnB/iCcCTh2tKwtVHI7V4QqHSiLxkLy6sHG g8neGaJJ7drgGDfeul3Ng9RJjrh8GQ9tu34xSyd6JH6CVtiHkCXp9bdpS X-Gm-Gg: AZFdTZeAiquW8kHc4N4dagupS0M7mzM9MBHYJ5eUDxVYTNparBkREwvO9x8QY7OvCPi J5/Qw0gRAyHakezCjspRsHS4H9J8+VcjIry6MxuwcqV+069hhDjmaGJu+MaOhjcS5kAlz8bcEYu MpidXxVK/g+p/ouxmlY5z+dQreep5gGY2dXNVcv8/3x76NVRUDDKBR8+thr2pT/CvPcY5HJKfG3 OWcl6xKRH2nCiFtvm6pctzNwHqXDPu+eJ38AIr6N0hyFC0jGHcgFSRJZqEG3qBRTgyEYTQyluWH lXEwTt3kdo1cwG0qCPEeIGFRTHjx/y6nTn4YcQmZ516uHUeCn/tc2MyicgGch1aiaK4GRR3Pq/t hR7V6iLAGKqQE7/k+DamWzHJIr9fYsXt9mMQ+Lq/ssraFI3iRcvb9vPILrRSwpC8BTh8XB+wZAP GHPs3R3SsHzKbiy8OlfyGyC6nUQJY= X-Received: by 2002:a05:7300:d108:b0:386:c6dd:2616 with SMTP id 5a478bee46e88-386c6dd29ffmr26366026eec.41.1796247267426; 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: llvm@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-Authority-Analysis: v=2.4 cv=B8QsQ+tM c=1 sm=1 tr=0 ts=6b108ee4 cx=c_pps a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=kj9zAlcOel0A:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=Ikd4Dj_1AAAA:8 a=EUspDBNiAAAA:8 a=RkTgK740hJReAd0VgacA:9 a=CjuIK1q_8ugA:10 a=bBxd6f-gb0O0v-kibOvt:22 X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDA4NSBTYWx0ZWRfXzHRIf+FUciT7 W1EDOx+k+b5B+zZFleZz5tHMQ7fWmYgm4LiI21ONKp5TqztBXdkz5wWue0CMpc9HHREipS/dwbT XdMU8CLvWolWzM2pn+YEBXMCn9Yg04A= X-Proofpoint-ORIG-GUID: nYjL0W8t1kQYiS56VQ-EUGAzJyc4OxS2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA4NSBTYWx0ZWRfX6yNAWivNEvkQ rw59OlZe7eCartLx0JHPc6MU9+C43/ooUAOXytr2qkWDuaGDVEow4E7dvpNtE7GWlFg6RAHg2YB KTLvIGBNpnsfXS+j2mQO3KyJQKB8PfJ0DCe5iX025gUnwkVwL//f8gEgH/5ikd57RGgOS4hpXcp wwgD6j3yzpl7m6yHWz1blnHpm2N9GUNmT7wV/asRetB4NPuiofzcU5/GFwMaXAQvDWjNedzMPRn ryaakaZP0BmzzD3Hixv55NkteMHDx4S9fcaaOohgQA1kmCt9tQoBTRvWW05tdexjZrjG0yKvdck JQedgrgXAwBuBiAzo8olv5MsM7YcqVJimE2aK7onDlybBv+V+s5QIkRfldg8YO4YJfCHQ5fVrpA e7Mdh/gPhDRZ5MjqxY2LTrLJASS24GUP0PKeJMi+sITmVYp0BAL8McSNhWTOgtehy9JvF+lvDmx xAYHhh10SzHUPwSWHgw== X-Proofpoint-GUID: nYjL0W8t1kQYiS56VQ-EUGAzJyc4OxS2 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 priorityscore=1501 bulkscore=0 adultscore=0 malwarescore=0 suspectscore=0 spamscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 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;