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

From: Juergen Gross
Date: Fri Apr 04 2025 - 11:04:14 EST


On 04.04.25 16:46, Josh Poimboeuf wrote:
On Fri, Apr 04, 2025 at 12:49:38PM +0200, Peter Zijlstra wrote:
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?

Is there any reason to have INSN_SYSCALL in the first place?


xen_hypercall_pv() needs a syscall which will return after the call of
the hypervisor.

xen_iret() is a special case where the syscall won't return.

Whether objtool has a need for special casing it is another question I
don't feel qualified to answer.


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature