[PATCH] powerpc64: Workaround sigtramp vdso return call.
Florian Weimer
fweimer@redhat.com
Tue Jan 26 14:12:01 GMT 2021
* Raoni Fassina Firmino:
> A not so recent kernel change[1] changed how the trampoline
> `__kernel_sigtramp_rt64` is used to call signal handlers.
>
> This was exposed on the test misc/tst-sigcontext-get_pc
>
> Before kernel 5.9, the kernel set LR to the trampoline address and
> jumped directly to the signal handler, and at the end the signal
> handler, as any other function, would `blr` to the address set. In
> other words, the trampoline was executed just at the end of the signal
> handler and the only thing it did was call sigreturn. But since
> kernel 5.9 the kernel set CTRL to the signal handler and calls to the
> trampoline code, the trampoline then `bctrl` to the address in CTRL,
> setting the LR to the next instruction in the middle of the
> trampoline, when the signal handler returns, the rest of the
> trampoline code executes the same code as before.
Thanks for the patch, byt:
No one has explained so far why the original blr instruction couldn't be
augmented with the appropriate branch predictor hint. The 2.07 ISA
manual suggests that it's possible, but maybe I'm reading it wrong.
Thanks,
Florian
--
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
More information about the Libc-alpha
mailing list