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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AF74C433E2 for ; Mon, 14 Sep 2020 09:58:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED9A920731 for ; Mon, 14 Sep 2020 09:58:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="zMQPN1WV"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="2NneM/9o" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED9A920731 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject: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=HKhA4ZytT9H4EmhECUjFkG0QNZr8JruO+zgkI5k1k+M=; b=zMQPN1WV+4I2/lfiwoQ8BTqNd9 WZ6zkKhEoNyayZ6d4dg66NNQOOtNm2lPpD+6h/3DrteFs0mcKgQ2fzJ0DDAiG/n/GDFxMieZWPDGn /NDJ2sw3mh51Xhm77ALa1xMpoOjla3pLJfa477rvh4Qvw4seVz+Y/9jW0jjuIT15qYLMGcgwPfEfn Rjw1ON96azEzKaPUpCN09fo978hGR7p5a2wsb801QePyJdR3tI2KQxU4phb/Bqco2kQ0y88OTZZWW gP+Uhd9GUeRanQsusu+aYd7vVpxh74hJirQnnowntrhpdDFePYONAj2BlOrd41x2U8n9xzjXmtyfN 5PUGNVYw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHlEl-0000Wf-MD; Mon, 14 Sep 2020 09:57:27 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHlEi-0000WC-GG for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2020 09:57:25 +0000 Received: from e123331-lin.nice.arm.com (unknown [37.6.197.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 662BC20731; Mon, 14 Sep 2020 09:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600077443; bh=/i8JIdcof+/Z5OS77tF0K9DZIQIHnegrBkil34Gly4o=; h=From:To:Cc:Subject:Date:From; b=2NneM/9o2/b95pOV7zRr+ZxlLdz6ucZ4ECvf2SRE73KUqT1ZfZG7p+KSisxM7Nc1S on+3zlAfsO1gLZK63bgJqZeztEJMWopZHdfJE+9l8uTvt9wEAt2zi7P81dbGoJNoGu We40XaEq0dvdk44gDFad5jNJqIBhfTZwUN0/9zRM= From: Ard Biesheuvel To: linux-efi@vger.kernel.org Subject: [PATCH 00/12] ARM: use adr_l/ldr_l macros for PC-relative references Date: Mon, 14 Sep 2020 12:56:54 +0300 Message-Id: <20200914095706.3985-1-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200914_055724_596082_780EE4F9 X-CRM114-Status: GOOD ( 14.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicolas Pitre , Marc Zyngier , Linus Walleij , Nick Desaulniers , Russell King , Stefan Agner , Peter Smith , Will Deacon , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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 This is a respin of the adr_l/ldr_l code I wrote some years ago in the context of my KASLR proof of concept for 32-bit ARM. A new use case came up, in the form of Clang, which does not implement the 'adrl' pseudo-instruction in its assembler, and so for PC-relative references that don't fit into a ARM adr instruction, we need something else. Patch #2 addresses an actual Clang build issue of this nature, by replacing an occurrence of adrl with adr_l. I have included my existing cleanup patches that were built on top of the adr_l macro, which replace several occurrences of open coded arithmetic to calculate runtime addresses based on link time virtual addresses stored in literals. Note that all of these patches with the exception of #2 were reviewed or acked by Nico before, but given that this was a while ago (and the fact that neither of us work for Linaro anymore), I have dropped these. Note that only patch #1 deviates significantly from the last version that I sent out, the remaining ones were just freshened up (and their commit logs slightly expanded). Cc: Russell King Cc: Linus Walleij Cc: Nicolas Pitre Cc: Nick Desaulniers Cc: Stefan Agner Cc: Peter Smith Cc: Marc Zyngier Cc: Will Deacon Ard Biesheuvel (12): ARM: assembler: introduce adr_l, ldr_l and str_l macros ARM: efistub: replace adrl pseudo-op with adr_l macro invocation ARM: module: add support for place relative relocations ARM: head-common.S: use PC-relative insn sequence for __proc_info ARM: head-common.S: use PC-relative insn sequence for idmap creation ARM: head.S: use PC-relative insn sequence for secondary_data ARM: kernel: use relative references for UP/SMP alternatives ARM: head: use PC-relative insn sequence for __smp_alt ARM: sleep.S: use PC-relative insn sequence for sleep_save_sp/mpidr_hash ARM: head.S: use PC-relative insn sequences for __fixup_pv_table ARM: head.S: use PC relative insn sequence to calculate PHYS_OFFSET ARM: kvm: replace open coded VA->PA calculations with adr_l call arch/arm/boot/compressed/head.S | 18 +--- arch/arm/include/asm/assembler.h | 88 ++++++++++++++++++- arch/arm/include/asm/elf.h | 5 ++ arch/arm/include/asm/processor.h | 2 +- arch/arm/kernel/head-common.S | 22 ++--- arch/arm/kernel/head.S | 90 +++++--------------- arch/arm/kernel/hyp-stub.S | 27 +++--- arch/arm/kernel/module.c | 20 ++++- arch/arm/kernel/sleep.S | 19 ++--- 9 files changed, 159 insertions(+), 132 deletions(-) -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel