Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp317904ybz; Wed, 15 Apr 2020 09:19:00 -0700 (PDT) X-Google-Smtp-Source: APiQypKfy8adWR5xg7ViHwmS6qxbGOj5bEvl76f6qoEHu3d1iKjF4hnBG5+bVXCK8dg6LXNHxDah X-Received: by 2002:a17:906:7804:: with SMTP id u4mr5925541ejm.328.1586967540762; Wed, 15 Apr 2020 09:19:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586967540; cv=none; d=google.com; s=arc-20160816; b=usB4yuH3DfUygCkvWhJEyzPBn+9vTxA87JyRUpFuMUO335A9iEVYLA+BEsW1vIa0wm DDDOj0EvSv76FAAztgTVc/vda+rV72zX40SJuQASS6N9vqdeBecWUMwCR197IGeojsS2 UHrJBrHGlmeVLWU1m8n78g1DbIILMo6mf02LEvZFHJD56WufxXXqtsb+UbBZ5ku45ooO 7z+ZVIzx/evUyF5ylvkq3UTDnUQQ7hkRFDi8h/DLx8AgUa82CFi5Mnc8Y2Urpz032jzG 9TLMxDjoVFnKZMkzvW3YdjXblLU+PauKHfzzI9s5SlSqVTPmWR8B7im1e3SxwqlnYX1x 0T8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=B3A4UgVjvWCvimFb4I6P0j03U/T83uQfcwdXhkwT688=; b=xDnuvNX53YOJe0jkO2vDwSWt2s9uOmdVZ9bPVluyFb2OccS6X3nU6tWi/uVWyLG4f+ hAhyEYdIpOMq/bOEcC9Ukqf00S1f2+b2xf03iCsCBStIG2QkEL/Y/dRG8n/6Urwwy3a+ sNrtJ/gDF571vpkmStqn79LqobEzOMmqFSShgDKUJouGR2HUHc19bYpEba/q2mNHTSHQ xFv6sb+fOBvXZVgzYG+0pz/hzIy5jS/SpbW+jxFZycOsi4RTv+7fuqO2CHlzb887Yu5c 12xB5UZEHvr+Hh/CzHV1Ii8hdYCEDbfqLeGzOP1kYAGpwS56HoItqkRtVzK//NUTph9O 7czw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g25si10940457ejo.389.2020.04.15.09.18.34; Wed, 15 Apr 2020 09:19:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436602AbgDNIW4 (ORCPT + 99 others); Tue, 14 Apr 2020 04:22:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2407128AbgDNIUx (ORCPT ); Tue, 14 Apr 2020 04:20:53 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C07EC00860A; Tue, 14 Apr 2020 01:20:53 -0700 (PDT) Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jOGoN-0006I5-8z; Tue, 14 Apr 2020 10:20:51 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id DD84C1C0450; Tue, 14 Apr 2020 10:20:50 +0200 (CEST) Date: Tue, 14 Apr 2020 08:20:50 -0000 From: "tip-bot2 for Ard Biesheuvel" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: efi/urgent] efi/arm: Deal with ADR going out of range in efi_enter_kernel() Cc: Arnd Bergmann , Ard Biesheuvel , Ingo Molnar , x86 , LKML In-Reply-To: <20200409130434.6736-6-ardb@kernel.org> References: <20200409130434.6736-6-ardb@kernel.org> MIME-Version: 1.0 Message-ID: <158685245053.28353.8781169269960396594.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the efi/urgent branch of tip: Commit-ID: a94691680bace7e1404e4f235badb74e30467e86 Gitweb: https://git.kernel.org/tip/a94691680bace7e1404e4f235badb74e30467e86 Author: Ard Biesheuvel AuthorDate: Thu, 09 Apr 2020 15:04:30 +02:00 Committer: Ingo Molnar CommitterDate: Tue, 14 Apr 2020 08:32:14 +02:00 efi/arm: Deal with ADR going out of range in efi_enter_kernel() Commit 0698fac4ac2a ("efi/arm: Clean EFI stub exit code from cache instead of avoiding it") introduced a PC-relative reference to 'call_cache_fn' into efi_enter_kernel(), which lives way at the end of head.S. In some cases, the ARM version of the ADR instruction does not have sufficient range, resulting in a build error: arch/arm/boot/compressed/head.S:1453: Error: invalid constant (fffffffffffffbe4) after fixup ARM defines an alternative with a wider range, called ADRL, but this does not exist for Thumb-2. At the same time, the ADR instruction in Thumb-2 has a wider range, and so it does not suffer from the same issue. So let's switch to ADRL for ARM builds, and keep the ADR for Thumb-2 builds. Reported-by: Arnd Bergmann Tested-by: Arnd Bergmann Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200409130434.6736-6-ardb@kernel.org --- arch/arm/boot/compressed/head.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index cabdd8f..e8e1c86 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -1450,7 +1450,8 @@ ENTRY(efi_enter_kernel) @ running beyond the PoU, and so calling cache_off below from @ inside the PE/COFF loader allocated region is unsafe unless @ we explicitly clean it to the PoC. - adr r0, call_cache_fn @ region of code we will + ARM( adrl r0, call_cache_fn ) + THUMB( adr r0, call_cache_fn ) @ region of code we will adr r1, 0f @ run with MMU off bl cache_clean_flush bl cache_off