From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=40.107.162.69 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796222920; b=isNyo032+l9Y+NLg7m+xVkUUPvuISgLERSdo/u4eXzTBUC01XqQdVrX5GTBeKNryZfbZ 7xqKXVadAIuPTLPzyJ22YtxQUVIsESvL+7I/V9bkhfdht3E7aeTmrqVrelh6mG/LYFCTc yr9YwnDBEGkW69wpyyjeSS9IwGP9Z7aWaMb36aiOhe8fQMkTDd+d8yJ+Li32Ln2LdGcPy NhjRL348tH+Z6NkCI5G6i5yY1k5P137GRTVmGyNpoMBPfJTB9G3TIt4HEdy8hK8xGqgUn GqK/fMFRgaR4UprMqnAeWx3AWFkP7PkY+fyn019omqn4qX1sopwgHyzTl9dptPCJzGg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796222920; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: Received:From:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:X-B4-Tracking:To:CC:X-Mailer: X-Originating-IP:X-ClientProxiedBy:X-EOPAttributedMessage: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=6WkpfIVCCLy3otHmDacHuNGbhC5lfGxOcuQNTEqzUXs=; b=xFGjoc2dD6lFUFkdiG8MBGQsCICiV8h7K/hJGNx1Qkst86KkXxPMdnF2j3L00/K5FUgT BpSWnERi8zwzAVIvbrA79brPfZEp0E3hnhV/2qNotTASbzgcF7CRK8s/I0DL+TPFLqb4J 7wn0lEASePAwFb0C6Kk6HxNbE0kDGCjvYWgCzm4f7xKiFYbXGfkdJvBSEeJECIWeGqAQA yVLg9cXvmKmkUTPV/ydpcJvfdDQmMD/KWOMRlQp1KX53AoqfWhg2Csf9ZY5ZtAaCHweTJ 9NYMOgKi1NoRqcSSkegmA+t9kbbFPkZH4Xn8mClI6w/LtGoypFQfiE8uWTS3idF5eQA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=foss.st.com; spf=pass smtp.mailfrom=foss.st.com; dkim=pass header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector2 header.b=A6YPvxmy; arc=pass header.oldest-pass=0 smtp.remote-ip=40.107.162.69 Received: from PA4PR04CU001.outbound.protection.outlook.com (mail-francecentralazon11013069.outbound.protection.outlook.com [40.107.162.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D139606A325; Wed, 2 Dec 2026 14:48:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2D139606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foss.st.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector2 header.b=A6YPvxmy ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Hfceg9mP8HN/DQXWqb8TClhxfNKUzEsweFQH7nve45Ad1X9z9ne8fR6EKej4goFM3I3lxgDGhvsaOsr7NoT+IDxfn5Z7QxeVsTw0DA+Wc8HOZOLTQiIbdP1kqEIRnbgwGo1vRYrvSaRQtjPIxAs8Wy4VdXTnw/kUXjqmeybTztLDDDqY9DZqZybGnIG7PS0grZ6NVih4moy52xTtE9VJKzUxCDjxFkHl73dSub6wPMCJRhyq2pW02JO1jsiQuaH/aZNY1wTOzPwr93DWMnv7jHObKQayeWErwyC8p8twf00Eo4goPOKl8tr8dvrNiEz5Hk19UdNig1jfoOdZZk1MVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6WkpfIVCCLy3otHmDacHuNGbhC5lfGxOcuQNTEqzUXs=; b=PU2RLmWUURVkfEoZjlU0b88InevOXtpM7syvNQ2Ev//rP6ujdVp2UegRExWUNqju/9ozB0tmyu5+dsZxOguNRNcdk1pVDa6v2Ju6dNoRQxvB6YXv7azFqf/LcZKgZGnnv9xBv/ctAE468h7AH+Yb0kUmo9mITNFTR5in/yLZYfYTTZzl1Z3niD3xgTW3NrGnC952qlr+Ihsqz/HZZGbF3Acu+zhN6hGygr0bUmjK5Oa/JkSWABUiWHEjgPVHqRiTnvwy+Bbg+2Mn5yuAqjuaCklCqAPp1j/wf0KJFsv3O2phpgMkPRDOBzPlB3TDnhzFFtBjwE7r43ZfDOS9i4gbdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 164.130.1.60) smtp.rcpttodomain=pengutronix.de smtp.mailfrom=foss.st.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=foss.st.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6WkpfIVCCLy3otHmDacHuNGbhC5lfGxOcuQNTEqzUXs=; b=A6YPvxmy/g4cem+sQsyEEaXLt6p7wirVafomHc85bykRWu/759PsXMiukkPl+BKAbrdZNOCu9qD1qVZHFz5x0Dm4uN6yp7IuOpIrfBSxVf7Hxa+b9QyOn2HJlOLvyS4jMw+aN6pRqyHL/fBeEGXmWJN/O6smgCQkEb5bq9c7z9UYzTqd8uiF+CnKM6z/q2CY+4CErCpKcWUraNppBZWBnzKrVxV9H5R9IZY1EMl68jh9Mn9m2K4QPy/9NKdl6HnRqIQs5kpJxyoF8cZqtCw9SGpyC8KAj14v64ww1AHxZKeOuiRH2fRqh3owIDXXcn3OZNQ9kheAsiFK1eIXWlzVvw== Received: from AM6PR05CA0016.eurprd05.prod.outlook.com (2603:10a6:20b:56::19) by AMBPR10MB9237.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:6ac::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Wed, 2 Dec 2026 14:48:35 +0000 Received: from CPH1EPF0000052B.eurprd05.prod.outlook.com (2603:10a6:20b:56:cafe::7b) by AM6PR05CA0016.outlook.office365.com (2603:10a6:20b:56::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Wed, 2 Dec 2026 14:48:35 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=fail (sender IP is 164.130.1.60) smtp.mailfrom=foss.st.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=foss.st.com; Received-SPF: Fail (protection.outlook.com: domain of foss.st.com does not designate 164.130.1.60 as permitted sender) receiver=protection.outlook.com; client-ip=164.130.1.60; helo=smtpO365.st.com; Received: from smtpO365.st.com (164.130.1.60) by CPH1EPF0000052B.mail.protection.outlook.com (10.167.241.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Wed, 2 Dec 2026 14:48:34 +0000 Received: from STKDAG1NODE2.st.com (10.75.128.133) by smtpO365.st.com (10.250.44.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Wed, 2 Dec 2026 15:49:53 +0100 Received: from localhost (10.48.87.127) by STKDAG1NODE2.st.com (10.75.128.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Wed, 2 Dec 2026 15:48:33 +0100 From: Arnaud Pouliquen Subject: [PATCH v23 0/6] Introduction of a remoteproc tee to load signed firmware Date: Wed, 2 Dec 2026 15:48:16 +0100 Message-ID: <20261202-rproc_tee_v23-b4-v23-0-bac8e36eb405@foss.st.com> X-Mailing-List: linux-kernel@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="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIALAvEGsC/x2MQQqAMAwEv1JytlBjkeJXRErUqLmopCKC9O8WL wszMPtCYhVO0JkXlG9JcuwFsKkMTBvtK1uZiwB02NZlrJ56TPFijjc2dvQ2sF+IHBGGGkp2Ki/ y/J/9kPMHe82iXGMAAAA= To: Bjorn Andersson , Mathieu Poirier , Rob Herring , "Krzysztof Kozlowski" , Conor Dooley , "Maxime Coquelin" , Alexandre Torgue , Fabien Dessenne , Arnaud Pouliquen , Philipp Zabel CC: , , , , , "Jens Wiklander" , X-Mailer: b4 0.13.0 X-ClientProxiedBy: STKCAS1NODE1.st.com (10.75.128.134) To STKDAG1NODE2.st.com (10.75.128.133) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CPH1EPF0000052B:EE_|AMBPR10MB9237:EE_ X-MS-Office365-Filtering-Correlation-Id: 93a154e0-e660-468f-6dc8-08df50835785 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|7416014|36860700016|23010399003|1800799024|11063799006|6133799003|18002099003|261009220027099003|261009221227099003|261009221727099003|261009223027099003|7136999003|13003099007|261009223327099003|921020|56012099006|10067099003|261102123227099003|261021121427099003|261021135927099003|261022115727099003|261021123027099003|261026121527099003|261026140227099003|261022075727099003|261022105027099003|261028144727099003; X-Microsoft-Antispam-Message-Info: 4PRV6ljTwjJvgUG/z2JD7DvxD+FcIV3QkOTUAWnSJ1IYY9UTAEss3Y71E0GaLC7BJ3TUJ7AyPv2mmWXFu36FkllK6AKlKtFh85YZSOFN+KvzGpFfW7J2tIsuMw0UXKi92B1ntmz0eFMo2bE2JfeMrNqlLmagliV/bR89L/Vzf5SE6zayW5WBsINRyB7rGi1yWZuKmo9c86KneYaXq1eh8PoF20+xtkPlk6mb0GIO+CDtF0LAw7iVyQ0ObjUUUZDn2f0ioOITmAE9FEgWPsMPpc286cwz3yxiD8gnc2j//pw73ibTtL9DJrabfTvXjo6fFBh9CGu2ncwuYxrESvLyMeHQdj8G5uGotPLmg7FDe2gAqj6le18ULUPfDFnXFa6Tq2CYYDj+t+O5PlS1cV04BYt6+5MkehJsL9iWNO274D8M3dD42o0y53GHddwLkBjFCE0BPPt9qNRddbQfP27gsOn1JvBfFbaiXYcunXiGkX/mvOR5LehQTaPPEVNI0Ey8zc7YYVoYj5KTapD7GrWTfuf8vIY664599IBsV+ppY/cq7ck3VWv7A6WUp9Ci1Jlopu3NAVhTaM3lEcXMExQ79jrwu/xHsqbq+mXQy5bxjFgs4XvLWr1MQlNH1i1kIfOG3k52IKNzNx4VGW96iDuSPN4FRpGO1tLStFHpJBe3LyWRya1czUy2gUN0OKuo9COJzB6hRT9QBMWKVGbWxUP3ow== X-Forefront-Antispam-Report: CIP:164.130.1.60;CTRY:IT;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:smtpO365.st.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(7416014)(36860700016)(23010399003)(1800799024)(11063799006)(6133799003)(18002099003)(261009220027099003)(261009221227099003)(261009221727099003)(261009223027099003)(7136999003)(13003099007)(261009223327099003)(921020)(56012099006)(10067099003)(261102123227099003)(261021121427099003)(261021135927099003)(261022115727099003)(261021123027099003)(261026121527099003)(261026140227099003)(261022075727099003)(261022105027099003)(261028144727099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IMQ5mnbxg9AgpZXrIb6bQB2zZrlPDs4hFIzpBbaTHJiaqlR1BjOx8YUdhY5zLQo96LWIbsRp4KwyQbnAOm7yIqCpSGQ4oW2ZRXYyfPq+EYn9EbTnyXvRY08DDZNlRvBU9NCEGmO2W5C7q8mzJlPSkAs1eDMrNiPeFKKCVdKMI/odQ3bOW6ToXA/kaWDJOYDlIq91NqRroKZoOm3qfK5ER5phkuSMYvQmw6RkMSabGVI8AZ5+Py182A+j42TD4suam48m8VedLte6QTZOQVChgFjwvBwaDsV76UPl4qrX+fx2HYreKqftuY4x1wWnQEnZxJ8vsbv+SnTfzcc9lVgKv6OMUUtDlofbtME+1ZWTOM9j7GkTG/cruK8raI9vlM9Q8p2EoYLKohXBeLWuZXQLDE4iXHc5rb4QjDWwygPtgog8B+7kVVxqO/ASqbUWubea X-OriginatorOrg: foss.st.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 14:48:34.7586 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 93a154e0-e660-468f-6dc8-08df50835785 X-MS-Exchange-CrossTenant-Id: 75e027c9-20d5-47d5-b82f-77d7cd041e8f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=75e027c9-20d5-47d5-b82f-77d7cd041e8f;Ip=[164.130.1.60];Helo=[smtpO365.st.com] X-MS-Exchange-CrossTenant-AuthSource: CPH1EPF0000052B.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AMBPR10MB9237 Main updates from version V22[1]: -------------------------------- This version drops the devicetree node describing the OP-TEE remoteproc Trusted Application (remoteproc-tee.yaml and its "80a4c275-0a47-4905-8285-1486a9771a08" compatible). The Trusted Application is a firmware service, discovered on the TEE bus by its UUID, so it does not need to be described in the devicetree. The st,rproc-tee property now references the OP-TEE firmware node itself, followed by the remote processor identifier assigned by the secure firmware. The mode is selected per remote processor: a remote processor without st,rproc-tee is still controlled directly by Linux, so both modes can coexist on a platform with several coprocessors (stm32mp2x). As a consequence, this version: - drops "dt-bindings: firmware: Add TEE remoteproc service binding"; - updates st,stm32-rproc.yaml: st,rproc-tee references the linaro,optee-tz node, st,syscfg-tz is forbidden in TEE mode, and the example no longer defines a firmware node; - updates remoteproc_tee.c: the TEE client device no longer gets a DT node, and rproc_tee_register() checks that the phandle targets a linaro,optee-tz node. It also addresses Sashiko review findings on v22: - remoteproc_tee: fix a deadlock between rproc_tee_register() and the auto-boot work, make the teardown paths uninterruptible, always call rproc_del() in rproc_tee_unregister(), handle the removal of the TEE backend while remote processors are registered, and validate the resource table address and size returned by the TEE; - remoteproc_tee: REMOTEPROC_TEE is now a tristate, to avoid link errors when OPTEE is built as a module; - rproc_pa_to_va(): use a phys_addr_t offset to avoid truncation with LPAE; - stm32_rproc: parse st,rproc-tee once, fail instead of deferring forever when the OP-TEE node is disabled, and keep the original remove ordering. More details are available in each patch commit message. Main updates from version V21[2]: -------------------------------- This version removes the st,stm32mp1-m4-tee compatibility string, which no longer seems to be accepted by the Devicetree maintainers. As a consequence, the stm32-rproc-tee driver, introduced to simplify the code, is removed. The STM32 integration reuses the existing stm32_rproc driver implemented in V19. Main updates from version V20[3]: -------------------------------- To address Rob's concern on v20 concerning resource declaration under the tee node, the child-parent hierarchy was replaced by a phandle. Main updates from version V19[4]: -------------------------------- Introduction of a dedicated stm32_rproc_tee.c driver and of the remoteproc-tee.yaml and st,stm32-rproc-tee.yaml bindings (both dropped since). [1] https://lore.kernel.org/linux-remoteproc/20260414152904.1679724-1-arnaud.pouliquen@foss.st.com/ [2] https://lore.kernel.org/linux-remoteproc/20260317180329.1207625-1-arnaud.pouliquen@foss.st.com/ [3] https://lore.kernel.org/linux-remoteproc/20251217153917.3998544-1-arnaud.pouliquen@foss.st.com/ [4] https://lore.kernel.org/linux-remoteproc/20250625094028.758016-1-arnaud.pouliquen@foss.st.com/ Tested-on: --------- commit b6a9fa34ce41 ("Linux 7.4-rc4"), STM32MP157C-DK2 with an OP-TEE build providing the remoteproc Trusted Application. Description of the feature: -------------------------- This series proposes the implementation of a remoteproc tee driver to communicate with a TEE trusted application responsible for authenticating and loading the remoteproc firmware image in an Arm secure context. 1) Principle: The remoteproc tee driver provides services to communicate with the OP-TEE trusted application running on the Trusted Execution Context (TEE). The trusted application in TEE manages the remote processor lifecycle: - authenticating and loading firmware images, - isolating and securing the remote processor memories, - supporting multi-firmware (e.g., TF-M + Zephyr on a Cortex-M33), - managing the start and stop of the firmware by the TEE. 2) Format of the signed image: Refer to: https://github.com/OP-TEE/optee_os/blob/master/ta/remoteproc/src/remoteproc_core.c#L18-L57 3) OP-TEE trusted application API: Refer to: https://github.com/OP-TEE/optee_os/blob/master/ta/remoteproc/include/ta_remoteproc.h 4) OP-TEE signature script Refer to: https://github.com/OP-TEE/optee_os/blob/master/scripts/sign_rproc_fw.py Example of usage: sign_rproc_fw.py --in --in --out --key ${OP-TEE_PATH}/keys/default.pem 5) Impact on User space Application No sysfs impact. The user only needs to provide the signed firmware image instead of the ELF image. For more information about the implementation, a presentation is available here (note that the format of the signed image has evolved between the presentation and the integration in OP-TEE). https://resources.linaro.org/en/resource/6c5bGvZwUAjX56fvxthxds --- Arnaud Pouliquen (6): dt-bindings: remoteproc: st,stm32-rproc: Add st,rproc-tee remoteproc: core: Introduce rproc_pa_to_va helper remoteproc: Introduce optional release_fw operation remoteproc: Add TEE support remoteproc: stm32: Create sub-functions to request shutdown and release remoteproc: stm32: add OP-TEE backend support .../bindings/remoteproc/st,stm32-rproc.yaml | 50 +- drivers/remoteproc/Kconfig | 11 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/remoteproc_core.c | 56 ++ drivers/remoteproc/remoteproc_internal.h | 6 + drivers/remoteproc/remoteproc_tee.c | 773 +++++++++++++++++++++ drivers/remoteproc/stm32_rproc.c | 252 ++++--- include/linux/remoteproc.h | 6 + include/linux/remoteproc_tee.h | 88 +++ 9 files changed, 1153 insertions(+), 90 deletions(-) --- base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f change-id: 20261202-rproc_tee_v23-b4-8e4faa0aa281 Best regards, -- Arnaud Pouliquen