1. 09 Dec, 2016 6 commits
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Replace kmap with copy_from_user() in trace_marker writing · 656c7f0d
      Steven Rostedt (Red Hat) authored
      Instead of using get_user_pages_fast() and kmap_atomic() when writing
      to the trace_marker file, just allocate enough space on the ring buffer
      directly, and write into it via copy_from_user().
      
      Writing into the trace_marker file use to allocate a temporary buffer
      to perform the copy_from_user(), as we didn't want to write into the
      ring buffer if the copy failed. But as a trace_marker write is suppose
      to be extremely fast, and allocating memory causes other tracepoints to
      trigger, Peter Zijlstra suggested using get_user_pages_fast() and
      kmap_atomic() to keep the user space pages in memory and reading it
      directly. But Henrik Austad had issues with this because it required taking
      the mm->mmap_sem and causing long delays with the write.
      
      Instead, just allocate the space in the ring buffer and use
      copy_from_user() directly. If it faults, return -EFAULT and write
      "<faulted>" into the ring buffer.
      
      Link: http://lkml.kernel.org/r/20161208124018.72dd0f86@gandalf.local.home
      
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Henrik Austad <henrik@austad.us>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Updates: d696b58c "tracing: Do not allocate buffer for trace_marker"
      Suggested-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      656c7f0d
    • Steven Rostedt (Red Hat)'s avatar
      ftrace/x86_32: Set ftrace_stub to weak to prevent gcc from using short jumps to it · 847fa1a6
      Steven Rostedt (Red Hat) authored
      With new binutils, gcc may get smart with its optimization and change a jmp
      from a 5 byte jump to a 2 byte one even though it was jumping to a global
      function. But that global function existed within a 2 byte radius, and gcc
      was able to optimize it. Unfortunately, that jump was also being modified
      when function graph tracing begins. Since ftrace expected that jump to be 5
      bytes, but it was only two, it overwrote code after the jump, causing a
      crash.
      
      This was fixed for x86_64 with commit 8329e818, with the same subject as
      this commit, but nothing was done for x86_32.
      
      Cc: stable@vger.kernel.org
      Fixes: d61f82d0 ("ftrace: use dynamic patching for updating mcount calls")
      Reported-by: default avatarColin Ian King <colin.king@canonical.com>
      Tested-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      847fa1a6
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Allow benchmark to be enabled at early_initcall() · 9c1f6bb8
      Steven Rostedt (Red Hat) authored
      The trace event start up selftests fails when the trace benchmark is
      enabled, because it is disabled during boot. It really only needs to be
      disabled before scheduling is set up, as it creates a thread.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      9c1f6bb8
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Have system enable return error if one of the events fail · 989a0a3d
      Steven Rostedt (Red Hat) authored
      If one of the events within a system fails to enable when "1" is written
      to the system "enable" file, it should return an error. Note, some events
      may still be enabled, but the user should know that something did go wrong.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      989a0a3d
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Do not start benchmark on boot up · 1dd349ab
      Steven Rostedt (Red Hat) authored
      Trace events are enabled very early on boot up via the boot command line
      parameter. The benchmark tool creates a new thread to perform the trace
      event benchmarking. But at start up, it is called before scheduling is set
      up and because it creates a new thread before the init thread is created,
      this crashes the kernel.
      
      Have the benchmark fail to register when started via the kernel command
      line.
      
      Also, since the registering of a tracepoint now can handle failure cases,
      return -ENOMEM instead of warning if the thread cannot be created.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      1dd349ab
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Have the reg function allow to fail · 8cf868af
      Steven Rostedt (Red Hat) authored
      Some tracepoints have a registration function that gets enabled when the
      tracepoint is enabled. There may be cases that the registraction function
      must fail (for example, can't allocate enough memory). In this case, the
      tracepoint should also fail to register, otherwise the user would not know
      why the tracepoint is not working.
      
      Cc: David Howells <dhowells@redhat.com>
      Cc: Seiji Aguchi <seiji.aguchi@hds.com>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      8cf868af
  2. 24 Nov, 2016 4 commits
  3. 23 Nov, 2016 4 commits
  4. 22 Nov, 2016 15 commits
  5. 15 Nov, 2016 1 commit
  6. 14 Nov, 2016 7 commits
  7. 13 Nov, 2016 3 commits
    • Linus Torvalds's avatar
      Linux 4.9-rc5 · a25f0944
      Linus Torvalds authored
      a25f0944
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · e234832a
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "ARM fixes.  There are a couple pending x86 patches but they'll have to
        wait for next week"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: arm/arm64: vgic: Kick VCPUs when queueing already pending IRQs
        KVM: arm/arm64: vgic: Prevent access to invalid SPIs
        arm/arm64: KVM: Perform local TLB invalidation when multiplexing vcpus on a single CPU
      e234832a
    • Linus Torvalds's avatar
      Merge branch 'media-fixes' (patches from Mauro) · e861d890
      Linus Torvalds authored
      Merge media fixes from Mauro Carvalho Chehab:
       "This contains two patches fixing problems with my patch series meant
        to make USB drivers to work again after the DMA on stack changes.
      
        The last patch on this series is actually not related to DMA on stack.
        It solves a longstanding bug affecting module unload, causing
        module_put() to be called twice. It was reported by the user who
        reported and tested the issues with the gp8psk driver with the DMA
        fixup patches. As we're late at -rc cycle, maybe you prefer to not
        apply it right now. If this is the case, I'll add to the pile of
        patches for 4.10.
      
        Exceptionally this time, I'm sending the patches via e-mail, because
        I'm on another trip, and won't be able to use the usual procedure
        until Monday. Also, it is only three patches, and you followed already
        the discussions about the first one"
      
      * emailed patches from Mauro Carvalho Chehab <mchehab@osg.samsung.com>:
        gp8psk: Fix DVB frontend attach
        gp8psk: fix gp8psk_usb_in_op() logic
        dvb-usb: move data_mutex to struct dvb_usb_device
      e861d890