riscv: lib: uaccess: fold fixups into body
authorJisheng Zhang <jszhang@kernel.org>
Thu, 18 Nov 2021 11:25:14 +0000 (19:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2022 15:16:36 +0000 (17:16 +0200)
commit093cb743dcadc83d3923db88a9bad93f3d8bb706
tree076cd5f609ada78280b6b1198afbe309294020f1
parent9de35edff035026e924f8b01b4bc223db25ded37
riscv: lib: uaccess: fold fixups into body

[ Upstream commit 9d504f9aa5c1b76673018da9503e76b351a24b8c ]

uaccess functions such __asm_copy_to_user(),  __arch_copy_from_user()
and __clear_user() place their exception fixups in the `.fixup` section
without any clear association with themselves. If we backtrace the
fixup code, it will be symbolized as an offset from the nearest prior
symbol.

Similar as arm64 does, we must move fixups into the body of the
functions themselves, after the usual fast-path returns.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/lib/uaccess.S