-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PowerPC] call to _mcount emitted by -pg needs to be emitted BEFORE function prolog #63220
Comments
@llvm/issue-subscribers-backend-powerpc |
Ftrace on ppc32 expects a three instruction sequence at the beginning of each function when specifying -pg: mflr r0 stw r0,4(r1) bl _mcount This is the case with all supported versions of gcc. Clang however emits a branch to _mcount after the function prologue, similar to the pre -mprofile-kernel ABI on ppc64. This is not supported. Disable ftrace on ppc32 if using clang for now. This can be re-enabled later if clang picks up support for -fpatchable-function-entry on ppc32. Signed-off-by: Naveen N Rao <naveen@kernel.org> Acked-by: Nick Desaulniers <ndesaulniers@google.com> Link: llvm/llvm-project#63220 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230609034501.407971-1-naveen@kernel.org
Ftrace on ppc32 expects a three instruction sequence at the beginning of each function when specifying -pg: mflr r0 stw r0,4(r1) bl _mcount This is the case with all supported versions of gcc. Clang however emits a branch to _mcount after the function prologue, similar to the pre -mprofile-kernel ABI on ppc64. This is not supported. Disable ftrace on ppc32 if using clang for now. This can be re-enabled later if clang picks up support for -fpatchable-function-entry on ppc32. Signed-off-by: Naveen N Rao <naveen@kernel.org> Acked-by: Nick Desaulniers <ndesaulniers@google.com> Link: llvm/llvm-project#63220 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230609034501.407971-1-naveen@kernel.org
Ftrace on ppc32 expects a three instruction sequence at the beginning of each function when specifying -pg: mflr r0 stw r0,4(r1) bl _mcount This is the case with all supported versions of gcc. Clang however emits a branch to _mcount after the function prologue, similar to the pre -mprofile-kernel ABI on ppc64. This is not supported. Disable ftrace on ppc32 if using clang for now. This can be re-enabled later if clang picks up support for -fpatchable-function-entry on ppc32. Signed-off-by: Naveen N Rao <naveen@kernel.org> Acked-by: Nick Desaulniers <ndesaulniers@google.com> Link: llvm/llvm-project#63220 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230609034501.407971-1-naveen@kernel.org
@nickdesaulniers Hi thanks for reporting this issue. Does this issue still matter? If so, maybe I can make a fix. |
With latest clang, |
Probably. cc @nathanchance who can follow up. |
On PPC, there is a codegen improvement that moves Must these three instructions be in the sequence in the description? What's the relationship between this task and the -fpatchable-function-entry support on ppc32? In https://lore.kernel.org/llvm/20230609034501.407971-1-naveen@kernel.org/, it says "This can be re-enabled |
Yes, adding support for Support for that is being discussed in #57031 |
For now only PPC big endian Linux is supported. PPC little endian Linux has XRAY support for 64-bit. PPC AIX has different patchable function entry implementations. Fixes llvm#63220 Fixes llvm#57031
#92997 is created for this issue. |
For now only PPC big endian Linux is supported. PPC little endian Linux has XRAY support for 64-bit. PPC AIX has different patchable function entry implementations. Fixes llvm#63220 Fixes llvm#57031
For now only PPC big endian Linux is supported. PPC little endian Linux has XRAY support for 64-bit. PPC AIX has different patchable function entry implementations. Fixes llvm#63220 Fixes llvm#57031
For now only PPC big endian Linux 32 and 64 bit are supported. PPC little endian Linux has XRAY support for 64-bit. PPC AIX has different patchable function entry implementations. Fixes llvm#63220 Fixes llvm#57031
From an LKML thread: https://lore.kernel.org/llvm/20230609034501.407971-1-naveen@kernel.org/
Example: https://godbolt.org/z/8r83PKorK
As a result, support for function tracing is being disabled in the linux kernel for ppc32 when built with clang.
cc @nemanjai @nemanja-ibm
The text was updated successfully, but these errors were encountered: