1. 24 Jan, 2012 1 commit
    • David Vrabel's avatar
      x86: xen: size struct xen_spinlock to always fit in arch_spinlock_t · 7a7546b3
      David Vrabel authored
      If NR_CPUS < 256 then arch_spinlock_t is only 16 bits wide but struct
      xen_spinlock is 32 bits.  When a spin lock is contended and
      xl->spinners is modified the two bytes immediately after the spin lock
      would be corrupted.
      
      This is a regression caused by 84eb950d
      (x86, ticketlock: Clean up types and accessors) which reduced the size
      of arch_spinlock_t.
      
      Fix this by making xl->spinners a u8 if NR_CPUS < 256.  A
      BUILD_BUG_ON() is also added to check the sizes of the two structures
      are compatible.
      
      In many cases this was not noticable as there would often be padding
      bytes after the lock (e.g., if any of CONFIG_GENERIC_LOCKBREAK,
      CONFIG_DEBUG_SPINLOCK, or CONFIG_DEBUG_LOCK_ALLOC were enabled).
      
      The bnx2 driver is affected. In struct bnx2, phy_lock and
      indirect_lock may have no padding after them.  Contention on phy_lock
      would corrupt indirect_lock making it appear locked and the driver
      would deadlock.
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@goop.org>
      Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
      CC: stable@kernel.org #only 3.2
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      7a7546b3
  2. 12 Jan, 2012 2 commits
    • Konrad Rzeszutek Wilk's avatar
      xen/balloon: Move the registration from device to subsystem. · 8ea11f7f
      Konrad Rzeszutek Wilk authored
      With git commit 07068021
      "xen-balloon: convert sysdev_class to a regular subsystem" we would
      end up with the attributes being put in:
      
       /sys/devices/xen_memory0/target_kb
      instead of
      /sys/devices/system/xen_memory/xen_memory0/target_kb
      
      Making the tools inable to deflate the kernel to make more space
      for launching another guest and printing:
      Error: Failed to query current memory allocation of dom0
      Reported-by: default avatarSander Eikelenboom <linux@eikelenboom.it>
      Suggested-by: default avatarKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      8ea11f7f
    • Konrad Rzeszutek Wilk's avatar
      Merge commit '07068021' into stable/for-linus-fixes-3.3 · d3b7737f
      Konrad Rzeszutek Wilk authored
      * commit '07068021': (50 commits)
        xen-balloon: convert sysdev_class to a regular subsystem
        clocksource: convert sysdev_class to a regular subsystem
        ibm_rtl: convert sysdev_class to a regular subsystem
        edac: convert sysdev_class to a regular subsystem
        rtmutex-tester: convert sysdev_class to a regular subsystem
        driver-core: implement 'sysdev' functionality for regular devices and buses
        kref: fix up the kfree build problems
        kref: Remove the memory barriers
        kref: Implement kref_put in terms of kref_sub
        kref: Inline all functions
        Drivers: hv: Get rid of an unnecessary check in hv.c
        Drivers: hv: Make the vmbus driver unloadable
        Drivers: hv: Fix a memory leak
        Documentation: Update stable address
        MAINTAINERS: stable: Update address
        w1: add fast search for single slave bus
        driver-core: skip uevent generation when nobody is listening
        drivers: hv: Don't OOPS when you cannot init vmbus
        firmware: google: fix gsmi.c build warning
        drivers_base: make argument to platform_device_register_full const
        ...
      d3b7737f
  3. 09 Jan, 2012 1 commit
  4. 14 Dec, 2011 7 commits
  5. 13 Dec, 2011 3 commits
    • Peter Zijlstra's avatar
      kref: Remove the memory barriers · 3c8ed889
      Peter Zijlstra authored
      Commit 1b0b3b99 ("kref: fix CPU ordering with respect to krefs")
      wrongly adds memory barriers to kref.
      
      It states:
      
        some atomic operations are only atomic, not ordered. Thus a CPU is allowed
        to reorder memory references to an object to before the reference is
        obtained. This fixes it.
      
      While true, it fails to show why this is a problem. I say it is not a
      problem because if there is a race with kref_put() such that we could
      end up referencing a free'd object without this memory barrier, we
      would still have that race with the memory barrier.
      
      The kref_put() in question could complete (and free the object) before
      the atomic_inc() and we'd still be up shit creek.
      
      The kref_init() case is even worse, if your object is published at this
      time you're so wrong the memory barrier won't make a difference what
      so ever. If its not published, the act of publishing should include
      the needed barriers/locks to make sure all writes prior to the act of
      publishing are complete such that others will only observe a complete
      object.
      
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Oliver Neukum <oneukum@suse.de>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      3c8ed889
    • Peter Zijlstra's avatar
      kref: Implement kref_put in terms of kref_sub · 47dbd7d9
      Peter Zijlstra authored
      Less lines of code is better.
      
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      47dbd7d9
    • Peter Zijlstra's avatar
      kref: Inline all functions · 4af679cd
      Peter Zijlstra authored
      These are tiny functions, there's no point in having them out-of-line.
      
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/n/tip-8eccvi2ur2fzgi00xdjlbf5z@git.kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4af679cd
  6. 12 Dec, 2011 5 commits
  7. 10 Dec, 2011 5 commits
  8. 28 Nov, 2011 1 commit
    • Tejun Heo's avatar
      Merge branch 'master' into x86/memblock · d4bbf7e7
      Tejun Heo authored
      Conflicts & resolutions:
      
      * arch/x86/xen/setup.c
      
      	dc91c728 "xen: allow extra memory to be in multiple regions"
      	24aa0788 "memblock, x86: Replace memblock_x86_reserve/free..."
      
      	conflicted on xen_add_extra_mem() updates.  The resolution is
      	trivial as the latter just want to replace
      	memblock_x86_reserve_range() with memblock_reserve().
      
      * drivers/pci/intel-iommu.c
      
      	166e9278 "x86/ia64: intel-iommu: move to drivers/iommu/"
      	5dfe8660 "bootmem: Replace work_with_active_regions() with..."
      
      	conflicted as the former moved the file under drivers/iommu/.
      	Resolved by applying the chnages from the latter on the moved
      	file.
      
      * mm/Kconfig
      
      	66616720 "memblock: add NO_BOOTMEM config symbol"
      	c378ddd5 "memblock, x86: Make ARCH_DISCARD_MEMBLOCK a config option"
      
      	conflicted trivially.  Both added config options.  Just
      	letting both add their own options resolves the conflict.
      
      * mm/memblock.c
      
      	d1f0ece6 "mm/memblock.c: small function definition fixes"
      	ed7b56a7 "memblock: Remove memblock_memory_can_coalesce()"
      
      	confliected.  The former updates function removed by the
      	latter.  Resolution is trivial.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      d4bbf7e7
  9. 27 Nov, 2011 8 commits
  10. 26 Nov, 2011 4 commits
  11. 24 Nov, 2011 3 commits