From patchwork Thu Feb 2 10:25:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13125694 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 55834C05027 for ; Thu, 2 Feb 2023 10:26:58 +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=JuuMgssCYNxx41gXCFB4rXhM3B6S3PFtFK5+mhXMDso=; b=S8gArdAq7MWc4v 6pStN62aAQykgse7Dp+eRa42TIoyXXs58qKlAjPQ4LmkYV2goN7yqjl5ja1/mH7Ip7SYukEALKOeE 70W38uANxi6Ftnb3fwqiAHe+FlXAbrYtMr4QBy6Z8lYULYPPCSHVWWYuLXDTfyXqoegGWJsHRtvzR sUSuKEX1rdNbkQ7NV3ld2sFGOWFTAw+0YH9VvZplBvR6NMz5k95ZjvlEykPz0A6SklOiZkIN1j7fj B3aC7Vf1BjVLt2Tf0bbofrx0EiAgGcxwZAo9zfuKtVTsufTC6dxDtwPmrm++gvgOfTTuL/hZaLcqZ f+UcNZT1ceHhcFLUwlSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNWmm-00FMbq-QH; Thu, 02 Feb 2023 10:25:44 +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 1pNWmk-00FMbR-CB for linux-arm-kernel@lists.infradead.org; Thu, 02 Feb 2023 10:25: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 263FD60B72; Thu, 2 Feb 2023 10:25:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50B94C433EF; Thu, 2 Feb 2023 10:25:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675333540; bh=Gb3T6TsLfV5TwqGHgvcKYvFwI4gAsDkyqVqCfdmHoKw=; h=From:To:Cc:Subject:Date:From; b=DPpuP0HWq3SUWfvJp0qzlvYHWj9A4nfE0PfUhgnnwtEIO5/IfCGazWW6T453qZLJu mRhd9CfsQMaL6hmPr6APq+RFjTFIaVmwL5ICcrGJLo5lFSuFpemdyxWsEf3ZJ9kbgr 0BVK9I1B1Srh/H/xt8LU0KfQuGvqpVFkygv9KRCShj6RTOVJyOkKIqu/erDM1OeHiy dMwoa0//0pC34elUZEM9ImnCTaNF9sO9e8Zkmyce+LrsKKN3+76vBCsm/AsOkb7zTn YWSSw4LyM+pTLMbszWohMM4+kHWjp26NRizRMTB0dbCS+EDDG78Z9khedCRjpommt/ kqAAeU8b9aKMQ== From: Arnd Bergmann To: Russell King , Arnd Bergmann Cc: Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: proc-v7: fix out-of-range adr instruction Date: Thu, 2 Feb 2023 11:25:32 +0100 Message-Id: <20230202102538.999026-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230202_022542_492033_6FA503F6 X-CRM114-Status: GOOD ( 14.81 ) 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 From: Arnd Bergmann Before the change to CONFIG_ARCH_MULTIPLATFORM, some CONFIG_ARM_ERRATA_* options were always hidden, but now they are user visible in expert configurations, which caused a compile-time failure in randconfig builds with all of the errata enabled. arch/arm/mm/proc-v7.S:545: Error: invalid constant (fffffffffffffbf4) after fixup /tmp/proc-v7-5b364b.s:1611:2: error: out of range pc-relative fixup value adr r3, v7_crval The problem is that the extra code size puts the v7_crval definition just outside of the range of the 'adr' instruction. Use the adr_l macro instead to allow longer offsets. Fixes: 84fc86360623 ("ARM: make ARCH_MULTIPLATFORM user-visible") Suggested-by: Ard Biesheuvel Signed-off-by: Arnd Bergmann --- arch/arm/mm/proc-v7.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 6b4ef9539b68..fe1469aa5be5 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -544,7 +544,7 @@ __errata_finish: mcr p14, 6, r0, c0, c0, 0 @ stop userspace TEEHBR access 1: #endif - adr r3, v7_crval + adr_l r3, v7_crval ldmia r3, {r3, r6} ARM_BE8(orr r6, r6, #1 << 25) @ big-endian page tables #ifdef CONFIG_SWP_EMULATE