Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull core locking updates from Thomas Gleixner.

* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  futex: Mark get_robust_list as deprecated
  futex: Do not leak robust list to unprivileged process
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull genirq updates from Thomas Gleixner.

* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return value
  genirq: Respect NUMA node affinity in setup_irq_irq affinity()
  genirq: Get rid of unneeded force parameter in irq_finalize_oneshot()
  genirq: Minor readablity improvement in irq_wake_thread()
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull kconfig bits from Michal Marek:
 "There is one fix for make oldconfig by Arnaud and updates to the
  merge_config.sh tool."

* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  merge_config.sh: Add option to display redundant configs
  merge_config.sh: Set execute bit
  merge_config.sh: Use the first file as the initial config
  kconfig: fix new choices being skipped upon config update
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull non-critical part of kbuild from Michal Marek:
 - New semantic patches, make coccicheck M= fix
 - make gtags speedup
 - make tags/TAGS always removes struct forward declarations
 - make deb-pkg fixes (some patches are still pending, I know)
 - scripts/patch-kernel fix from the last user of this script ;)

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  scripts/patch-kernel: digest kernel.org hosted .xz patches
  scripts/coccinelle/api/ptr_ret.cocci: semantic patch for ptr_err
  scripts: refactor remove structure forward declarations
  kbuild: incremental tags update for GNU Global
  coccinelle: semantic patch for bool issues
  coccinelle: semantic patch to check for PTR_ERR after reassignment
  coccinelle: semantic patch converting 0 test to null test
  coccinelle: semantic patch for missing iounmap
  coccinelle: semantic patch for missing clk_put
  kbuild: Fix out-of-tree build for 'make deb-pkg'
  kbuild: Only build linux-image package for UML
  kbuild: Fix link to headers in 'make deb-pkg'
  coccicheck: change handling of C={1,2} when M= is set
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull kbuild changes from Michal Marek:
 - Unification of cmd_uimage among archs that use it
 - make headers_check tries harder before reporting a missing
   <linux/types.h> include
 - kbuild portability fix for shells that do not support echo -e
 - make clean descends into samples/
 - setlocalversion grep fix
 - modpost typo fix
 - dtc warnings fix

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  setlocalversion: Use "grep -q" instead of piping output to "read dummy"
  modpost: fix ALL_INIT_DATA_SECTIONS
  Kbuild: centralize MKIMAGE and cmd_uimage definitions
  headers_check: recursively search for linux/types.h inclusion
  scripts/Kbuild.include: Fix portability problem of "echo -e"
  scripts: dtc: fix compile warnings
  kbuild: clean up samples directory
  kbuild: disable -Wmissing-field-initializers for W=1
sparc32: fix fallout from system.h removal

Build failures for the typical configs I use

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc

Pull Sam Ravnborg's sparc32 build fixes from David Miller.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc32: fix fallout from system.h removal
virtio: balloon: Allow stats update after restore from S4

There's no reason stats update after restore can't work.  If a host
requested for stats, and before servicing the request, the guest entered
S4, upon restore, the stats request can still be processed and sent off
to the host.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio: drop thaw PM operation

The thaw operation was used by the balloon driver, but after the last
commit there's no reason to have separate thaw and restore callbacks.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-pci: drop restore_common()

restore_common() was shared between restore and thaw callbacks.  With
thaw gone, we don't need restore_common() anymore.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-pci: S3 support

There's no difference in supporting S3 and S4 for virtio devices: the
vqs have to be re-created as the device has to be assumed to be reset at
restore-time.  Since S4 already handles this situation, we can directly
use the same code and callbacks for S3 support.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-pci: switch to PM ops macro to initialise PM functions

Use the SET_SYSTEM_SLEEP_PM_OPS macro to initialise the suspend/resume
functions in the new PM API.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
sched: Fix incorrect usage of for_each_cpu_mask() in select_fallback_rq()

The function for_each_cpu_mask() expects a *pointer* to struct
cpumask as its second argument, whereas select_fallback_rq()
passes the value itself.

And moreover, for_each_cpu_mask() has been marked as obselete
in include/linux/cpumask.h. So move to the more appropriate
for_each_cpu() variant.

Reported-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Dave Jones <davej@redhat.com>
Cc: Liu Chuansheng <chuansheng.liu@intel.com>
Cc: vapier@gentoo.org
Cc: rusty@rustcorp.com.au
Link: http://lkml.kernel.org/r/4F75BED4.9050005@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
selinux: don't inline slow-path code into avc_has_perm_noaudit()

The selinux AVC paths remain some of the hottest (and deepest) codepaths
at filename lookup time, and we make it worse by having the slow path
cases take up I$ and stack space even when they don't trigger.  Gcc
tends to always want to inline functions that are just called once -
never mind that this might make for slower and worse code in the caller.

So this tries to improve on it a bit by making the slow-path cases
explicitly separate functions that are marked noinline, causing gcc to
at least no longer allocate stack space for them unless they are
actually called.  It also seems to help register allocation a tiny bit,
since gcc now doesn't take the slow case code into account.

Uninlining the slow path may also allow us to inline the remaining hot
path into the one caller that actually matters: avc_has_perm_flags().
I'll have to look at that separately, but both avc_audit() and
avc_has_perm_noaudit() are now small and lean enough that inlining them
may make sense.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
selinux: inline avc_audit() and avc_has_perm_noaudit() into caller

Now that all the slow-path code is gone from these functions, we can
inline them into the main caller - avc_has_perm_flags().

Now the compiler can see that 'avc' is allocated on the stack for this
case, which helps register pressure a bit.  It also actually shrinks the
total stack frame, because the stack frame that avc_has_perm_flags()
always needed (for that 'avc' allocation) is now sufficient for the
inlined functions too.

Inlining isn't bad - but mindless inlining of cold code (see the
previous commit) is.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ASPM: Fix pcie devices with non-pcie children

Since 3.2.12 and 3.3, some systems are failing to boot with a BUG_ON.
Some other systems using the pata_jmicron driver fail to boot because no
disks are detected.  Passing pcie_aspm=force on the kernel command line
works around it.

The cause: commit 4949be16822e ("PCI: ignore pre-1.1 ASPM quirking when
ASPM is disabled") changed the behaviour of pcie_aspm_sanity_check() to
always return 0 if aspm is disabled, in order to avoid cases where we
changed ASPM state on pre-PCIe 1.1 devices.

This skipped the secondary function of pcie_aspm_sanity_check which was
to avoid us enabling ASPM on devices that had non-PCIe children, causing
trouble later on.  Move the aspm_disabled check so we continue to honour
that scenario.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=42979 and
          http://bugs.debian.org/665420

Reported-by: Romain Francoise <romain@orebokech.com> # kernel panic
Reported-by: Chris Holland <bandidoirlandes@gmail.com> # disk detection trouble
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: stable@vger.kernel.org
Tested-by: Hatem Masmoudi <hatem.masmoudi@gmail.com> # Dell Latitude E5520
Tested-by: janek <jan0x6c@gmail.com> # pata_jmicron with JMB362/JMB363
[jn: with more symptoms in log message]
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
selinuxfs: merge dentry allocation into sel_make_dir()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
aio: merge aio_cancel_all() with wait_for_all_aios()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
aio: take final put_ioctx() into callers of io_destroy()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>