]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: OMAP2+: Fix regression for smc calls for vmap stack
authorTony Lindgren <tony@atomide.com>
Thu, 31 Mar 2022 17:17:37 +0000 (20:17 +0300)
committerArnd Bergmann <arnd@arndb.de>
Thu, 31 Mar 2022 20:41:27 +0000 (22:41 +0200)
commit3abfe424f0c824e120975515f360302f2e8641dc
treeae07f989398251aff6247e8b8dae60e62916a00c
parentad4c02722a89e6725853abc26cd8f0c1d77316af
ARM: OMAP2+: Fix regression for smc calls for vmap stack

Commit 70d164697fc0 ("ARM: implement THREAD_INFO_IN_TASK for uniprocessor
systems") started triggering an issue with smc calls hanging on boot as
VMAP_STACK is now enabled by default.

Based on discussions on the #armlinux irc channel, Arnd noticed that omaps
are using __pa() for stack for smc calls. This does not work with vmap
stack.

Let's fix the issue by changing the param arrays to use static param[5] for
each function for __pa() to work. This consumes a bit more memory compared
to adding a single static buffer, but avoids potential races with the smc
calls initializing the shared buffer. For omap_secure_dispatcher(), we need
to use a cpu specific buffer as there's nothing currently ensuring it only
gets called from cpu0.

Fixes: 70d164697fc0 ("ARM: implement THREAD_INFO_IN_TASK for uniprocessor systems")
Link: https://lore.kernel.org/r/20220331171737.48211-1-tony@atomide.com
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/mach-omap2/omap-secure.c