[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c0f19f86-043b-470a-9196-06323974ac54@zytor.com>
Date: Fri, 14 Nov 2025 13:08:58 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: Uros Bizjak <ubizjak@...il.com>,
Alexey Makhalov <alexey.makhalov@...adcom.com>
Cc: "Jason A. Donenfeld" <Jason@...c4.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
"Theodore Ts'o" <tytso@....edu>,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
Xin Li <xin@...or.com>, Andrew Cooper <andrew.cooper3@...rix.com>,
Andy Lutomirski <luto@...nel.org>, Ard Biesheuvel <ardb@...nel.org>,
Borislav Petkov <bp@...en8.de>, Brian Gerst <brgerst@...il.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>, James Morse <james.morse@....com>,
Jarkko Sakkinen <jarkko@...nel.org>,
Josh Poimboeuf <jpoimboe@...nel.org>, Kees Cook <kees@...nel.org>,
Nam Cao <namcao@...utronix.de>, Oleg Nesterov <oleg@...hat.com>,
Perry Yuan <perry.yuan@....com>, Thomas Gleixner <tglx@...utronix.de>,
Thomas Huth <thuth@...hat.com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-sgx@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH v2 7/9] x86/vdso: abstract out vdso system call internals
On 2025-11-13 20:40, H. Peter Anvin wrote:
>
> For 64 bits, if you need frame pointer support *and* frob %rsp, using:
>
> xchg %[arg],%%rbp
> <stuff>
> xchg %[arg],%%rbp
>
> ... is probably easiest, with %[arg] in a register.
>
Incidentally, ORC is one thing, but if you need DWARF information to be
correct for user space, it is definitely "fun". With the xchg hack for 64
bits it is just a matter of using .cfi_def_cfa_register to change the frame
pointer around, but in the 32-bit case the best I could come up with was:
.cfi_remember_state
push %ebp
.cfi_escape 0x0f,3,0x74,0,0x06 // CFA address in *%esp
mov %eax, %ebp
mov $syscall_no, %eax
int $0x80
pop %ebp
.cfi_restore_state
Note that in both cases you need to *NOT* put in any of these CFI directives
when compiling without frame pointers (in which case you need to let gcc take
care of it if you want any hope of getting the CFI correct.)
-hpa
Powered by blists - more mailing lists