Thread (29 messages) 29 messages, 3 authors, 2022-09-28

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

From: Benjamin Gray <hidden>
Date: 2022-09-27 03:13:27

On Mon, 2022-09-26 at 14:49 +0000, Christophe Leroy wrote:
quoted
+       /* 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 patch_branch() ?
I didn't think of it at the time. To get the same abort-if-patch-failed
semantics then the following should work

  int err;
  ...

  /* Replace indirect branch sequence with direct branch where 
   * possible 
   */
  err = patch_branch(&entry->jump[PPC64_STUB_MTCTR_OFFSET], addr, 0);
  if (err && err != -ERANGE)
      return 0;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help