From patchwork Mon May 30 11:24:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 12864543 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 485A2C433F5 for ; Mon, 30 May 2022 11:31:19 +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: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:In-Reply-To:References: List-Owner; bh=nORCYdexzEM+mTTIr3Z1LhTfV4idH5JQEr27mWAar/E=; b=JSkYBiAmn8b2R2 7CRDBcd8hXYNr0hRrI2CAbw3Kd+sUlfMC3CR9W8sFOHUvh2Opz+plwEgo+kIYgOAH9/k5FkIjlyse +4vLmO9jN7OnzL/8o4sZkl3L7tkGUuWHvSIRw2DXd4MgjldSWuO3qhF3A10CO7dDbUEFEhE+5D69t EKO3gxO0PO3vCGQAwP77GGhyZoBZd4TGP7KLPdSJ2GTZvcqND8znMkdCVck6s8FLXmr8QN/fh01MF FgnVCynTWanhSumwd+Fq3cVoOj+fCS6ugRsZFFZnOMub+VX3K8Rdf9EyjxVcbfMhxq5Yjmc2AYfo9 GSbdznmmpYIbuXg5yViA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvdVk-006KSm-5v; Mon, 30 May 2022 11:24:36 +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 1nvdVg-006KSN-O8 for linux-arm-kernel@lists.infradead.org; Mon, 30 May 2022 11:24:34 +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 00B7761074; Mon, 30 May 2022 11:24:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FE55C385B8; Mon, 30 May 2022 11:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653909871; bh=P3xevVed3IvxOg+xFHz2Ye6LsnEaTAu2QFqIyykN+WI=; h=From:To:Cc:Subject:Date:From; b=WLJC7ue3fKotSZ8lTc9D4PaRgIow/mDv1a76fTxH2Pxqj9Bex4gXWC0FcD5WoG3Zr wANwjhk3xse5ENUMCg7S0vXK7Scp65ZSAfaQIovUgZiPNqTE40CS1KoA5FMbxJgYXr 4zZGqH7q9lO1KIW+U5WT3bo8dpbh/X1gpKFQLozYxk6D20J7hwMaKjgccnjuEIZNec ESkSjWwG/C7RNIh+i7SL98erCXui0KBhlHVngGFtQ7krawK0bv2gdblllt3QBccWuy 8Z/kqYc2FXTqczc/yqSt8Xn0UyIZmcQxTaYWfJ/RawgcnZCj7XctI13eccg830k9uk N5fkwOQ8/cY2Q== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk Cc: Ard Biesheuvel , Nathan Chancellor , Nick Desaulniers , kernel test robot Subject: [PATCH] ARM: entry: add .ltorg directive to keep literals in range Date: Mon, 30 May 2022 13:24:17 +0200 Message-Id: <20220530112417.2492510-1-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1687; h=from:subject; bh=P3xevVed3IvxOg+xFHz2Ye6LsnEaTAu2QFqIyykN+WI=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBilKlfej/rSYPCCTCR6H6929UbRCOyZT4O3usfP1V6 cp4Vu/mJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYpSpXwAKCRDDTyI5ktmPJIqSC/ 9g+HySWT/Re0dRzdom14gxwebmQr/Zl/G9PPNHVdF/QDfmUmIK2xPuvLTfTbg9XlVFSBZh0s9FaIME l0K6aywErrN+tL6Y+49V5Oi/W0rrxnHHSwnx4owDdKgxB8kiqzHfx1YNCOtCR+msT1KTH3hi5AXzyB 8gsEQPxHNDWXTZfwtfYasCTx46AqWjTF3iRiFX6iN7bKFglpa3K6UaLy/ee7mRfREbkc+fCCTVX3jm PNnkbVgqN5OqJXsJL2EEKd2kUkbt5pjsVYwEV4+K24X8+QuIRuSyvw3o0koaZ5vkUwiUyyR7EgcKrz e6fQ+XgoVrjFR7ArvyomlnGiPFyNGxoqxkeRX+8tbXRqJryyZlrR5ovizdbJgyogzsdouyR+Tg76tR RN5a71JCHVXLENGtzRBLjtCCy/GxEWYUkfLuPLSF2c7gSMDkhV6a15b0sFQBAJpy6JAB9Qol2MVr6D rhKX1xpD69KXgo8wwFOYUt/J6ZcGs+0tb+z6exCUmmJ14= 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-20220530_042433_552482_535627DF X-CRM114-Status: GOOD ( 12.92 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org LKP reports a build issue on Clang, related to a literal load of __current issued through the ldr_va macro. This turns out to be due to the fact that group relocations are disabled when CONFIG_COMPILE_TEST=y, which means that the ldr_va macro resolves to a pair of LDR instructions, the first one being a literal load issued too far from its literal pool. Due to the introduction of a couple of new uses of this macro in commit 508074607c7b95b2 ("ARM: 9195/1: entry: avoid explicit literal loads"), the literal pools end up getting rearranged in a way that causes the literal for __current to go out of range. Let's fix this up by putting a .ltorg directive in a suitable place in the code. Cc: Nathan Chancellor Cc: Nick Desaulniers Fixes: 508074607c7b95b2 ("ARM: 9195/1: entry: avoid explicit literal loads") Reported-by: kernel test robot Link: https://lore.kernel.org/all/202205290805.1vZLAr36-lkp@intel.com/ Signed-off-by: Ard Biesheuvel Tested-by: Nathan Chancellor --- arch/arm/kernel/entry-common.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 7aa3ded4af92..6a447ac67d80 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -298,14 +298,15 @@ local_restart: 9001: sub lr, saved_pc, #4 str lr, [sp, #S_PC] get_thread_info tsk b ret_fast_syscall #endif ENDPROC(vector_swi) + .ltorg /* * This is the really slow path. We're going to be doing * context switches, and waiting for our parent to respond. */ __sys_trace: add r0, sp, #S_OFF