Re: [PATCH] objtool: Fix SYSCALL instruction handling and INSN_CONTEXT_SWITCH

From: Peter Zijlstra
Date: Fri Apr 04 2025 - 06:49:48 EST


On Thu, Apr 03, 2025 at 11:48:13AM -0700, Josh Poimboeuf wrote:

> The real problem here is that INSN_CONTEXT_SWITCH is ambiguous. It can
> represent both call semantics (SYSCALL, SYSENTER) and return semantics
> (SYSRET, IRET, RETS, RETU). Those differ significantly: calls preserve
> control flow whereas returns terminate it.

Does that not rather suggest we should perhaps have INSN_SYSCALL /
INSN_SYSRET to replace the single ambiguous thing?