Thread (16 messages) 16 messages, 6 authors, 2018-08-31

Re: [PATCH] treewide: remove current_text_addr

From: "H. Peter Anvin" <hpa@zytor.com>
Date: 2018-08-27 13:37:39
Also in: linux-alpha, linux-m68k, linux-mips, linux-riscv, linux-um

On 08/27/18 06:11, Peter Zijlstra wrote:
On Mon, Aug 27, 2018 at 05:26:53AM -0700, H. Peter Anvin wrote:
quoted
_THIS_IP_, however, is completely ill-defined, other than being an
address *somewhere* in the same global function (not even necessarily
the same function if the function is static!)  As my experiment show, in
many (nearly) cases gcc will hoist the address all the way to the top of
the function, at least for the current generic implementation.
It seems to have mostly worked so far... did anything change?
Most likely because the major architectures contain a arch-specific
assembly implementation.  The generic implementation used in some places
is completely broken, as my experiments show.
quoted
For the case where _THIS_IP_ is passed to an out-of-line function in all
cases, it is extra pointless because all it does is increase the
footprint of every caller: _RET_IP_ is inherently passed to the function
anyway, and with tailcall protection it will uniquely identify a callsite.
So I think we can convert many of the lockdep _THIS_IP_ calls to
_RET_IP_ on the other side, with a wee bit of care.

A little something like so perhaps...
I don't have time to look at this right now (I'm on sabbatical, and I'm
dealing with personal legal stuff right at the moment), but I think it
is the right direction.

	-hpa
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help