Re: [PATCH] entry: always inline local_irq_{enable,disable}_exit_to_user()

From: Peter Zijlstra

Date: Fri Dec 05 2025 - 10:10:57 EST


On Fri, Dec 05, 2025 at 05:03:33AM -0800, Eric Dumazet wrote:

> > Earlier Zen with RET mitigation? ;-)
>
> This was AMD Rome "AMD EPYC 7B12 64-Core Processor",
> bu also AMDTurin "AMD EPYC 9B45 128-Core Processor" to a certain extent.
>
> When you say RET mitigation, this is the five int3 after retq, right ?

Nope, that one is SLS, AMD has BTB type confusion on return prediction
(the AMD RetBleed) and patches all the RET sites with jumps to
retbleed_return_thunk(), or one of the srso*return_thunk() thingies. All
are somewhat expensive.

So while normally CALL+RET is well optimized and hardly noticeable, the
moment your uarch needs one of these return thunks, you're going to
notice them.