Re: [PATCH v2 3/6] powerpc/module: Optimise nearby branches in ELF V2 ABI stub

2022-09-26 Thread Benjamin Gray
On Mon, 2022-09-26 at 14:49 +, Christophe Leroy wrote: > > +   /* Replace indirect branch sequence with direct branch > > where possible */ > > +   if (!create_branch(&direct, jump_seq_addr, addr, 0)) > > +   if (patch_instruction(jump_seq_addr, direct)) > > Why not use pat

Re: [PATCH v2 3/6] powerpc/module: Optimise nearby branches in ELF V2 ABI stub

2022-09-26 Thread Christophe Leroy
Le 26/09/2022 à 08:43, Benjamin Gray a écrit : > Inserts a direct branch to the stub target when possible, replacing the > mtctr/btctr sequence. > > The load into r12 could potentially be skipped too, but that change > would need to refactor the arguments to indicate that the address > does not

[PATCH v2 3/6] powerpc/module: Optimise nearby branches in ELF V2 ABI stub

2022-09-25 Thread Benjamin Gray
Inserts a direct branch to the stub target when possible, replacing the mtctr/btctr sequence. The load into r12 could potentially be skipped too, but that change would need to refactor the arguments to indicate that the address does not have a separate local entry point. This helps the static cal