From patchwork Sat Aug 5 20:52:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9883333 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 98F0060392 for ; Sat, 5 Aug 2017 20:53:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A80A286CC for ; Sat, 5 Aug 2017 20:53:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EBCA287B9; Sat, 5 Aug 2017 20:53:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28CBB286CC for ; Sat, 5 Aug 2017 20:53:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752765AbdHEUxf (ORCPT ); Sat, 5 Aug 2017 16:53:35 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:35062 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752756AbdHEUxb (ORCPT ); Sat, 5 Aug 2017 16:53:31 -0400 Received: by mail-wm0-f42.google.com with SMTP id m85so42480286wma.0 for ; Sat, 05 Aug 2017 13:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=weVne3m08tFNCU5/+ujdM2q3KUTNoztTJxW2gBd+82c=; b=e74EGa8Yfo3zqHXt3YF3lm/MrRzKychI8mImFS/i6am5L8Gy5I0twZ1b6SvsLXCHLA 70zDvjmqiSK3/0f3nRmOkHaGaZsu4hp3ENv/p5QNobGQRHkTCYE697E9McNNHwYDQGp1 UKZBVc/ORPQLQvOcT1LDxrtVtc66Uuocwzruk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=weVne3m08tFNCU5/+ujdM2q3KUTNoztTJxW2gBd+82c=; b=Q4PIttaTnFCbKxfKAg0NJrGla9kMDtlrLmuzDQGzD8BLU3r8MtDwKANnTDJHNbkfDM cmXcC9wwQE4wAY4zzTscpjPjmR8jn7cfsSqODHmIwjOM7ks4Ez+MHtG5Btk2/9T9Wd1k PkC6Vcrxapse4ieiSRE3akiK7WZfyUKyHjtCluthBJwtQnILZ+S59aHTAKWa7JGCtmnn 4T5pXy1PR08JYf6tb1QlNbweR2O18hT/AIhXZ12Mw/hHWPmoTXxFhI8wAWIHP0c6wZox WlfqbMhaMPOKfyV+UQ2ipvBviQpJgJ6wYjt0E8qVFVpsY+ME5LwLKks5mkMXza0qBC8t +nOA== X-Gm-Message-State: AHYfb5hNr8csuq+iunD10/ewN0Y88t512vjrg1uWmdqQ0A1eqrySuWvY cx7JsqFTpTFxMvB0 X-Received: by 10.28.191.157 with SMTP id o29mr4381364wmi.121.1501966410692; Sat, 05 Aug 2017 13:53:30 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:29 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux@armlinux.org.uk, linux-omap@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, krzk@kernel.org, jason@lakedaemon.net, arm@kernel.org, andrew@lunn.ch, gregory.clement@free-electrons.com, sebastian.hesselbarth@gmail.com, tony@atomide.com, baohua@kernel.org, horms@verge.net.au, magnus.damm@gmail.com, vireshk@kernel.org, shiraz.linux.kernel@gmail.com, patrice.chotard@st.com, nico@linaro.org, dave.martin@arm.com, marc.zyngier@arm.com Cc: Ard Biesheuvel Subject: [PATCH 07/15] ARM: head.S: use PC-relative insn sequences for __fixup_pv_table Date: Sat, 5 Aug 2017 21:52:14 +0100 Message-Id: <20170805205222.19868-8-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170805205222.19868-1-ard.biesheuvel@linaro.org> References: <20170805205222.19868-1-ard.biesheuvel@linaro.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace the open coded PC relative offset calculations with adr_l and mov_l invocations. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/head.S | 27 ++++++-------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index aed341e0f530..939543e73874 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -578,14 +578,11 @@ ENDPROC(fixup_smp) */ __HEAD __fixup_pv_table: - adr r0, 1f - ldmia r0, {r3-r7} + adr_l r6, __pv_phys_pfn_offset + adr_l r7, __pv_offset @ __pa(__pv_offset) + mov_l r3, __pv_offset @ __va(__pv_offset) mvn ip, #0 - subs r3, r0, r3 @ PHYS_OFFSET - PAGE_OFFSET - add r4, r4, r3 @ adjust table start address - add r5, r5, r3 @ adjust table end address - add r6, r6, r3 @ adjust __pv_phys_pfn_offset address - add r7, r7, r3 @ adjust __pv_offset address + subs r3, r7, r3 @ PHYS_OFFSET - PAGE_OFFSET mov r0, r8, lsr #PAGE_SHIFT @ convert to PFN str r0, [r6] @ save computed PHYS_OFFSET to __pv_phys_pfn_offset strcc ip, [r7, #HIGH_OFFSET] @ save to __pv_offset high bits @@ -594,20 +591,15 @@ __fixup_pv_table: THUMB( it ne @ cross section branch ) bne __error str r3, [r7, #LOW_OFFSET] @ save to __pv_offset low bits + adr_l r4, __pv_table_begin + adr_l r5, __pv_table_end b __fixup_a_pv_table ENDPROC(__fixup_pv_table) - - .align -1: .long . - .long __pv_table_begin - .long __pv_table_end -2: .long __pv_phys_pfn_offset - .long __pv_offset + .ltorg .text __fixup_a_pv_table: - adr r0, 3f - ldr r6, [r0] + mov_l r6, __pv_offset add r6, r6, r3 ldr r0, [r6, #HIGH_OFFSET] @ pv_offset high word ldr r6, [r6, #LOW_OFFSET] @ pv_offset low word @@ -676,9 +668,6 @@ ARM_BE8(rev16 ip, ip) #endif ENDPROC(__fixup_a_pv_table) - .align -3: .long __pv_offset - ENTRY(fixup_pv_table) stmfd sp!, {r4 - r7, lr} mov r3, #0 @ no offset