From: Gaosheng Cui <cuigaosheng1@huawei.com> To: <linux@armlinux.org.uk>, <krzysztof.kozlowski@canonical.com>, <andrew@lunn.ch>, <gregory.clement@bootlin.com>, <sebastian.hesselbarth@gmail.com>, <vireshk@kernel.org>, <shiraz.linux.kernel@gmail.com>, <soc@kernel.org>, <linus.walleij@linaro.org>, <ardb@kernel.org>, <cuigaosheng1@huawei.com> Cc: <linux-arm-kernel@lists.infradead.org>, <linux-samsung-soc@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <gongruiqi1@huawei.com>, <wangweiyang2@huawei.com> Subject: [PATCH -next 1/3] arm-soc: exynos: replace open coded VA->PA conversions Date: Sat, 18 Dec 2021 16:58:41 +0800 [thread overview] Message-ID: <20211218085843.212497-2-cuigaosheng1@huawei.com> (raw) In-Reply-To: <20211218085843.212497-1-cuigaosheng1@huawei.com> From: Ard Biesheuvel <ard.biesheuvel@linaro.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 <ard.biesheuvel@linaro.org> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> --- arch/arm/mach-exynos/headsmp.S | 9 +-------- arch/arm/mach-exynos/sleep.S | 26 +++++--------------------- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/arch/arm/mach-exynos/headsmp.S b/arch/arm/mach-exynos/headsmp.S index 0ac2cb9a7355..be7cd0eebe1d 100644 --- a/arch/arm/mach-exynos/headsmp.S +++ b/arch/arm/mach-exynos/headsmp.S @@ -19,10 +19,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, exynos_pen_release pen: ldr r7, [r6] cmp r7, r0 bne pen @@ -33,7 +30,3 @@ pen: ldr r7, [r6] */ b secondary_startup ENDPROC(exynos4_secondary_startup) - - .align 2 -1: .long . - .long exynos_pen_release diff --git a/arch/arm/mach-exynos/sleep.S b/arch/arm/mach-exynos/sleep.S index ed93f91853b8..ed27515a4458 100644 --- a/arch/arm/mach-exynos/sleep.S +++ b/arch/arm/mach-exynos/sleep.S @@ -8,6 +8,7 @@ #include <linux/linkage.h> #include <asm/asm-offsets.h> +#include <asm/assembler.h> #include <asm/hardware/cache-l2x0.h> #include "smc.h" @@ -54,19 +55,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] @@ -85,9 +80,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] @@ -106,15 +99,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 .align 2 .globl cp15_save_diag -- 2.30.0
WARNING: multiple messages have this Message-ID (diff)
From: Gaosheng Cui <cuigaosheng1@huawei.com> To: <linux@armlinux.org.uk>, <krzysztof.kozlowski@canonical.com>, <andrew@lunn.ch>, <gregory.clement@bootlin.com>, <sebastian.hesselbarth@gmail.com>, <vireshk@kernel.org>, <shiraz.linux.kernel@gmail.com>, <soc@kernel.org>, <linus.walleij@linaro.org>, <ardb@kernel.org>, <cuigaosheng1@huawei.com> Cc: <linux-arm-kernel@lists.infradead.org>, <linux-samsung-soc@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <gongruiqi1@huawei.com>, <wangweiyang2@huawei.com> Subject: [PATCH -next 1/3] arm-soc: exynos: replace open coded VA->PA conversions Date: Sat, 18 Dec 2021 16:58:41 +0800 [thread overview] Message-ID: <20211218085843.212497-2-cuigaosheng1@huawei.com> (raw) In-Reply-To: <20211218085843.212497-1-cuigaosheng1@huawei.com> From: Ard Biesheuvel <ard.biesheuvel@linaro.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 <ard.biesheuvel@linaro.org> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> --- arch/arm/mach-exynos/headsmp.S | 9 +-------- arch/arm/mach-exynos/sleep.S | 26 +++++--------------------- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/arch/arm/mach-exynos/headsmp.S b/arch/arm/mach-exynos/headsmp.S index 0ac2cb9a7355..be7cd0eebe1d 100644 --- a/arch/arm/mach-exynos/headsmp.S +++ b/arch/arm/mach-exynos/headsmp.S @@ -19,10 +19,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, exynos_pen_release pen: ldr r7, [r6] cmp r7, r0 bne pen @@ -33,7 +30,3 @@ pen: ldr r7, [r6] */ b secondary_startup ENDPROC(exynos4_secondary_startup) - - .align 2 -1: .long . - .long exynos_pen_release diff --git a/arch/arm/mach-exynos/sleep.S b/arch/arm/mach-exynos/sleep.S index ed93f91853b8..ed27515a4458 100644 --- a/arch/arm/mach-exynos/sleep.S +++ b/arch/arm/mach-exynos/sleep.S @@ -8,6 +8,7 @@ #include <linux/linkage.h> #include <asm/asm-offsets.h> +#include <asm/assembler.h> #include <asm/hardware/cache-l2x0.h> #include "smc.h" @@ -54,19 +55,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] @@ -85,9 +80,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] @@ -106,15 +99,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 .align 2 .globl cp15_save_diag -- 2.30.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-12-18 8:57 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-12-18 8:58 [PATCH -next 0/3] replace open coded VA->PA calculation Gaosheng Cui 2021-12-18 8:58 ` Gaosheng Cui 2021-12-18 8:58 ` Gaosheng Cui [this message] 2021-12-18 8:58 ` [PATCH -next 1/3] arm-soc: exynos: replace open coded VA->PA conversions Gaosheng Cui 2021-12-18 8:58 ` [PATCH -next 2/3] arm-soc: mvebu: replace open coded VA->PA conversion Gaosheng Cui 2021-12-18 8:58 ` Gaosheng Cui 2021-12-18 8:58 ` [PATCH -next 3/3] arm-soc: various: replace open coded VA->PA calculation Gaosheng Cui 2021-12-18 8:58 ` Gaosheng Cui 2021-12-20 15:39 ` [PATCH -next 0/3] " Arnd Bergmann 2021-12-20 15:39 ` Arnd Bergmann 2021-12-20 18:06 ` Andrew Lunn 2021-12-20 18:06 ` Andrew Lunn 2021-12-20 18:16 ` Ard Biesheuvel 2021-12-20 18:16 ` Ard Biesheuvel 2021-12-21 1:41 ` cuigaosheng 2021-12-21 1:41 ` cuigaosheng 2021-12-21 9:15 ` Arnd Bergmann 2021-12-21 9:15 ` Arnd Bergmann 2021-12-22 2:31 ` Linus Walleij 2021-12-22 2:31 ` Linus Walleij 2021-12-22 9:29 ` Ard Biesheuvel 2021-12-22 9:29 ` Ard Biesheuvel 2021-12-24 4:05 ` Linus Walleij 2021-12-24 4:05 ` Linus Walleij
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20211218085843.212497-2-cuigaosheng1@huawei.com \ --to=cuigaosheng1@huawei.com \ --cc=andrew@lunn.ch \ --cc=ardb@kernel.org \ --cc=gongruiqi1@huawei.com \ --cc=gregory.clement@bootlin.com \ --cc=krzysztof.kozlowski@canonical.com \ --cc=linus.walleij@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-samsung-soc@vger.kernel.org \ --cc=linux@armlinux.org.uk \ --cc=sebastian.hesselbarth@gmail.com \ --cc=shiraz.linux.kernel@gmail.com \ --cc=soc@kernel.org \ --cc=vireshk@kernel.org \ --cc=wangweiyang2@huawei.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.