On Thu, 2022-10-06 at 11:39 +1100, Michael Ellerman wrote: > Christophe Leroy <christophe.le...@csgroup.eu> writes: > > However, thinking out loudly, I'm wondering, could we make things > > any > > simpler when CONFIG_MODULES is not selected, or is that a too much > > corner case on PPC64 ? > > I'd say it's mostly a corner case. > > Obviously no distros ship with modules disabled. > > AFAIK even the stripped down kernels we use in CPU bringup have > modules > enabled. > > So I think it's probably not worth worrying about, unless there's an > obvious and fairly simple optimisation. > > cheers
Yeah, I think supporting this case would amount to a whole new trampoline implementation. Something like the original RFC implementation would be best here as there would only be one TOC to worry about. Instead, I expect this can all be optimised better once we can apply patches to call-sites. If so, we can patch the call-site NOPs ourselves without marking the trampoline as caller-saved TOC, which would remove the suboptimal save-r2 trampolines. Then we could use separate local & global entry points like the RFC. This would unify the kernel/module trampolines again. The benefit of this series is that it works with just what the ABI offers, without extra kernel tools / linker magic. But I would definitely revisit it once call-site patching is possible, especially when working on inline static calls.