Thread (3 messages) 3 messages, 2 authors, 2022-03-31

Re: [PATCH] ARM: OMAP2+: Fix regression for smc calls for vmap stack

From: Arnd Bergmann <arnd@arndb.de>
Date: 2022-03-31 15:28:52
Also in: linux-omap

On Thu, Mar 31, 2022 at 4:42 PM Tony Lindgren [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
--- a/arch/arm/mach-omap2/omap-secure.c
+++ b/arch/arm/mach-omap2/omap-secure.c
@@ -59,8 +59,8 @@ static void __init omap_optee_init_check(void)
 u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs, u32 arg1, u32 arg2,
                                                         u32 arg3, u32 arg4)
 {
+       static u32 param[5];
        u32 ret;
-       u32 param[5];
I think for this one, you do need to use a DEFINE_PER_CPU() to make it
work when multiple cores run into the function concurrently. This is entered
on OMAP44xx from irq_notifier() with cmd==CPU_CLUSTER_PM_ENTER
and from start_secondary(). I suspect that one can show these never happen
on more than one CPU at a time, but I have not been able to prove that
myself.
quoted hunk ↗ jump to hunk
@@ -119,8 +119,8 @@ phys_addr_t omap_secure_ram_mempool_base(void)
 #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
 u32 omap3_save_secure_ram(void __iomem *addr, int size)
 {
+       static u32 param[5];
        u32 ret;
-       u32 param[5];

        if (size != OMAP3_SAVE_SECURE_RAM_SZ)
                return OMAP3_SAVE_SECURE_RAM_SZ;
@@ -153,8 +153,8 @@ u32 omap3_save_secure_ram(void __iomem *addr, int size)
 u32 rx51_secure_dispatcher(u32 idx, u32 process, u32 flag, u32 nargs,
                           u32 arg1, u32 arg2, u32 arg3, u32 arg4)
 {
+       static u32 param[5];
        u32 ret;
-       u32 param[5];

        param[0] = nargs+1; /* RX-51 needs number of arguments + 1 */
        param[1] = arg1;
These look good, as they are clearly only run on single-core SoCs
with preemption disabled.

         Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help