1. 20 11月, 2014 12 次提交
  2. 19 11月, 2014 1 次提交
    • S
      tracing: Fix race of function probes counting · a9ce7c36
      Steven Rostedt (Red Hat) 提交于
      The function probe counting for traceon and traceoff suffered a race
      condition where if the probe was executing on two or more CPUs at the
      same time, it could decrement the counter by more than one when
      disabling (or enabling) the tracer only once.
      
      The way the traceon and traceoff probes are suppose to work is that
      they disable (or enable) tracing once per count. If a user were to
      echo 'schedule:traceoff:3' into set_ftrace_filter, then when the
      schedule function was called, it would disable tracing. But the count
      should only be decremented once (to 2). Then if the user enabled tracing
      again (via tracing_on file), the next call to schedule would disable
      tracing again and the count would be decremented to 1.
      
      But if multiple CPUS called schedule at the same time, it is possible
      that the count would be decremented more than once because of the
      simple "count--" used.
      
      By reading the count into a local variable and using memory barriers
      we can guarantee that the count would only be decremented once per
      disable (or enable).
      
      The stack trace probe had a similar race, but here the stack trace will
      decrement for each time it is called. But this had the read-modify-
      write race, where it could stack trace more than the number of times
      that was specified. This case we use a cmpxchg to stack trace only the
      number of times specified.
      
      The dump probes can still use the old "update_count()" function as
      they only run once, and that is controlled by the dump logic
      itself.
      
      Link: http://lkml.kernel.org/r/20141118134643.4b550ee4@gandalf.local.homeSigned-off-by: NSteven Rostedt <rostedt@goodmis.org>
      a9ce7c36
  3. 14 11月, 2014 9 次提交
  4. 12 11月, 2014 6 次提交
  5. 01 11月, 2014 2 次提交
    • S
      ftrace/x86: Show trampoline call function in enabled_functions · 15d5b02c
      Steven Rostedt (Red Hat) 提交于
      The file /sys/kernel/debug/tracing/eneabled_functions is used to debug
      ftrace function hooks. Add to the output what function is being called
      by the trampoline if the arch supports it.
      
      Add support for this feature in x86_64.
      
      Cc: H. Peter Anvin <hpa@linux.intel.com>
      Tested-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Tested-by: NJiri Kosina <jkosina@suse.cz>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      15d5b02c
    • S
      ftrace/x86: Add dynamic allocated trampoline for ftrace_ops · f3bea491
      Steven Rostedt (Red Hat) 提交于
      The current method of handling multiple function callbacks is to register
      a list function callback that calls all the other callbacks based on
      their hash tables and compare it to the function that the callback was
      called on. But this is very inefficient.
      
      For example, if you are tracing all functions in the kernel and then
      add a kprobe to a function such that the kprobe uses ftrace, the
      mcount trampoline will switch from calling the function trace callback
      to calling the list callback that will iterate over all registered
      ftrace_ops (in this case, the function tracer and the kprobes callback).
      That means for every function being traced it checks the hash of the
      ftrace_ops for function tracing and kprobes, even though the kprobes
      is only set at a single function. The kprobes ftrace_ops is checked
      for every function being traced!
      
      Instead of calling the list function for functions that are only being
      traced by a single callback, we can call a dynamically allocated
      trampoline that calls the callback directly. The function graph tracer
      already uses a direct call trampoline when it is being traced by itself
      but it is not dynamically allocated. It's trampoline is static in the
      kernel core. The infrastructure that called the function graph trampoline
      can also be used to call a dynamically allocated one.
      
      For now, only ftrace_ops that are not dynamically allocated can have
      a trampoline. That is, users such as function tracer or stack tracer.
      kprobes and perf allocate their ftrace_ops, and until there's a safe
      way to free the trampoline, it can not be used. The dynamically allocated
      ftrace_ops may, although, use the trampoline if the kernel is not
      compiled with CONFIG_PREEMPT. But that will come later.
      Tested-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Tested-by: NJiri Kosina <jkosina@suse.cz>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      f3bea491
  6. 25 10月, 2014 2 次提交
    • S
      ftrace: Fix checking of trampoline ftrace_ops in finding trampoline · 4fc40904
      Steven Rostedt (Red Hat) 提交于
      When modifying code, ftrace has several checks to make sure things
      are being done correctly. One of them is to make sure any code it
      modifies is exactly what it expects it to be before it modifies it.
      In order to do so with the new trampoline logic, it must be able
      to find out what trampoline a function is hooked to in order to
      see if the code that hooks to it is what's expected.
      
      The logic to find the trampoline from a record (accounting descriptor
      for a function that is hooked) needs to only look at the "old_hash"
      of an ops that is being modified. The old_hash is the list of function
      an ops is hooked to before its update. Since a record would only be
      pointing to an ops that is being modified if it was already hooked
      before.
      
      Currently, it can pick a modified ops based on its new functions it
      will be hooked to, and this picks the wrong trampoline and causes
      the check to fail, disabling ftrace.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      
      ftrace: squash into ordering of ops for modification
      4fc40904
    • S
      ftrace: Set ops->old_hash on modifying what an ops hooks to · 8252ecf3
      Steven Rostedt (Red Hat) 提交于
      The code that checks for trampolines when modifying function hooks
      tests against a modified ops "old_hash". But the ops old_hash pointer
      is not being updated before the changes are made, making it possible
      to not find the right hash to the callback and possibly causing
      ftrace to break in accounting and disable itself.
      
      Have the ops set its old_hash before the modifying takes place.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      8252ecf3
  7. 20 10月, 2014 8 次提交
    • L
      Linux 3.18-rc1 · f114040e
      Linus Torvalds 提交于
      f114040e
    • L
      Merge tag 'arm-soc-fixes-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 4d3639ac
      Linus Torvalds 提交于
      Pull ARM SoC fixes from Olof Johansson:
       "A batch of fixes that have come in during the merge window.
      
        Some of them are defconfig updates for things that have now landed,
        some errata additions and a few general scattered fixes.
      
        There's also a qcom DT update that adds support for SATA on AP148, and
        basic support for Sony Xperia Z1 and CM-QS600 platforms that seemed
        isolated enough that we could merge it even if it's late"
      
      * tag 'arm-soc-fixes-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        MAINTAINERS: corrected bcm2835 search
        ARM: dts: Explicitly set dr_mode on exynos5420-arndale-octa
        ARM: dts: Explicitly set dr_mode on exynos Peach boards
        ARM: dts: qcom: add CM-QS600 board
        ARM: dts: qcom: Add initial DTS file for Sony Xperia Z1 phone
        ARM: dts: qcom: Add SATA support on IPQ8064/AP148
        MAINTAINERS: Update Santosh Shilimkar's email id
        ARM: sunxi_defconfig: enable CONFIG_REGULATOR
        ARM: dts: Disable smc91x on n900 until bootloader dependency is removed
        ARM: omap2plus_defconfig: Enable ARM erratum 430973 for omap3
        ARM: exynos_defconfig: enable USB gadget support
        ARM: exynos_defconfig: Enable Maxim 77693 and I2C GPIO drivers
        ARM: mm: Fix ifdef around cpu_*_do_[suspend, resume] ops
        ARM: EXYNOS: Fix build with PM_SLEEP=n and ARM_EXYNOS_CPUIDLE=n
        ARM: SAMSUNG: Restore Samsung PM Debug functionality
        ARM: dts: Fix pull setting in sd4_width8 pin group for exynos4x12
        ARM: exynos_defconfig: Enable SBS battery support
        ARM: exynos_defconfig: Enable Control Groups support
        ARM: exynos_defconfig: Enable Atmel maXTouch support
        ARM: exynos_defconfig: Enable MAX77802
      4d3639ac
    • L
      Merge git://git.infradead.org/users/eparis/audit · ab074ade
      Linus Torvalds 提交于
      Pull audit updates from Eric Paris:
       "So this change across a whole bunch of arches really solves one basic
        problem.  We want to audit when seccomp is killing a process.  seccomp
        hooks in before the audit syscall entry code.  audit_syscall_entry
        took as an argument the arch of the given syscall.  Since the arch is
        part of what makes a syscall number meaningful it's an important part
        of the record, but it isn't available when seccomp shoots the
        syscall...
      
        For most arch's we have a better way to get the arch (syscall_get_arch)
        So the solution was two fold: Implement syscall_get_arch() everywhere
        there is audit which didn't have it.  Use syscall_get_arch() in the
        seccomp audit code.  Having syscall_get_arch() everywhere meant it was
        a useless flag on the stack and we could get rid of it for the typical
        syscall entry.
      
        The other changes inside the audit system aren't grand, fixed some
        records that had invalid spaces.  Better locking around the task comm
        field.  Removing some dead functions and structs.  Make some things
        static.  Really minor stuff"
      
      * git://git.infradead.org/users/eparis/audit: (31 commits)
        audit: rename audit_log_remove_rule to disambiguate for trees
        audit: cull redundancy in audit_rule_change
        audit: WARN if audit_rule_change called illegally
        audit: put rule existence check in canonical order
        next: openrisc: Fix build
        audit: get comm using lock to avoid race in string printing
        audit: remove open_arg() function that is never used
        audit: correct AUDIT_GET_FEATURE return message type
        audit: set nlmsg_len for multicast messages.
        audit: use union for audit_field values since they are mutually exclusive
        audit: invalid op= values for rules
        audit: use atomic_t to simplify audit_serial()
        kernel/audit.c: use ARRAY_SIZE instead of sizeof/sizeof[0]
        audit: reduce scope of audit_log_fcaps
        audit: reduce scope of audit_net_id
        audit: arm64: Remove the audit arch argument to audit_syscall_entry
        arm64: audit: Add audit hook in syscall_trace_enter/exit()
        audit: x86: drop arch from __audit_syscall_entry() interface
        sparc: implement is_32bit_task
        sparc: properly conditionalize use of TIF_32BIT
        ...
      ab074ade
    • O
      Merge tag 'qcom-dt-for-3.18-3' of... · 57764512
      Olof Johansson 提交于
      Merge tag 'qcom-dt-for-3.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/galak/linux-qcom into fixes
      
      Merge "qcom DT changes for v3.18-3" from Kumar Gala:
      
      Qualcomm ARM Based Device Tree Updates for v3.18-3
      
      * Added Board support for CM-QS600 and Sony Xperia Z1 phone
      * Added SATA support on IPQ8064/AP148
      
      * tag 'qcom-dt-for-3.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/galak/linux-qcom:
        ARM: dts: qcom: add CM-QS600 board
        ARM: dts: qcom: Add initial DTS file for Sony Xperia Z1 phone
        ARM: dts: qcom: Add SATA support on IPQ8064/AP148
      57764512
    • O
      Merge tag 'samsung-fixes-2' of... · e29c6486
      Olof Johansson 提交于
      Merge tag 'samsung-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into fixes
      
      Pull more fixes from Kukjin Kim:
      
      2nd Samsung fixes for v3.18
      - Explicitly set dr_mode on exynos5800-peach-pi, exynos5420-peach-pit
        and exynos5420-arndale-octa boards, because the USB dwc3 controller
        will not work properly without dr_mode as host on above boards if
        the USB host and gadget are enabled in kernel configuration both.
      
      * tag 'samsung-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
        ARM: dts: Explicitly set dr_mode on exynos5420-arndale-octa
        ARM: dts: Explicitly set dr_mode on exynos Peach boards
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      e29c6486
    • S
      MAINTAINERS: corrected bcm2835 search · 9209bec4
      Scott Branden 提交于
      Corrected bcm2835 maintainer info by using N: to specify any files with
      bcm2835 in are directed to the proper maintainer.
      Also corrected minor mispelling of ARCHITECTURE in 2 comment locations.
      Signed-off-by: NScott Branden <sbranden@broadcom.com>
      Signed-off-by: NStephen Warren <swarren@wwwdotorg.org>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      9209bec4
    • L
      Merge tag 'ntb-3.18' of git://github.com/jonmason/ntb · 61ed53de
      Linus Torvalds 提交于
      Pull ntb (non-transparent bridge) updates from Jon Mason:
       "Add support for Haswell NTB split BARs, a debugfs entry for basic
        debugging info, and some code clean-ups"
      
      * tag 'ntb-3.18' of git://github.com/jonmason/ntb:
        ntb: Adding split BAR support for Haswell platforms
        ntb: use errata flag set via DID to implement workaround
        ntb: conslidate reading of PPD to move platform detection earlier
        ntb: move platform detection to separate function
        NTB: debugfs device entry
      61ed53de
    • L
      Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 278f1d07
      Linus Torvalds 提交于
      Pull i2c updates from Wolfram Sang:
       "Highlights from the I2C subsystem for 3.18:
      
         - new drivers for Axxia AM55xx, and Hisilicon hix5hd2 SoC.
      
         - designware driver gained AMD support, exynos gained exynos7 support
      
        The rest is usual driver stuff.  Hopefully no lowlights this time"
      
      * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: i801: Add Device IDs for Intel Sunrise Point PCH
        i2c: hix5hd2: add i2c controller driver
        i2c-imx: Disable the clock on probe failure
        i2c: designware: Add support for AMD I2C controller
        i2c: designware: Rework probe() to get clock a bit later
        i2c: designware: Default to fast mode in case of ACPI
        i2c: axxia: Add I2C driver for AXM55xx
        i2c: exynos: add support for HSI2C module on Exynos7
        i2c: mxs: detect No Slave Ack on SELECT in PIO mode
        i2c: cros_ec: Remove EC_I2C_FLAG_10BIT
        i2c: cros-ec-tunnel: Add of match table
        i2c: rcar: remove sign-compare flaw
        i2c: ismt: Use minimum descriptor size
        i2c: imx: Add arbitration lost check
        i2c: rk3x: Remove unlikely() annotations
        i2c: rcar: check for no IRQ in rcar_i2c_irq()
        i2c: rcar: make rcar_i2c_prepare_msg() *void*
        i2c: rcar: simplify check for last message
        i2c: designware: add support of platform data to set I2C mode
        i2c: designware: add support of I2C standard mode
      278f1d07