Giter VIP home page Giter VIP logo

Comments (6)

joe-lawrence avatar joe-lawrence commented on July 17, 2024

issue-1382.tar.gz

See comparison of cmdline_proc_show() for when CONFIG_FTRACE_MCOUNT_USE_OBJTOOL vs CONFIG_FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY:

--- mcount_objtool      2024-03-25 15:31:39.819471809 -0400
+++ mcount_patchable_fun_entry  2024-03-25 15:32:10.441579666 -0400
@@ -5,7 +5,6 @@ Disassembly of section .text.cmdline_pro
                         0: R_PPC64_REL16_HA     .TOC.
    4:   00 00 42 38     addi    r2,r2,0
                         4: R_PPC64_REL16_LO     .TOC.+0x4
-   8:   a6 02 08 7c     mflr    r0
-   c:   01 00 00 48     bl      c <cmdline_proc_show+0xc>
-                        c: R_PPC64_REL24        _mcount
+   8:   00 00 00 60     nop
+   c:   00 00 00 60     nop
   10:   a6 02 08 7c     mflr    r0

The checks in kpatch_find_func_profiling_calls() for the PPC64 arch look for that "_mcount" relocation, which isn't present in the patchable-function-entry case.

To support this config, we could look for the nop instructions directly, like the S390 case, or maybe verify that there is a "patchable_function_entries" relocation for the function. This gets a little weird as the compiler seems to generate multiple __patchable_function_entries sections (one for each section?):

$ objdump -j__patchable_function_entries -r fs/proc/cmdline.o

fs/proc/cmdline.o:     file format elf64-powerpcle

RELOCATION RECORDS FOR [__patchable_function_entries]:
OFFSET           TYPE              VALUE
0000000000000000 R_PPC64_ADDR64    .init.text+0x0000000000000008


RELOCATION RECORDS FOR [__patchable_function_entries]:
OFFSET           TYPE              VALUE
0000000000000000 R_PPC64_ADDR64    .text.cmdline_proc_show+0x0000000000000008

from kpatch.

joe-lawrence avatar joe-lawrence commented on July 17, 2024

repro-1382.tar.gz

from kpatch.

jpoimboe avatar jpoimboe commented on July 17, 2024

Multiple sections with the same name, weird :-) IMO, checking for the nops is probably sufficient.

from kpatch.

github-actions avatar github-actions commented on July 17, 2024

This issue has been open for 30 days with no activity and no assignee. It will be closed in 7 days unless a comment is added.

from kpatch.

github-actions avatar github-actions commented on July 17, 2024

This issue has been open for 30 days with no activity and no assignee. It will be closed in 7 days unless a comment is added.

from kpatch.

github-actions avatar github-actions commented on July 17, 2024

This issue was closed because it was inactive for 7 days after being marked stale.

from kpatch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.