From patchwork Sat Aug 5 20:52:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109488 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp991604qge; Sat, 5 Aug 2017 13:53:22 -0700 (PDT) X-Received: by 10.98.43.78 with SMTP id r75mr6770673pfr.269.1501966402049; Sat, 05 Aug 2017 13:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966402; cv=none; d=google.com; s=arc-20160816; b=lopWEVf5+n4db0AwN6K/2g2idRKGcjFi5iL8B68dCRPJ/B2NKHvgSByVZ1M+4izfjR Kl40/AnvsFef3UyhrQv8X0OyH8IlwrQcBjeLNV6a9CFV+aP/vTstgD46W1woKZ1LTu5p OM7AfEsZLxgUr3hZYUs7e44D3OKo6hJKnRl5cxbIPjdbjb6glmDLz6LXxtNShkk8R+Yu grOef3X4SNiBMI/+AWwpPsdKfhesncUYdP8irXyTOhJkZTAw88qKcr821duOY/gPg7d7 EAFWM4JYsLkvQN1KkMOcHATcQLaCr0y6j+zAMwqZTJzc0D+p0xlqF0JsmRaAvy+13FfZ jqLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=VAJEK0I5rbnq0Fr3r38kk7clkQKG53mVhzQl4rqt5dI=; b=JfEDlV/LQtVwm2cnssKkpq6TAspIACwah1g0K0P76vXSPhC0tgTltKF0rBwwWkppJQ Sdbuyu8mTe8xYUxWmAjBUIgAZdNAnCbvDaMLdr7B2mGfTtGKzF0S4Po9DYZ98hZ0Uoqc Lnm3+eDAfKdQQjH2dymJvzjqzEvMBrBrlqPiiInnaw6RjbgbN7R4UgH6ba28ZWplm/6D TCf6dXBIj6FMW7RGDiHy+SNVft9ykvWyoB3SxK8/vCJSqmfU0EYOuWLD2XfKRVSUAI+f FKy0HJvPFZQSoXcfr8dYp0iadjh2QEy9MMhCzPjNyHKcd85BNG0/k9nMxgam0iveMRQG eKVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=jtVDzefv; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si2480065pgo.694.2017.08.05.13.53.21; Sat, 05 Aug 2017 13:53:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=jtVDzefv; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752280AbdHEUxN (ORCPT + 3 others); Sat, 5 Aug 2017 16:53:13 -0400 Received: from mail-wr0-f171.google.com ([209.85.128.171]:33005 "EHLO mail-wr0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751900AbdHEUxL (ORCPT ); Sat, 5 Aug 2017 16:53:11 -0400 Received: by mail-wr0-f171.google.com with SMTP id v105so27162431wrb.0 for ; Sat, 05 Aug 2017 13:53:11 -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=Z7AJAzwrv8i6psYuqzfsm9AF3MgwmVusZzTSffJgUF0=; b=jtVDzefvCj/FRmySfR+47JZEidHY1m7dWug6s9xbBiQFlqXT7OgEm3S6eeybCsFj4c N+1kiaXvxJ559zxLrOmEpWvLFwjCRfhAZUqJE1YM5WCINrqv2z5erXVzywUauDuqu6Gd MG2QiQ+C9MUHdiCvaJo4nKgI9TBAHwBz4ehgs= 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=Z7AJAzwrv8i6psYuqzfsm9AF3MgwmVusZzTSffJgUF0=; b=uCSOFpXw3Nf2v++a5YSZs2m99ztqK9UUFUht3e/plvWdJRG7s7yhREOknNwTafU2O0 p5q8gtHbvoQWRYLv/jTDdQDcnfxdX9MOE9XE7Pn4iov0uvZ0H52UwUvex6KMB3AmwRpQ 7PUmSa0NQDJXyYSz3MCtCm9Y9mAKoAD20VSBtj1YVqSTBT4GDYvT888LYbTG2Z3+ZbtZ oHYq5tinuGJbMTqV4aH5sDGB2d9l0QC3Sxj1QJDfzCQia9NP/fZV8Dfdnc23vh3GxZ6U k6hwJNEWscHMEtKvo+Sqt/XnJi99V4VsBf05NqdARLMmuTzPsBr6u2t6FBw8prjis2O8 pzFw== X-Gm-Message-State: AIVw111MADTsf/fp4PYyppPnhN3cFO09T4i4LnoH2X4AY14BOHPv/VwF zwNY8Tww+P7htgMo X-Received: by 10.223.163.16 with SMTP id c16mr5069436wrb.173.1501966390426; Sat, 05 Aug 2017 13:53:10 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:09 -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 01/15] ARM: assembler: introduce adr_l, ldr_l and str_l macros Date: Sat, 5 Aug 2017 21:52:08 +0100 Message-Id: <20170805205222.19868-2-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 Like arm64, ARM supports position independent code sequences that produce symbol references with a greater reach than the ordinary adr/ldr instructions. Currently, we use open coded instruction sequences involving literals and arithmetic operations. Instead, we can use movw/movt pairs on v7 CPUs, circumventing the D-cache entirely. For older CPUs, we can emit the literal into a subsection, allowing it to be emitted out of line while retaining the ability to perform arithmetic on label offsets. E.g., on pre-v7 CPUs, we can emit a PC-relative reference as follows: ldr , 222f 111: add , , pc .subsection 1 222: .long - (111b + 8) .previous This is allowed by the assembler because, unlike ordinary sections, subsections are combined into a single section into the object file, and so the label references are not true cross-section references that are visible as relocations. Note that we could even do something like add , pc, #(222f - 111f) & ~0xfff ldr , [, #(222f - 111f) & 0xfff] 111: add , , pc .subsection 1 222: .long - (111b + 8) .previous if it turns out that the 4 KB range of the ldr instruction is insufficient to reach the literal in the subsection, although this is currently not a problem (of the 98 objects built from .S files in a multi_v7_defconfig build, only 11 have .text sections that are over 1 KB, and the largest one [entry-armv.o] is 3308 bytes) Subsections have been available in binutils since 2004 at least, so they should not cause any issues with older toolchains. So use the above to implement the macros mov_l, adr_l, adrm_l (using ldm to load multiple literals at once), ldr_l and str_l, all of which will use movw/movt pairs on v7 and later CPUs, and use PC-relative literals otherwise. Signed-off-by: Ard Biesheuvel --- arch/arm/include/asm/assembler.h | 70 ++++++++++++++++++++ 1 file changed, 70 insertions(+) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index ad301f107dd2..cedf59a7f853 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h @@ -518,4 +518,74 @@ THUMB( orr \reg , \reg , #PSR_T_BIT ) #endif .endm +#ifdef CONFIG_THUMB2_KERNEL +#define ARM_PC_BIAS 4 +#else +#define ARM_PC_BIAS 8 +#endif + + .macro __adldst_l, op, reg, sym, tmp + .if __LINUX_ARM_ARCH__ < 7 + ldr \tmp, 111f + .subsection 1 + .align 2 +111: .long \sym - (222f + ARM_PC_BIAS) + .previous + .else + movw \tmp, #:lower16:\sym - (222f + ARM_PC_BIAS) + movt \tmp, #:upper16:\sym - (222f + ARM_PC_BIAS) + .endif +222:; .ifc \op, add + add \reg, \tmp, pc + .elseif CONFIG_THUMB2_KERNEL == 1 + add \tmp, \tmp, pc + \op \reg, [\tmp] + .else + \op \reg, [pc, \tmp] + .endif + .endm + + /* + * mov_l - move a constant value or [relocated] address into a register + */ + .macro mov_l, dst:req, imm:req + .if __LINUX_ARM_ARCH__ < 7 + ldr \dst, =\imm + .else + movw \dst, #:lower16:\imm + movt \dst, #:upper16:\imm + .endif + .endm + + /* + * adr_l - adr pseudo-op with unlimited range + * + * @dst: destination register + * @sym: name of the symbol + */ + .macro adr_l, dst:req, sym:req + __adldst_l add, \dst, \sym, \dst + .endm + + /* + * ldr_l - ldr pseudo-op with unlimited range + * + * @dst: destination register + * @sym: name of the symbol + */ + .macro ldr_l, dst:req, sym:req + __adldst_l ldr, \dst, \sym, \dst + .endm + + /* + * str_l - str pseudo-op with unlimited range + * + * @src: source register + * @sym: name of the symbol + * @tmp: mandatory scratch register + */ + .macro str_l, src:req, sym:req, tmp:req + __adldst_l str, \src, \sym, \tmp + .endm + #endif /* __ASM_ASSEMBLER_H__ */ From patchwork Sat Aug 5 20:52:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109489 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp991615qge; Sat, 5 Aug 2017 13:53:22 -0700 (PDT) X-Received: by 10.98.211.73 with SMTP id q70mr6741871pfg.285.1501966402703; Sat, 05 Aug 2017 13:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966402; cv=none; d=google.com; s=arc-20160816; b=FaXgc/SaCEvdrHGB1yeNkZw0hjjAHiCC1J4BwbVn6HfeoTUGYtOxmfwiL8KaUKoyTX Xn3Mg/S1Lc2+mpHhbnILjfEuenLjsrjjHpXRznqNYeRvqEqbaM7JD+MX/PkhK8v6enTJ AkaxDEiqG3SsskWqG9/Ym+fR2GnP/fyOiiWxTFs7IHQ76l+NhRZS7LyBRR5+yMaBv8Tr U6v/H5buVTeJ1GraBiCptsjBj5rJapurvc7qVYBI5MNOtKFRv3fqz+6/2+hg8hBb6Asw gqLJSQDp9ST7XlbOaz90L1LloC9K4KSQufWvytFfHcY3DIXG26FkEwflQdkAxCKCSZhV S8CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=g47jTa0w7nYudYNqb2keVrxaays+CqTCfErehCtzlv4=; b=T7EKRuDZzeLGogJHhWn7XhqSJPmx3aSO5W8MPwdOCL0+MiSHz8mSuKLa+hXqfGlrvM u/EyObFNizcTosscgvUoLbK86BFpA8HizMNUHl4GMNT4XbjThAWHyhKpngBDeV2NvLRM eRcOkcFjN+n1OpcXCbPY46OR9Hq1R/T3CvO4ldmvm0uQE+YJLT4Gc4P7B1XUiYBOJ6N+ hGQC1A1wC5M1DVma4T5+D5bhoQlz37useVOrO9Y+N/+BYcVUXjbjP1pJe8dWyZ3NruVn WrzH3RHWVZx3+FeMgTJoqUVwW549KElvT4vHGoAJjq1rJ6TZdwxm6OhXalPTb2hhl3j8 wSRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Ge48/yWd; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si2480065pgo.694.2017.08.05.13.53.22; Sat, 05 Aug 2017 13:53:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Ge48/yWd; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752643AbdHEUxR (ORCPT + 3 others); Sat, 5 Aug 2017 16:53:17 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:35024 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751401AbdHEUxP (ORCPT ); Sat, 5 Aug 2017 16:53:15 -0400 Received: by mail-wm0-f44.google.com with SMTP id m85so42478120wma.0 for ; Sat, 05 Aug 2017 13:53:14 -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=Z+7fZrLjEl5NG/5VHI+5wY5OrhioWvkA34hARviywqA=; b=Ge48/yWdSBVbBrFyV6ri9e8CTmulOYAWFO7FrN7TYayda/VrITedwkGlz32spdataE yisyQLy5x6hKgIuq2z3kZKcgL3Vhp58zHrjG9EBbflMPk3SQ/PJL03KDGcT9jlz2jco6 8vqA9LBT8kbbp8hYRDn8pgig6pahT0eG2CAK4= 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=Z+7fZrLjEl5NG/5VHI+5wY5OrhioWvkA34hARviywqA=; b=mS2liSyy4/AIvosNBUVAv1C4CxEv0roZw/VGZl9+2ZGiJb5qjM+P+L69fukVjYBVFk KsUPTNJ4SWG+E446AiTklcWIw4vZ389XLC8hX35gyEmpAB5L11mjfRGnqn9ftfHl/ZNI vqPeNM3z+nVh8kWm3jS5J8+tyKvRDkSKUbIowJLLUZdm26FGMUUlJ2MawNTySxR0oAYf 3nHgcLdym5bveeQahFJo2apekGik3SDBGfNyne4R2VM73GvmhnDXu6HFHXV6H1sYsKep tA0fGd+OCYulhJOoiVkfm8JEoKpVnrmEtkJVS0K2bA30uIrJ6bHvXxV26GWZ39LGsXaK f9vg== X-Gm-Message-State: AHYfb5jxoIuKGyXRWc8eSVrcCRKphn7pWnsvTqX8ix8cdSZDZfu/OuKq XzPsArbkNxAWrx23 X-Received: by 10.28.71.206 with SMTP id m75mr4292198wmi.13.1501966393903; Sat, 05 Aug 2017 13:53:13 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:13 -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 02/15] ARM: head-common.S: use PC-relative insn sequence for __proc_info Date: Sat, 5 Aug 2017 21:52:09 +0100 Message-Id: <20170805205222.19868-3-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 Replace the open coded PC relative offset calculations with a pair of adr_l invocations. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/head-common.S | 22 ++++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S index 8733012d231f..06035488130c 100644 --- a/arch/arm/kernel/head-common.S +++ b/arch/arm/kernel/head-common.S @@ -150,11 +150,12 @@ ENDPROC(lookup_processor_type) * r9 = cpuid (preserved) */ __lookup_processor_type: - adr r3, __lookup_processor_type_data - ldmia r3, {r4 - r6} - sub r3, r3, r4 @ get offset between virt&phys - add r5, r5, r3 @ convert virt addresses to - add r6, r6, r3 @ physical address space + /* + * Look in for information about the __proc_info + * structure. + */ + adr_l r5, __proc_info_begin + adr_l r6, __proc_info_end 1: ldmia r5, {r3, r4} @ value, mask and r4, r4, r9 @ mask wanted bits teq r3, r4 @@ -166,17 +167,6 @@ __lookup_processor_type: 2: ret lr ENDPROC(__lookup_processor_type) -/* - * Look in for information about the __proc_info structure. - */ - .align 2 - .type __lookup_processor_type_data, %object -__lookup_processor_type_data: - .long . - .long __proc_info_begin - .long __proc_info_end - .size __lookup_processor_type_data, . - __lookup_processor_type_data - __error_lpae: #ifdef CONFIG_DEBUG_LL adr r0, str_lpae From patchwork Sat Aug 5 20:52:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109490 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp991667qge; Sat, 5 Aug 2017 13:53:26 -0700 (PDT) X-Received: by 10.84.231.143 with SMTP id g15mr7821733plk.157.1501966406530; Sat, 05 Aug 2017 13:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966406; cv=none; d=google.com; s=arc-20160816; b=trh68y4e7vCnazjuNts9zyzVXYSPJ7B+Ka4Fj3dL+zQaH3IdtixfaLCSRqXxDk8sam o0jVvCpcm0hj086dTbKuMr1rvzJE14i08v5uP+Gv/QCtbqW4Ei3/EaUjCLOOa+Uokfw/ wdM83pnYCRxl/NFZvbDt+eF/emLmMbcwnI8H7ZQLZd6KrdowsJNLSct9mRwimIqcoPF5 xxe+ZW6QrixEft7A25HG/mkVCunkWVaf12nhOiGEUfrvW/AjKA6pcjEKAXTW22c9c7iw jS53AAjVPyWS+GKdJMmzTJhSL9R85JkK8c4VH7HTImPrOxyW4OS08s5JnsbB+IkUkx/M cxVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=oYM6hjboCniIka/Jjse2hAbLCIS4WiOywxNirSO+ylw=; b=viyZckLcN/gvXW54FjtTG++TRuYg4xeoSrUSUEgXQjeH4H1kC5ru09NlqivkiNcGf2 xMZn1SSfJ0cZ6PqONtTELRc5hDmUl340zBfsOQ+wGRdwfRNYd0L96qyI3EVJs8EieRtW 3fqsuAVfqO+ud5rPKcnmUkhdI8qEUFUJReZv794RMgzZjzuzIyLbvVgo2h5aee4xxFHv dwGboKJaw6Rmrj3/3RENBZruX4+uZ8ghBUqBw1FTDFl235RnWo9KWuNidtLDdWGCXGpN b7G/UO9x8n3EdHSFddIfdzVhXknc0AdcPU8rsmOhZrmgQuhSZDx//QoohI6PdIi60skB ZOUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Oq6tPsih; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si2666264pfb.409.2017.08.05.13.53.26; Sat, 05 Aug 2017 13:53:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Oq6tPsih; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751900AbdHEUxW (ORCPT + 3 others); Sat, 5 Aug 2017 16:53:22 -0400 Received: from mail-wr0-f176.google.com ([209.85.128.176]:33012 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752661AbdHEUxS (ORCPT ); Sat, 5 Aug 2017 16:53:18 -0400 Received: by mail-wr0-f176.google.com with SMTP id v105so27162921wrb.0 for ; Sat, 05 Aug 2017 13:53:17 -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=UjP01tbr0+U785R7Y/bWJ4Ge/bnZSzS/dsXQg2oOd7g=; b=Oq6tPsih7wDXmHZr39rBllBoYIPyGCDr/HHAvcTRlmIaxA2jkkUW3qm39k5Ib2V+Jn ADGifVvUgfCor6SeZQy2Gio9kd69ARO+ujKxwELP7PzbjF75cPl+wNgAV2Eq2N3VYQh/ cZ0hVIndrJ1Rk+O2C338qHLwBc+W59yqIRt74= 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=UjP01tbr0+U785R7Y/bWJ4Ge/bnZSzS/dsXQg2oOd7g=; b=s+7URLY5WJBQgwaGdL/mD19XgFZrv8YZPASMooX2VZT/5UEFOjR8eKlmkg45fR8tR3 yHIEKJn1W0AzAaxBaqfTglbN9J3J51P07nex1HWK54IX2nrjR/xsGMnYO7mcMW4o6FBl CA2b78JDOQsPerCQy9hypaqbV6cd7scmgbHxhLtx9mCquw36+E2lwZtO2MejPQGxPPXn okZTEyCGZfZYa70uHyv42syH1wldVnwfTzYsaCMAkiN02GfBwoDwzuwWpe2HDoE+X5L4 mr0X9OqmxIjWjK6+0f8DMAa1YA8Mvj+gkogAvksYgOzkzL9Bj+z4q4G/0XG4OdffuMXa xovQ== X-Gm-Message-State: AIVw110kse2CusFil9B8daS+hX+Ca55fokYkrXVlZjaPWCGK2xr3uKKO os8W89TK8KPc9FMr X-Received: by 10.223.172.230 with SMTP id o93mr5071030wrc.273.1501966397092; Sat, 05 Aug 2017 13:53:17 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:16 -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 03/15] ARM: head-common.S: use PC-relative insn sequence for __turn_mmu_on Date: Sat, 5 Aug 2017 21:52:10 +0100 Message-Id: <20170805205222.19868-4-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 Replace the open coded PC relative offset calculations with a pair of adr_l invocations. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/head.S | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 04286fd9e09c..0a98aec0e39d 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -227,11 +227,8 @@ __create_page_tables: * Create identity mapping to cater for __enable_mmu. * This identity mapping will be removed by paging_init(). */ - adr r0, __turn_mmu_on_loc - ldmia r0, {r3, r5, r6} - sub r0, r0, r3 @ virt->phys offset - add r5, r5, r0 @ phys __turn_mmu_on - add r6, r6, r0 @ phys __turn_mmu_on_end + adr_l r5, __turn_mmu_on @ _pa(__turn_mmu_on) + adr_l r6, __turn_mmu_on_end @ _pa(__turn_mmu_on_end) mov r5, r5, lsr #SECTION_SHIFT mov r6, r6, lsr #SECTION_SHIFT @@ -354,11 +351,6 @@ __create_page_tables: ret lr ENDPROC(__create_page_tables) .ltorg - .align -__turn_mmu_on_loc: - .long . - .long __turn_mmu_on - .long __turn_mmu_on_end #if defined(CONFIG_SMP) .text From patchwork Sat Aug 5 20:52:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109493 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp991843qge; Sat, 5 Aug 2017 13:53:42 -0700 (PDT) X-Received: by 10.98.106.6 with SMTP id f6mr6925956pfc.53.1501966422365; Sat, 05 Aug 2017 13:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966422; cv=none; d=google.com; s=arc-20160816; b=DpyllSTAsXQRQJ0ScnXh8D7EBGalNy2CWuOPWd2xif+HPpboYb0kXUx3Tbhd/1uDuG Kaq+3IWd4kHB81VYIP5BZhrlIfxJWoPHgAs9eHwZ5A70+nHtS0qSLCfs+GGL7ogejgBQ biIXNeHnqBIDVQCj+azzH/Q/OjM7cl/XpkTKzsG5whUvU+w+Fx9MFu0bcS/mBL/cJStZ lf5bZpSLHTo2DdGySMnFim+DyRN54DlJyCKagug2xLxOa+dl2teT/DMtYeEBjyAIZQX8 8UzJt89T/DDUStysdnhqxdWSroxW0qOqF0B+SaiRjHIBsXce2GEi9U4aPYVnkKIEsH0U IEzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=vyTgIPPo3W+ESUP0vaCpBGKNOud8gbGF4YqVQol8imE=; b=hDTycfPqa2sM1GVFgmt4ZbovIZDLStZpjI76mTnghI+hA4n89xsA7a6inLt/yPFEhi IhfxbqYwSUluEIl40v7RwwLOrTTHztIWrBhamAUypTmGQ7AXS6R+VJnCrrWakPruys+6 BjbS+Fc9D2aWfqNxx3FrU+a9e83xawu6LoOFI8bzVsdLWmWStPrxXtL80euQkyCZWsM/ lxxArCCU5xbiHwEDgnR6ns6SoZnPZbGyvh7rD15r0L2cRFj4SwbtuStFqlDlCvqsk+rZ C/mztIOHkY1yJiOqNKH4Rf8sGVaCNZFwfpL2di9KuA/2oYGghVCUVBoAYY89Zb3Q7Udi zs9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=CvL9zWh3; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si3018685plk.487.2017.08.05.13.53.42; Sat, 05 Aug 2017 13:53:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=CvL9zWh3; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbdHEUx2 (ORCPT + 3 others); Sat, 5 Aug 2017 16:53:28 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:34060 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519AbdHEUxV (ORCPT ); Sat, 5 Aug 2017 16:53:21 -0400 Received: by mail-wr0-f172.google.com with SMTP id 12so27171838wrb.1 for ; Sat, 05 Aug 2017 13:53:21 -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=smB7+/ftor91JOGfrg55i5EDQc5Fj3QoDW7QAxSNp94=; b=CvL9zWh3Z+N/BHL7Bk1jeDxYxAhZfS4ac/wJ1sPuDmCQAhGpMpcTIufFVpHzfTAeQr QFAynJbhh6baayr4TEcPbSErRi3P9kGRl28mCUtF3FJ3lLrF57HJGXfVZeUC+Dcs1rp8 nOcCeJlrpZKIe59Tqb+MRDEAqFteHQnolaT7U= 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=smB7+/ftor91JOGfrg55i5EDQc5Fj3QoDW7QAxSNp94=; b=ckyjgXYD49rjuRL6pJlFPBylrmBUyHAN78/Diir8ZDzMFPOEQdw+wUOLnCaMuedxKi II/hBY4ldQxvXyG6udq+Rg2EVpvYw7Q/obe5gQE9w2ahShED2WtB3cd7fpvcK1HfRpcI O8OlhT9+jpdkUmHeZ45m64XnvBvIt608170VG3KlFS/ZxG9bFnai8KrGp1Td6LwLutLz iOVuwD1Zfw3fEfDvlIjUGSzE7OE21JKO0MmiJZjfIyB6G1jez6EtYlfFJA4XigcLiZ8a vvq/7wIvXOeDd3OpPZ6JJFCiddw4eXasZRyEJpZUxXHJehwJFTami0g0FAwsKurerHv0 e6WA== X-Gm-Message-State: AIVw111HI71qBIZiVW98oyVpjr8xsQY9pG6UUjAUCiC8l8bHbyJCvBRx lQ4d+Dd31BA5lTtu X-Received: by 10.223.134.26 with SMTP id 26mr5064482wrv.268.1501966400685; Sat, 05 Aug 2017 13:53:20 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:19 -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 04/15] ARM: head.S: use PC-relative insn sequence for secondary_data Date: Sat, 5 Aug 2017 21:52:11 +0100 Message-Id: <20170805205222.19868-5-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 Replace the open coded PC relative offset calculations with adr_l and ldr_l invocations. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/head.S | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 0a98aec0e39d..6e9df3663a57 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -386,10 +386,8 @@ ENTRY(secondary_startup) /* * Use the page tables supplied from __cpu_up. */ - adr r4, __secondary_data - ldmia r4, {r5, r7, r12} @ address to jump to after - sub lr, r4, r5 @ mmu has been enabled - add r3, r7, lr + adr_l r3, secondary_data + mov_l r12, __secondary_switched ldrd r4, [r3, #0] @ get secondary_data.pgdir ARM_BE8(eor r4, r4, r5) @ Swap r5 and r4 in BE: ARM_BE8(eor r5, r4, r5) @ it can be done in 3 steps @@ -404,22 +402,13 @@ ARM_BE8(eor r4, r4, r5) @ without using a temp reg. ENDPROC(secondary_startup) ENDPROC(secondary_startup_arm) - /* - * r6 = &secondary_data - */ ENTRY(__secondary_switched) - ldr sp, [r7, #12] @ get secondary_data.stack + ldr_l r7, secondary_data + 12 @ get secondary_data.stack + mov sp, r7 mov fp, #0 b secondary_start_kernel ENDPROC(__secondary_switched) - .align - - .type __secondary_data, %object -__secondary_data: - .long . - .long secondary_data - .long __secondary_switched #endif /* defined(CONFIG_SMP) */ From patchwork Sat Aug 5 20:52:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109491 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp991794qge; Sat, 5 Aug 2017 13:53:36 -0700 (PDT) X-Received: by 10.84.174.129 with SMTP id r1mr7777818plb.55.1501966416594; Sat, 05 Aug 2017 13:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966416; cv=none; d=google.com; s=arc-20160816; b=HVM7OZnu4oO1z5bJVDvqdWRhNulHxHq0Gc75Re2Xg55j8+yMmpjiDOcQbqbJNkJu08 1QCDCG7uQoE1K0JJxFq9XqHhlUsMBOozEyH7ggjX40+apvxwXgV99rtENELe7uJOL0dL 7p63u6mkpTArQz8ptYK1Lo4ZMfWRH6NOhW6H/+t2IDci4sLHhw26rIUETsOFyrndt8lX syYbWeie4310FVkUGF7LmgDZH1wnKLpEV9ZuunPegfpkxd+6e4iWo3gEt01Vjvv90oqN ++rgvUPHmd9kKV8J7jKYfu4SgfJCxy3X3FJ/M7cieBIKaOG3extTVR0GYfIqTwYp1LHs DxPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Mcjh3vn1DyheoD8D7Zu4T71Gpnl1NsP4r2GjSseyDjk=; b=kK17qPFsqciPfWrr/KwkKdDqrxYU++miK8hMMwjei4bMBSjYjyvt+bVV1dJbWLsIEu bVtfqaT1as/VM15gjeqd8NaCgMFyoyZFsvbATQNH052Bs1E3TkxC0UMvcwsun8QL3pO4 TAtqkBS7cujwxjjxveoB8KD1Pr/Sc4npJMNg1WMaI1iFu9LWEdKaX/KS7S/9zUYj8rgE HnXZgO/NDi0e8uwnZ/hALllawekic6bg0yeVuuVI2H4VhO7R0ty3EHbZSQuUhEHGAPYa +Mdxlk7mU2C6JNt+dlWPJV+ZJ10k/Oq+9UoiutvdThI5jSTx9bHf0Dby4LMmU0VDcyhe 31aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Iw4uFNpm; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si3018685plk.487.2017.08.05.13.53.36; Sat, 05 Aug 2017 13:53:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Iw4uFNpm; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752595AbdHEUx3 (ORCPT + 3 others); Sat, 5 Aug 2017 16:53:29 -0400 Received: from mail-wr0-f178.google.com ([209.85.128.178]:34063 "EHLO mail-wr0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752724AbdHEUxZ (ORCPT ); Sat, 5 Aug 2017 16:53:25 -0400 Received: by mail-wr0-f178.google.com with SMTP id 12so27172080wrb.1 for ; Sat, 05 Aug 2017 13:53:24 -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=k5onxlKK/PyKFt2gLNbOxILCedirmVtcEqPLhb8Y8Jw=; b=Iw4uFNpmhbXRl8jk5SHo2Y4CWc5kaNS94D/VEa377l/N7M6wdKogbv4T/rHbqeqeIM U6oM4sogUegUFIFNKg/78Y4vnFEBWrtBsLadm19iryL+F+3EtICY67+1EVx6t2C10CLH omupH9h/VxxZ0DEXMzg2y5b2rTYRZhHh97vAY= 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=k5onxlKK/PyKFt2gLNbOxILCedirmVtcEqPLhb8Y8Jw=; b=c9/Ibp1APze7Q8CBsmjQNws/ikSP2Ep3JVIKd7yB3T51jjl6BxhuTBJO3ntyaIsjAr qszrcREUAL3VOix/kAFNYKj7YkKkxLrq20e06uzUP3EmmffGvgCWCdwbuuIDrmgBfM5d Yis7ClAlcGjCMosWernwzIbPoh+HsXVjt4v1MNVL7Z3Jd1+KFdoOWBXTUhNYdA7n5dkD 9mh0Ir1zuhmfsuvN6PRk64yEUXeOJtJc15jNeKpd7st/nKs1Uj3YoQObyoArVUDtV5vQ EiuzAkv8EZKQfTff7up1saN08RlOgCQj60U1OXABEZAgOgZ4xHDbv8Tsr4L6cGgheYd4 TX9g== X-Gm-Message-State: AIVw113G/v1tPL6xowBZ1s1XR3pUSlje0S6iEloEYZRF7ozzLIyKY62L R3LtMXOIJXxRTS1R X-Received: by 10.223.136.28 with SMTP id d28mr5361978wrd.217.1501966403910; Sat, 05 Aug 2017 13:53:23 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:23 -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 05/15] ARM: head: use PC-relative insn sequence for __smp_alt Date: Sat, 5 Aug 2017 21:52:12 +0100 Message-Id: <20170805205222.19868-6-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 Replace the open coded PC relative offset calculations with a pair of adr_l invocations. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/head.S | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 6e9df3663a57..aed341e0f530 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -523,19 +523,11 @@ ARM_BE8(rev r0, r0) @ byteswap if big endian retne lr __fixup_smp_on_up: - adr r0, 1f - ldmia r0, {r3 - r5} - sub r3, r0, r3 - add r4, r4, r3 - add r5, r5, r3 + adr_l r4, __smpalt_begin + adr_l r5, __smpalt_end b __do_fixup_smp_on_up ENDPROC(__fixup_smp) - .align -1: .word . - .word __smpalt_begin - .word __smpalt_end - .pushsection .data .globl smp_on_up smp_on_up: From patchwork Sat Aug 5 20:52:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109494 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp991865qge; Sat, 5 Aug 2017 13:53:45 -0700 (PDT) X-Received: by 10.84.239.22 with SMTP id w22mr8007130plk.90.1501966425275; Sat, 05 Aug 2017 13:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966425; cv=none; d=google.com; s=arc-20160816; b=KCMzOIJNUX99+DJoHUM+0txdwstFVR66dVsZybv3QW30FV2A4lHWUBpgDAzsggBgvO x/JON0gR+UISmNaCL6G3+eZHzeWO9IbbFbu4Mqn4dkVJfozxtENueStorU/q6YGG8M79 8+yHrxzOidt8fKD3V6ioQir8NBT0WrE/AzRylJzdcQeOqtAcwRx7WdDE3T2KXL5L7WTJ x5vf/JUwphXLjTySWiA3s/IVqlYVTU0j6i97uV9O+KrRkMZgaFvxhfLPPdUsGG/7OVbS ugx+iFrYxVVrpIv5QqYCGyqShL05BAeAoYbHEaIwBQMko/r1UIKyXfpCqDuKFEMNr7su Ipzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=/YgPCmkG7+GojHfTD57l8TFXDU6ngygNLxr9Gkyh93s=; b=naPzUgvYWH3IrTJhBeqnYaFDestTgoA8pHV/5/8JLvGvzc9EuevHLUJdnTKrtZ2zgB n/EZtw45ZRRa3Es4uVY05AC5mXNNSY41Ao1cRBuVzMCa25p5S0Bz8imCQXxeb+poMLh6 pSqhklPJQkcZv3wntpfeCzrDtnnTaLFIuGdRVGcQMsZH64B9FldI8eDRlMrKJ5Q3Eo3G HyaTLSdkZpuDGFYQiqxJc6qWG4N2ymlxtj6finNhg+NI0R5Q/edifc9AsOuxW0LIJSXA RS7IAC+w4t21gRWMk2LmBGeaCJSKOlAnuGBYhWI47gMoYsWX7W4cekvgMkSlbOGVp+Xq gm1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Sw1aUrcS; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si3018685plk.487.2017.08.05.13.53.45; Sat, 05 Aug 2017 13:53:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Sw1aUrcS; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752771AbdHEUxl (ORCPT + 3 others); Sat, 5 Aug 2017 16:53:41 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:35053 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752610AbdHEUx2 (ORCPT ); Sat, 5 Aug 2017 16:53:28 -0400 Received: by mail-wm0-f50.google.com with SMTP id m85so42479802wma.0 for ; Sat, 05 Aug 2017 13:53:27 -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=qVwwZv5cVJLFrFIZWKPDugl12/5aWWtNTrDvraSpoBo=; b=Sw1aUrcSiEdyR2j4KUHaazcCiabH2dop+7ki3zfbXv6GWE4qfBx/PPqx+y8lVTYRTr wQULxvvSxr8AXLNkMtS6EHKCLnZK9jP/Vw/B7Wo+uPsC86AgkbjDe69C9Lito7Mthulr Sqo3rWsYME27diHPrCdyAiBYp3llsCTiAr7SU= 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=qVwwZv5cVJLFrFIZWKPDugl12/5aWWtNTrDvraSpoBo=; b=Jue13eDFqoEzBEIRgsmBUcMiC4pxlDDYKlDpUOsCbofOJ7OBXAMFklToHlbm14YsLx rPvsaiZ5D/FaWaPPmI4/bnIMYbUf7RgmR7VKt4uLmvdLom+NZdVWfJxrvtG51igwzfNf fTeo18sqvfxhOt8mp0j2AEZPy1Bxvj9z9A2NQSvaSWYYwhL13a8b/1Q6m9szxw4b/SeX kQi5bi9s79fnx2BjLpXvI/75MPKqT0J6kZ6eb4g7xarSB9lQBQVU4LFuObmgqwEpK0E4 E6ZjxhRrSQxLJDdk6RdPfReEyLLx1Ea2R9XqtJhWCRl00hzO21i/OAZGLCvKAVxDP9qY EpkQ== X-Gm-Message-State: AHYfb5gkjq1ofi/WHOdpmwdHeLf3argji21H2VkmH6hRVnMdus8UbViq XX99f8HFXLa1J0zU X-Received: by 10.28.142.74 with SMTP id q71mr4596993wmd.25.1501966407181; Sat, 05 Aug 2017 13:53:27 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:26 -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 06/15] ARM: sleep.S: use PC-relative insn sequence for sleep_save_sp/mpidr_hash Date: Sat, 5 Aug 2017 21:52:13 +0100 Message-Id: <20170805205222.19868-7-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 Replace the open coded PC relative offset calculations with adr_l and ldr_l invocations. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/sleep.S | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S index 0f6c1000582c..3026b119d3ff 100644 --- a/arch/arm/kernel/sleep.S +++ b/arch/arm/kernel/sleep.S @@ -137,9 +137,8 @@ ARM_BE8(setend be) @ ensure we are in BE mode mov r1, #0 ALT_SMP(mrc p15, 0, r0, c0, c0, 5) ALT_UP_B(1f) - adr r2, mpidr_hash_ptr - ldr r3, [r2] - add r2, r2, r3 @ r2 = struct mpidr_hash phys address + adr_l r2, mpidr_hash @ r2 = struct mpidr_hash phys address + /* * This ldmia relies on the memory layout of the mpidr_hash * struct mpidr_hash. @@ -147,10 +146,7 @@ ARM_BE8(setend be) @ ensure we are in BE mode ldmia r2, { r3-r6 } @ r3 = mpidr mask (r4,r5,r6) = l[0,1,2] shifts compute_mpidr_hash r1, r4, r5, r6, r0, r3 1: - adr r0, _sleep_save_sp - ldr r2, [r0] - add r0, r0, r2 - ldr r0, [r0, #SLEEP_SAVE_SP_PHYS] + ldr_l r0, sleep_save_sp + SLEEP_SAVE_SP_PHYS ldr r0, [r0, r1, lsl #2] @ load phys pgd, stack, resume fn @@ -164,12 +160,6 @@ ENDPROC(cpu_resume) ENDPROC(cpu_resume_arm) #endif - .align 2 -_sleep_save_sp: - .long sleep_save_sp - . -mpidr_hash_ptr: - .long mpidr_hash - . @ mpidr_hash struct offset - .data .type sleep_save_sp, #object ENTRY(sleep_save_sp) 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: 109492 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp991820qge; Sat, 5 Aug 2017 13:53:39 -0700 (PDT) X-Received: by 10.99.0.17 with SMTP id 17mr102794pga.209.1501966419354; Sat, 05 Aug 2017 13:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966419; cv=none; d=google.com; s=arc-20160816; b=zCB4W1G/VnmMYfelCwvj3OQU5axurnv41RJkYjmUvIkJWwXJ1ImwatLcX32gj1GCuG Ua2zikwiVALCWodImPbbVXxyK3LIq1WAPQKl3Zwgj+nDDL5FhBausSxNebmHRwn1wAmS MwGLYSc6z7tYoU2inIr+4VPp5rhJNkocp+/PEeQ9hVzojEvDzSf/TrHg5R8COabnPo4E mgqKA82owzImOqMh2sHIo3js4L0//6qtH0OO7VT/eKZvgpHvzWa8vr7LtnmeUMRRPG92 vGuccwCnCqc5irIvXGmzshg2+bJYzdnmqbPpY5mYSRyA+Mg6/cICB2Aha+iRIuvkDWB4 U99g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=379LL9WwBHkHGhzs/fMLSmcRM02kyk/ff3XAruVbUQQ=; b=zp9mRRw+kUUx4zxnfxsm2in0e3bV9vk/r3oR5YRL+yjP+/r74EkMiQPOHdyG2K1joo 3CmW1DvKfl8slrH0/gF+PIrWhRqw6VoFOiFw27zG7n8TuwfiKLR+MGJoT7i3QuDH+/Rm J7D9ARfeS/7sPmZNp+0/tBhicp1mdOt9B7ucFT3NGH4FlJl5nTRnZzYbknOL5rdlKF6W quNgCaJGaFPA7gwMUrOMPqaHp2llBhnZxXOKiIZpY3z8U9nZN3NgMarKbf4ahMpF9/pM j/ywmlS6U8uOIFLKsZMNFDD1G007y16Ci0Sg0bTEj4scjvbTM0vLbwC3FIxv+qd7X3Ud A0xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=e74EGa8Y; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si3018685plk.487.2017.08.05.13.53.39; Sat, 05 Aug 2017 13:53:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=e74EGa8Y; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752765AbdHEUxf (ORCPT + 3 others); 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 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(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 From patchwork Sat Aug 5 20:52:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109495 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp991959qge; Sat, 5 Aug 2017 13:53:52 -0700 (PDT) X-Received: by 10.98.104.133 with SMTP id d127mr6915407pfc.193.1501966432098; Sat, 05 Aug 2017 13:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966432; cv=none; d=google.com; s=arc-20160816; b=W6EeWKnyvT8Ctha5bJUrfzgR+VMkX+IDRWVk/y/T6jvClDmqAoRTG8D25x44zcmQI9 Kq+PVQj8wcSpS+0k4d8o+FJCU1oQj/Hc0hK/Wso26NLFpGwg6ewgyJDL4Aibb59NUFTn ODwNd8o/pWmnE23n/1ZV3z+jXXR9/vqrQeBuuEXf12G+A4yGKg6bajolc1iOL5OG1gIc knxrX2K5nMKN/CuO7uUNdVABpEJrBVQiTM3t5VmSo1ToW1R0ZuWQvNVCC+J1LPuhkwqL X+EAZYn7By8tdBifXClSuheHYXAbMp+DtBYOHMDsqgJlXRaNISSAPjZz13tOUDFWrWsC 3/xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=vbSCR3670snehtbQ612A6S/1eDls28nFMiu3SqsGUro=; b=z4iHR8kj4+sY/EjLs8LkjsX4a3TTFjtpCRgPq4nl1e0oHOsFUUYtHS8Hjk6I3fG0KT qKdadlMqzwhsnf03OWjJZcr/RselCkl5UKRocSpGpb+Ev6s5CRH5aGS5z3za9hc+xYh2 16dZErJUHzi6s6XFqqP4KkH9ZHC/2mCO9a+BtMEmFxOWOR5fSqYFcQZvxWTF5CI7Z1Yb Cgt+LIruCj/dZ4tSEEmqgrBgBT8gisYKsHhxi5debuEH/0txKKk5nUkRoMZ4sfc+nuRO fbshOdTwPnNZHDgfiVFgOl0V+6z0HHtrjsrjUiKqy90G+TuNYZi9Wnj6O3kp80fkkVdJ uSWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=AzNI/lXk; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si3018685plk.487.2017.08.05.13.53.51; Sat, 05 Aug 2017 13:53:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=AzNI/lXk; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752790AbdHEUxs (ORCPT + 3 others); Sat, 5 Aug 2017 16:53:48 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35070 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752761AbdHEUxf (ORCPT ); Sat, 5 Aug 2017 16:53:35 -0400 Received: by mail-wm0-f46.google.com with SMTP id m85so42480804wma.0 for ; Sat, 05 Aug 2017 13:53:35 -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=5WQyT0WG5y7rV9xMOfN/zzzm++0D2SfRBebqJRnq+2g=; b=AzNI/lXkhN3bBVYoUgoq6xCjWG7+uhNT4iuVu3dHqOm6FrxYoP+/ndrWwt4l4CclLQ +GHkB98NdzgRtUiJChGRPsfklH/+6nCt3S3ZeCuV2C8U2bc/eJpkaBP71kLcX/WrgAhU 3jrlh4rVaO4jBs53gIebS/FBKNqK0U10sqjWQ= 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=5WQyT0WG5y7rV9xMOfN/zzzm++0D2SfRBebqJRnq+2g=; b=qYgvaN1Vg9L200CW5nlhFITW8OnlJ+Xana3SZHEFWj/5l5rb8aEyWuaVRK67d/5N/Y 155lOA/K88rT+vh8FNoOUqrfwSN6vameqc6nWvb/bCRepVgg6rk0HhhoBLkK02sDxRy4 zurWsfxcXSUvrHo1mLVD5XZmPuu8FeELzIlo4AKqrvCuQU58xLGAG0TLv1WkR9nfXoqY SDh9IEDratnR1mkTd0DObCHl6GVju6w94RZztCtfp3f5JpP4noZFtjACiXEwmPyll2wQ /tPsnKO61hquzej/fgfGDWUDpd0f2Wti/OhfcNab91PchYL6y/maGtfFFZ5xAr3k9OHn qmhQ== X-Gm-Message-State: AHYfb5griZDnT2QtqaGer/z7+zRgKlFOySVXgziRPLKSRQjZWxjiWW7P WMJFILD4KcQ7tBzlbvzd8Q== X-Received: by 10.28.180.8 with SMTP id d8mr4167339wmf.161.1501966414539; Sat, 05 Aug 2017 13:53:34 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:33 -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 08/15] ARM: head.S: use PC relative insn sequence to calculate PHYS_OFFSET Date: Sat, 5 Aug 2017 21:52:15 +0100 Message-Id: <20170805205222.19868-9-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 Replace the open coded arithmetic with a simple adr_l/sub pair. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/head.S | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 939543e73874..e08a4623a980 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -106,10 +106,8 @@ ENTRY(stext) #endif #ifndef CONFIG_XIP_KERNEL - adr r3, 2f - ldmia r3, {r4, r8} - sub r4, r3, r4 @ (PHYS_OFFSET - PAGE_OFFSET) - add r8, r8, r4 @ PHYS_OFFSET + adr_l r8, _text @ __pa(_text) + sub r8, r8, #TEXT_OFFSET @ PHYS_OFFSET #else ldr r8, =PLAT_PHYS_OFFSET @ always constant in this case #endif @@ -161,10 +159,6 @@ ENTRY(stext) 1: b __enable_mmu ENDPROC(stext) .ltorg -#ifndef CONFIG_XIP_KERNEL -2: .long . - .long PAGE_OFFSET -#endif /* * Setup the initial page tables. We only setup the barest From patchwork Sat Aug 5 20:52:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109497 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp992061qge; Sat, 5 Aug 2017 13:54:00 -0700 (PDT) X-Received: by 10.99.127.19 with SMTP id a19mr6566845pgd.380.1501966439979; Sat, 05 Aug 2017 13:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966439; cv=none; d=google.com; s=arc-20160816; b=JK9J+khkPlzqkeriDSbDJadv8UAvi1wXUdOyeB95nrQU0FB3WagyMwDjfDrFqsr0Pi j7sXn8DfNKpct1qo2zmYMQRiL+S0VmYtJ5+/gM4qQKwb8pSP7zXh6PzqQFvNaMbXpgpz FQGf7wvet+wtWsm14/HPKg70eXLNVOt+K9fb0ID8l3X3KShKDQuR05l3ufmuDS/Li5T5 l9WJ16YJq6J41MGiWgKZdH2Mer2VEhKb/zn3LvETeihzrCumDN/tYo9EXkABypjJyU8U YqDv/feLblrCLC6L+b74ZsSFCg/3/5dZgyjRhlckR4flCEEVS2zHUlMhavaZyHTFKbbh sliA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=69kP00OGWIuyA1e73s9RJ1imNB+JsvK8I2cIa8T7amA=; b=L7g3j1UJBibqTWLj4wHf+resioQmlcMK/4Z2MxLeZzrKHRLKV6qERwqcZaHDWZHcPh Vgs6vQcsSDjsqc/zod7mb3H5fF5lM1Ffr0f7wYcitGDKQ/sQuwOnbTscZY+GJ0RaW037 i72mr563sLeCkbeE9QnCgVkI3egmGNYWtSO8TIntrap7mIUunTWm6iHqVrFCckCSoxdg DyH5DEJyDIZMOgdSw6BB+ZkRKPfMcifKFRVflwGHOZblmAo8lF5oW3d3BDzebyADFPm1 Dcjf9gcj1r2Hc999N+DrMilbP0jh5XHFeB4YzNyFtax/9K9XnhjJ+hcEU/p0VBc9FI5p aGxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=HzvZeHqk; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si3018685plk.487.2017.08.05.13.53.59; Sat, 05 Aug 2017 13:53:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=HzvZeHqk; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751519AbdHEUxq (ORCPT + 3 others); Sat, 5 Aug 2017 16:53:46 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:38538 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752790AbdHEUxj (ORCPT ); Sat, 5 Aug 2017 16:53:39 -0400 Received: by mail-wm0-f51.google.com with SMTP id m85so42571708wma.1 for ; Sat, 05 Aug 2017 13:53:38 -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=Go4oiOIfSahBhfcjIXSc+kQd+zVlXSNpIuSjvpikkj4=; b=HzvZeHqkMVGkIQfpw7iHEhCiLP8oOb2MZxKe7XB/C+5ty9b5iiu/1+N+GZhsCGoEOp WkL/i7tNFy4Ni7NSeq2fEbShvh3G/oDL9qTKu6NKeIfzZvJq4Qg0GX1n5GTkViObTf3t OE24uivJiXHMI7f783L+VP0n8ddlJHA9n/Woo= 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=Go4oiOIfSahBhfcjIXSc+kQd+zVlXSNpIuSjvpikkj4=; b=f05lQNp/ZAANcJpsDRXd4YW/2RSRHsCnkAg1wPPU543nO4Hb7QYqiHSt9QnqX4Ztmd 5BKpsRJhKG15y6r/8TZymw0m02i1yGVhyfFQuRVFfNRqb+TNC+SGQCpFRLn2tsdnxTXK OFkMPoV8WZecH4+C3cWguMjs09uFJw1l8RLeiw+JdDh4srkcDKDCyXk82tgkqAMU9Sdk GRDLMJprtcQDOmme/OLDz40ZysjhRlSOtAmMM5sPdT69xW65QjfhViQMklkXSsGmZ6Pn Rtz1cVyp1ss5Ro7FAHz4gRv92r6duYYFS7/gO3DoFJUgbLKsc94yQuwK2XcqYRkuU7VP RS/g== X-Gm-Message-State: AHYfb5hyZmVy4o2pWC7Iu4S0OB+eKBndGvuxuf7VxudojtaW889ds+Nl 3Lvgv4zNKVP4eEL6 X-Received: by 10.28.26.5 with SMTP id a5mr4297202wma.80.1501966418265; Sat, 05 Aug 2017 13:53:38 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:37 -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 09/15] ARM: kvm: replace open coded VA->PA calculations with adr_l call Date: Sat, 5 Aug 2017 21:52:16 +0100 Message-Id: <20170805205222.19868-10-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 Replace the open coded calculations of the actual physical address of the KVM stub vector table with a single adr_l invocation. Cc: Marc Zyngier Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/head.S | 15 ++------- arch/arm/kernel/hyp-stub.S | 33 +++++++------------- arch/arm/kvm/init.S | 8 +---- 3 files changed, 15 insertions(+), 41 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 8a756870c238..5884e8151376 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -427,15 +427,10 @@ dtb_check_done: /* * Compute the address of the hyp vectors after relocation. - * This requires some arithmetic since we cannot directly - * reference __hyp_stub_vectors in a PC-relative way. * Call __hyp_set_vectors with the new address so that we * can HVC again after the copy. */ -0: adr r0, 0b - movw r1, #:lower16:__hyp_stub_vectors - 0b - movt r1, #:upper16:__hyp_stub_vectors - 0b - add r0, r0, r1 + adr_l r0, __hyp_stub_vectors sub r0, r0, r5 add r0, r0, r10 bl __hyp_set_vectors @@ -568,17 +563,11 @@ not_relocated: mov r0, #0 cmp r0, #HYP_MODE @ if not booted in HYP mode... bne __enter_kernel @ boot kernel directly - adr r12, .L__hyp_reentry_vectors_offset - ldr r0, [r12] - add r0, r0, r12 - + adr_l r0, __hyp_reentry_vectors bl __hyp_set_vectors __HVC(0) @ otherwise bounce to hyp mode b . @ should never be reached - - .align 2 -.L__hyp_reentry_vectors_offset: .long __hyp_reentry_vectors - . #else b __enter_kernel #endif diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S index ec7e7377d423..55b5fab83861 100644 --- a/arch/arm/kernel/hyp-stub.S +++ b/arch/arm/kernel/hyp-stub.S @@ -36,41 +36,38 @@ ENTRY(__boot_cpu_mode) .text /* - * Save the primary CPU boot mode. Requires 3 scratch registers. + * Save the primary CPU boot mode. Requires 2 scratch registers. */ - .macro store_primary_cpu_mode reg1, reg2, reg3 + .macro store_primary_cpu_mode reg1, reg2 mrs \reg1, cpsr and \reg1, \reg1, #MODE_MASK - adr \reg2, .L__boot_cpu_mode_offset - ldr \reg3, [\reg2] - str \reg1, [\reg2, \reg3] + str_l \reg1, __boot_cpu_mode, \reg2 .endm /* * Compare the current mode with the one saved on the primary CPU. * If they don't match, record that fact. The Z bit indicates * if there's a match or not. - * Requires 3 additionnal scratch registers. + * Requires 2 additionnal scratch registers. */ - .macro compare_cpu_mode_with_primary mode, reg1, reg2, reg3 - adr \reg2, .L__boot_cpu_mode_offset - ldr \reg3, [\reg2] - ldr \reg1, [\reg2, \reg3] + .macro compare_cpu_mode_with_primary mode, reg1, reg2 + adr_l \reg2, __boot_cpu_mode + ldr \reg1, [\reg2] cmp \mode, \reg1 @ matches primary CPU boot mode? orrne \reg1, \reg1, #BOOT_CPU_MODE_MISMATCH - strne \reg1, [\reg2, \reg3] @ record what happened and give up + strne \reg1, [\reg2] @ record what happened and give up .endm #else /* ZIMAGE */ - .macro store_primary_cpu_mode reg1:req, reg2:req, reg3:req + .macro store_primary_cpu_mode reg1:req, reg2:req .endm /* * The zImage loader only runs on one CPU, so we don't bother with mult-CPU * consistency checking: */ - .macro compare_cpu_mode_with_primary mode, reg1, reg2, reg3 + .macro compare_cpu_mode_with_primary mode, reg1, reg2 cmp \mode, \mode .endm @@ -85,7 +82,7 @@ ENTRY(__boot_cpu_mode) */ @ Call this from the primary CPU ENTRY(__hyp_stub_install) - store_primary_cpu_mode r4, r5, r6 + store_primary_cpu_mode r4, r5 ENDPROC(__hyp_stub_install) @ fall through... @@ -99,7 +96,7 @@ ENTRY(__hyp_stub_install_secondary) * If the secondary has booted with a different mode, give up * immediately. */ - compare_cpu_mode_with_primary r4, r5, r6, r7 + compare_cpu_mode_with_primary r4, r5, r6 retne lr /* @@ -264,12 +261,6 @@ ENTRY(__hyp_reset_vectors) ret lr ENDPROC(__hyp_reset_vectors) -#ifndef ZIMAGE -.align 2 -.L__boot_cpu_mode_offset: - .long __boot_cpu_mode - . -#endif - .align 5 ENTRY(__hyp_stub_vectors) __hyp_stub_reset: W(b) . diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S index 5386528665b5..d777c6fbd869 100644 --- a/arch/arm/kvm/init.S +++ b/arch/arm/kvm/init.S @@ -143,13 +143,7 @@ reset: bic r1, r1, r0 mcr p15, 4, r1, c1, c0, 0 @ HSCTLR - /* - * Install stub vectors, using ardb's VA->PA trick. - */ -0: adr r0, 0b @ PA(0) - movw r1, #:lower16:__hyp_stub_vectors - 0b @ VA(stub) - VA(0) - movt r1, #:upper16:__hyp_stub_vectors - 0b - add r1, r1, r0 @ PA(stub) + adr_l r1, __hyp_stub_vectors @ PA(stub) mcr p15, 4, r1, c12, c0, 0 @ HVBAR b exit From patchwork Sat Aug 5 20:52:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109502 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp992293qge; Sat, 5 Aug 2017 13:54:20 -0700 (PDT) X-Received: by 10.84.236.70 with SMTP id h6mr8143416pln.339.1501966460871; Sat, 05 Aug 2017 13:54:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966460; cv=none; d=google.com; s=arc-20160816; b=ncvIlhYJaDEANKQ+ZTp0tGrzUQWWR/4aXllW4a9LSKgAMAVbtldQpgJP+3aPA1OBcF a+OH2Mfs7KPwPPKOGFxH1Rpe0LfEd6egJPPEYBiqFd3Hmyvz7eXP9i0YQ6Ly9t+lFMkg 3kQzQp58B/A6PelmW+K+7lq61DI1HC7bkFZ2vfmnlmCpNP6Z+OukCiFz/E8RXRGVRmYz p67Al87NNXiTttPKHaaT2nE04QK/9WIKl9vTmqd9RRavkcJUj90ynt/W4acdT12avSNT itedo9qeqDymAnZF+6JjUM7k2rOBywr3ffklZHaaHndUv7J7j3fAZbXtfPPv1J/ouPe2 undw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=bB/xSs/7/TMX77s4pTV/jO7RiPXYB4iGimQehgDLePk=; b=n8arrIQoEb/XOGld2Jf3HpEOgiTm3gEqqo0fU8370clgkDS0noSS29PkAThDvotro+ 7IsKHukB9Hk2XHiKd2JKEQ6jmzq2B0eekICu49R8qTJqGxwmxJFxlM+PlyBkaec28BLL R9d86XU7Kre5CRfNWRlzV2T8em3NtcFCDc8PQ1tFLVI/sK6VwiEVurlH8Wr5eBfcjWY3 USsyAqYKYMy2SxuhQ1Ni645XrnnSDGX8bc/oeBEMTgOvE/+Ntbn4C+hf+X9saTl66MfL CdzT6WXhK00lVGSmOZbM9sm2RxqPCRXY10CLg/VAzOa3RSmSTgfTc+fPI66Hpi38Dhm0 l1JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Vgtp4UZb; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si2667268pfg.662.2017.08.05.13.54.20; Sat, 05 Aug 2017 13:54:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Vgtp4UZb; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752858AbdHEUyR (ORCPT + 3 others); Sat, 5 Aug 2017 16:54:17 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:37366 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752795AbdHEUxm (ORCPT ); Sat, 5 Aug 2017 16:53:42 -0400 Received: by mail-wm0-f48.google.com with SMTP id t201so42547383wmt.0 for ; Sat, 05 Aug 2017 13:53:42 -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=8t6IV4bmNjAgcv5Be09tvxPF5UJpUqInMAYOh79BmGQ=; b=Vgtp4UZbkswXzgx2tTKUNNUmWB50/LXHnuSHBwwIUGaJ/gZSEkWQxGgm5Ilz6SUXre 6/uM+owxdBIUrQQxSnyVpongquNfhMLQ9u3a6mALIGDyEv5rF18PIJjLIhPfDkkOMS3o T8eaFGbFPqbE6nwwiwmXhVgETne25gHGMIiyw= 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=8t6IV4bmNjAgcv5Be09tvxPF5UJpUqInMAYOh79BmGQ=; b=Jk7TSHQ78C1KOT6pduvAS4VF33ZPKokwJ9rcEXBP1Y97dYdNYUdQcEcvT23vWbOQUD jXsLDv0phs8TqOaffhYkNGqy1HbqmCjVbynGoDGiVUNl2tE66ITx/HampySuXW35E79k VWGZfUn8klit6mgTisCUH8bwGB8h5aXn5Bov9uuyneX6WXRVX8G+Q7Y3dRPj3I/O6DX6 +1k46dnlBGV+/K7EvbdLp2hRzmDbUMCW+ipBQOnLBDp6EN3KbEzTUDMXrUIrIhK4mhyQ oVrcPxojaN/2fkitInjjYMZxKwm5+YdK2Z0RZpHv7AC3t/whRvsjazNf5ih/XQaB1n6X VH4g== X-Gm-Message-State: AHYfb5ghvxYajPxcxXGAJpdUiltzjXrPf2NsxlNH8w+lbhEJcqd9wW2h n5r10NYcpG8MReVx X-Received: by 10.28.71.206 with SMTP id m75mr4292742wmi.13.1501966421464; Sat, 05 Aug 2017 13:53:41 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:40 -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 10/15] arm-soc: exynos: replace open coded VA->PA conversions Date: Sat, 5 Aug 2017 21:52:17 +0100 Message-Id: <20170805205222.19868-11-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 This replaces a couple of open coded calculations to obtain the physical address of a far symbol with calls to the new adr_l etc macros. Signed-off-by: Ard Biesheuvel --- arch/arm/mach-exynos/headsmp.S | 9 +------ arch/arm/mach-exynos/sleep.S | 26 ++++---------------- 2 files changed, 6 insertions(+), 29 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-exynos/headsmp.S b/arch/arm/mach-exynos/headsmp.S index d3d24ab351ae..25de5aff1c41 100644 --- a/arch/arm/mach-exynos/headsmp.S +++ b/arch/arm/mach-exynos/headsmp.S @@ -23,10 +23,7 @@ ENTRY(exynos4_secondary_startup) ARM_BE8(setend be) mrc p15, 0, r0, c0, c0, 5 and r0, r0, #15 - adr r4, 1f - ldmia r4, {r5, r6} - sub r4, r4, r5 - add r6, r6, r4 + adr_l r6, pen_release pen: ldr r7, [r6] cmp r7, r0 bne pen @@ -37,7 +34,3 @@ pen: ldr r7, [r6] */ b secondary_startup ENDPROC(exynos4_secondary_startup) - - .align 2 -1: .long . - .long pen_release diff --git a/arch/arm/mach-exynos/sleep.S b/arch/arm/mach-exynos/sleep.S index cf950790fbdc..003465699263 100644 --- a/arch/arm/mach-exynos/sleep.S +++ b/arch/arm/mach-exynos/sleep.S @@ -17,6 +17,7 @@ #include #include +#include #include #include "smc.h" @@ -62,19 +63,13 @@ ENTRY(exynos_cpu_resume_ns) cmp r0, r1 bne skip_cp15 - adr r0, _cp15_save_power - ldr r1, [r0] - ldr r1, [r0, r1] - adr r0, _cp15_save_diag - ldr r2, [r0] - ldr r2, [r0, r2] + ldr_l r1, cp15_save_power + ldr_l r2, cp15_save_diag mov r0, #SMC_CMD_C15RESUME dsb smc #0 #ifdef CONFIG_CACHE_L2X0 - adr r0, 1f - ldr r2, [r0] - add r0, r2, r0 + adr_l r0, l2x0_saved_regs /* Check that the address has been initialised. */ ldr r1, [r0, #L2X0_R_PHY_BASE] @@ -93,9 +88,7 @@ ENTRY(exynos_cpu_resume_ns) smc #0 /* Reload saved regs pointer because smc corrupts registers. */ - adr r0, 1f - ldr r2, [r0] - add r0, r2, r0 + adr_l r0, l2x0_saved_regs ldr r1, [r0, #L2X0_R_PWR_CTRL] ldr r2, [r0, #L2X0_R_AUX_CTRL] @@ -114,15 +107,6 @@ skip_cp15: b cpu_resume ENDPROC(exynos_cpu_resume_ns) - .align -_cp15_save_power: - .long cp15_save_power - . -_cp15_save_diag: - .long cp15_save_diag - . -#ifdef CONFIG_CACHE_L2X0 -1: .long l2x0_saved_regs - . -#endif /* CONFIG_CACHE_L2X0 */ - .data .globl cp15_save_diag cp15_save_diag: From patchwork Sat Aug 5 20:52:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109496 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp992027qge; Sat, 5 Aug 2017 13:53:57 -0700 (PDT) X-Received: by 10.98.63.204 with SMTP id z73mr6792658pfj.278.1501966437371; Sat, 05 Aug 2017 13:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966437; cv=none; d=google.com; s=arc-20160816; b=QmOFRBeubc3zZIuO+Cr+lQDHvcoKAdHUWfPMepgjhJiR56cAMWRQva0t40FOF2aBrR rJwo2F5lDNrl+LUYib++Bge+3/gdTNETMIYRVV92zbPjLjp9uwZEim9reyHh0TzYH837 4C9c1m3B+9VKl3E7g/BVr+jvue8PHTV2gQjKkNp2CYoVqz0j+JX9DT8VfOLLcm+gjutE JhFTRSB2BczarA8mkfLdWIZqYXK1RAaaqUnE6MtucDRsla2AQKXFcHQPzCrDvk5Hfvkn gSvcB6LoWWnMs42hU25lMa4/w4ikQuBHZY0JcAFRVC2afdJS+MpcKKxMhlbXF07LWMvx QwXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=K5nOi/ZedXwgmUONoN+vYNi7cVA430eoLqgBLKCcyCE=; b=yPMRRRCgHfKjam0qUSv69W895IF4/RR/nxE+TsosA1/Xi8JjT2OPUwTIBhP0oqLpsy ZfziUiAJSCxhO44r9Zrf4nCETOsYsnhqr15x9A+LpSpt6GUB2N8bnAJcwYz/JrWyqChD XUC/vEV6DRfNALT9/o1ditmmkA0FBLn081iRUnzRS4nmdyNvOppZkercLzK1VTpTPrQH 0+e3/PLRZpbt7PNfstsPi/beguxJIE+jCsI3H0xVyDUwfpWFRN9bx0CgUsP31iqO+JOb vnqKd/MJGAOSnfazjEh+JrEbS514y+f6h/YCWkrgAhjUdNz3ipVDDylT6YmFU7k0keLo xKjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=jaLaInHw; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si3018685plk.487.2017.08.05.13.53.57; Sat, 05 Aug 2017 13:53:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=jaLaInHw; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752873AbdHEUxx (ORCPT + 3 others); Sat, 5 Aug 2017 16:53:53 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:35857 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752820AbdHEUxq (ORCPT ); Sat, 5 Aug 2017 16:53:46 -0400 Received: by mail-wm0-f41.google.com with SMTP id t201so42450330wmt.1 for ; Sat, 05 Aug 2017 13:53:45 -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=u3I3Jk6wrJK6+7ea8yX3xVYVsbsP1/6JexLXk9d8LqI=; b=jaLaInHw9XlWbJPQ8iFgCklojqH1ATfBLlcdc1NXYXDhY54j4LpDU/+Tig73ENLrQV yZV0zBw/x8NNsuNJHuNryhPZdafNba2rmNH2XSjXjEW8UXDgReDrVvT1LlZyNX/n6/c8 lv+LGqLgrMHiMkBT0BeJ0Hn6XM9gszxGqAKek= 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=u3I3Jk6wrJK6+7ea8yX3xVYVsbsP1/6JexLXk9d8LqI=; b=PymYZ4cXqi8izwg9/Bo0Vc81xVQo8F3czNCxfxPVgQ6ijdzIT3HL6roVFFGIsVbTSk IIBeTSVvZEIWeiaH1kgUzgsc4gs1vjyI/hgnDD0NNU5mIKvkNyJjg/avZ1F1qEQKo+hN OFmqEDjF0E+N3Y4JgTmSvpxqqr9qG4qLkymXJeK7PqzzHmAw5L185ROOVj2Yv07xb5v2 xL6WIE6uEqzQa5NRPcuPa9idcoK/3FaFQj5mdDpaU/FxBc2w68K61j0h81vQj49NsxbZ vHINwnRQL+FDDa+mb12tq+/ObUMlQBZ04JLNtqkLZfKAOymOLNyZLsV0h8kYQHsLSxO9 Ev5A== X-Gm-Message-State: AHYfb5iINDsCQxWjqXuuhA8uyuir6YxsQYZC46onVx93rjxF1+MEV3WJ t9T0OBQTiYNunEFJ X-Received: by 10.28.57.193 with SMTP id g184mr4398864wma.32.1501966424868; Sat, 05 Aug 2017 13:53:44 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:44 -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 11/15] arm-soc: mvebu: replace open coded VA->PA conversion Date: Sat, 5 Aug 2017 21:52:18 +0100 Message-Id: <20170805205222.19868-12-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 This replaces an open coded calculation to obtain the physical address of a far symbol with a call to the new ldr_l etc macro. Signed-off-by: Ard Biesheuvel --- arch/arm/mach-mvebu/coherency_ll.S | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-mvebu/coherency_ll.S b/arch/arm/mach-mvebu/coherency_ll.S index 8b2fbc8b6bc6..df0ccb5cef1d 100644 --- a/arch/arm/mach-mvebu/coherency_ll.S +++ b/arch/arm/mach-mvebu/coherency_ll.S @@ -42,9 +42,7 @@ ENTRY(ll_get_coherency_base) ldr r1, =coherency_base cmp r1, #0 beq 2f - adr r1, 3f - ldr r3, [r1] - ldr r1, [r1, r3] + ldr_l r1, coherency_phys_base b 2f 1: /* @@ -160,7 +158,3 @@ ENTRY(ll_disable_coherency) dsb ret lr ENDPROC(ll_disable_coherency) - - .align 2 -3: - .long coherency_phys_base - . From patchwork Sat Aug 5 20:52:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109498 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp992098qge; Sat, 5 Aug 2017 13:54:02 -0700 (PDT) X-Received: by 10.84.128.73 with SMTP id 67mr7938492pla.155.1501966442863; Sat, 05 Aug 2017 13:54:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966442; cv=none; d=google.com; s=arc-20160816; b=sPPIe5LCRHOP85GR9k8Kn5hUr6y72zJKvsvLUmQzjX+dDUnS4rwrmGbkFB4Vl/ZWiz eJRK006Kb/DPDvGf6QcwF8YRk7FRd5GSs4082WpyB4rHeLHKkw6+BJ9dQpMzva8v5sbe vzTj5t60ypcg6p3BoHmJ7auf5cAnDZVRdwMbVWkszte83KCasNb9nFXzes298QdUt0r0 kOljm5opjLLrlT0I4eVHQbup2izsRlITH3J0VtorAsxSxTkRk83Mc00EkBEgxEtq6w6B VwI73A3GJSLz5ppwxshZrM4q064QNou090VTwflrQ+auswdrsreD+ovq8WjFcyCb+gv4 Fa/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=/i3DN6hw4DPg30XBx3DLJJMBOu2KUQblKCLYjsC7+BI=; b=ubuuafPQ4KTVdV5wVZYYanm1DQarRsHKyTAv6dW9zn4b3hUnrbPD+aYUmhoMv3bbLa L98BQ3GvEGZoN4zjgtBaCFZ0ELO1w2Wwx8v8ZESm/eKd3vMSPlyn/PALStQia0833Z2P z5REGouuEgllN+Q/jumWeaPSlRqvaBSYnM+FTpumiCTSKFtm+uJ8JZJ7Mi8e6fTNnuvc 39dRvZZ+TgTsxSfn65XziWt002mYpcXT5aXK3S6kYZpGtwPrZ3ymlJlCjkChxII550Ck nNrP6UxlzvEXZdXRmmIrPMzmFv+2ibhFPqJ3l7zllBhmWCFWb40WSxPU8mI+CbBfTECt QJ9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=P0pcxnHC; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si3018685plk.487.2017.08.05.13.54.02; Sat, 05 Aug 2017 13:54:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=P0pcxnHC; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752904AbdHEUx6 (ORCPT + 3 others); Sat, 5 Aug 2017 16:53:58 -0400 Received: from mail-wr0-f181.google.com ([209.85.128.181]:36343 "EHLO mail-wr0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752761AbdHEUxt (ORCPT ); Sat, 5 Aug 2017 16:53:49 -0400 Received: by mail-wr0-f181.google.com with SMTP id y43so27169445wrd.3 for ; Sat, 05 Aug 2017 13:53:49 -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=LcPBJwZTGwIOAGGfdbSnNhARqc+C54x63A3k8Ade8N0=; b=P0pcxnHCsp1hdjPu3qzZL97BmyB7BlaMec93e54ZorFhkVuwHyUixhszZTzPR658Pv QI7UrdmRy+o5U/MLdNBULVFK8ypq73UEXP+b24dqpXyR5VRl9m1s/deOwSgbkMOaM4U7 2L+J6k5FMAGg6On/GAO8OuwpnT/gH8t3SwGCo= 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=LcPBJwZTGwIOAGGfdbSnNhARqc+C54x63A3k8Ade8N0=; b=XBZ20f5E85qkNlRsvzdhFTZkEpxcgKVa5ZMaw+7huvtyroyuYTfUVku9JwADKANzxg DfIAREdH40JHuxQARrtAcMCQJStjIuw9BHYSLUtwMpkD6kB1FTKebgFH/5NpRZZ6cFA1 lBslryrmboSOiuOUFOBEuonD7xm1XK1sYrz8hiOxLqwF+yALIWH7c1amkdhX8ySlRdDv U8bo/ZeO7J3mGuYVHBtQjsIj5ynFzUSizk+lioQ8dhSZ42XWS0alpgSJjFEOCFPFrrux IQg4uN/bBjb49LidweiKjy1Clc3zqjkwF5rVWQnGjM/8plGNh6cHEW58FAky1Mdl7phD QQrg== X-Gm-Message-State: AIVw111Nro34fEJYbxTYNFoX3dlxuWfPHl00nGS8rFI1E8+J/Ql+Xtqk k0L+5Z0UEO+zTtw+ X-Received: by 10.223.143.68 with SMTP id p62mr5055104wrb.20.1501966428452; Sat, 05 Aug 2017 13:53:48 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:47 -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 12/15] arm-soc: omap: replace open coded VA->PA calculations Date: Sat, 5 Aug 2017 21:52:19 +0100 Message-Id: <20170805205222.19868-13-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 This replaces a couple of open coded calculations to obtain the physical address of a far symbol with calls to the new adr_l etc macros. Signed-off-by: Ard Biesheuvel --- arch/arm/mach-omap2/sleep34xx.S | 21 ++++---------------- arch/arm/mach-omap2/sleep44xx.S | 12 ++--------- 2 files changed, 6 insertions(+), 27 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 1b9f0520dea9..418a4478622d 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S @@ -86,9 +86,7 @@ ENTRY(enable_omap3630_toggle_l2_on_restore) stmfd sp!, {lr} @ save registers on stack /* Setup so that we will disable and enable l2 */ mov r1, #0x1 - adrl r3, l2dis_3630_offset @ may be too distant for plain adr - ldr r2, [r3] @ value for offset - str r1, [r2, r3] @ write to l2dis_3630 + str_l r1, l2dis_3630, r2 @ write to l2dis_3630 ldmfd sp!, {pc} @ restore regs and return ENDPROC(enable_omap3630_toggle_l2_on_restore) @@ -422,9 +420,7 @@ ENTRY(omap3_restore) cmp r2, #0x0 @ Check if target power state was OFF or RET bne logic_l1_restore - adr r1, l2dis_3630_offset @ address for offset - ldr r0, [r1] @ value for offset - ldr r0, [r1, r0] @ value at l2dis_3630 + ldr_l r0, l2dis_3630 @ value at l2dis_3630 cmp r0, #0x1 @ should we disable L2 on 3630? bne skipl2dis mrc p15, 0, r0, c1, c0, 1 @@ -436,9 +432,7 @@ skipl2dis: and r1, #0x700 cmp r1, #0x300 beq l2_inv_gp - adr r0, l2_inv_api_params_offset - ldr r3, [r0] - add r3, r3, r0 @ r3 points to dummy parameters + adr_l r3, l2_inv_api_params @ r3 points to dummy parameters mov r0, #40 @ set service ID for PPA mov r12, r0 @ copy secure Service ID in r12 mov r1, #0 @ set task id for ROM code in r1 @@ -476,9 +470,6 @@ skipl2dis: #endif b logic_l1_restore - .align -l2_inv_api_params_offset: - .long l2_inv_api_params - . l2_inv_gp: /* Execute smi to invalidate L2 cache */ mov r12, #0x1 @ set up to invalidate L2 @@ -495,9 +486,7 @@ l2_inv_gp: mov r12, #0x2 smc #0 @ Call SMI monitor (smieq) logic_l1_restore: - adr r0, l2dis_3630_offset @ adress for offset - ldr r1, [r0] @ value for offset - ldr r1, [r0, r1] @ value at l2dis_3630 + ldr_l r1, l2dis_3630 @ value at l2dis_3630 cmp r1, #0x1 @ Test if L2 re-enable needed on 3630 bne skipl2reen mrc p15, 0, r1, c1, c0, 1 @@ -526,8 +515,6 @@ control_stat: .word CONTROL_STAT control_mem_rta: .word CONTROL_MEM_RTA_CTRL -l2dis_3630_offset: - .long l2dis_3630 - . .data l2dis_3630: diff --git a/arch/arm/mach-omap2/sleep44xx.S b/arch/arm/mach-omap2/sleep44xx.S index c7a3b4aab4b5..274fbb91f08f 100644 --- a/arch/arm/mach-omap2/sleep44xx.S +++ b/arch/arm/mach-omap2/sleep44xx.S @@ -260,9 +260,7 @@ ENTRY(omap4_cpu_resume) beq skip_ns_smp_enable ppa_actrl_retry: mov r0, #OMAP4_PPA_CPU_ACTRL_SMP_INDEX - adr r1, ppa_zero_params_offset - ldr r3, [r1] - add r3, r3, r1 @ Pointer to ppa_zero_params + adr_l r3, ppa_zero_params @ Pointer to ppa_zero_params mov r1, #0x0 @ Process ID mov r2, #0x4 @ Flag mov r6, #0xff @@ -299,9 +297,7 @@ skip_ns_smp_enable: ldr r0, =OMAP4_PPA_L2_POR_INDEX ldr r1, =OMAP44XX_SAR_RAM_BASE ldr r4, [r1, #L2X0_PREFETCH_CTRL_OFFSET] - adr r1, ppa_por_params_offset - ldr r3, [r1] - add r3, r3, r1 @ Pointer to ppa_por_params + adr_l r3, ppa_por_params @ Pointer to ppa_por_params str r4, [r3, #0x04] mov r1, #0x0 @ Process ID mov r2, #0x4 @ Flag @@ -326,8 +322,6 @@ skip_l2en: #endif b cpu_resume @ Jump to generic resume -ppa_por_params_offset: - .long ppa_por_params - . ENDPROC(omap4_cpu_resume) #endif /* CONFIG_ARCH_OMAP4 */ @@ -380,8 +374,6 @@ ENTRY(omap_do_wfi) nop ldmfd sp!, {pc} -ppa_zero_params_offset: - .long ppa_zero_params - . ENDPROC(omap_do_wfi) .data From patchwork Sat Aug 5 20:52:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109500 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp992216qge; Sat, 5 Aug 2017 13:54:14 -0700 (PDT) X-Received: by 10.99.44.10 with SMTP id s10mr6559549pgs.116.1501966453870; Sat, 05 Aug 2017 13:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966453; cv=none; d=google.com; s=arc-20160816; b=PwIMQOwl72/a3G5DulF/esYl5CNu1orwvWJgWmU9ZlARpnGo1bdfp+76WzVJ3UuUIV NBuCDPf9dZBDkp7gj5ZNUqb9/2hsOMerjdwyGyXFP48+QIPlvtXb5G2E2aW8MRjMZZHL XuRZzRrAdLciizby4V/a+s+MYzrD8sxKHz9iw8htGyd3SwYn+VNdAr6/UXVFE3XEC3sM j6JmFlzOiSJq0YGQBHWQrvo5DPTVEJqhA6EwGcT3KA+UlyAzfcas3/uuajhnFiHGpbZQ /HcuqgEWjK/MsL5UC+y3tOziiM9IAH4UoXS/6Lw56uUzXyloJIq8i/MDh9BjWYyavLbs fbwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=bdDto/obCG/gBgUNRyeEkSHviAXjgrnreSPYvucE9dg=; b=m8aBtNLWtNErZCU19DQXjYQhIxvnGIY6+6ghQdpGx4IsPw77ww+d0OPDuEebj4TAH5 QTJU074EgUpdQWnGlGo2D8NQvLWLNAgdX4jlai4EKwlsbsf0tnucVmwtcH9Wmvaa4b6k X5mTScc5ZflriiS9pY2FvPzswxXlwfwXYXaznVQxMRfC80SYLiSVm6fIPSUHPADZyLbm U99DHVD5vEX3O2Zx0WcvlG+sie7VFaP0xgfMo1rORTZ0/2095dqQ77Sm1YtwuoyZ7KZ/ W7z5AkL1/pqwifh0vTYRiTL5Gj2TbR21rmvA9Cgrbu5Nm1l7IAwiKVsCyt8443NNU6ci VZVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=aSi3DI8V; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si3018685plk.487.2017.08.05.13.54.13; Sat, 05 Aug 2017 13:54:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=aSi3DI8V; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752802AbdHEUyG (ORCPT + 3 others); Sat, 5 Aug 2017 16:54:06 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:35113 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752863AbdHEUxx (ORCPT ); Sat, 5 Aug 2017 16:53:53 -0400 Received: by mail-wm0-f42.google.com with SMTP id m85so42483267wma.0 for ; Sat, 05 Aug 2017 13:53:52 -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=74NmevsJMIrPT9ZeoMsM1IJHz3SOXbrLKfcHj8sa8k0=; b=aSi3DI8VxF8vdyaFBxqnqB0IwrbLo51k9BA6262w6d3gH/6SbAyA2qzwxcdgzC8PsV OUSK3VyVTPRVEts32xsRJ8E5028DzvDgf+Yg5t2AvRhBqIG6Mi2OculohpwSxFN+If3Z PqnDgc8tR9ri0Bib4UNni1AXv9h4wwDtVMOAw= 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=74NmevsJMIrPT9ZeoMsM1IJHz3SOXbrLKfcHj8sa8k0=; b=ssLbs4FR4XZDOJ2ZMGJ9Q4hxPnXR0lKxRkmfgCOtWl5bUgPxEWrHm7HBNeE27wbjcf c8eMWdWruFZye9zfZ/VSfMlUGA4MYnnu7AcwrKStNnIuDHGKQ8Om1iSOv4uEIrFYbEYq Dz+mHlG+nTa1e15/3ap1kZV3G+2j61D7Hkwul7WV4bq18NsVF5Gx39CAlb0zeNqy1Ohg RbMSNw/cOhZuTJbbpYN3Zeb35/yma+1O32fJsTVz2N2LTsXVwHVjYd5xZMIJm5tmt+8U 0K2QjSwUACcxtkwv72ZWcvXUQjqYNW8EtEVeHQpxmcJJIaddXjCK5/7p/fxYBpk0hlVl zOuw== X-Gm-Message-State: AHYfb5iUGdnIaKB/XbPD3TzGdXuvuYWQI00Jl80rNdwE68vsa5YnFB47 MebQpB8BAo8kDcJE X-Received: by 10.28.100.136 with SMTP id y130mr4574673wmb.60.1501966431977; Sat, 05 Aug 2017 13:53:51 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:51 -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 13/15] arm-soc: various: replace open coded VA->PA calculation of pen_release Date: Sat, 5 Aug 2017 21:52:20 +0100 Message-Id: <20170805205222.19868-14-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 This replaces a few copies of the open coded calculations of the physical address of 'pen_release' in the secondary startup code of a couple of platforms. Signed-off-by: Ard Biesheuvel --- arch/arm/mach-prima2/headsmp.S | 11 +++-------- arch/arm/mach-spear/headsmp.S | 11 +++-------- arch/arm/mach-sti/headsmp.S | 10 +++------- arch/arm/plat-versatile/headsmp.S | 9 +-------- 4 files changed, 10 insertions(+), 31 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-prima2/headsmp.S b/arch/arm/mach-prima2/headsmp.S index 209d9fc5c16c..070df700bb38 100644 --- a/arch/arm/mach-prima2/headsmp.S +++ b/arch/arm/mach-prima2/headsmp.S @@ -9,6 +9,8 @@ #include #include +#include + /* * SIRFSOC specific entry point for secondary CPUs. This provides * a "holding pen" into which all secondary cores are held until we're @@ -17,10 +19,7 @@ ENTRY(sirfsoc_secondary_startup) mrc p15, 0, r0, c0, c0, 5 and r0, r0, #15 - adr r4, 1f - ldmia r4, {r5, r6} - sub r4, r4, r5 - add r6, r6, r4 + adr_l r6, pen_release pen: ldr r7, [r6] cmp r7, r0 bne pen @@ -31,7 +30,3 @@ pen: ldr r7, [r6] */ b secondary_startup ENDPROC(sirfsoc_secondary_startup) - - .align -1: .long . - .long pen_release diff --git a/arch/arm/mach-spear/headsmp.S b/arch/arm/mach-spear/headsmp.S index c52192dc3d9f..4da01b103f33 100644 --- a/arch/arm/mach-spear/headsmp.S +++ b/arch/arm/mach-spear/headsmp.S @@ -13,6 +13,8 @@ #include #include +#include + __INIT /* @@ -23,10 +25,7 @@ ENTRY(spear13xx_secondary_startup) mrc p15, 0, r0, c0, c0, 5 and r0, r0, #15 - adr r4, 1f - ldmia r4, {r5, r6} - sub r4, r4, r5 - add r6, r6, r4 + adr_l r6, pen_release pen: ldr r7, [r6] cmp r7, r0 bne pen @@ -40,8 +39,4 @@ pen: ldr r7, [r6] * should now contain the SVC stack for this core */ b secondary_startup - - .align -1: .long . - .long pen_release ENDPROC(spear13xx_secondary_startup) diff --git a/arch/arm/mach-sti/headsmp.S b/arch/arm/mach-sti/headsmp.S index e0ad451700d5..cdf3442f397b 100644 --- a/arch/arm/mach-sti/headsmp.S +++ b/arch/arm/mach-sti/headsmp.S @@ -16,6 +16,8 @@ #include #include +#include + /* * ST specific entry point for secondary CPUs. This provides * a "holding pen" into which all secondary cores are held until we're @@ -24,10 +26,7 @@ ENTRY(sti_secondary_startup) mrc p15, 0, r0, c0, c0, 5 and r0, r0, #15 - adr r4, 1f - ldmia r4, {r5, r6} - sub r4, r4, r5 - add r6, r6, r4 + adr_l r6, pen_release pen: ldr r7, [r6] cmp r7, r0 bne pen @@ -38,6 +37,3 @@ pen: ldr r7, [r6] */ b secondary_startup ENDPROC(sti_secondary_startup) - -1: .long . - .long pen_release diff --git a/arch/arm/plat-versatile/headsmp.S b/arch/arm/plat-versatile/headsmp.S index 40f27e52de75..0f2a5eddac5a 100644 --- a/arch/arm/plat-versatile/headsmp.S +++ b/arch/arm/plat-versatile/headsmp.S @@ -21,10 +21,7 @@ ENTRY(versatile_secondary_startup) ARM_BE8(setend be) mrc p15, 0, r0, c0, c0, 5 bic r0, #0xff000000 - adr r4, 1f - ldmia r4, {r5, r6} - sub r4, r4, r5 - add r6, r6, r4 + adr_l r6, pen_release pen: ldr r7, [r6] cmp r7, r0 bne pen @@ -34,8 +31,4 @@ pen: ldr r7, [r6] * should now contain the SVC stack for this core */ b secondary_startup - - .align -1: .long . - .long pen_release ENDPROC(versatile_secondary_startup) From patchwork Sat Aug 5 20:52:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109499 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp992150qge; Sat, 5 Aug 2017 13:54:07 -0700 (PDT) X-Received: by 10.99.117.67 with SMTP id f3mr6700395pgn.258.1501966447473; Sat, 05 Aug 2017 13:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966447; cv=none; d=google.com; s=arc-20160816; b=w9yRSvuvxQ3T56GHSfttt14HAT/x2N/UQcCuyXu02pYyfKRpjs+X3zoKlsWnyVsMAT 8Qaks31s0LKwuSQdq7ZPTmwigmdfNOd5Nv7UfFkxmdstDelHa92eE61MdN0QBio7nbIE 619W154qsARQDpSimEu06sgcPv/QFIudZp4rx78AG4BkZTiIbUnPLykeKkM3S3k8N5PP m1+U5PRJnd8WECxrTwrSSBiSefijpNgE9FCfLdK3s7+MphNGLMIvdZVgB30SfTe62A1e 81cCJErdHCGJyjxsZDNam6uxEgrX4wQ+8piNaChu5WuOWtj95BgAmGqHTg8RZM94dWhI avSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=3qITjTS8Anzieb3Mw1v9k/GrTNgk8e9M6TfQmdleqN4=; b=BFAGSN0pDCKgOlglcrlOWpq/NR3/wSE95nNyQUGOpKxOxYoBNzzjy1C2nN3JgxVluN FQDNrBuT6kM+fmhyYSAC6dvNDCYMsNeQhN4YW7J7oMpevY/6Vh62Y29PoesE3H/Dgwvu v1dHCl1xH4MzPU/M7P8D5/BrxrYV92GzYTY4jJGBzsTItwyi8TeHAjkNKmZAsxJ3YGQv 89N0xQ03oqeElW16JFz72WerYjcmP7ZGYMoDCtks0VSnC1WnXrEnNiQjHnxQAd+A+e7O iQ1k3NqJo8CsbJYeZnlLxJiahjgBxCnogkNRT9UIvaLIrMXwmQuf3FagtO/6PnR9jyOe Q7vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=MiX1R5+g; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si3018685plk.487.2017.08.05.13.54.07; Sat, 05 Aug 2017 13:54:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=MiX1R5+g; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752104AbdHEUyE (ORCPT + 3 others); Sat, 5 Aug 2017 16:54:04 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:38579 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752840AbdHEUx4 (ORCPT ); Sat, 5 Aug 2017 16:53:56 -0400 Received: by mail-wm0-f53.google.com with SMTP id m85so42574146wma.1 for ; Sat, 05 Aug 2017 13:53:56 -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=HgtvlHtjxVQtYXstO0AYX5efYHzWsBFgWdEFzZ6J5m8=; b=MiX1R5+g9uw7R63eTtwF0t1sTWTfaQw7RpJHNyBCFaoUyJ+BkM52E1Au3Tz1XVza5s WyStk+mg8aJa9Na7yiljVgDo4zyVkv/tLUFVAqmSDLk8/srbSCaW1+h61hjhWI/4egci PF2BmCevVmzd+R53Uky3ium2sNqstliCzqTOs= 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=HgtvlHtjxVQtYXstO0AYX5efYHzWsBFgWdEFzZ6J5m8=; b=h8l2y8dFppa1dpZB8s/8vGoxh9IqDsX2cdbsySrlX4zpz4YCe2SGkwPaoh/0V5dPLP JI0ngGuVaaoJUguOFfMwnJUVRHkuyHPFMcgjKD5b2lN3PMNU0fZ8NxWM+TY/6MWnNu8F 3BgTSDM+fGls/hiRYS+qUIxBcvHQu2CO84vZdm+HAMCIBe5kk1Fhz3ixr64X0wrC3sC7 CJzXQ72TZWx/oWpccl2f609jMFkvoloUc8JrsdBJuZ2Y8yifjR6Ru1sGM2FF3ehu/z7C mA2rrnAC/09NOEqXvvK1rLRKaPWdKhXhsaMH8mfMDHVG+9auSJhS4iPxL0FLq3koiJzK upaA== X-Gm-Message-State: AHYfb5iFBTG6Fz7v2Uj4l9ZCl3A8l1lp3Xk/jZvmVj0eanULCCv7X94g ARxkdAp89oOg7VXP X-Received: by 10.28.181.18 with SMTP id e18mr4287563wmf.157.1501966435763; Sat, 05 Aug 2017 13:53:55 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:54 -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 14/15] arm-soc: shmobile: replace open coded VA->PA calculation Date: Sat, 5 Aug 2017 21:52:21 +0100 Message-Id: <20170805205222.19868-15-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 This replaces a couple of open coded calculations to obtain the physical address of a far symbol with calls to the new adr_l etc macros. Signed-off-by: Ard Biesheuvel --- arch/arm/mach-shmobile/headsmp.S | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S index 32e0bf6e3ccb..f5e0d7c93cda 100644 --- a/arch/arm/mach-shmobile/headsmp.S +++ b/arch/arm/mach-shmobile/headsmp.S @@ -46,11 +46,10 @@ ENTRY(shmobile_smp_boot) and r0, r1, #0xffffff @ MPIDR_HWID_BITMASK @ r0 = cpu_logical_map() value mov r1, #0 @ r1 = CPU index - adr r2, 1f - ldmia r2, {r5, r6, r7} - add r5, r5, r2 @ array of per-cpu mpidr values - add r6, r6, r2 @ array of per-cpu functions - add r7, r7, r2 @ array of per-cpu arguments + + adr_l r5, shmobile_smp_mpidr @ array of per-cpu mpidr values + adr_l r6, shmobile_smp_fn @ array of per-cpu functions + adr_l r7, shmobile_smp_arg @ array of per-cpu arguments shmobile_smp_boot_find_mpidr: ldr r8, [r5, r1, lsl #2] @@ -78,11 +77,6 @@ ENTRY(shmobile_smp_sleep) b shmobile_smp_boot ENDPROC(shmobile_smp_sleep) - .align 2 -1: .long shmobile_smp_mpidr - . - .long shmobile_smp_fn - 1b - .long shmobile_smp_arg - 1b - .bss .globl shmobile_smp_mpidr shmobile_smp_mpidr: From patchwork Sat Aug 5 20:52:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109501 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp992268qge; Sat, 5 Aug 2017 13:54:19 -0700 (PDT) X-Received: by 10.84.215.215 with SMTP id g23mr7945585plj.114.1501966458994; Sat, 05 Aug 2017 13:54:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966458; cv=none; d=google.com; s=arc-20160816; b=nCk2MsRUBolWYLiu83tdbCc0AEPPu9q7cWVA2xG5i3AW8q+yGhOyHPWYZh/VTV74OH IrayT+PhyxjRHxcOaC7/c2NIw0GJgXY1KaKRQ2UdL5LckDnoi9aK4kBWl/o0JZQr51dI ry48qGJSYahnhcvDtI4vMyQGAynrtWy8iaWDpeveS+rTEqQiWOJq9IksBAi29qRtRP74 MOUnXnP86iVXiBETXt6NjCjz1j9P+s39WSk0hNMO8fGq1lxvqlp4V4ZvDrNpxgiwjXrl yAw4D9/01CDED3oO89r/t5cFrSYT/IQUqPFwGqNzUmOrwroXKVMPqMbi2YPwL3MM1XMP rYAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=T/PsXQqM5A3LGSBbxuXLXcsqQYo6hGK3Qehd5wDJ7N4=; b=CmZRvyB0quv3Y/jExFe0Cm9BNI679lED6sW/pDwwjqZEpJt9vr98aDU0q3npN2rZXn uRxox/9BXLSAme3Ka1dbO6T1obIsII06PfRV73gbswXxaVVrU/+Y1cU69s7F2QIrJFBY o5XEYHqfoVQKMC4fbqc0c6Q6rDMSWky5qvnVCVX7p3tp+Yc/Nc/rx52oKHOSHS4rRHvr dnU7HHf5WT5ICeFO0CtGu7zi2ZiVyAWANb6rQUKG9Q6+B/BFOQKzeDnpXc82y1y+/k6G SEdQXjQv5F+960+MAVJA1DKP0cnLxT9d0m6zQZ3Sm6IXzmDF9uZp0ZYxU/uvzrU2/xTf g7eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=NWdfPLQM; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si2667268pfg.662.2017.08.05.13.54.18; Sat, 05 Aug 2017 13:54:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=NWdfPLQM; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752863AbdHEUyQ (ORCPT + 3 others); Sat, 5 Aug 2017 16:54:16 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:35894 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752917AbdHEUyA (ORCPT ); Sat, 5 Aug 2017 16:54:00 -0400 Received: by mail-wm0-f45.google.com with SMTP id t201so42452514wmt.1 for ; Sat, 05 Aug 2017 13:54:00 -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=aBJ+ZJYVVJY5UPy7n00EgotUih+BsL7WsvuLTx2gZQg=; b=NWdfPLQM2bISR0rlD0h0pabm8BPpYKjrxWHOXNSe2j0Vbb/6V+WX2wAE+wZGPsQmB2 sYLtUMfmEzq4vTo9+9w+eXxeMpwfisJBiQ601z4SReXZduJ9lTvhzKWnv1Ce13LMB6NY 2WhI9T3kESjDDgstW/J34MGZfckgsk1g0ON+g= 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=aBJ+ZJYVVJY5UPy7n00EgotUih+BsL7WsvuLTx2gZQg=; b=n25A2vtRD7pgk7R7O8VBxHvsXfWoCRFHKkpMBrYDDmFORXW0K3uMCt8XQUdx141gtB ZIEi297ChEhoHzqDXW07vcc7KhaXbyPnlPRT/F8swWv8iXcUFYfp4XKC3ZXjdAa31+ZR 9nzHW8e027Kyi0+/URX3RPmfvxCp3QF30dkNJlOhoDcXzhQma/+KMMp7s9YgBeRiPkuZ ldkh5DJpDQEsDjwtK0wT2dgDvcx2Hq9VEV7BwjSXLJsS/SQKhKxHoUnOWyCfy7HFKomK fIp7mO/JEH+U4bwxzTUE4SdmIuscJsmH/HbLeVd+0YHxZwfzpZbvDSrNrBOFLXcV2m3s awHQ== X-Gm-Message-State: AHYfb5jmop8lNsFSQURBhiFhoN/xbCM3san3NQD8oZ3+jaIKreYzpL/q NKjsNqd0JgUqZhLj X-Received: by 10.28.236.221 with SMTP id h90mr1674149wmi.143.1501966439709; Sat, 05 Aug 2017 13:53:59 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:58 -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 15/15] ARM: l2c: replace open coded VA->PA calculation Date: Sat, 5 Aug 2017 21:52:22 +0100 Message-Id: <20170805205222.19868-16-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 This replaces an open coded calculation to obtain the physical address of a far symbol with a call to the new adr_l macro. Signed-off-by: Ard Biesheuvel --- arch/arm/mm/l2c-l2x0-resume.S | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mm/l2c-l2x0-resume.S b/arch/arm/mm/l2c-l2x0-resume.S index fda415e4ca8f..3e75aa8c1aff 100644 --- a/arch/arm/mm/l2c-l2x0-resume.S +++ b/arch/arm/mm/l2c-l2x0-resume.S @@ -12,9 +12,7 @@ .text ENTRY(l2c310_early_resume) - adr r0, 1f - ldr r2, [r0] - add r0, r2, r0 + adr_l r0, l2x0_saved_regs ldmia r0, {r1, r2, r3, r4, r5, r6, r7, r8} @ r1 = phys address of L2C-310 controller @@ -54,6 +52,3 @@ ENTRY(l2c310_early_resume) str r9, [r1, #L2X0_CTRL] ret lr ENDPROC(l2c310_early_resume) - - .align -1: .long l2x0_saved_regs - .