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 C883DC433F5 for ; Tue, 31 May 2022 15:30:12 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9Gev/DFI4EhJLTS+e0hswo3jsqNCifbz+OR4UtSOylc=; b=nmBIjZDdFl3FUE 3lyCyNn7dAuJae4P4XVtKlmi+p6dQ7DoHq8Jcq+MRYqTLQvin9vYlMzsuEO2FajPtpdyEQJz7olKc r+PnSHIQ2C8Bn+Eor16t5C05ADrpe/9RRjKrqU5oWoE7omoAutsbjNlzsX9AsRA17sl2VWDvZSUls q/n20l8iA7gIpSE1LDwS947wO1Z4ZNP+zFM+CAS/JKMAJ4FutLt2miQD0Jkg+OmmTicavJuAh+sup Qz8eQW93uwvohindrsBjjbEJfjIcdzzwLHXiAwyzUfeujKNz/TU626X4CvEQiELUg283TgMH6FzeY qbxghOrkYSLohGvnmVPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nw3nx-00BZ0l-Ct; Tue, 31 May 2022 15:29:09 +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 1nw3nu-00BYyk-Jg for linux-arm-kernel@lists.infradead.org; Tue, 31 May 2022 15:29:08 +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 C93986136F; Tue, 31 May 2022 15:29:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE90BC385A9; Tue, 31 May 2022 15:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654010943; bh=fy7WUGSJ2OLE4qgu4xmiC6iyf76//miWcABR43juyfk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ecAfTyDZWH5/sEQ+LHLG429obVFQw5TiRvj5HjFetRN7B3/xZhKkpRFrQn4ZFKYc5 WgmGeIrEK/TuOwXqFnACg3IW3k/JmapX/S6WbLMxgblZ61MDdC9/3X+XmtijtpmnNK vzdh3ryRaonqENZaxJIQa3080eHPOeCSOpSd6htZES/IjAAYHFvaceu1QUmf+MQV+2 2hK4uom5+Q/4kUXncUkCxhc//5Sp3WBvbWR5oFnUdNfVxGproFyvMsYybDfIHC0EMc L3y0P6QUCZVCl7KohEmaoQHJhDROB868f/j7pzkxaCQ9CEHZpxPeVCozpUBGW7Ej4F wpQInMKbHTrkw== Date: Tue, 31 May 2022 08:29:01 -0700 From: Nathan Chancellor To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, Nick Desaulniers , kernel test robot Subject: Re: [PATCH] ARM: entry: add .ltorg directive to keep literals in range Message-ID: References: <20220530112417.2492510-1-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220530112417.2492510-1-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220531_082906_730099_52581E39 X-CRM114-Status: GOOD ( 25.39 ) 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 On Mon, May 30, 2022 at 01:24:17PM +0200, Ard Biesheuvel wrote: > 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. For the record, I do see a similar failure with GNU as, not sure if it is worth calling that out in the commit message or not: arch/arm/kernel/entry-common.S: Assembler messages: arch/arm/kernel/entry-common.S:149: Error: invalid literal constant: pool needs to be closer > 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 With the problematic configuration, I no longer see issues with either clang or GCC: 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 > -- > 2.30.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel