Re: [RFC PATCH v2 04/10] lib: vdso: get pointer to vdso data from the arch
From: Andy Lutomirski <luto@kernel.org>
Date: 2019-12-24 02:27:56
Also in:
linux-arm-kernel, linux-mips, lkml
From: Andy Lutomirski <luto@kernel.org>
Date: 2019-12-24 02:27:56
Also in:
linux-arm-kernel, linux-mips, lkml
On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy [off-list ref] wrote:
On powerpc, __arch_get_vdso_data() clobbers the link register, requiring the caller to set a stack frame in order to save it. As the parent function already has to set a stack frame and save the link register to call the C vdso function, retriving the vdso data pointer there is lighter.
I'm confused. Can't you inline __arch_get_vdso_data()? Or is the issue that you can't retrieve the program counter on power without clobbering the link register? I would imagine that this patch generates worse code on any architecture with PC-relative addressing modes (which includes at least x86_64, and I would guess includes most modern architectures). --Andy