Skip to content
  1. Feb 08, 2015
    • Steven Rostedt (Red Hat)'s avatar
      x86/tlb/trace: Do not trace on CPU that is offline · 6c8465a8
      Steven Rostedt (Red Hat) authored
      When taking a CPU down for suspend and resume, a tracepoint may be called
      when the CPU has been designated offline. As tracepoints require RCU for
      protection, they must not be called if the current CPU is offline.
      
      Unfortunately, trace_tlb_flush() is called in this scenario as was noted
      by LOCKDEP:
      
      ...
      
       Disabling non-boot CPUs ...
       intel_pstate CPU 1 exiting
      
       ===============================
       smpboot: CPU 1 didn't die...
       [ INFO: suspicious RCU usage. ]
       3.19.0-rc7-next-20150204.1-iniza-small #1 Not tainted
       -------------------------------
       include/trace/events/tlb.h:35 suspicious rcu_dereference_check() usage!
      
       other info that might help us debug this:
      
       RCU used illegally from offline CPU!
       rcu_scheduler_active = 1, debug_locks = 0
       no locks held by swapper/1/0.
      
       stack backtrace:
       CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.19.0-rc7-next-20150204.1-iniza-small #1
       Hardware name: SAMSUNG ELECTRONICS CO., LTD. 530U3BI/530U4BI/530U4BH/530U3BI/530U4BI/530U4BH, BIOS 13XK 03/28/2013
        0000000000000001 ffff88011a44fe18 ffffffff817e370d 0000000000000011
        ffff88011a448290 ffff88011a44fe48 ffffffff810d6847 ffff8800c66b9600
        0000000000000001 ffff88011a44c000 ffffffff81cb3900 ffff88011a44fe78
       Call Trace:
        [<ffffffff817e370d>] dump_stack+0x4c/0x65
        [<ffffffff810d6847>] lockdep_rcu_suspicious+0xe7/0x120
        [<ffffffff810b71a5>] idle_task_exit+0x205/0x2c0
        [<ffffffff81054c4e>] play_dead_common+0xe/0x50
        [<ffffffff81054ca5>] native_play_dead+0x15/0x140
        [<ffffffff8102963f>] arch_cpu_idle_dead+0xf/0x20
        [<ffffffff810cd89e>] cpu_startup_entry+0x37e/0x580
        [<ffffffff81053e20>] start_secondary+0x140/0x150
       intel_pstate CPU 2 exiting
      
      ...
      
      By converting the tlb_flush tracepoint to a TRACE_EVENT_CONDITION where the
      condition is cpu_online(smp_processor_id()), we can avoid calling RCU protected
      code when the CPU is offline.
      
      Link: http://lkml.kernel.org/r/CA+icZUUGiGDoL5NU8RuxKzFjoLjEKRtUWx=JB8B9a0EQv-eGzQ@mail.gmail.com
      
      
      
      Cc: stable@vger.kernel.org # 3.17+
      Fixes: d17d8f9d "x86/mm: Add tracepoints for TLB flushes"
      Reported-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
      Tested-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
      Suggested-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Acked-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Acked-by: default avatarDave Hansen <dave@sr71.net>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      6c8465a8
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Add condition check to RCU lockdep checks · a05d59a5
      Steven Rostedt (Red Hat) authored
      The trace_tlb_flush() tracepoint can be called when a CPU is going offline.
      When a CPU is offline, RCU is no longer watching that CPU and since the
      tracepoint is protected by RCU, it must not be called. To prevent the
      tlb_flush tracepoint from being called when the CPU is offline, it was
      converted to a TRACE_EVENT_CONDITION where the condition checks if the
      CPU is online before calling the tracepoint.
      
      Unfortunately, this was not enough to stop lockdep from complaining about
      it. Even though the RCU protected code of the tracepoint will never be
      called, the condition is hidden within the tracepoint, and even though the
      condition prevents RCU code from being called, the lockdep checks are
      outside the tracepoint (this is to test tracepoints even when they are not
      enabled).
      
      Even though tracepoints should be checked to be RCU safe when they are not
      enabled, the condition should still be considered when checking RCU.
      
      Link: http://lkml.kernel.org/r/CA+icZUUGiGDoL5NU8RuxKzFjoLjEKRtUWx=JB8B9a0EQv-eGzQ@mail.gmail.com
      
      
      
      Fixes: 3a630178 "tracing: generate RCU warnings even when tracepoints are disabled"
      Cc: stable@vger.kernel.org # 3.18+
      Acked-by: default avatarDave Hansen <dave@sr71.net>
      Reported-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
      Tested-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      a05d59a5
  2. Jan 15, 2015
    • 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.org
      
      
      
      Reported-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.org
      
      
      
      Reported-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
  3. Jan 06, 2015
  4. Jan 05, 2015
  5. Jan 04, 2015
  6. Jan 03, 2015
  7. Jan 01, 2015
  8. Dec 31, 2014
    • Tobias Klauser's avatar
      nios2: Use preempt_schedule_irq · 1b0f4492
      Tobias Klauser authored
      
      
      Follow aa0d5326 ("ia64: Use preempt_schedule_irq") and use
      preempt_schedule_irq instead of enabling/disabling interrupts and
      messing around with PREEMPT_ACTIVE in the nios2 low-level preemption
      code ourselves. Also get rid of the now needless re-check for
      TIF_NEED_RESCHED, preempt_schedule_irq will already take care of
      rescheduling.
      
      This also fixes the following build error when building with
      CONFIG_PREEMPT:
      
      arch/nios2/kernel/built-in.o: In function `need_resched':
      arch/nios2/kernel/entry.S:374: undefined reference to `PREEMPT_ACTIVE'
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
      Acked-by: default avatarLey Foon Tan <lftan@altera.com>
      1b0f4492
    • Walter Goossens's avatar
      nios2: Initialize cpuinfo.mmu · 6f3d2b00
      Walter Goossens authored
      
      
      This patch initializes the mmu field of the cpuinfo structure to the
      value supplied by the devicetree.
      
      Signed-off-by: default avatarWalter Goossens <waltergoossens@home.nl>
      Acked-by: default avatarLey Foon Tan <lftan@altera.com>
      6f3d2b00
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 9bb29b6b
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "A very small set of fixes for 3.19, as everyone was out.
      
        The clocksource patch was something I missed for the merge window
        after the change that broke arm64 was merged through arm-soc.  The
        other two patches are a fix for an undetected merge problem in mvebu
        and a defconfig change to make some exynos boards work with the normal
        multi_v7_defconfig"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        Add USB_EHCI_EXYNOS to multi_v7_defconfig
        ARM: mvebu: Fix pinctrl configuration for Armada 370 DB
        clocksource: arch_timer: Only use the virtual counter (CNTVCT) on arm64
      9bb29b6b
    • Linus Torvalds's avatar
      Merge tag 'fbdev-fixes-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux · e4811a27
      Linus Torvalds authored
      Pull fbdev fixes from Tomi Valkeinen:
      
       - Fix regression with Nokia N900 display
      
       - Fix crash on fbdev using freed __initdata logos
      
       - Fix fb_deferred_io_fsync() return value.
      
      * tag 'fbdev-fixes-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
        OMAPDSS: SDI: fix output port_num
        video/fbdev: fix defio's fsync
        video/logo: prevent use of logos after they have been freed
        OMAPDSS: pll: NULL dereference in error handling
        OMAPDSS: HDMI: remove double initializer entries
      e4811a27
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · bac22980
      Linus Torvalds authored
      Pull input layer fixes from Dmitry Torokhov:
       "Fixes for v7 protocol for ALPS devices and few other driver fixes.
      
        Also users can request input events to be stamped with boot time
        timestamps, in addition to real and monotonic timestamps"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: hil_kbd - fix incorrect use of init_completion
        Input: alps - v7: document the v7 touchpad packet protocol
        Input: alps - v7: fix finger counting for > 2 fingers on clickpads
        Input: alps - v7: sometimes a single touch is reported in mt[1]
        Input: alps - v7: ignore new packets
        Input: evdev - add CLOCK_BOOTTIME support
        Input: psmouse - expose drift duration for IBM trackpoints
        Input: stmpe - bias keypad columns properly
        Input: stmpe - enforce device tree only mode
        mfd: stmpe: add pull up/down register offsets for STMPE
        Input: optimize events_per_packet count calculation
        Input: edt-ft5x06 - fixed a macro coding style issue
        Input: gpio_keys - replace timer and workqueue with delayed workqueue
        Input: gpio_keys - allow separating gpio and irq in device tree
      bac22980
    • Jiri Kosina's avatar
      Revert "cfg80211: make WEXT compatibility unselectable" · 831a39c2
      Jiri Kosina authored
      This reverts commit 24a0aa21.
      
      It's causing severe userspace breakage.  Namely, all the utilities from
      wireless-utils which are relying on CONFIG_WEXT (which means tools like
      'iwconfig', 'iwlist', etc) are not working anymore.  There is a 'iw'
      utility in newer wireless-tools, which is supposed to be a replacement
      for all the "deprecated" binaries, but it's far away from being
      massively adopted.
      
      Please see [1] for example of the userspace breakage this is causing.
      
      In addition to that, Larry Finger reports [2] that this patch is also
      causing ipw2200 driver being impossible to build.
      
      To me this clearly shows that CONFIG_WEXT is far, far away from being
      "deprecated enough" to be removed.
      
      [1] http://thread.gmane.org/gmane.linux.kernel/1857010
      [2] http://thread.gmane.org/gmane.linux.network/343688
      
      
      
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      831a39c2
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 2c90331c
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix double SKB free in bluetooth 6lowpan layer, from Jukka Rissanen.
      
       2) Fix receive checksum handling in enic driver, from Govindarajulu
          Varadarajan.
      
       3) Fix NAPI poll list corruption in virtio_net and caif_virtio, from
          Herbert Xu.  Also, add code to detect drivers that have this mistake
          in the future.
      
       4) Fix doorbell endianness handling in mlx4 driver, from Amir Vadai.
      
       5) Don't clobber IP6CB() before xfrm6_policy_check() is called in TCP
          input path,f rom Nicolas Dichtel.
      
       6) Fix MPLS action validation in openvswitch, from Pravin B Shelar.
      
       7) Fix double SKB free in vxlan driver, also from Pravin.
      
       8) When we scrub a packet, which happens when we are switching the
          context of the packet (namespace, etc.), we should reset the
          secmark.  From Thomas Graf.
      
       9) ->ndo_gso_check() needs to do more than return true/false, it also
          has to allow the driver to clear netdev feature bits in order for
          the caller to be able to proceed properly.  From Jesse Gross.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (62 commits)
        genetlink: A genl_bind() to an out-of-range multicast group should not WARN().
        netlink/genetlink: pass network namespace to bind/unbind
        ne2k-pci: Add pci_disable_device in error handling
        bonding: change error message to debug message in __bond_release_one()
        genetlink: pass multicast bind/unbind to families
        netlink: call unbind when releasing socket
        netlink: update listeners directly when removing socket
        genetlink: pass only network namespace to genl_has_listeners()
        netlink: rename netlink_unbind() to netlink_undo_bind()
        net: Generalize ndo_gso_check to ndo_features_check
        net: incorrect use of init_completion fixup
        neigh: remove next ptr from struct neigh_table
        net: xilinx: Remove unnecessary temac_property in the driver
        net: phy: micrel: use generic config_init for KSZ8021/KSZ8031
        net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding
        openvswitch: fix odd_ptr_err.cocci warnings
        Bluetooth: Fix accepting connections when not using mgmt
        Bluetooth: Fix controller configuration with HCI_QUIRK_INVALID_BDADDR
        brcmfmac: Do not crash if platform data is not populated
        ipw2200: select CFG80211_WEXT
        ...
      2c90331c
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-3.19-fixes' of... · 6ab1e8de
      Linus Torvalds authored
      Merge tag 'linux-kselftest-3.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull kselftest fix from Shuah Khan:
       "Fix exec test compile warnings"
      
      * tag 'linux-kselftest-3.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests/exec: Use %zu to format size_t
      6ab1e8de
    • Alan Stern's avatar
      SCSI: fix regression in scsi_send_eh_cmnd() · 511833ac
      Alan Stern authored
      
      
      Commit ac61d195 (scsi: set correct completion code in
      scsi_send_eh_cmnd()) introduced a bug.  It changed the stored return
      value from a queuecommand call, but it didn't take into account that
      the return value was used again later on.  This patch fixes the bug by
      changing the later usage.
      
      There is a big comment in the middle of scsi_send_eh_cmnd() which
      does a good job of explaining how the routine works.  But it mentions
      a "rtn = FAILURE" value that doesn't exist in the code.  This patch
      adjusts the code to match the comment (I assume the comment is right
      and the code is wrong).
      
      This fixes Bugzilla #88341.
      
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-by: default avatarАндрей Аладьев <aladjev.andrew@gmail.com>
      Tested-by: default avatarАндрей Аладьев <aladjev.andrew@gmail.com>
      Fixes: ac61d195
      Acked-by: default avatarHannes Reinecke <hare@suse.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      511833ac
  9. Dec 30, 2014