1. 18 Jan, 2015 2 commits
  2. 17 Jan, 2015 6 commits
  3. 16 Jan, 2015 27 commits
    • Louis Langholtz's avatar
      kernel: avoid overflow in cmp_range · fc7f0dd3
      Louis Langholtz authored
      Avoid overflow possibility.
      
      [ The overflow is purely theoretical, since this is used for memory
        ranges that aren't even close to using the full 64 bits, but this is
        the right thing to do regardless.  - Linus ]
      Signed-off-by: default avatarLouis Langholtz <lou_langholtz@me.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Peter Anvin <hpa@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fc7f0dd3
    • Sukadev Bhattiprolu's avatar
      perf tools powerpc: Use dwfl_report_elf() instead of offline. · 6bcf9c1f
      Sukadev Bhattiprolu authored
      dwfl_report_offline() works only when libraries are prelinked.
      
      Replace dwfl_report_offline() with dwfl_report_elf() so we correctly
      extract debug info even from libraries that are not prelinked.
      Reported-by: default avatarJiri Olsa <jolsa@redhat.com>
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Tested-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Link: http://lkml.kernel.org/r/20150114221045.GA17703@us.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6bcf9c1f
    • Namhyung Kim's avatar
      perf tools: Fix segfault for symbol annotation on TUI · 813ccd15
      Namhyung Kim authored
      Currently the symbol structure is allocated with symbol_conf.priv_size
      to carry sideband information like annotation, map browser on TUI and
      sort-by-name tree node.  So retrieving these information from symbol
      needs to care about the details of such placement.
      
      However the annotation code just assumes that the symbol is placed after
      the struct annotation.  But actually there's other info between them.
      So accessing those struct will lead to an undefined behavior (usually a
      crash) after they write their info to the same location.
      
      To reproduce the problem, please follow the steps below:
      
        1. run perf report (TUI of course) with -v option
        2. open map browser (by pressing right arrow key for any entry)
        3. search any function (by pressing '/' key and input whatever..)
        4. return to the hist browser (by pressing 'q' or left arrow key)
        5. open annotation window for the same entry (by pressing 'a' key)
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1421234288-22758-1-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      813ccd15
    • Wang Nan's avatar
      perf test: Fix dwarf unwind using libunwind. · b93b0967
      Wang Nan authored
      Perf tool fails to unwind user stack if the event raises in a shared
      object. This patch improves tests/dwarf-unwind.c to demonstrate the
      problem by utilizing commonly used glibc function "bsearch". If perf is
      not statically linked, the testcase will try to unwind a mixed call
      trace.
      
      By debugging libunwind I found that there is a bug in unwind-libunwind:
      it always passes 0 as segbase to libunwind, cause libunwind unable to
      locate debug_frame entry fir first level ip address (I add some more
      debugging output into libunwind to make things clear):
      
                     >_Uarm_dwarf_find_debug_frame: start_ip = 10be98, end_ip = 10c2a4
                     >_Uarm_dwarf_find_debug_frame: found debug_frame table `/lib/libc-2.18.so': segbase=0x0, len=7, gp=0x0, table_data=0x449388
                     >_Uarm_dwarf_search_unwind_table: call lookup:ip = b6cd3bcc, segbase = 0, rel_ip = b6cd3bcc
                     >lookup: e->start_ip_offset = bcf18 (rel_ip = b6cd3bcc)
                     >lookup: e->start_ip_offset = 6d314 (rel_ip = b6cd3bcc)
                     >lookup: e->start_ip_offset = 33d0c (rel_ip = b6cd3bcc)
                      ...
                     >lookup: e->start_ip_offset = 15d0c (rel_ip = b6cd3bcc)
                     >lookup: e->start_ip_offset = 15c40 (rel_ip = b6cd3bcc)
       >_Uarm_dwarf_search_unwind_table: IP b6cd3bcc inside range b6c12000-b6d4c000, but no explicit unwind info found
                      >put_rs_cache: unmasking signals/interrupts and releasing lock
                     >_Uarm_dwarf_step: returning -10
       >_Uarm_step: dwarf_step()=-10
      
      This patch passes map->start as segbase to dwarf_find_debug_frame(), so
      di will be initialized correctly.
      
      In addition, dso and executable are different when setting segbase. This
      patch first check whether the elf is executable, and pass segbase only
      for shared object.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1421203007-75799-1-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b93b0967
    • Vineet Gupta's avatar
      perf tools: Avoid build splat for syscall numbers with uclibc · ea1fe3a8
      Vineet Gupta authored
      This is due to duplicated unistd inclusion (via uClibc headers + kernel headers)
      Also seen on ARM uClibc based tools
      
         ------- ARC build ---------->8-------------
      
        CC       util/evlist.o
      In file included from
      ~/arc/k.org/arch/arc/include/uapi/asm/unistd.h:25:0,
                       from util/../perf-sys.h:10,
                       from util/../perf.h:15,
                       from util/event.h:7,
                       from util/event.c:3:
      ~/arc/k.org/include/uapi/asm-generic/unistd.h:906:0:
      warning: "__NR_fcntl64" redefined [enabled by default]
       #define __NR_fcntl64 __NR3264_fcntl
       ^
      In file included from
      ~/arc/gnu/INSTALL_1412-arc-2014.12-rc1/arc-snps-linux-uclibc/sysroot/usr/include/sys/syscall.h:24:0,
                       from util/../perf-sys.h:6,
         ----------------->8-------------------
      
         ------- ARM build ---------->8-------------
      
        CC FPIC  plugin_scsi.o
      In file included from util/../perf-sys.h:9:0,
                       from util/../perf.h:15,
                       from util/cache.h:7,
                       from perf.c:12:
      ~/arc/k.org/arch/arm/include/uapi/asm/unistd.h:28:0:
      warning: "__NR_restart_syscall" redefined [enabled by default]
      In file included from
      ~/buildroot/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/sys/syscall.h:25:0,
                       from util/../perf-sys.h:6,
                       from util/../perf.h:15,
                       from util/cache.h:7,
                       from perf.c:12:
      ~/buildroot/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/bits/sysnum.h:17:0:
      note: this is the location of the previous definition
         ----------------->8-------------------
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1421156604-30603-4-git-send-email-vgupta@synopsys.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ea1fe3a8
    • Vineet Gupta's avatar
      perf tools: Elide strlcpy warning with uclibc · a83d869f
      Vineet Gupta authored
         ----------------->8------------------
        CC       bench/sched-pipe.o
      In file included from builtin-annotate.c:13:0:
      util/cache.h:76:15: warning: redundant redeclaration of 'strlcpy'
      [-Wredundant-decls]
       extern size_t strlcpy(char *dest, const char *src, size_t size);
                     ^
      In file included from util/util.h:55:0,
                       from builtin.h:4,
                       from builtin-annotate.c:8:
      ~/vineetg/arc/gnu/INSTALL_1412-arc-2014.12-rc1/arc-snps-linux-uclibc/sysroot/usr/include/string.h:396:15:
      note: previous declaration of 'strlcpy' was here
       extern size_t strlcpy(char *__restrict dst, const char *__restrict src,
         ----------------->8------------------
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1421156604-30603-3-git-send-email-vgupta@synopsys.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a83d869f
    • Alexey Brodkin's avatar
      perf tools: Fix statfs.f_type data type mismatch build error with uclibc · db1806ed
      Alexey Brodkin authored
      ARC Linux uses the no legacy syscalls abi and corresponding uClibc headers
      statfs defines f_type to be U32 which causes perf build breakage
      
      http://git.uclibc.org/uClibc/tree/libc/sysdeps/linux/common-generic/bits/statfs.h
      
        ----------->8---------------
          CC       fs/fs.o
        fs/fs.c: In function 'fs__valid_mount':
        fs/fs.c:82:24: error: comparison between signed and unsigned integer
        expressions [-Werror=sign-compare]
          else if (st_fs.f_type != magic)
                                ^
        cc1: all warnings being treated as errors
        ----------->8---------------
      Signed-off-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Cody P Schafer <dev@codyps.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Link: http://lkml.kernel.org/r/1420888254-17504-2-git-send-email-vgupta@synopsys.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      db1806ed
    • Arnaldo Carvalho de Melo's avatar
      tools: Remove bitops/hweight usage of bits in tools/perf · 25cd480e
      Arnaldo Carvalho de Melo authored
      We need to use lib/hweight.c for that, just like we do for lib/rbtree.c,
      so tools need to link hweight.o. For now do it directly, but we need to
      have a tools/lib/lk.a or .so that collects these goodies...
      Reported-by: default avatarJan Beulich <JBeulich@suse.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-a1e91dx3apzqw5kbdt7ut21s@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      25cd480e
    • Namhyung Kim's avatar
      perf machine: Fix __machine__findnew_thread() error path · 260d819e
      Namhyung Kim authored
      When thread__init_map_groups() fails, a new thread should be removed
      from the rbtree since it's gonna be freed.  Also update last match cache
      only if the function succeeded.
      Reported-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1420763892-15535-1-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      260d819e
    • Namhyung Kim's avatar
      perf tools: Fix building error in x86_64 when dwarf unwind is on · c6e5e9fb
      Namhyung Kim authored
      When build with 'make ARCH=x86' and dwarf unwind is on, there is a
      compiling error:
      
         CC       /home/wn/perf/arch/x86/util/unwind-libdw.o
         CC       /home/wn/perf/arch/x86/tests/regs_load.o
       arch/x86/tests/regs_load.S: Assembler messages:
       arch/x86/tests/regs_load.S:65: Error: operand type mismatch for `push'
       arch/x86/tests/regs_load.S:72: Error: operand type mismatch for `pop'
       make[1]: *** [/home/wn/perf/arch/x86/tests/regs_load.o] Error 1
       make[1]: INTERNAL: Exiting with 25 jobserver tokens available; should be 24!
       make: *** [all] Error 2
       ...
      
      Which is caused by incorrectly undefine macro HAVE_ARCH_X86_64_SUPPORT.
      'config/Makefile.arch' tests __x86_64__ only when 'ARCH=x86_64'.
      However, when building x86_64 kernel, ARCH=x86 is valid and commonly
      used. Build systems, such as yocto, uses x86_64 compiler with 'ARCH=x86'
      to build x86_64 perf, which causes mismatching.
      
      As __LP64__ is defined for x86_64 as well, we can consolidate the
      __x86_64__ check to the __LP64__ check and get rid of the IS_X86_64
      IMHO.
      
      (This patch is made by Namhyung Kim when replying my v1 patch:
      
      https://lkml.org/lkml/2015/1/7/17
      
      I modified the code to remove dependency on RAW_ARCH:
      
      https://lkml.org/lkml/2015/1/7/865
      
      Namhyung Kim didn't provide his SOB in his original email. I add
      mine only for my modification.)
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/1421029255-23039-1-git-send-email-wangnan0@huawei.com
      [ Namhyung provided his S-o-B on a followup to this patch thread on lkml ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c6e5e9fb
    • Namhyung Kim's avatar
      perf probe: Propagate error code when write(2) failed · 7949ba1f
      Namhyung Kim authored
      When it failed to write probe commands to the probe_event file in
      debugfs, it needs to propagate the error code properly.  Current code
      blindly uses the return value of the write(2) so it always uses
      -1 (-EPERM) and it might confuse users.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1420886028-15135-4-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7949ba1f
    • Linus Torvalds's avatar
      Merge tag 'char-misc-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 7ad4b4ae
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are three small driver fixes for reported issues for 3.19-rc5.
      
        All of these have been in linux-next for a while with no reported
        problems"
      
      * tag 'char-misc-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        mcb: mcb-pci: Only remap the 1st 0x200 bytes of BAR 0
        mei: add ABI documentation for fw_status exported through sysfs
        mei: clean reset bit before reset
      7ad4b4ae
    • Linus Torvalds's avatar
      Merge tag 'driver-core-3.19-rc5' of... · 62b15300
      Linus Torvalds authored
      Merge tag 'driver-core-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core fix from Greg KH:
       "Here is one kernfs fix for a reported issue for 3.19-rc5.
      
        It has been in linux-next for a while"
      
      * tag 'driver-core-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        kernfs: Fix kernfs_name_compare
      62b15300
    • Linus Torvalds's avatar
      Merge tag 'tty-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 7b78de8c
      Linus Torvalds authored
      Pull tty/serial driver fixes from Greg KH:
       "Here are some tty and serial driver fixes for 3.19-rc5 that resolve
        some reported issues, and add a new device id to the 8250 serial port
        driver.
      
        All have been in linux-next with no reported problems"
      
      * tag 'tty-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial: samsung: Add the support for Exynos5433 SoC
        Revert "tty: Fix pty master poll() after slave closes v2"
        tty: Prevent hw state corruption in exclusive mode reopen
        tty: Add support for the WCH384 4S multi-IO card
        serial: fix parisc boot hang
      7b78de8c
    • Linus Torvalds's avatar
      Merge tag 'staging-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 937102fe
      Linus Torvalds authored
      Pull staging driver fixes from Greg KH:
       "Here are 6 staging driver fixes for 3.19-rc5.
      
        They fix some reported issues with some IIO drivers, as well as some
        issues with the vt6655 wireless driver.
      
        All have been in linux-next for a while"
      
      * tag 'staging-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: vt6655: fix sparse warning: argument type
        staging: vt6655: Fix loss of distant/weak access points on channel change.
        staging: vt6655: vnt_tx_packet Fix corrupted tx packets.
        staging: vt6655: fix sparse warnings: incorrect argument type
        iio: iio: Fix iio_channel_read return if channel havn't info
        iio: ad799x: Fix ad7991/ad7995/ad7999 config setup
      937102fe
    • Linus Torvalds's avatar
      Merge tag 'usb-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 79600d4b
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here is a bunch of USB fixes for 3.19-rc5.
      
        Most of these are gadget driver fixes, along with the xhci driver fix
        that we both reported having problems with, as well as some new device
        ids and other tiny fixes.
      
        All have been in linux-next with no problems"
      
      * tag 'usb-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (43 commits)
        usb: dwc3: gadget: Stop TRB preparation after limit is reached
        usb: dwc3: gadget: Fix TRB preparation during SG
        usb: phy: mv-usb: fix usb_phy build errors
        usb: serial: handle -ENODEV quietly in generic_submit_read_urb
        usb: serial: silence all non-critical read errors
        USB: console: fix potential use after free
        USB: console: fix uninitialised ldisc semaphore
        usb: gadget: udc: atmel: fix possible oops when unloading module
        usb: gadget: gadgetfs: fix an oops in ep_write()
        usb: phy: Fix deferred probing
        OHCI: add a quirk for ULi M5237 blocking on reset
        uas: Add US_FL_NO_ATA_1X for 2 more Seagate disk enclosures
        uas: Do not blacklist ASM1153 disk enclosures
        usb: gadget: udc: avoid dereference before NULL check in ep_queue
        usb: host: ehci-tegra: request deferred probe when failing to get phy
        uas: disable UAS on Apricorn SATA dongles
        uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS566 with usb-id 0bc2:a013
        uas: Add US_FL_NO_ATA_1X for Seagate devices with usb-id 0bc2:a013
        xhci: Add broken-streams quirk for Fresco Logic FL1000G xhci controllers
        USB: EHCI: adjust error return code
        ...
      79600d4b
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · fa818dc4
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       - Wire up compat_sys_execveat for compat (AArch32) tasks
       - Revert 421520ba, as this breaks our side of the boot protocol
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: partially revert "ARM: 8167/1: extend the reserved memory for initrd to be page aligned"
        arm64: compat: wire up compat_sys_execveat
      fa818dc4
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-3.19-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · a2a32cd1
      Linus Torvalds authored
      Pull NFS client bugfixes from Trond Myklebust:
       "Highlights include:
      
         - Stable fix for a NFSv3/lockd race
         - Fixes for several NFSv4.1 client id trunking bugs
         - Remove an incorrect test when checking for delegated opens"
      
      * tag 'nfs-for-3.19-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        NFSv4: Remove incorrect check in can_open_delegated()
        NFS: Ignore transport protocol when detecting server trunking
        NFSv4/v4.1: Verify the client owner id during trunking detection
        NFSv4: Cache the NFSv4/v4.1 client owner_id in the struct nfs_client
        NFSv4.1: Fix client id trunking on Linux
        LOCKD: Fix a race when initialising nlmsvc_timeout
      a2a32cd1
    • Linus Torvalds's avatar
      Merge tag 'trace-fixes-v3.19-rc3' of... · 23aa4b41
      Linus Torvalds authored
      Merge tag 'trace-fixes-v3.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
      
      Pull ftrace fixes from Steven Rostedt:
       "This holds a few fixes to the ftrace infrastructure as well as the
        mixture of function graph tracing and kprobes.
      
        When jprobes and function graph tracing is enabled at the same time it
        will crash the system:
      
            # modprobe jprobe_example
            # echo function_graph > /sys/kernel/debug/tracing/current_tracer
      
        After the first fork (jprobe_example probes it), the system will
        crash.
      
        This is due to the way jprobes copies the stack frame and does not do
        a normal function return.  This messes up with the function graph
        tracing accounting which hijacks the return address from the stack and
        replaces it with a hook function.  It saves the return addresses in a
        separate stack to put back the correct return address when done.  But
        because the jprobe functions do not do a normal return, their stack
        addresses are not put back until the function they probe is called,
        which means that the probed function will get the return address of
        the jprobe handler instead of its own.
      
        The simple fix here was to disable function graph tracing while the
        jprobe handler is being called.
      
        While debugging this I found two minor bugs with the function graph
        tracing.
      
        The first was about the function graph tracer sharing its function
        hash with the function tracer (they both get filtered by the same
        input).  The changing of the set_ftrace_filter would not sync the
        function recording records after a change if the function tracer was
        disabled but the function graph tracer was enabled.  This was due to
        the update only checking one of the ops instead of the shared ops to
        see if they were enabled and should perform the sync.  This caused the
        ftrace accounting to break and a ftrace_bug() would be triggered,
        disabling ftrace until a reboot.
      
        The second was that the check to update records only checked one of
        the filter hashes.  It needs to test both the "filter" and "notrace"
        hashes.  The "filter" hash determines what functions to trace where as
        the "notrace" hash determines what functions not to trace (trace all
        but these).  Both hashes need to be passed to the update code to find
        out what change is being done during the update.  This also broke the
        ftrace record accounting and triggered a ftrace_bug().
      
        This patch set also include two more fixes that were reported
        separately from the kprobe issue.
      
        One was that init_ftrace_syscalls() was called twice at boot up.  This
        is not a major bug, but that call performed a rather large kmalloc
        (NR_syscalls * sizeof(*syscalls_metadata)).  The second call made the
        first one a memory leak, and wastes memory.
      
        The other fix is a regression caused by an update in the v3.19 merge
        window.  The moving to enable events early, moved the enabling before
        PID 1 was created.  The syscall events require setting the
        TIF_SYSCALL_TRACEPOINT for all tasks.  But for_each_process_thread()
        does not include the swapper task (PID 0), and ended up being a nop.
      
        A suggested fix was to add the init_task() to have its flag set, but I
        didn't really want to mess with PID 0 for this minor bug.  Instead I
        disable and re-enable events again at early_initcall() where it use to
        be enabled.  This also handles any other event that might have its own
        reg function that could break at early boot up"
      
      * tag 'trace-fixes-v3.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Fix enabling of syscall events on the command line
        tracing: Remove extra call to init_ftrace_syscalls()
        ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing
        ftrace: Check both notrace and filter for old hash
        ftrace: Fix updating of filters for shared global_ops filters
      23aa4b41
    • Catalin Marinas's avatar
      arm64: partially revert "ARM: 8167/1: extend the reserved memory for initrd to be page aligned" · 0145058c
      Catalin Marinas authored
      This patch partially reverts commit 421520ba
      (only the arm64 part). There is no guarantee that the boot-loader places other
      images like dtb in a different page than initrd start/end, especially when the
      kernel is built with 64KB pages. When this happens, such pages must not be
      freed. The free_reserved_area() already takes care of rounding up "start" and
      rounding down "end" to avoid freeing partially used pages.
      
      Cc: <stable@vger.kernel.org> # 3.17+
      Reported-by: default avatarPeter Maydell <Peter.Maydell@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      0145058c
    • Kan Liang's avatar
      perf/x86/intel: Fix bug for "cycles:p" and "cycles:pp" on SLM · 33636732
      Kan Liang authored
      cycles:p and cycles:pp do not work on SLM since commit:
      
         86a04461 ("perf/x86: Revamp PEBS event selection")
      
      UOPS_RETIRED.ALL is not a PEBS capable event, so it should not be used
      to count cycle number.
      
      Actually SLM calls intel_pebs_aliases_core2() which uses INST_RETIRED.ANY_P
      to count the number of cycles. It's a PEBS capable event. But inv and
      cmask must be set to count cycles.
      
      Considering SLM allows all events as PEBS with no flags, only
      INST_RETIRED.ANY_P, inv=1, cmask=16 needs to handled specially.
      Signed-off-by: default avatarKan Liang <kan.liang@intel.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1421084541-31639-1-git-send-email-kan.liang@intel.com
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      33636732
    • Stephane Eranian's avatar
      perf/rapl: Fix sysfs_show() initialization for RAPL PMU · 433678bd
      Stephane Eranian authored
      This patch fixes a problem with the initialization of the
      sysfs_show() routine for the RAPL PMU.
      
      The current code was wrongly relying on the EVENT_ATTR_STR()
      macro which uses the events_sysfs_show() function in the x86
      PMU code. That function itself was relying on the x86_pmu data
      structure. Yet RAPL and the core PMU (x86_pmu) have nothing to
      do with each other. They should therefore not interact with
      each other.
      
      The x86_pmu structure is initialized at boot time based on
      the host CPU model. When the host CPU is not supported, the
      x86_pmu remains uninitialized and some of the callbacks it
      contains are NULL.
      
      The false dependency with x86_pmu could potentially cause crashes
      in case the x86_pmu is not initialized while the RAPL PMU is. This
      may, for instance, be the case in virtualized environments.
      
      This patch fixes the problem by using a private sysfs_show()
      routine for exporting the RAPL PMU events.
      Signed-off-by: default avatarStephane Eranian <eranian@google.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20150113225953.GA21525@thinkpad
      Cc: vincent.weaver@maine.edu
      Cc: jolsa@redhat.com
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      433678bd
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse · cb596708
      Linus Torvalds authored
      Pull fuse fixes from Miklos Szeredi:
       "This fixes a regression in the latest fuse update plus a fix for a
        rather theoretical memory ordering issue"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
        fuse: add memory barrier to INIT
        fuse: fix LOOKUP vs INIT compat handling
      cb596708
    • Linus Torvalds's avatar
      Merge tag 'fbdev-fixes-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux · 0b6212e0
      Linus Torvalds authored
      Pull fbdev fixes from Tomi Valkeinen:
       - broadsheetfb: fix memory leak
       - simplefb: fix build failure on sparc
      
      * tag 'fbdev-fixes-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
        fbdev/broadsheetfb: fix memory leak
        simplefb: Fix build failure on Sparc
      0b6212e0
    • Linus Torvalds's avatar
      Merge tag 'mmc-v3.19-4' of git://git.linaro.org/people/ulf.hansson/mmc · 7b552bc1
      Linus Torvalds authored
      Pull MMC bugfix from Ulf Hansson:
       "Fix sdhci regulator regression for Qualcomm and Nvidia boards"
      
      * tag 'mmc-v3.19-4' of git://git.linaro.org/people/ulf.hansson/mmc:
        mmc: sdhci: Set SDHCI_POWER_ON with external vmmc
      7b552bc1
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k · f8cb3954
      Linus Torvalds authored
      Pull m68k fixlet from Geert Uytterhoeven.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
        m68k: Wire up execveat
      f8cb3954
    • Linus Torvalds's avatar
      Merge tag 'powerpc-3.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux · 3fa116e8
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "A few powerpc fixes"
      
      * tag 'powerpc-3.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux:
        powerpc: Work around gcc bug in current_thread_info()
        cxl: Fix issues when unmapping contexts
        powernv: Fix OPAL tracepoint code
      3fa116e8
  4. 15 Jan, 2015 5 commits
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Fix enabling of syscall events on the command line · ce1039bd
      Steven Rostedt (Red Hat) authored
      Commit 5f893b26 "tracing: Move enabling tracepoints to just after
      rcu_init()" broke the enabling of system call events from the command
      line. The reason was that the enabling of command line trace events
      was moved before PID 1 started, and the syscall tracepoints require
      that all tasks have the TIF_SYSCALL_TRACEPOINT flag set. But the
      swapper task (pid 0) is not part of that. Since the swapper task is the
      only task that is running at this early in boot, no task gets the
      flag set, and the tracepoint never gets reached.
      
      Instead of setting the swapper task flag (there should be no reason to
      do that), re-enabled trace events again after the init thread (PID 1)
      has been started. It requires disabling all command line events and
      re-enabling them, as just enabling them again will not reset the logic
      to set the TIF_SYSCALL_TRACEPOINT flag, as the syscall tracepoint will
      be fooled into thinking that it was already set, and wont try setting
      it again. For this reason, we must first disable it and re-enable it.
      
      Link: http://lkml.kernel.org/r/1421188517-18312-1-git-send-email-mpe@ellerman.id.au
      Link: http://lkml.kernel.org/r/20150115040506.216066449@goodmis.orgReported-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      ce1039bd
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Remove extra call to init_ftrace_syscalls() · 83829b74
      Steven Rostedt (Red Hat) authored
      trace_init() calls init_ftrace_syscalls() and then calls trace_event_init()
      which also calls init_ftrace_syscalls(). It makes more sense to only
      call it from trace_event_init().
      
      Calling it twice wastes memory, as it allocates the syscall events twice,
      and loses the first copy of it.
      
      Link: http://lkml.kernel.org/r/54AF53BD.5070303@huawei.com
      Link: http://lkml.kernel.org/r/20150115040505.930398632@goodmis.orgReported-by: default avatarWang Nan <wangnan0@huawei.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      83829b74
    • Steven Rostedt (Red Hat)'s avatar
      ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing · 237d28db
      Steven Rostedt (Red Hat) authored
      If the function graph tracer traces a jprobe callback, the system will
      crash. This can easily be demonstrated by compiling the jprobe
      sample module that is in the kernel tree, loading it and running the
      function graph tracer.
      
       # modprobe jprobe_example.ko
       # echo function_graph > /sys/kernel/debug/tracing/current_tracer
       # ls
      
      The first two commands end up in a nice crash after the first fork.
      (do_fork has a jprobe attached to it, so "ls" just triggers that fork)
      
      The problem is caused by the jprobe_return() that all jprobe callbacks
      must end with. The way jprobes works is that the function a jprobe
      is attached to has a breakpoint placed at the start of it (or it uses
      ftrace if fentry is supported). The breakpoint handler (or ftrace callback)
      will copy the stack frame and change the ip address to return to the
      jprobe handler instead of the function. The jprobe handler must end
      with jprobe_return() which swaps the stack and does an int3 (breakpoint).
      This breakpoint handler will then put back the saved stack frame,
      simulate the instruction at the beginning of the function it added
      a breakpoint to, and then continue on.
      
      For function tracing to work, it hijakes the return address from the
      stack frame, and replaces it with a hook function that will trace
      the end of the call. This hook function will restore the return
      address of the function call.
      
      If the function tracer traces the jprobe handler, the hook function
      for that handler will not be called, and its saved return address
      will be used for the next function. This will result in a kernel crash.
      
      To solve this, pause function tracing before the jprobe handler is called
      and unpause it before it returns back to the function it probed.
      
      Some other updates:
      
      Used a variable "saved_sp" to hold kcb->jprobe_saved_sp. This makes the
      code look a bit cleaner and easier to understand (various tries to fix
      this bug required this change).
      
      Note, if fentry is being used, jprobes will change the ip address before
      the function graph tracer runs and it will not be able to trace the
      function that the jprobe is probing.
      
      Link: http://lkml.kernel.org/r/20150114154329.552437962@goodmis.org
      
      Cc: stable@vger.kernel.org # 2.6.30+
      Acked-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      237d28db
    • Steven Rostedt (Red Hat)'s avatar
      ftrace: Check both notrace and filter for old hash · 7485058e
      Steven Rostedt (Red Hat) authored
      Using just the filter for checking for trampolines or regs is not enough
      when updating the code against the records that represent all functions.
      Both the filter hash and the notrace hash need to be checked.
      
      To trigger this bug (using trace-cmd and perf):
      
       # perf probe -a do_fork
       # trace-cmd start -B foo -e probe
       # trace-cmd record -p function_graph -n do_fork sleep 1
      
      The trace-cmd record at the end clears the filter before it disables
      function_graph tracing and then that causes the accounting of the
      ftrace function records to become incorrect and causes ftrace to bug.
      
      Link: http://lkml.kernel.org/r/20150114154329.358378039@goodmis.org
      
      Cc: stable@vger.kernel.org
      [ still need to switch old_hash_ops to old_ops_hash ]
      Reviewed-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      7485058e
    • Steven Rostedt (Red Hat)'s avatar
      ftrace: Fix updating of filters for shared global_ops filters · 8f86f837
      Steven Rostedt (Red Hat) authored
      As the set_ftrace_filter affects both the function tracer as well as the
      function graph tracer, the ops that represent each have a shared
      ftrace_ops_hash structure. This allows both to be updated when the filter
      files are updated.
      
      But if function graph is enabled and the global_ops (function tracing) ops
      is not, then it is possible that the filter could be changed without the
      update happening for the function graph ops. This will cause the changes
      to not take place and may even cause a ftrace_bug to occur as it could mess
      with the trampoline accounting.
      
      The solution is to check if the ops uses the shared global_ops filter and
      if the ops itself is not enabled, to check if there's another ops that is
      enabled and also shares the global_ops filter. In that case, the
      modification still needs to be executed.
      
      Link: http://lkml.kernel.org/r/20150114154329.055980438@goodmis.org
      
      Cc: stable@vger.kernel.org # 3.17+
      Reviewed-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      8f86f837