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 98A45C433EF for ; Mon, 31 Jan 2022 17:24:46 +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=WYQAdmkcU1n9QDwa0zWznWAwhK5tLEKQWuoec2rUlog=; b=a0TRkNVCRAxLWH bd0v+OS7VzuI/5LmxphoK34qyI9KS5EauChKM5kWilq3kecRaoV36Mz/jQBC4sz2fA3Vn8O6kVYqP IFDa8vflP0iP08doiD6BU3VK3DKgB+OZCp7zZKI5Z94s6882AszD8p9P5KQpfYP1TfAkzlKmJMa5v ZHc6m/X4AfkhMpg7FfJ/AJb17uxC95LoBaWAcEpIn1yXpZ5PVpBULaRvirijUrB5NS758A55kY7Jj gKv2zAlkzhDN6/VjFA87nDQFNshehO6oDUaMol/UKea/Ruf66h1ILzv60w6FjS9HQu0/pZAjqFiem UT/IkPW4c93hmWxHsKLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEaOZ-00A5Ex-GO; Mon, 31 Jan 2022 17:23:16 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEa6J-009zKz-8D for linux-arm-kernel@lists.infradead.org; Mon, 31 Jan 2022 17:04:25 +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 68F9C60C75; Mon, 31 Jan 2022 17:04:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88B99C340F0; Mon, 31 Jan 2022 17:04:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643648661; bh=S74DKMO0CADG1HmA/tT72B//6ktzsp79oBGbqFvT7v8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VVkMygzAHhqvDHmW2z15hBLrdylkDOgBlZ3XfM6ZS4a80T8qYer9bK5v4WXCx50bF 9KTIf3UHFGZa+n+rkr+4XVSAZyFUFJ/oyvc1F9+NxmS79vCabsZdBkshkb9l8zS1sm SNmV/U+XuMqlgNSrHz5d/a/Er0NAEcunXzo41ZrELo/JLh+p05q7q+xuizs5kulmbq LzdFgEyT0OEzTTBR4j/3+pPd+9R67PPyvPEBqgvEqGW7KbkuNXMM7WSkBS+5q6axvJ 73Rp8s2Vg1LfxOot/Wx9ziMWJnGF39pfVpxhGsIQ71xoCyjmPsTc+8BCBg2pLi31qA D6vc3HjRyJPbw== 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 v2 10/12] drivers/firmware/scmi: disable ftrace for Clang Thumb2 builds Date: Mon, 31 Jan 2022 18:03:45 +0100 Message-Id: <20220131170347.381551-11-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220131170347.381551-1-ardb@kernel.org> References: <20220131170347.381551-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1707; h=from:subject; bh=S74DKMO0CADG1HmA/tT72B//6ktzsp79oBGbqFvT7v8=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBh+BZujBCOMOlyJSoqPrrpmcDvz9+LD6JJohQW8KH2 oC2vVJSJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYfgWbgAKCRDDTyI5ktmPJCG0DA CIR5Xbk3MHRCXqVPKgpsYxAfEZoFv5UY2y/TqTvcR+9EF3fg/gSOLvaVoyyZofrEjvLKPo/Y8KZM7g C4TP1xbobUFk9SBnpQTDS/w5b3CegoDlUS5jE/o5tN55660oI29MRa49Hcd7vtrHfFi9INCfDCOrV5 7N5CnIxdC/jF5HZSC3wAThBqDxolpvNgilpMI31t08lzQ5ctfV81nOFj/SLnkKGE26rJvrIIPaNtli KNlL+d0XWq0OhRaJJDuaxZ42tqEGyHT3T9TIWNTLdjMV8yCNq0+UU9Dco/tf9QTawFnYc+AzmQNhDE j2jM1HupchqpJEp7FLeaaodrKOWVmP3ZEVWuhtjphlOJTr6QAMdhKpwXjrzG3OiQIcgfQ0Y6EF+Sf+ N0YiwUlQ6m2InGLAQWAsLKENsE3dsZhe9rkkqS5Twr4VEUeXleEOJb6IaofuvlWMrb0BmrT2s4jT/7 B2+wkO2NweN3moJOw20dsuvhIoeMTepPNheJlZdGTfDMQ= 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-20220131_090423_429369_1631B861 X-CRM114-Status: GOOD ( 11.25 ) 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 --- 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