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=yNJ5i587L1k+J517oT72R1kO4FqQ6mns+aUvuvcrWYcotRtq3rClfjW4H+9lJVHSl9// TqttX708oROvZ/Avr0+fR0/pwujo3lC/VqSBBVRyjttk3roDfluAdJjB9XWXdrtzVk8HX eCvHQ2TIX8I19WQ2oy3nVxlSiAmSV5nRAaxrrxOqvWlSOryVZLY6uio71ADdb1pT0gov3 7EbKVUhX37vtovgauCnxAjKFzMRX9G7L3LFOFvyi7wnZb5dCz0kxzx8f7lgWF6wd2Ikne HSGfS305DhSdVH4E+o45BLsFIq1tg1bJ9L07b5lgRcsIGmuRIWn/8qwumbzmPG8DNmw== 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-Authority-Analysis: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-GUID: X-Proofpoint-Spam-Info:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=omqYWhVqMOT50g1k6P+qZSjcEmapQunIcBNENfkNHQM=; b=22OI0py5YQSC9KlYcj/VNs1DTZ7Ua06MY6UdkKq0gEcSo9mo8aGJAiMw6F/nygo+W0dJ nWMVKMTZVXVti2J7L54lQVZDdA+q2LlwZlesZ31krY3dXhFoXyu5NJZ2NIuYneXgOrnSo zeb2v682FM4LtewleMuzd7IO+ZinlMoXNXPnnYeAWt/2OOsMspIBEAuwUeRfGwF07t5X1 GY8iqva62apDy3BU8he/KGMgnvoNRZzN6blWJZ0AZq80fDT3GWBDdZ5Clr8tJH8Wzk7UK zED817HBKXCSukt05juoBLf9iVzDe6Oi6TOJK0PWHSc2M2TfTRovKF1cpmJfD5vyZaQ== 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=CPolo8G6; 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 066A1606A32F for ; Wed, 2 Dec 2026 21:34:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 066A1606A32F 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=CPolo8G6 Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B2LGpBL1316142 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 4jaj5a2c84-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-386b8624cf7so3408350eec.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=1796247268; x=1796852068; 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=CPolo8G6NXkHu8OOx2jyuruKVg65FZm44TxP/OHrPt2RHpjpLFZ14vTQCEgOUQ/t08 YgtinsjHYYqbDYbIccl79nCi0rU6K0+QrWFjDfWrxq4tLEDnzVl2IG1XOvPT25Jq2ilM flJXBokzXzoQMz0feZeM6mzlMcKXIMvIvFi6ns0fNP7f39Y24eLvfUqnSiEOCqCMhLKy xcEI/fHuqvZhaJVLjEtZkImwm027QxbftSWb2JxvQ5+ogjK7O1to/bMW32efcBo9fQbe bzNUXfwncZGwUJRN+WlTUOkN20fbU2gmWioXUuHiMecyGdR5Ce9TRLdS1mSH+4f97Wz7 +ZQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796247268; x=1796852068; 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=qTe+7pI6CZ+MY/gKA/DpM6mTCwv7vtbUx9sWfzDUmgfxbzoCRIpY/M0FR6jrk3ivMG vqmZ3kh3z+cUO6XEl7KuV5y0GgUHGICCeu3VTAAcfGrPvTqkZss/II+01cQEJhPdrWTR xQUjrqClNdTZsDoFJZsvp0wSAl+6YcGapzOCd73JONC92eCTOEn7DhRzjE7cS49MZEqZ Tu6jXAITbY4UCJaN/X2EFVx/aMPxTg9MgVVm9EyuZuxzgbbbDZYXHqRY98cCc7GTRc6X 4G5wRJ68El0mtGb0WSOJuUKYaJyIFacVnQmQcssz93r3gw6un7NJng8fLUmw0/Vyqeu5 3YbQ== X-Forwarded-Encrypted: i=1; AL+hErEqp+XTuWiAAYCDYe0Tckc6jfCc8Fw7Wa8XvtaijlLuJKJhyM2rYro8JCe2jKsBXAY5iDA99fQpj2t0F1NLrG0=@vger.kernel.org X-Gm-Message-State: APuU4Z8DEJR4mnffcqxk1N2hTIguW9QP+dDhaYbc5j7DGbMROPPvlL4T bhUSkpk8vjUtRVXytjmDUW2Y0rNbeEGMkzkcfL+QLRsZTfwtLPDfoilq0q2fgrFJSlPWKd7A/3H y67/zSwRdwzFxQhlsGdrn79HZ11AjTEgDtASO/guInvn9Q5wlmi1wBtO++EpK/9jpNrnov60= X-Gm-Gg: AZFdTZcQ7pRNveJEGxP73b5Hg9m2rnULh9cX7WVmN4KT3VZdTWfVffE7ji2UrE72Rd/ zGF50el8OrTnVBMErW9T5LQmJPqOVRESqUp+tv/OZl8zH9WMyhDD9YQa0Oj9dEVBdX05H5ur5hw J0CoIAZih16avOBvCE3sziSTxgKc8LaKRgZrhxyDBHK7ztguJCMT6nfQG/ihjuVhXJd8SydQ435 rOOf3/wBqYq33PHVnVePt24PTJTijwZbVEXVyCD1vbhRddmYSRtRfyagkhOtooTExBqA/xNgXEF tCkwNVKQwHUthZG1p6sAaBCdQdoMRi7fKl/71eYlI10YEIP4tfxrT7pkpt5RIIrVdYp+wo9hIL2 qcowLOQv1AHneH8gja6RDFdnXu9vo71+XxJby0srqqMI4T63DVatvjuuHayrraLD8UhkseWq1sg FCgUJkcCpI8MAJ+dS0HuaXxIJjcpk= X-Received: by 2002:a05:7300:d108:b0:386:c6dd:2616 with SMTP id 5a478bee46e88-386c6dd29ffmr26366036eec.41.1796247267444; 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-integrity@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: dDEndlt1GCXWzy-f97Jp3x99Yq3kwhGc X-Authority-Analysis: v=2.4 cv=TYYDJhQh 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=_K5XuSEh1TEqbUxoQ0s3:22 a=Ikd4Dj_1AAAA:8 a=EUspDBNiAAAA:8 a=RkTgK740hJReAd0VgacA:9 a=CjuIK1q_8ugA:10 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA4NSBTYWx0ZWRfX4XY/g219K9IY 4TSnE8oIG9vMiogd//9RFrTEYIG5kfKpam8gHlGW5SGaE66P9K2BL6ANsOnpWer5eAWlJB4mlea 5v4riQPDsg5Xz0z7ZAt4c3FrPeW9hOQryaiUQoKKnF+7oc123YdLbtI3j/9CgG3JYEAiH+RQUO8 Y4Oga/Gr42KVT+OBPx0DXIO/djDj/+v1EGaoAqI2RdzjV6rNCOmvUoKmwmIRUWY3u39OZqNpTkj 7286/lp6aH9BjY1CAzQogdumhCB+J+7/4RFp3CvMK2B7dWBOnp59zeINQHUh9EH4YEW9RLWEaKB TbBaqjNjiOKaOreyx0MVZcWewvuNYcR47OjDR+VSSPPxKkVljERKbPf/p5tX/NjGXfK3at3jJD0 YE4ixguQOYb7VnHMDDeOrikf7mk6sMdhQCq9Bo220yC6YKD6ti/Z1SJoN1NF8JAEa21ReQIkJ67 sFaw4Pj2LUA2oNE7vZA== X-Proofpoint-GUID: dDEndlt1GCXWzy-f97Jp3x99Yq3kwhGc X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDA4NSBTYWx0ZWRfX00qzOqMOfSpE SWeRSGPx1yWlzH7mOlOCOr969zMGU0sGeb4xuaOGPLDUHjumRZCsHiKSewASrx8SWm62QkYrVKB YPkmTZszGL3S53CJHBypb4hc4eUkeRE= 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 bulkscore=0 impostorscore=0 priorityscore=1501 adultscore=0 malwarescore=0 phishscore=0 spamscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=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;