1. 26 Jun, 2013 3 commits
    • Daniel Vetter's avatar
      mutex: Add w/w mutex slowpath debugging · 23010027
      Daniel Vetter authored
      Injects EDEADLK conditions at pseudo-random interval, with
      exponential backoff up to UINT_MAX (to ensure that every lock
      operation still completes in a reasonable time).
      
      This way we can test the wound slowpath even for ww mutex users
      where contention is never expected, and the ww deadlock
      avoidance algorithm is only needed for correctness against
      malicious userspace. An example would be protecting kernel
      modesetting properties, which thanks to single-threaded X isn't
      really expected to contend, ever.
      
      I've looked into using the CONFIG_FAULT_INJECTION
      infrastructure, but decided against it for two reasons:
      
      - EDEADLK handling is mandatory for ww mutex users and should
        never affect the outcome of a syscall. This is in contrast to -ENOMEM
        injection. So fine configurability isn't required.
      
      - The fault injection framework only allows to set a simple
        probability for failure. Now the probability that a ww mutex acquire
        stage with N locks will never complete (due to too many injected
        EDEADLK backoffs) is zero. But the expected number of ww_mutex_lock
        operations for the completely uncontended case would be O(exp(N)).
        The per-acuiqire ctx exponential backoff solution choosen here only
        results in O(log N) overhead due to injection and so O(log N * N)
        lock operations. This way we can fail with high probability (and so
        have good test coverage even for fancy backoff and lock acquisition
        paths) without running into patalogical cases.
      
      Note that EDEADLK will only ever be injected when we managed to
      acquire the lock. This prevents any behaviour changes for users
      which rely on the EALREADY semantics.
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: dri-devel@lists.freedesktop.org
      Cc: linaro-mm-sig@lists.linaro.org
      Cc: rostedt@goodmis.org
      Cc: daniel@ffwll.ch
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20130620113117.4001.21681.stgit@patserSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      23010027
    • Maarten Lankhorst's avatar
      mutex: Add support for wound/wait style locks · 040a0a37
      Maarten Lankhorst authored
      Wound/wait mutexes are used when other multiple lock
      acquisitions of a similar type can be done in an arbitrary
      order. The deadlock handling used here is called wait/wound in
      the RDBMS literature: The older tasks waits until it can acquire
      the contended lock. The younger tasks needs to back off and drop
      all the locks it is currently holding, i.e. the younger task is
      wounded.
      
      For full documentation please read Documentation/ww-mutex-design.txt.
      
      References: https://lwn.net/Articles/548909/Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Acked-by: default avatarRob Clark <robdclark@gmail.com>
      Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: dri-devel@lists.freedesktop.org
      Cc: linaro-mm-sig@lists.linaro.org
      Cc: rostedt@goodmis.org
      Cc: daniel@ffwll.ch
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/51C8038C.9000106@canonical.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      040a0a37
    • Maarten Lankhorst's avatar
      arch: Make __mutex_fastpath_lock_retval return whether fastpath succeeded or not · a41b56ef
      Maarten Lankhorst authored
      This will allow me to call functions that have multiple
      arguments if fastpath fails. This is required to support ticket
      mutexes, because they need to be able to pass an extra argument
      to the fail function.
      
      Originally I duplicated the functions, by adding
      __mutex_fastpath_lock_retval_arg. This ended up being just a
      duplication of the existing function, so a way to test if
      fastpath was called ended up being better.
      
      This also cleaned up the reservation mutex patch some by being
      able to call an atomic_set instead of atomic_xchg, and making it
      easier to detect if the wrong unlock function was previously
      used.
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: dri-devel@lists.freedesktop.org
      Cc: linaro-mm-sig@lists.linaro.org
      Cc: robclark@gmail.com
      Cc: rostedt@goodmis.org
      Cc: daniel@ffwll.ch
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20130620113105.4001.83929.stgit@patserSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a41b56ef
  2. 25 Jun, 2013 4 commits
  3. 24 Jun, 2013 6 commits
  4. 22 Jun, 2013 9 commits
  5. 21 Jun, 2013 9 commits
    • Linus Torvalds's avatar
      Merge branch 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f71194a7
      Linus Torvalds authored
      Pull x86 fixes from Peter Anvin:
       "This series fixes a couple of build failures, and fixes MTRR cleanup
        and memory setup on very specific memory maps.
      
        Finally, it fixes triggering backtraces on all CPUs, which was
        inadvertently disabled on x86."
      
      * 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/efi: Fix dummy variable buffer allocation
        x86: Fix trigger_all_cpu_backtrace() implementation
        x86: Fix section mismatch on load_ucode_ap
        x86: fix build error and kconfig for ia32_emulation and binfmt
        range: Do not add new blank slot with add_range_with_merge
        x86, mtrr: Fix original mtrr range get for mtrr_cleanup
      f71194a7
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · e61cd5e2
      Linus Torvalds authored
      Pull drm radeon fixes from Dave Airlie:
       "One core fix, but mostly radeon fixes for s/r and big endian UVD
        support, and a fix to stop the GPU being reset for no good reason, and
        crashing people's machines."
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/radeon: update lockup tracking when scheduling in empty ring
        drm/prime: Honor requested file flags when exporting a buffer
        drm/radeon: fix UVD on big endian
        drm/radeon: fix write back suspend regression with uvd v2
        drm/radeon: do not try to uselessly update virtual memory pagetable
      e61cd5e2
    • Linus Torvalds's avatar
      Merge tag 'acpi-3.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 64a2f30a
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
      
       - Fix for a regression causing a failure to turn on some devices on
         some systems during initialization introduced by a recent revert of
         an ACPI PM change that broke something else.  Fortunately, we know
         exactly what devices are affected, so we can add a fix just for them
         leaving everyone else alone.
      
       - ACPI power resources initialization fix preventing a NULL pointer
         from being dereferenced in the acpi_add_power_resource() error code
         path.
      
       - ACPI dock station driver fix that adds missing locking to
         write_undock().
      
       - ACPI resources allocation fix changing the scope of an old workaround
         so that it doesn't affect systems that aren't actually buggy.  This
         was reported a couple of days ago to fix DMA problems on some new
         platforms so we need it in -stable.  From Mika Westerberg.
      
      * tag 'acpi-3.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI / LPSS: Power up LPSS devices during enumeration
        ACPI / PM: Fix error code path for power resources initialization
        ACPI / dock: Take ACPI scan lock in write_undock()
        ACPI / resources: call acpi_get_override_irq() only for legacy IRQ resources
      64a2f30a
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 9d0be540
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "Three one-line fixes for my first pull request; one for x86 host, one
        for x86 guest, one for PPC"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        x86: kvmclock: zero initialize pvclock shared memory area
        kvm/ppc/booke: Delay kvmppc_lazy_ee_enable
        KVM: x86: remove vcpu's CPL check in host-invoked XCR set
      9d0be540
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 92616ee6
      Linus Torvalds authored
      Pull crypto fix from Herbert Xu:
       "This fixes an unaligned crash in XTS mode when using aseni_intel"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: aesni_intel - fix accessing of unaligned memory
      92616ee6
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 7ecba6f2
      Linus Torvalds authored
      Pull Ceph fix from Sage Weil:
       "This fixes a problem preventing the kernel and userland librbd
        libraries from sharing data with the new format 2 images"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
        rbd: use the correct length for format 2 object names
      7ecba6f2
    • H. Peter Anvin's avatar
      Merge tag 'efi-urgent' into x86/urgent · df91c351
      H. Peter Anvin authored
       * Don't leak random kernel memory to EFI variable NVRAM when attempting
         to initiate garbage collection. Also, free the kernel memory when
         we're done with it instead of leaking - Ben Hutchings
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      df91c351
    • Mika Westerberg's avatar
      spi/pxa2xx: fix memory corruption due to wrong size used in devm_kzalloc() · cc0ee987
      Mika Westerberg authored
      ACPI part of the driver accidentally used sizeof(*ssp) instead of the
      correct sizeof(*pdata). This leads to nasty memory corruptions like the one
      below:
      
          BUG: unable to handle kernel paging request at 0000000749fd30b8
          IP: [<ffffffff813fe8a1>] __list_del_entry+0x31/0xd0
          PGD 0
          Oops: 0000 [#1] PREEMPT SMP
          Modules linked in:
          CPU: 0 PID: 30 Comm: kworker/0:1 Not tainted 3.10.0-rc6v3.10-rc6_sdhci_modprobe+ #443
          task: ffff8801483a0940 ti: ffff88014839e000 task.ti: ffff88014839e000
          RIP: 0010:[<ffffffff813fe8a1>]  [<ffffffff813fe8a1>] __list_del_entry+0x31/0xd0
          RSP: 0000:ffff88014839fde8  EFLAGS: 00010046
          RAX: ffff880149fd30b0 RBX: ffff880149fd3040 RCX: dead000000200200
          RDX: 0000000749fd30b0 RSI: ffff880149fd3058 RDI: ffff88014834d640
          RBP: ffff88014839fde8 R08: ffff88014834d640 R09: 0000000000000001
          R10: ffff8801483a0940 R11: 0000000000000001 R12: ffff880149fd3040
          R13: ffffffff810e0b30 R14: ffff8801483a0940 R15: ffff88014834d640
          FS:  0000000000000000(0000) GS:ffff880149e00000(0000) knlGS:0000000000000000
          CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
          CR2: 0000000000000168 CR3: 0000000001e0b000 CR4: 00000000001407f0
          DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
          DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
          Stack:
           ffff88014839fe48 ffffffff810e0baf ffffffff81120abd ffff88014839fe20
           ffff8801483a0940 ffff8801483a0940 ffff8801483a0940 ffff8801486b1c90
           ffff88014834d640 ffffffff810e0b30 0000000000000000 0000000000000000
          Call Trace:
           [<ffffffff810e0baf>] worker_thread+0x7f/0x390
           [<ffffffff81120abd>] ? trace_hardirqs_on+0xd/0x10
           [<ffffffff810e0b30>] ? manage_workers.isra.22+0x2b0/0x2b0
           [<ffffffff810e6c09>] kthread+0xd9/0xe0
           [<ffffffff810f93df>] ? local_clock+0x3f/0x50
           [<ffffffff810e6b30>] ? kthread_create_on_node+0x110/0x110
           [<ffffffff818c5dec>] ret_from_fork+0x7c/0xb0
           [<ffffffff810e6b30>] ? kthread_create_on_node+0x110/0x110
      
      Fix this by using the right structure size in devm_kzalloc().
      Reported-by: default avatarJerome Blin <jerome.blin@intel.com>
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      Cc: stable@vger.kernel.org # 3.9+
      cc0ee987
    • Ben Hutchings's avatar
      x86/efi: Fix dummy variable buffer allocation · b8cb62f8
      Ben Hutchings authored
      1. Check for allocation failure
      2. Clear the buffer contents, as they may actually be written to flash
      3. Don't leak the buffer
      
      Compile-tested only.
      
      [ Tested successfully on my buggy ASUS machine - Matt ]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      b8cb62f8
  6. 20 Jun, 2013 9 commits