aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/bnxt_re/main.c
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2021-08-02 15:07:33 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2021-08-05 14:10:32 +0100
commite130338eed5de0f5b6b913e8619d096153cbccb0 (patch)
treeaa4681d633783b702493b6dcfc97579dd7083723 /drivers/infiniband/hw/bnxt_re/main.c
parentarm64: entry: move bulk of ret_to_user to C (diff)
downloadlinux-dev-e130338eed5de0f5b6b913e8619d096153cbccb0.tar.xz
linux-dev-e130338eed5de0f5b6b913e8619d096153cbccb0.zip
arm64: entry: call exit_to_user_mode() from C
When handling an exception from EL0, we perform the entry work in that exception's C handler, and once the C handler has finished, we return back to the entry assembly. Subsequently in the common `ret_to_user` assembly we perform the exit work that balances with the entry work. This can be somewhat difficult to follow, and makes it hard to rework the return paths (e.g. to pass additional context to the exit code, or to have exception return logic for specific exceptions). This patch reworks the entry code such that each EL0 C exception handler is responsible for both the entry and exit work. This clearly balances the two (and will permit additional variation in future), and avoids an unnecessary bounce between assembly and C in the common case, leaving `ret_from_fork` as the only place assembly has to call the exit code. This means that the exit work is now inlined into the C handler, which is already the case for the entry work, and allows the compiler to generate better code (e.g. by immediately returning when there is no exit work to perform). To align with other exception entry/exit helpers, enter_from_user_mode() is updated to take the EL0 pt_regs as a parameter, though this is currently unused. There should be no functional change as a result of this patch. However, this should lead to slightly better backtraces when an error is encountered within do_notify_resume(), as the C handler should appear in the backtrace, indicating the specific exception that the kernel was entered with. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: James Morse <james.morse@arm.com> Cc: Joey Gouly <joey.gouly@arm.com> Cc: Marc Zyngier <maz@kernel.org> Cc: Will Deacon <will@kernel.org> Reviewed-by: Joey Gouly <joey.gouly@arm.com> Link: https://lore.kernel.org/r/20210802140733.52716-5-mark.rutland@arm.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'drivers/infiniband/hw/bnxt_re/main.c')
0 files changed, 0 insertions, 0 deletions