1
0
Fork 0
Commit Graph

83180 Commits (123c1407af877b9b036b852b77013a6f9f6049b0)

Author SHA1 Message Date
Jiri Pirko 351638e7de net: pass info struct via netdevice notifier
So far, only net_device * could be passed along with netdevice notifier
event. This patch provides a possibility to pass custom structure
able to provide info that event listener needs to know.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>

v2->v3: fix typo on simeth
	shortened dev_getter
	shortened notifier_info struct name
v1->v2: fix notifier_call parameter in call_netdevice_notifier()
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-28 13:11:01 -07:00
David S. Miller e6ff4c75f9 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Merge net into net-next because some upcoming net-next changes
build on top of bug fixes that went into net.

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-24 16:48:28 -07:00
Linus Torvalds d4c2456a18 Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc fixes from Benjamin Herrenschmidt:
 "Some more P8 related bits, a bunch of fixes for our P7+/P8 HW crypto
  drivers, some added workarounds for those radeons that don't do proper
  64-bit MSIs and a couple of other trivialities by myself."

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/pseries: Make 32-bit MSI quirk work on systems lacking firmware support
  powerpc/powernv: Build a zImage.epapr
  powerpc: Make radeon 32-bit MSI quirk work on powernv
  powerpc: Context switch more PMU related SPRs
  powerpc/powernv: Fix condition for when to invalidate the TCE cache
  powerpc/pci: Fix bogus message at boot about empty memory resources
  powerpc: Fix TLB cleanup at boot on POWER8
  drivers/crypto/nx: Fixes for multiple races and issues
2013-05-24 08:57:38 -07:00
Brian King f1dd153121 powerpc/pseries: Make 32-bit MSI quirk work on systems lacking firmware support
Recent commit e61133dda4 added support
for a new firmware feature to force an adapter to use 32 bit MSIs.
However, this firmware is not available for all systems. The hack below
allows devices needing 32 bit MSIs to work on these systems as well.
It is careful to only enable this on Gen2 slots, which should limit
this to configurations where this hack is needed and tested to work.

[Small change to factor out the hack into a separate function -- BenH]

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-24 18:16:54 +10:00
Benjamin Herrenschmidt 83920c498e powerpc/powernv: Build a zImage.epapr
The zImage.epapr wrapper allows to use zImages when booting via a flat
device-tree which can be used on powernv.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-24 18:13:46 +10:00
Benjamin Herrenschmidt b72c1f6514 powerpc: Make radeon 32-bit MSI quirk work on powernv
This moves the quirk itself to pci_64.c as to get built on all ppc64
platforms (the only ones with a pci_dn), factors the two implementations
of get_pdn() into a single pci_get_dn() and use the quirk to do 32-bit
MSIs on IODA based powernv platforms.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-24 18:13:45 +10:00
Michael Ellerman 59affcd3e4 powerpc: Context switch more PMU related SPRs
In commit 9353374 "Context switch the new EBB SPRs" we added support for
context switching some new EBB SPRs. However despite four of us signing
off on that patch we missed some. To be fair these are not actually new
SPRs, but they are now potentially user accessible so need to be context
switched.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-24 18:13:45 +10:00
Benjamin Herrenschmidt 605e44d6e6 powerpc/powernv: Fix condition for when to invalidate the TCE cache
We use two flags, one to indicate an invalidation is needed after
creating a new entry and one to indicate an invalidation is needed
after removing an entry. However we were testing the wrong flag
in the remove case.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-24 18:13:44 +10:00
Benjamin Herrenschmidt bee7dd9c5f powerpc/pci: Fix bogus message at boot about empty memory resources
The message is only meant to be displayed if resource 0 is empty,
but was displayed if any is.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-24 18:13:44 +10:00
Benjamin Herrenschmidt 8fc1f5d7ef powerpc: Fix TLB cleanup at boot on POWER8
The TLB has 512 congruence classes (2048 entries 4 way set associative)
while P7 had 128

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-24 18:13:44 +10:00
Linus Torvalds b91fd4d5aa PCI updates for v3.10:
Moorestown
       Revert "x86/pci/mrst: Use configuration mechanism 1 for 00:00.0, 00:02.0, 00:03.0"
   Hotplug
       PCI: acpiphp: Re-enumerate devices when host bridge receives Bus Check
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRnnUuAAoJEFmIoMA60/r8+JwQALrHdQvA8rGl/TNF0xkJjsU+
 EfdkBj23+qYYsYNla7Z/CfY7k5gXTtymqauhzpa1VRoY/bkpSWMDBxK551CxgBae
 RW0JbZxfoswLlA9eVRUz6mlUl7hL0Ky0/E6d9/UBXSAC0wsN6BB11lqKgi/uxAr2
 ACuZBZW1EZP9zoD615Id5gtRAZe8+9w47p8d6kQcyJntmCoZwo8Na/HRE/tR+wVY
 o3AHMxMOr9Ac+G3/rFl5ffzoHkLwTws4UEVNhvKBek3ogsAau3tgeIgjjvFRToFh
 HxsdpCmgOAfjCF/RC0AxRugtykHw4n3WlaND2WM6JWolLeIQTZr41GlwYy4F1CRG
 gSRk0dMNGBYs9OgDC81KJGYqstHwL0MTig2ul4BvlrLanLnySgVu1kbhaerR3WzA
 11k0GwlJbkFMCbQLZDaq51KHAdDYnCsRVG/tOGmsM8puUPOTXu3pLbPk3SbgWVGc
 7vbUkjJlHwlNoUbeyOOOElUMCRnIiCl/IetwjgZb+Qibq2dO4v6WF5GR+2DPBwua
 8GNbzQXyNxOPzvYBHE4YgK5lcb7yVeLvlOtPgbM0UMqC1SnFISzJRiNpfbj21rAk
 ADT4lqL29vqkX37uIQ55KPeTTThA65EKUoI3+dNtGHLSPoKdt3QlJc9wwQNKxEzx
 EEHxGRkebYNcPB1GqwEl
 =M8/H
 -----END PGP SIGNATURE-----

Merge tag 'pci-v3.10-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI updates from Bjorn Helgaas:
 "Here are some more fixes for v3.10.  The Moorestown update broke Intel
  Medfield devices, so I reverted it.  The acpiphp change fixes a
  regression: we broke hotplug notifications to host bridges when we
  split acpiphp into the host-bridge related part and the
  endpoint-related part.

  Moorestown
      Revert "x86/pci/mrst: Use configuration mechanism 1 for 00:00.0, 00:02.0, 00:03.0"
  Hotplug
      PCI: acpiphp: Re-enumerate devices when host bridge receives Bus Check"

* tag 'pci-v3.10-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  Revert "x86/pci/mrst: Use configuration mechanism 1 for 00:00.0, 00:02.0, 00:03.0"
  PCI: acpiphp: Re-enumerate devices when host bridge receives Bus Check
2013-05-23 13:50:53 -07:00
Linus Torvalds b64194068b USB fixes for 3.10-rc2
Here are a number of tiny USB bugfixes / new device ids for 3.10-rc2
 
 The majority of these are USB gadget fixes, but they are all small.
 Other than that, some USB host controller fixes, and USB serial driver
 fixes for problems reported with them.
 
 Also hopefully a fixed up USB_OTG Kconfig dependancy, that one seems to
 be almost impossible to get right for all of the different platforms
 these days.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEYEABECAAYFAlGeP/gACgkQMUfUDdst+ykXygCfeIL5/HMREhUSHQgb6IiIDR81
 QHAAn0zJfRAyWUz4AtbrRsLSVfk3Q9vm
 =DQIq
 -----END PGP SIGNATURE-----

Merge tag 'usb-3.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg Kroah-Hartman:
 "Here are a number of tiny USB bugfixes / new device ids for 3.10-rc2

  The majority of these are USB gadget fixes, but they are all small.
  Other than that, some USB host controller fixes, and USB serial driver
  fixes for problems reported with them.

  Also hopefully a fixed up USB_OTG Kconfig dependancy, that one seems
  to be almost impossible to get right for all of the different
  platforms these days."

* tag 'usb-3.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (56 commits)
  USB: cxacru: potential underflow in cxacru_cm_get_array()
  USB: ftdi_sio: Add support for Newport CONEX motor drivers
  USB: option: add device IDs for Dell 5804 (Novatel E371) WWAN card
  usb: ohci: fix goto wrong tag in err case
  usb: isp1760-if: fix memleak when platform_get_resource fail
  usb: ehci-s5p: fix memleak when fallback to pdata
  USB: serial: clean up chars_in_buffer
  USB: ti_usb_3410_5052: fix chars_in_buffer overhead
  USB: io_ti: fix chars_in_buffer overhead
  USB: ftdi_sio: fix chars_in_buffer overhead
  USB: ftdi_sio: clean up get_modem_status
  USB: serial: add generic wait_until_sent implementation
  USB: serial: add wait_until_sent operation
  USB: set device dma_mask without reference to global data
  USB: Blacklisted Cinterion's PLxx WWAN Interface
  usb: option: Add Telewell TW-LTE 4G
  USB: EHCI: remove bogus #error
  USB: reset resume quirk needed by a hub
  USB: usb-stor: realtek_cr: Fix compile error
  usb, chipidea: fix link error when USB_EHCI_HCD is a module
  ...
2013-05-23 09:23:32 -07:00
Linus Torvalds 72dd4e7980 Merge git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull kvm bugfixes from Gleb Natapov.

* git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM/MIPS32: Wrap calls to gfn_to_pfn() with srcu_read_lock/unlock()
  KVM/MIPS32: Move include/asm/kvm.h => include/uapi/asm/kvm.h since it is a user visible API.
  KVM: take over co-maintainership from Marcelo, fix MAINTAINERS entry
2013-05-23 09:18:08 -07:00
Linus Torvalds 101b82f56d Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32
Pull AVR32 update from Hans-Christian Egtvedt:
 "wow, it has gone 10 releases since my last request :("

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32:
  avr32: fix building warnings caused by redefinitions of HZ
  avr32: fix relocation check for signed 18-bit offset
  avr32: move NODES_SHIFT into Kconfig and delete numnodes.h
2013-05-22 18:06:57 -07:00
Linus Torvalds 3cb7a59fd8 Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS update from Ralf Baechle:
 - Fix a build error if <linux/printk.h> is included without
   <linux/linkage.h> having been included before.
 - Cleanup and fix the damage done by the generic idle loop patch.
 - A kprobes fix that brings the MIPS code in line with what other
   architectures are for quite a while already.
 - Wire up the native getdents64(2) syscall for 64 bit - for some reason
   it was only for the compat ABIs.  This has been reported to cause an
   application issue.  This turned out bigger than I meant but the wait
   instruction support code was driving me nuts.

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
  MIPS: N64: Wire getdents64(2)
  kprobes/mips: Fix to check double free of insn slot
  MIPS: Idle: Break r4k_wait into two functions and fix it.
  MIPS: Idle: Do address fiddlery in helper functions.
  MIPS: Idle: Consolidate all declarations in <asm/idle.h>.
  MIPS: Idle: Don't call local_irq_disable() in cpu_wait() implementations.
  MIPS: Idle: Re-enable irqs at the end of r3081, au1k and loongson2 cpu_wait.
  MIPS: Idle: Make call of function pointer readable.
  MIPS: Idle: Consistently reformat inline assembler.
  MIPS: Idle: cleaup SMTC idle hook as per Linux coding style.
  MIPS: Consolidate idle loop / WAIT instruction support in a single file.
  MIPS: clock.h: Remove declaration of cpu_wait.
  Add include dependencies to <linux/printk.h>.
  MIPS: Rewrite pfn_valid to work in modules, too.
2013-05-22 18:05:45 -07:00
Jiang Liu 0c9b5a317b avr32: fix building warnings caused by redefinitions of HZ
As suggested by David Howells <dhowells@redhat.com>, use
asm-generic/param.h and uapi/asm-generic/param.h for AVR32.

It also fixes building warnings caused by redefinitions of HZ:
In file included from /ws/linux/kernel/linux.git/include/uapi/linux/param.h:4,
                 from include/linux/timex.h:63,
                 from include/linux/jiffies.h:8,
                 from include/linux/ktime.h:25,
                 from include/linux/timer.h:5,
                 from include/linux/workqueue.h:8,
                 from include/linux/srcu.h:34,
                 from include/linux/notifier.h:15,
                 from include/linux/memory_hotplug.h:6,
                 from include/linux/mmzone.h:777,
                 from include/linux/gfp.h:4,
                 from arch/avr32/mm/init.c:10:
/ws/linux/kernel/linux.git/arch/avr32/include/asm/param.h:6:1: warning: "HZ" redefined
In file included from /ws/linux/kernel/linux.git/arch/avr32/include/asm/param.h:4,
                 from /ws/linux/kernel/linux.git/include/uapi/linux/param.h:4,
                 from include/linux/timex.h:63,
                 from include/linux/jiffies.h:8,
                 from include/linux/ktime.h:25,
                 from include/linux/timer.h:5,
                 from include/linux/workqueue.h:8,
                 from include/linux/srcu.h:34,
                 from include/linux/notifier.h:15,
                 from include/linux/memory_hotplug.h:6,
                 from include/linux/mmzone.h:777,
                 from include/linux/gfp.h:4,
                 from arch/avr32/mm/init.c:10:
/ws/linux/kernel/linux.git/arch/avr32/include/uapi/asm/param.h:6:1: warning: this is the location of the previous definition

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
2013-05-22 21:05:44 +02:00
Aron Xu dec33abaaf MIPS: N64: Wire getdents64(2)
As a relatively new ABI, N64 only had getdents syscall while other modern
architectures have getdents64.

This was noticed when Python 3.3 shifted to the latter one for aarch64.

[ralf@linux-mips.org: The history of getdents64 is a little complicated.
Commit 1a1d77dd589de5a567fa95e36aa6999c704ceca4 [Merge with 2.4.0-test7.]
added N64 getdents(2) to arch/mips64/kernel/scall_64.S as syscall 5213,
then dropped again in 578720675c44e54e8aa7c68f6dce59ed37ce3d3b [Overhaul
of the 64-bit syscall interface.  Now heritage free.] for 2.5.18 in 2002.]

Signed-off-by: Aron Xu <aron@debian.org>
Acked-by: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5285/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-22 15:37:58 +02:00
Masami Hiramatsu 22047b8517 kprobes/mips: Fix to check double free of insn slot
Fix to check double free of insn_slot at arch_remove_kprobe
as other arches do.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: David Daney <ddaney@caviumnetworks.com>
Cc: Maneesh Soni <manesoni@cisco.com>
Cc: Victor Kamensky <kamensky@cisco.com>
Cc: linux-mips@linux-mips.org
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: yrl.pp-manager.tt@hitachi.com
Cc: systemtap@sourceware.org
Patchwork: https://patchwork.linux-mips.org/patch/5293/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-22 12:48:30 +02:00
Sanjay Lal 6d17c0d1e8 KVM/MIPS32: Wrap calls to gfn_to_pfn() with srcu_read_lock/unlock()
- As suggested by Gleb, wrap calls to gfn_to_pfn() with srcu_read_lock/unlock().
  Memory slots should be acccessed from a SRCU read section.
- kvm_mips_map_page() now returns an error code to it's callers, instead of
  calling panic() if it cannot find a mapping for a particular gfn.

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
2013-05-22 11:44:09 +03:00
Sanjay Lal ba86e4dda7 KVM/MIPS32: Move include/asm/kvm.h => include/uapi/asm/kvm.h since it is a user visible API.
Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
2013-05-22 11:42:53 +03:00
Ralf Baechle 087d990b37 MIPS: Idle: Break r4k_wait into two functions and fix it.
local_irq_enable() may expand into very different code, so it rather should
stay in C.  Also this keeps the assembler code size constant which keeps
the rollback code simple.  So it's best to split r4k_wait into two parts,
one C and one assembler.

Finally add the local_irq_enable() to r4k_wait to ensure the WAIT
instruction in __r4k_wait() will work properly.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-22 01:34:28 +02:00
Ralf Baechle f94d9a8ef9 MIPS: Idle: Do address fiddlery in helper functions.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-22 01:34:28 +02:00
Ralf Baechle bdc92d74e0 MIPS: Idle: Consolidate all declarations in <asm/idle.h>.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-22 01:34:27 +02:00
Ralf Baechle d882f07a83 MIPS: Idle: Don't call local_irq_disable() in cpu_wait() implementations.
The generic idle loop has already disabled interrupts so this is redundant.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-22 01:34:27 +02:00
Ralf Baechle fb40bc3e94 MIPS: Idle: Re-enable irqs at the end of r3081, au1k and loongson2 cpu_wait.
Without this, the

    WARN_ON_ONCE(irqs_disabled());

in the idle loop will be triggered.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-22 01:34:26 +02:00
Ralf Baechle c9b6869dbb MIPS: Idle: Make call of function pointer readable.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-22 01:34:26 +02:00
Ralf Baechle f91a148aa2 MIPS: Idle: Consistently reformat inline assembler.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-22 01:34:25 +02:00
Ralf Baechle 00baf8576c MIPS: Idle: cleaup SMTC idle hook as per Linux coding style.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-22 01:34:25 +02:00
Ralf Baechle 49f2ec91e1 MIPS: Consolidate idle loop / WAIT instruction support in a single file.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-22 01:34:25 +02:00
Ralf Baechle 1a461c5bdc MIPS: clock.h: Remove declaration of cpu_wait.
Duplicate and has no business in this header file.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-22 01:34:25 +02:00
Linus Torvalds c4ad180f0e Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 update from Martin Schwidefsky:
 "An additional sysfs attribute for channel paths and a couple of bux
  fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/pgtable: fix ipte notify bit
  s390/xpram: mark xpram as non-rotational
  s390/smp: fix cpu re-scan vs. cpu state
  s390/cio: add channel ID sysfs attribute
  s390/ftrace: fix mcount adjustment
  s390: fix gmap_ipte_notifier vs. software dirty pages
  s390: disable pfmf for clear page instruction
  s390/disassembler: prevent endless loop in print_fn_code()
  s390: remove non existent reference to GENERIC_KERNEL_THREAD
2013-05-21 09:36:46 -07:00
Stephen Boyd aa03381046 ARM: smp: Drop RCU_NONIDLE usage in cpu_die()
Before f7b861b7a6 ("arm: Use generic idle loop") ARM would kill the
CPU within the rcu idle section.  Now that the rcu_idle_enter()/exit()
pair have been pushed lower down in the idle loop this is no longer true
and so using RCU_NONIDLE here is no longer necessary and also harmful
because RCU is not actually idle at this point.

Cc: Russell King <linux@arm.linux.org.uk>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-05-21 08:56:21 -07:00
Daniel Borkmann aafc787e41 arm: bpf_jit: can call module_free() from any context
Follow-up on module_free()/vfree() that takes care of the rest, so no
longer this workaround with work_struct needed.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Mircea Gherzan <mgherzan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-20 14:03:50 -07:00
Daniel Borkmann ed900ffb73 ppc: bpf_jit: can call module_free() from any context
Followup patch on module_free()/vfree() that takes care of the rest, so
no longer this workaround with work_struct is needed.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Matt Evans <matt@ozlabs.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-20 14:03:50 -07:00
Linus Torvalds 5e427ec2d0 x86: Fix bit corruption at CPU resume time
In commit 78d77df715 ("x86-64, init: Do not set NX bits on non-NX
capable hardware") we added the early_pmd_flags that gets the NX bit set
when a CPU supports NX. However, the new variable was marked __initdata,
because the main _use_ of this is in an __init routine.

However, the bit setting happens from secondary_startup_64(), which is
called not only at bootup, but on every secondary CPU start.  Including
resuming from STR and at CPU hotplug time.  So the value cannot be
__initdata.

Reported-bisected-and-tested-by: Michal Hocko <mhocko@suse.cz>
Cc: stable@vger.kernel.org # v3.9
Acked-by: Peter Anvin <hpa@linux.intel.com>
Cc: Fernando Luis Vázquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-05-20 11:36:03 -07:00
Bjorn Helgaas f3f011750a Revert "x86/pci/mrst: Use configuration mechanism 1 for 00:00.0, 00:02.0, 00:03.0"
This reverts commit dd72be99d1.

Andy Shevchenko <andy.shevchenko@gmail.com> reported that this commit
broke Intel Medfield devices.

Reference: https://lkml.kernel.org/r/CAHp75Vdf6gFZChS47=grUygHBDWcoOWDYPzw+Zj5bdVCWj85Jw@mail.gmail.com
Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2013-05-20 10:20:21 -06:00
Eric Dumazet 314beb9bca x86: bpf_jit_comp: secure bpf jit against spraying attacks
hpa bringed into my attention some security related issues
with BPF JIT on x86.

This patch makes sure the bpf generated code is marked read only,
as other kernel text sections.

It also splits the unused space (we vmalloc() and only use a fraction of
the page) in two parts, so that the generated bpf code not starts at a
known offset in the page, but a pseudo random one.

Refs:
http://mainisusuallyafunction.blogspot.com/2012/11/attacking-hardened-linux-systems-with.html

Reported-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-19 23:55:41 -07:00
Ralf Baechle 8b9232141b MIPS: Rewrite pfn_valid to work in modules, too.
This fixes:

  MODPOST 393 modules
ERROR: "min_low_pfn" [arch/mips/kvm/kvm.ko] undefined!
make[3]: *** [__modpost] Error 1

It would have been possible to just export min_low_pfn but in the end
pfn_valid should return 1 for any pfn argument for which a struct page
exists so using min_low_pfn was wrong anyway.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-19 09:56:58 +02:00
Linus Torvalds e51066824a Merge branch 'devm_no_resource_check' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull devm usage cleanup from Wolfram Sang:
 "Lately, I have been experimenting how to improve the devm interface to
  make writing device drivers easier and less error prone while also
  getting rid of its subtle issues.  I think it has more potential but
  still needs work and definately conistency, especiall in its usage.

  The first thing I come up with is a low hanging fruit regarding
  devm_ioremap_resouce().  This function already checks if the passed
  resource is valid and gives an error message if not.  So, we can
  remove similar checks from the drivers and get rid of a bit of code
  and a number of inconsistent error strings.

  This series only removes the unneeded check iff devm_ioremap_resource
  follows platform_get_resource directly.  The previous version tried to
  shuffle code if needed, too, what lead to an embarrasing bug.  It
  turned out to me that shuffling code for all cases found will make the
  automated script too complex, so I am unsure if an automated cleanup
  is the proper tool for this case.  Removing the easy stuff seems
  worthwhile to me, though.

  Despite various architectures and platform dependencies, I managed to
  compile test 45 out of 57 modified files locally using heuristics and
  defconfigs."

Pulled because: 296 deletions, 0 additions.

* 'devm_no_resource_check' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (33 commits)
  sound/soc/kirkwood: don't check resource with devm_ioremap_resource
  sound/soc/fsl: don't check resource with devm_ioremap_resource
  arch/mips/lantiq/xway: don't check resource with devm_ioremap_resource
  arch/arm/plat-samsung: don't check resource with devm_ioremap_resource
  arch/arm/mach-tegra: don't check resource with devm_ioremap_resource
  drivers/watchdog: don't check resource with devm_ioremap_resource
  drivers/w1/masters: don't check resource with devm_ioremap_resource
  drivers/video/omap2/dss: don't check resource with devm_ioremap_resource
  drivers/video/omap2: don't check resource with devm_ioremap_resource
  drivers/usb/phy: don't check resource with devm_ioremap_resource
  drivers/usb/host: don't check resource with devm_ioremap_resource
  drivers/usb/gadget: don't check resource with devm_ioremap_resource
  drivers/usb/chipidea: don't check resource with devm_ioremap_resource
  drivers/thermal: don't check resource with devm_ioremap_resource
  drivers/staging/nvec: don't check resource with devm_ioremap_resource
  drivers/staging/dwc2: don't check resource with devm_ioremap_resource
  drivers/spi: don't check resource with devm_ioremap_resource
  drivers/rtc: don't check resource with devm_ioremap_resource
  drivers/pwm: don't check resource with devm_ioremap_resource
  drivers/pinctrl: don't check resource with devm_ioremap_resource
  ...
2013-05-18 10:54:54 -07:00
Linus Torvalds 3c6a279ffc Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS fixes from Ralf Baechle:
 "Patching up across the field.  The reversion of the two ASID patches
  is particularly important as it was breaking many platforms."

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
  MIPS: ralink: use the dwc2 driver for the rt305x USB controller
  MIPS: Extract schedule_mfi info from __schedule
  MIPS: Fix sibling call handling in get_frame_info
  MIPS: MSP71xx: remove inline marking of EXPORT_SYMBOL functions
  MIPS: Make virt_to_phys() work for all unmapped addresses.
  MIPS: Fix build error for crash_dump.c in 3.10-rc1
  MIPS: Xway: Fix clk leak
  Revert "MIPS: Allow ASID size to be determined at boot time."
  Revert "MIPS: microMIPS: Support dynamic ASID sizing."
2013-05-18 10:36:37 -07:00
Linus Torvalds f71df63380 Fixes for duplicate definition of early_console, kernel/time/Kconfig
include, __flush_dcache_all() set/way computing, debug (locking, bit
 testing). The of_platform_populate() was moved to an arch_init_call() to
 allow subsys_init_call() drivers to probe the DT.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.9 (GNU/Linux)
 
 iQIcBAABAgAGBQJRlmhKAAoJEGvWsS0AyF7xjTcQAJZgLV4d3x2cf5n57Y9WmLmF
 ivClmSoiDUWzWRWZp8RGbG4A2P9EUCGSuSFP1nA6jSyRYFq8483jibtejP6+h5qK
 wGVoBN9T171CuOdxK1lWDqV/r0ALHgYDRkWLRL1Kuc3Jsmi3fNZvnV6vOsSezrQd
 pEtTHX5TR0ltQPEI1uKqpKJF7tis8Ary1XkmsAtAfWW3cbqxkuPhbj+1GpMdsI4h
 f/OR1vxR4c1JqFdcCdehfei+WC94wVUHAnuUj9LxTYXmy8x/ztKsZuXPY3Bxd/4w
 0ag7nzlQyb3//ociqHN18THr7ftUtkOTLMCd01dqmf4edG7tqxVpgLuKDZ0qD+JA
 P0qJ5yBcnEb7pH/KNRZu2Xbrio3n5PFpVB0RfJiu+wWRLKV+PZWYXXaS/qb+OvVq
 kMVco2MguXeyuHAuxlIUpC0hqCaevJIPeqwAOP1TqQvNrnm/Q/W99pXmzZY5/JgY
 PJpa4SIERWb/8FL0eqKXro+lcmoeanBqHWehxvb9qie+bEeANbaX4jImmScOOqqU
 a0DXWhF3AWh1lyuyBEfxIvNzy2o6PGZh38eQp1obSrM39I2SjO+BCBeSMZn18Ojh
 zafc60MbiAu5YukIClHZMSSlYGUfvz4Vi4bq4R5tNUvjx5PmOwKQBKVxRYICrdYi
 RJow+92Be+WhTuSpMa+Z
 =Ewl8
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64

Pull arm64 fixes from Catalin Marinas:
 "Fixes for duplicate definition of early_console, kernel/time/Kconfig
  include, __flush_dcache_all() set/way computing, debug (locking, bit
  testing).  The of_platform_populate() was moved to an arch_init_call()
  to allow subsys_init_call() drivers to probe the DT."

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64:
  arm64: debug: fix mdscr.ss check when enabling debug exceptions
  arm64: Do not source kernel/time/Kconfig explicitly
  arm64: mm: Fix operands of clz in __flush_dcache_all
  arm64: Invoke the of_platform_populate() at arch_initcall() level
  arm64: debug: clear mdscr_el1 instead of taking the OS lock
  arm64: Fix duplicate definition of early_console
2013-05-18 10:20:46 -07:00
Wolfram Sang 02fdb79f36 arch/mips/lantiq/xway: don't check resource with devm_ioremap_resource
devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: John Crispin <blogic@openwrt.org>
2013-05-18 11:59:34 +02:00
Wolfram Sang c818b58e63 arch/arm/plat-samsung: don't check resource with devm_ioremap_resource
devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-05-18 11:59:33 +02:00
Wolfram Sang d7fc0dde96 arch/arm/mach-tegra: don't check resource with devm_ioremap_resource
devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Stephen Warren <swarren@nvidia.com>
2013-05-18 11:58:05 +02:00
Eric Dumazet 5199dfe531 sparc: bpf_jit_comp: can call module_free() from any context
module_free()/vfree() takes care of details, we no longer need a wrapper
and a work_struct.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-17 18:27:52 -07:00
Eric Dumazet 650c849670 x86: bpf_jit_comp: can call module_free() from any context
It looks like we can call module_free()/vfree() from softirq context,
so no longer need a wrapper and a work_struct.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-17 17:37:19 -07:00
Matthijs Kooijman 2792d42fe6 MIPS: ralink: use the dwc2 driver for the rt305x USB controller
This sets up the devicetree file for the rt3050 chip series and rt3052
eval board to use the right compatible string for the dwc2 driver.

Acked-by: John Crispin <blogic@openwrt.org>
Cc: blogic@openwrt.org
Cc: linux-mips@linux-mips.org
Cc: Matthijs Kooijman <matthijs@stdin.nl>
Patchwork: https://patchwork.linux-mips.org/patch/5226/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-17 21:16:59 +02:00
Tony Wu 5000653e92 MIPS: Extract schedule_mfi info from __schedule
schedule_mfi is supposed to be extracted from schedule(), and
is used in thread_saved_pc and get_wchan.

But, after optimization, schedule() is reduced to a sibling
call to __schedule(), and no real frame info can be extracted.

One solution is to compile schedule() with -fno-omit-frame-pointer
and -fno-optimize-sibling-calls, but that will incur performance
degradation.

Another solution is to extract info from the real scheduler,
__schedule, and this is the approache adopted here.

This patch reads the __schedule address by either following
the 'j' call in schedule if KALLSYMS is disabled or by using
kallsyms_lookup_name to lookup __schedule if KALLSYMS is
available, then, extracts schedule_mfi from __schedule frame info.

This patch also fixes the "Can't analyze schedule() prologue"
warning at boot time.

Signed-off-by: Tony Wu <tung7970@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5237/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-17 20:59:35 +02:00
Tony Wu e7438c4b89 MIPS: Fix sibling call handling in get_frame_info
Given a function, get_frame_info() analyzes its instructions
to figure out frame size and return address. get_frame_info()
works as follows:

1. analyze up to 128 instructions if the function size is unknown
2. search for 'addiu/daddiu sp,sp,-immed' for frame size
3. search for 'sw ra,offset(sp)' for return address
4. end search when it sees jr/jal/jalr

This leads to an issue when the given function is a sibling
call, example shown as follows.

801ca110 <schedule>:
801ca110:       8f820000        lw      v0,0(gp)
801ca114:       8c420000        lw      v0,0(v0)
801ca118:       080726f0        j       801c9bc0 <__schedule>
801ca11c:       00000000        nop

801ca120 <io_schedule>:
801ca120:       27bdffe8        addiu   sp,sp,-24
801ca124:       3c028022        lui     v0,0x8022
801ca128:       afbf0014        sw      ra,20(sp)

In this case, get_frame_info() cannot properly detect schedule's
frame info, and eventually returns io_schedule's instead.

This patch adds 'j' to the end search condition to workaround
sibling call cases.

Signed-off-by: Tony Wu <tung7970@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5236/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-17 20:59:28 +02:00
Denis Efremov d552b233f6 MIPS: MSP71xx: remove inline marking of EXPORT_SYMBOL functions
EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <yefremov.denis@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: trivial@kernel.org
Cc: ldv-project@linuxtesting.org
Patchwork: https://patchwork.linux-mips.org/patch/5227/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-05-17 20:36:32 +02:00