Skip to content
Snippets Groups Projects
  1. Aug 28, 2014
  2. Jul 12, 2014
  3. Jul 08, 2014
  4. Jun 26, 2014
    • Alex Smith's avatar
      recordmcount/MIPS: Fix possible incorrect mcount_loc table entries in modules · 91ad11d7
      Alex Smith authored
      
      On MIPS calls to _mcount in modules generate 2 instructions to load
      the _mcount address (and therefore 2 relocations). The mcount_loc
      table should only reference the first of these, so the second is
      filtered out by checking the relocation offset and ignoring ones that
      immediately follow the previous one seen.
      
      However if a module has an _mcount call at offset 0, the second
      relocation would not be filtered out due to old_r_offset == 0
      being taken to mean that the current relocation is the first one
      seen, and both would end up in the mcount_loc table.
      
      This results in ftrace_make_nop() patching both (adjacent)
      instructions to branches over the _mcount call sequence like so:
      
        0xffffffffc08a8000:  04 00 00 10     b       0xffffffffc08a8014
        0xffffffffc08a8004:  04 00 00 10     b       0xffffffffc08a8018
        0xffffffffc08a8008:  2d 08 e0 03     move    at,ra
        ...
      
      The second branch is in the delay slot of the first, which is
      defined to be unpredictable - on the platform on which this bug was
      encountered, it triggers a reserved instruction exception.
      
      Fix by initializing old_r_offset to ~0 and using that instead of 0
      to determine whether the current relocation is the first seen.
      
      Signed-off-by: default avatarAlex Smith <alex.smith@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: stable@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7098/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      91ad11d7
  5. Jun 23, 2014
  6. Jun 20, 2014
  7. Jun 19, 2014
  8. Jun 18, 2014
  9. Jun 17, 2014
  10. Jun 10, 2014
  11. Jun 09, 2014
  12. Jun 04, 2014
  13. May 29, 2014
    • AKASHI Takahiro's avatar
      ftrace: Add arm64 support to recordmcount · af64d2aa
      AKASHI Takahiro authored
      
      Recordmcount utility under scripts is run, after compiling each object,
      to find out all the locations of calling _mcount() and put them into
      specific seciton named __mcount_loc.
      Then linker collects all such information into a table in the kernel image
      (between __start_mcount_loc and __stop_mcount_loc) for later use by ftrace.
      
      This patch adds arm64 specific definitions to identify such locations.
      There are two types of implementation, C and Perl. On arm64, only C version
      is used to build the kernel now that CONFIG_HAVE_C_RECORDMCOUNT is on.
      But Perl version is also maintained.
      
      This patch also contains a workaround just in case where a header file,
      elf.h, on host machine doesn't have definitions of EM_AARCH64 nor
      R_AARCH64_ABS64. Without them, compiling C version of recordmcount will
      fail.
      
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarAKASHI Takahiro <takahiro.akashi@linaro.org>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      af64d2aa
  14. May 20, 2014
  15. May 14, 2014
Loading