From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BC8E415F34; Tue, 21 Jul 2026 18:09:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784657397; cv=none; b=bP650zOO+8W97VrSv+GvE1dqHRFr64FxSxmf9xuD1cI+CEy7Tag2iYFZhzRceFxHlqarH7I2wHYUVhY/0wJVb6PnPmP47FQj88W8ZXN/9/eTbMaRsOUXxP10PPGDPN3JmtVXMS65lWGC0z09qR9MNcJLI+Qv/Ri4IpnPuEc8WcY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784657397; c=relaxed/simple; bh=nuNTVFD1rwit60S2Kw4SKK+ZZrTvA/PLDNyslBAOzUQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AujEiYJrglDwou4HtD8pPHtxT+jaN0n9bQgV0rJrUVbfbq1if05PAInTUBIe9bEpaz2HtW+9TiNruAIS2zfglhdSUXeKSK3MQEkjDqCHGR/RNthI0XEFfYFX2FfimWtzosbhDIZ1PAwOdpeH3peInBs+xTrYnSHgvrVHzkxdGhM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M30dXX/s; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M30dXX/s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28D841F00A3A; Tue, 21 Jul 2026 18:09:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784657396; bh=qJ2PC1oOUN/lV90CXEwewsm2mx2rssquszpJHMN4XBo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=M30dXX/sgOYHq+tH0rU+Ulien6D5uQDu69XilF4cR/c3jFtGoo2SJPKmaS7FkkXyo SRRTaoplw7zDgeiBuqWblypHcZoV3vCAKWZfW3yldRXo5GQvUS4qhW6a7w0q4drL7E aYjxieBNBz8lO9XjSOhH76uxRl8d1lS/7V+FcPElHJezohJqjofl4Wc4JNeQe0C/81 VecKSQXkI7rmMBXB3l1320zMCTKDepfA7f8t2yXeAHyh6kktizMqfmD8+77ucLgNRh UCyQY05HDxt5gcsA1cdsncRpq2NzPsHGXA3+FvXZU4Q9SrwAfdOKizX1aJTz1xtPvS WvxVgtwAQ+9Sg== Date: Tue, 21 Jul 2026 11:09:50 -0700 From: Nathan Chancellor To: Yo'av Moshe Cc: Sami Tolvanen , Frank Li , Sascha Hauer , Russell King , Pengutronix Kernel Team , Fabio Estevam , Nick Desaulniers , Bill Wendling , Justin Stitt , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev, stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] ARM: imx: Fix suspend/resume crash with Clang CFI Message-ID: <20260721180950.GA3684684@ax162> References: <20260718111340.159896-1-linux@yoavmoshe.com> <3046e60d-509f-471f-bd15-3ce78c87500b@yoavmoshe.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3046e60d-509f-471f-bd15-3ce78c87500b@yoavmoshe.com> On Tue, Jul 21, 2026 at 07:29:50AM +0200, Yo'av Moshe wrote: > On 2026-07-20 9:29 PM, Sami Tolvanen wrote: > > Would it be possible to just copy the 4-byte CFI hash prefix to OCRAM > > when relocating the function? If not, the __nocfi approach seems > > reasonable to me. > > > > Sami > > I gave this a try - I tried copying 4 bytes from before imx6_suspend > into OCRAM, but when I tested it on physical hardware (Kobo Clara HD), > it still crashed on suspend. > > I suspect it's because imx6_suspend is written in assembly > (suspend-imx6.S) rather than C, so Clang doesn't emit a CFI hash prefix > before it in the first place. Does using SYM_TYPED_FUNC_START for imx6_suspend() make that work? Something like this builds fine for me and I see __kcfi_typeid_imx6_suspend generated by Clang. diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S index 63ccc2d0e920..6ded29a38c99 100644 --- a/arch/arm/mach-imx/suspend-imx6.S +++ b/arch/arm/mach-imx/suspend-imx6.S @@ -3,6 +3,7 @@ * Copyright 2014 Freescale Semiconductor, Inc. */ +#include #include #include #include @@ -148,7 +149,7 @@ .endm -ENTRY(imx6_suspend) +SYM_TYPED_FUNC_START(imx6_suspend) ldr r1, [r0, #PM_INFO_PBASE_OFFSET] ldr r2, [r0, #PM_INFO_RESUME_ADDR_OFFSET] ldr r3, [r0, #PM_INFO_DDR_TYPE_OFFSET] @@ -329,4 +330,4 @@ resume: resume_mmdc ret lr -ENDPROC(imx6_suspend) +SYM_FUNC_END(imx6_suspend) -- Cheers, Nathan