[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f967d835-d26e-47af-af35-c3c79746f7d9@rasmusvillemoes.dk>
Date: Mon, 10 Jun 2024 15:38:34 +0200
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: Peter Zijlstra <peterz@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Anvin <hpa@...or.com>, Ingo Molnar <mingo@...nel.org>,
Borislav Petkov <bp@...en8.de>, Thomas Gleixner <tglx@...utronix.de>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
the arch/x86 maintainers <x86@...nel.org>,
linux-arch <linux-arch@...r.kernel.org>
Subject: Re: [PATCH] x86: add 'runtime constant' infrastructure
On 10/06/2024 12.43, Peter Zijlstra wrote:
> On Sat, Jun 08, 2024 at 12:35:05PM -0700, Linus Torvalds wrote:
>> Comments?
>
> It obviously has the constraint of never running the code before the
> corresponding runtime_const_init() has been done, otherwise things will
> go sideways in a hurry, but this also makes the whole thing a *lot*
> simpler.
>
> The only thing I'm not sure about is it having a section per symbol,
> given how jump_label and static_call took off, this might not be
> scalable.
>
> Yes, the approach is super simple and straight forward, but imagine
> there being like a 100 symbols soon :/
>
> The below hackery -- it very much needs cleanup and is only compiled on
> x86_64 and does not support modules, boots for me.
As can be seen in my other reply, yes, I'm also worried about the
scalability and would like to see this applied to more stuff.
But if we do this, surely that's what scripts/sorttable is for, right?
Alternatively, if we just keep emitting to per-symbol
__runtime_const_##sym sections but collect them in one __runtime_const,
just using __runtime_const { *(SORT_BY_NAME(__runtime_const_*)) } in the
linker script should already be enough to allow that binary search to
work (with whatever : AT(ADDR() ... ) magic is also required), with no
post-processing at build or runtime required.
Rasmus
Powered by blists - more mailing lists