From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57F79C433F5 for ; Thu, 3 Feb 2022 08:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WFTPFmiUMk6nb0ywZ8Rce+sdLfVIzZ0HeeXeHjTLL9k=; b=Yozpqi6cB/ypH/ 5iJIDYisvqlWNI+IqHWMTqvcizrQIxK85bttO37O/zAT+KhenLhyNsx9Mn+GFnum9GC5FGPBp6K1C V87DDWJBvOvZ4IMXnZvGQESa0sW530I8dU4fk8XuBE7G9YipdlxDaB/1aQZisrdDJc4Jdf6yWVbOV KgBRXdECbJE/ytAwW46YpRhUnMidjZhs41g2oijqY5db6IDdvlHxu8RN6dYJtP34ydu9kXx7+d8rD Dzrjck3SmRspwuXgYik0SFmuKgkvRiDPX546FCYK/pgBoTQnd5NGO+sLL5kWiUYED19JAB2nz44GO lSfK/YYfjlzF0BSy8jzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFXS5-000LCe-OX; Thu, 03 Feb 2022 08:26:50 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFXO6-000JNG-23 for linux-arm-kernel@lists.infradead.org; Thu, 03 Feb 2022 08:22:43 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A07FC61841; Thu, 3 Feb 2022 08:22:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAD61C340EF; Thu, 3 Feb 2022 08:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643876561; bh=WkJcHgvoYesDdrQb/4S6BdJtpVr5vSChc/SoMxPxVS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sY42TYSYnaVH0XhiLdKEkvi7mPk7FvF3bYSrBilz/2Xe+4sjEFHE9AyqDiqW9cDB5 4RETjWnt0cXBMogF+htbMYv1YpumongMh73pV6uuEvBYBhVcibDtH7kbjRHTuepQ76 HiYUIi290m/RiDzEqDW84UCYVJl1Eg+q5kr0+OHrrVyGHqSdv56mIKrAAlP/BUBGCh VMEfQCxnoOZcrTqdn6j/SG6CFwGKSjJWsgmuQDbty1hIvQngyurTYDIkS8uRUsO69m ZIunZFRQ7lLZzwYKptRgrdaylUT3dlGP2QYzSyM0GhDJMfhe5LT6PCZ1LarSgtgrgZ CwKZwR1rqpCzw== From: Ard Biesheuvel To: linux@armlinux.org.uk Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Steven Rostedt , Sudeep Holla , Cristian Marussi , Nathan Chancellor , Nick Desaulniers , Arnd Bergmann , Linus Walleij , Masami Hiramatsu Subject: [PATCH v3 10/13] drivers/firmware/scmi: disable ftrace for Clang Thumb2 builds Date: Thu, 3 Feb 2022 09:22:01 +0100 Message-Id: <20220203082204.1176734-11-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220203082204.1176734-1-ardb@kernel.org> References: <20220203082204.1176734-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1811; h=from:subject; bh=WkJcHgvoYesDdrQb/4S6BdJtpVr5vSChc/SoMxPxVS0=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBh+5ClB+oi+CxNghHlmp1qdbJQLhoBZhVXc5dydH/E pqiaUIiJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYfuQpQAKCRDDTyI5ktmPJEvfC/ 92uGhhweuJ2Kf3PiPE49rRB/+8X9nmkEHUkUy6AuGDENxzVIdONCMZFN0h1ZaAjz4oo2pLhZi3b9aG PGXAyOGzEcA5C4PtIiYiGwQk1hYTXI6GPN/zj5i9WHjisJKAU5nz+G6B1Y/2oEcTR901ql46TYaltG KjwSIjT9LTZDF5znU1DbmdR42wUAzJAjlu5P2qlGn7MtRmgzmGRF/X5HZvji90tfTGa9xEMYRpwgPh YiP3U1NK/5Zo6XD0gLQAfkLgXhqToym05kCc2cGUwgMPJ1BNxLWptrPGLu8XfV60dmwPaHMtyU8LBr rUL0K+rl0B+kYa1M00xKZeu4kYJqLsP2tcMI8I06UTeM2ZvdF4J36M5wgha++wuPWLjGU1Z9MLNT2H N8Xs/Ds9H72Ji4Zx3gFln1jx4Zpy8QUWcx8umhhWCfemHj9C0PElUIfBGnYhQwNOdoQjaa+19pbtqV +5eFi+liE0mv7gtfBZRgQdBC5CWARvbv4RUBrHmAVmYcU= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220203_002242_201056_D6248ACF X-CRM114-Status: GOOD ( 11.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The SMC calling convention designates R0-R7 as input registers in AArch32 mode, and this conflicts with the compiler's use of R7 as a frame pointer when building in Thumb2 mode. Generally, we don't enable the frame pointer, and GCC happily enables the -pg profiling hooks without them. However, Clang refuses, and errors out with the message below: drivers/firmware/arm_scmi/smc.c:152:2: error: write to reserved register 'R7' arm_smccc_1_1_invoke(scmi_info->func_id, 0, 0, 0, 0, 0, 0, 0, &res); ^ include/linux/arm-smccc.h:550:4: note: expanded from macro 'arm_smccc_1_1_invoke' arm_smccc_1_1_smc(__VA_ARGS__); \ ^ Let's just disable ftrace for the compilation unit when building this configuration. Signed-off-by: Ard Biesheuvel Reviewed-by: Nick Desaulniers Acked-by: Sudeep Holla --- drivers/firmware/arm_scmi/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/firmware/arm_scmi/Makefile b/drivers/firmware/arm_scmi/Makefile index 1dcf123d64ab..52b9078bfe96 100644 --- a/drivers/firmware/arm_scmi/Makefile +++ b/drivers/firmware/arm_scmi/Makefile @@ -11,3 +11,10 @@ scmi-module-objs := $(scmi-bus-y) $(scmi-driver-y) $(scmi-protocols-y) \ $(scmi-transport-y) obj-$(CONFIG_ARM_SCMI_PROTOCOL) += scmi-module.o obj-$(CONFIG_ARM_SCMI_POWER_DOMAIN) += scmi_pm_domain.o + +ifeq ($(CONFIG_THUMB2_KERNEL)$(CONFIG_CC_IS_CLANG),yy) +# The use of R7 in the SMCCC conflicts with the compiler's use of R7 as a frame +# pointer in Thumb2 mode, which is forcibly enabled by Clang when profiling +# hooks are inserted via the -pg switch. +CFLAGS_REMOVE_smc.o += $(CC_FLAGS_FTRACE) +endif -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel