Commit graph

968 commits

Author SHA1 Message Date
Linus Torvalds
96d928ed75 Xtensa changes and fixes for 4.1
- fix linker script transformation for .text / .text.fixup
 - wire bpf and execveat syscalls;
 - provide __NR_sync_file_range2 instead of __NR_sync_file_range, as that's
   what xtensa uses.
 
 - make xtfpgs LCD driver functional and configurable. This fixes hardware
   lockup on KC705/ML605 boot;
 - add audio subsystem bits to xtfpga DTS and provide sample KC705 config
   with audio features enabled.
 - add CY7C67300 USB controller support to XTFPGA.
 - fix locking issues in ISS network driver;
 - document PIC and MX interrupt distributor device tree bindings;
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJVLzRJAAoJEI9vqH3mFV2sfzgQAKDUeAlMbq78vvz10dThU5I2
 bRM2z3nfH1pOz8MToYGJ2UQMUAX09EFcLvhgy61e6bHECvT4Pgrq7QPizD7kAXv4
 nHPFX5syHCy6ASKXYGrZj1+moaufkhYgA7hPAggaDtUA7v5fbWPRiHbYWgk4By/f
 oWkmKtd2Jv+YXyfi0zA1ccD5eh885UPfaC396UAq5PvD6SafjGYWSHci67TRTrIw
 Ejc+e+MWC+yS/6TWtpYUUCeV1YkeYPj+w9JJXCCHRBebtTNv4HHdjyE5DLyTH3+0
 3I+T5m8F07VYJ9Q2CZwfTQfU2/3vtxivw2EPcGa8UdubjLlxtIyhEZlJzg4HZn9W
 KkCaDMMPoLeuyYYlTtudQVXpAKuactTq0DUGGYUIbkdHbADCP9PVrOk6zsyQwa+B
 u4iW2KPyVHIHkOOHG8F7qPAkAYKvJYEZO/JXycmTBMDU4evE2zQHXEujU5PyW2FZ
 3CA5I0DxqsYK+PG0geDq+aZxdLYD44SiA6yD/P2YrBXRTDz/AaiBi0MhDT3taBYV
 0ttXdKyYM0QWNaLmqs/7HMG7X9daVG5qqv0IllkyXf8luDZMeA5LfCG+4flO8lZz
 oSHzDUj8HPZE2q9Mko66AH1UYbV8g3YkPUcS48/d7ZCOE2lkwlG/6T+IAxnPncIv
 NKGyz0J/m+D7YBVCDC8p
 =wl+K
 -----END PGP SIGNATURE-----

Merge tag 'xtensa-20150416' of git://github.com/czankel/xtensa-linux

Pull Xtensa updates from Chris Zankel:

 - fix linker script transformation for .text / .text.fixup

 - wire bpf and execveat syscalls

 - provide __NR_sync_file_range2 instead of __NR_sync_file_range, as
   that's what xtensa uses.

 - make xtfpgs LCD driver functional and configurable.  This fixes
   hardware lockup on KC705/ML605 boot

 - add audio subsystem bits to xtfpga DTS and provide sample KC705
   config with audio features enabled

 - add CY7C67300 USB controller support to XTFPGA

 - fix locking issues in ISS network driver

 - document PIC and MX interrupt distributor device tree bindings

* tag 'xtensa-20150416' of git://github.com/czankel/xtensa-linux:
  xtensa: xtfpga: add CY7C67300 USB controller support
  irqchip: xtensa-pic: xtensa-mx: document DT bindings
  xtensa: ISS: fix locking in TAP network adapter
  xtensa: Fix fix linker script transformation for .text / .text.fixup
  xtensa: provide __NR_sync_file_range2 instead of __NR_sync_file_range
  xtensa: wire bpf and execveat syscalls
  xtensa: xtfpga: fix hardware lockup caused by LCD driver
  xtensa: xtfpga: provide defconfig with audio subsystem
  xtensa: xtfpga: add audio card to xtfpga DTS
2015-04-17 15:32:30 -04:00
Linus Torvalds
fa2e5c073a Merge branch 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc
Pull exec domain removal from Richard Weinberger:
 "This series removes execution domain support from Linux.

  The idea behind exec domains was to support different ABIs.  The
  feature was never complete nor stable.  Let's rip it out and make the
  kernel signal handling code less complicated"

* 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc: (27 commits)
  arm64: Removed unused variable
  sparc: Fix execution domain removal
  Remove rest of exec domains.
  arch: Remove exec_domain from remaining archs
  arc: Remove signal translation and exec_domain
  xtensa: Remove signal translation and exec_domain
  xtensa: Autogenerate offsets in struct thread_info
  x86: Remove signal translation and exec_domain
  unicore32: Remove signal translation and exec_domain
  um: Remove signal translation and exec_domain
  tile: Remove signal translation and exec_domain
  sparc: Remove signal translation and exec_domain
  sh: Remove signal translation and exec_domain
  s390: Remove signal translation and exec_domain
  mn10300: Remove signal translation and exec_domain
  microblaze: Remove signal translation and exec_domain
  m68k: Remove signal translation and exec_domain
  m32r: Remove signal translation and exec_domain
  m32r: Autogenerate offsets in struct thread_info
  frv: Remove signal translation and exec_domain
  ...
2015-04-15 13:53:55 -07:00
Linus Torvalds
ca2ec32658 Merge branch 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs update from Al Viro:
 "Part one:

   - struct filename-related cleanups

   - saner iov_iter_init() replacements (and switching the syscalls to
     use of those)

   - ntfs switch to ->write_iter() (Anton)

   - aio cleanups and splitting iocb into common and async parts
     (Christoph)

   - assorted fixes (me, bfields, Andrew Elble)

  There's a lot more, including the completion of switchover to
  ->{read,write}_iter(), d_inode/d_backing_inode annotations, f_flags
  race fixes, etc, but that goes after #for-davem merge.  David has
  pulled it, and once it's in I'll send the next vfs pull request"

* 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (35 commits)
  sg_start_req(): use import_iovec()
  sg_start_req(): make sure that there's not too many elements in iovec
  blk_rq_map_user(): use import_single_range()
  sg_io(): use import_iovec()
  process_vm_access: switch to {compat_,}import_iovec()
  switch keyctl_instantiate_key_common() to iov_iter
  switch {compat_,}do_readv_writev() to {compat_,}import_iovec()
  aio_setup_vectored_rw(): switch to {compat_,}import_iovec()
  vmsplice_to_user(): switch to import_iovec()
  kill aio_setup_single_vector()
  aio: simplify arguments of aio_setup_..._rw()
  aio: lift iov_iter_init() into aio_setup_..._rw()
  lift iov_iter into {compat_,}do_readv_writev()
  NFS: fix BUG() crash in notify_change() with patch to chown_common()
  dcache: return -ESTALE not -EBUSY on distributed fs race
  NTFS: Version 2.1.32 - Update file write from aio_write to write_iter.
  VFS: Add iov_iter_fault_in_multipages_readable()
  drop bogus check in file_open_root()
  switch security_inode_getattr() to struct path *
  constify tomoyo_realpath_from_path()
  ...
2015-04-14 15:31:03 -07:00
Chris Zankel
2ba9268dd6 Xtensa improvements for 4.1:
- fix locking issues in ISS network driver;
 - document PIC and MX interrupt distributor device tree bindings;
 - add CY7C67300 USB controller support to XTFPGA.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJVK2UPAAoJEFH5zJH4P6BEtdEQAJpThJvrVr+Wn0BkgnSZoA3I
 jRKhIwj+3c8XXcRRY+4T/hU+9Rh7+XhKjTy+u4Rbgbm5bhmvjvbwuDRS+czsa/RC
 r/FE874QZD5O8KLtdqkTkyRJ4XmKDQHbDUpTuk300xQeV53fFwa6EeOclVrmZMzz
 yBDaFG4rmPa7/4TTvbyLwloA355pbKuhAFT2ndRFFHty4KrfE/XZcKQk25ubgTak
 PYgBGfUpyZ0F7WZ92L8F3WYcud0p4PlYXelQDVVa5iJDLQGkyrJAzDx8e+URVI+E
 ym9SWVUD33kAhXwQ2i3vm7HEDD4JZJbMZQupWKHy6aqFeaXv31tU5KDOu0V3148O
 9ezrAU5Ciav9NGUDQ9318Rb3cJkYoPelHWE5QHEU60VOOt4UHw3wsBtcuCnUSODl
 BllotRHXYFoBsWcwOBgH1j36wsOGTKxn98wRdHvCLqD6vwneKCv8WRRNRU2N0jvB
 VTVL4AOPDLmoiwcqomcSXes16ZKU98fgvbSdaCqojDDtYpsj6bsrs67joPwp9+5j
 3HA3+47Hn4uaoFiDbs5N/oLgv+fFUY83o6LwxtAAufF2U92KZEX99zayQ0wB54+C
 U1KR8lmXJcl2KjDXY6tGmfyXrBCwxFk2/WqN43yvvLSxDtDUtDJAw3SHCtQG6Hcd
 HZFasgLoxxphwtuAkWny
 =sZxq
 -----END PGP SIGNATURE-----

Merge tag 'xtensa-for-next-20150413' of git://github.com/jcmvbkbc/linux-xtensa into for_next

Xtensa improvements for 4.1:

- fix locking issues in ISS network driver;
- document PIC and MX interrupt distributor device tree bindings;
- add CY7C67300 USB controller support to XTFPGA.

Signed-off-by: Chris Zankel <chris@zankel.net>
2015-04-14 04:47:53 +00:00
Chris Zankel
7ead5b7e4a Linux 4.0
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJVKu3vAAoJEHm+PkMAQRiGmk4H/0DPq3rGa4gBhxZoG7N/JDNe
 WxZPbo/gY0l75DDquN5DZ3QFM9SKPOrZj39k9OzvdVdbnkPz2Wf6iN7aO3+XJFUo
 VD+x4xxRy2v8uIXAVtUQ9kOJqOYX7Ifww2izXJT7umIdQwkgXd5gdcAasZcROllq
 +gVUMAdpMK3ZUKfEYu5tZrgYDb/b80h7P2O/FKOeYf7LKxwsn2sPCtXBeqRFBU6d
 yP0i5JNoZbNfCRx/wzuCABV12Sq+p7TnFU2bxsvDrciHJjI/0fM4DNi7/Pc1IbKf
 vOKwaS2q4m81FoZvOSfv9ZfnT/hAlRorc7aXX9al/mkIeWLZv4OMZZhd0h7OX0k=
 =Asl1
 -----END PGP SIGNATURE-----

Merge tag 'v4.0' into for_next

Linux 4.0
2015-04-14 03:51:35 +00:00
Max Filippov
e0bf6c5ca2 xtensa: xtfpga: add CY7C67300 USB controller support
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-04-13 09:34:37 +03:00
Max Filippov
24e94454c8 xtensa: ISS: fix locking in TAP network adapter
- don't lock lp->lock in the iss_net_timer for the call of iss_net_poll,
  it will lock it itself;
- invert order of lp->lock and opened_lock acquisition in the
  iss_net_open to make it consistent with iss_net_poll;
- replace spin_lock with spin_lock_bh when acquiring locks used in
  iss_net_timer from non-atomic context;
- replace spin_lock_irqsave with spin_lock_bh in the iss_net_start_xmit
  as the driver doesn't use lp->lock in the hard IRQ context;
- replace __SPIN_LOCK_UNLOCKED(lp.lock) with spin_lock_init, otherwise
  lockdep is unhappy about using non-static key.

Cc: <stable@vger.kernel.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-04-13 09:01:00 +03:00
Richard Weinberger
3e66701cbd xtensa: Remove signal translation and exec_domain
As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.

Signed-off-by: Richard Weinberger <richard@nod.at>
2015-04-12 21:03:29 +02:00
Richard Weinberger
cb418fdb33 xtensa: Autogenerate offsets in struct thread_info
Maintaining offsets by hand is no fun.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Richard Weinberger <richard@nod.at>
2015-04-12 21:03:29 +02:00
Al Viro
74008b365d whack-a-mole: there's no point doing set_fs(USER_DS) in sigframe setup
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11 22:24:31 -04:00
Guenter Roeck
834a316eee xtensa: Fix fix linker script transformation for .text / .text.fixup
Commit 779c88c94c ("ARM: 8321/1: asm-generic: introduce .text.fixup
input section") introduced a new .text.fixup section which is merged
with .text at link time. This causes xtensa builds to fail with lots
of error messages similar to the following.

lib/lib.a(kobject.o): In function `kobject_create':
(.text+0x498): dangerous relocation: l32r: literal placed after use:
				     (.literal+0x150)

Linker script transformation needs to be updated to detect and handle
the new section.

Fixes: 779c88c94c ("ARM: 8321/1: asm-generic: introduce .text.fixup
		     input section")
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Chris Zankel <chris@zankel.net>
2015-04-10 07:31:21 +00:00
Yijing Wang
b97ea289cf PCI: Assign resources before drivers claim devices (pci_scan_root_bus())
Previously, pci_scan_root_bus() created a root PCI bus, enumerated the
devices on it, and called pci_bus_add_devices(), which made the devices
available for drivers to claim them.

Most callers assigned resources to devices after pci_scan_root_bus()
returns, which may be after drivers have claimed the devices.  This is
incorrect; the PCI core should not change device resources while a driver
is managing the device.

Remove pci_bus_add_devices() from pci_scan_root_bus() and do it after any
resource assignment in the callers.

Note that ARM's pci_common_init_dev() already called pci_bus_add_devices()
after pci_scan_root_bus(), so we only need to remove the first call:

  pci_common_init_dev
    pcibios_init_hw
      pci_scan_root_bus
        pci_bus_add_devices        # first call
    pci_bus_assign_resources
    pci_bus_add_devices            # second call

[bhelgaas: changelog, drop "root_bus" var in alpha common_init_pci(),
return failure earlier in mn10300, add "return" in x86 pcibios_scan_root(),
return early if xtensa platform_pcibios_fixup() fails]
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Richard Henderson <rth@twiddle.net>
CC: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
CC: Matt Turner <mattst88@gmail.com>
CC: David Howells <dhowells@redhat.com>
CC: Tony Luck <tony.luck@intel.com>
CC: Michal Simek <monstr@monstr.eu>
CC: Ralf Baechle <ralf@linux-mips.org>
CC: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
CC: Sebastian Ott <sebott@linux.vnet.ibm.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: Chris Metcalf <cmetcalf@ezchip.com>
CC: Chris Zankel <chris@zankel.net>
CC: Max Filippov <jcmvbkbc@gmail.com>
CC: Thomas Gleixner <tglx@linutronix.de>
2015-03-19 10:17:13 -05:00
Chris Zankel
0372c1abdd Xtensa fixes for 4.0:
- make xtfpgs LCD driver functional and configurable. This fixes hardware
   lockup on KC705/ML605 boot;
 - wire bpf and execveat syscalls;
 - provide __NR_sync_file_range2 instead of __NR_sync_file_range, as that's
   what xtensa uses.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJU9sxSAAoJEFH5zJH4P6BEwFsP/1qkSVtBdkiCQhhTp+jTxVfT
 uVUST6QbG+zcqV61Ni44ghd4T0qkfGZZixlCMvDT2o3mE/dNWVZiG0rAt+q09HQ3
 sUSmLaM8scUqreZRUdvLVq+wZTQH9dUhtBvssLrkFk0VJrTkNuCZo56A5d8BL7RM
 xD8FM2d3UVDBnG9Rs9O7guzu/lvIiYMYO9e3mOh//pY9aSDnn6fUVpoqVwx9qx7v
 azi8aSFDMQH4swGHojNdrRfM0eUZxyYie/fzcj1YkE5qOHo9m7ZvO1jighZc0xka
 qBTQV/k/5oA7hY6Ovg7PjSeZCuqWnK2nGV+wJnGJYH21JBLZvK/0NLT7UFEVDXbt
 7mCbhlxgBclj5a1Vb2zfmPjw1fZ3qRJ8DNPXt8KkCPCy+HYyN6RRqjCxfBAFV/KI
 L26TmyfpXOtdOYX3e+vp23LFn6hdSbZbY45LCIMBW1xi4bnPczmRviXtAhZwWtTA
 lrE1sPzckRAjbcqsfZ5+hDZDplQKI/VlA/YTIuG78bPzecSZLLRahycYJSlDl2CQ
 thoyZedLN6ia838yk3B17CHxf2NFNUEoSLxIuOC0xkhJ6OkOs79duGoL4sbVQLKt
 8EzVQ3p2ZmivLvRLYykUaqoq33tFleJCitANzq12k3auohDfBkpg6lFUkq6jmqP9
 XRQL52qTwt52phod1S3E
 =y80U
 -----END PGP SIGNATURE-----

Merge tag 'xtensa-for-next-20150304' of git://github.com/jcmvbkbc/linux-xtensa into for_next

Xtensa fixes for 4.0:

- make xtfpgs LCD driver functional and configurable. This fixes hardware
  lockup on KC705/ML605 boot;
- wire bpf and execveat syscalls;
- provide __NR_sync_file_range2 instead of __NR_sync_file_range, as that's
  what xtensa uses.
2015-03-13 00:41:32 +00:00
Max Filippov
01e84c70fe xtensa: provide __NR_sync_file_range2 instead of __NR_sync_file_range
xtensa actually uses sync_file_range2 implementation, so it should
define __NR_sync_file_range2 as other architectures that use that
function. That fixes userspace interface (that apparently never worked)
and avoids special-casing xtensa in libc implementations.
See the thread ending at
http://lists.busybox.net/pipermail/uclibc/2015-February/048833.html
for more details.

Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-03-04 12:07:05 +03:00
Max Filippov
d44679ab13 xtensa: wire bpf and execveat syscalls
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-03-04 12:07:04 +03:00
Max Filippov
4949009eb8 xtensa: xtfpga: fix hardware lockup caused by LCD driver
LCD driver is always built for the XTFPGA platform, but its base address
is not configurable, and is wrong for ML605/KC705. Its initialization
locks up KC705 board hardware.

Make the whole driver optional, and its base address and bus width
configurable. Implement 4-bit bus access method.

Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-02-27 07:55:29 +03:00
Linus Torvalds
eaa0eda562 asm-generic: uaccess.h cleanup
Like in 3.19, I once more have a multi-stage cleanup for one asm-generic
 header file, this time the work was done by Michael Tsirkin and cleans
 up the uaccess.h file in asm-generic, as well as all architectures for
 which the respective maintainers did not pick up his patches directly.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIVAwUAVONFpmCrR//JCVInAQIoYRAA1T3ID1bQLqdi8TU1X+vzutXzGFRhRFii
 u18GYeN6sGTcfqQD0GsNSaH7G8XehF3cgJ9eo4h9YkRPIG/0T0FO+dqdB0uRh8iy
 GKcUqVhgvCFpOBDUJC6FgMvgWWyVrgSUBqG6qSXck/PDcMSsUa/m/GcLhR/sHWGn
 EGEAzYNvJgdOaJ1z0vfPFK6mPwFwmYzIss5XFuoBAKKN856fBlxofkQqdpKjGDFH
 n0UziaJ5tbCdlZ9M9Y5JN9RU8yBCcOmGHnHUAQHz3BXOt9sD7o5jDuzsUbj+vUGJ
 gzNc8kee9Pyy8ZA1F959gspaxe5Oumq7NLgs3HDjK6ZDRKpJvZb6iXi56f15chlZ
 dItTbFSxCHOFs0d8XJKNbmPt44pJ/qKO+03lMIGttMkIm7hXfvyMWSPZV9G0Pu1y
 zbWEDgW2Mdrdt0saNSD46IEp+c7E5P3D9JSctQRdQjReoCbOHwqrSHi1Zeg97XL4
 I1E0KwDqFUw3P1dXr5ahXmR50ZigBGjN5Fz3N7GmJt2x4PRSS2Sw92hyCrL0YM8J
 56FdRA7UJ0V/SzmAko3F5wWmhabc6L+qrVA42R6U3SNSjU8hwppOkYKDINNhPZfL
 SGy1oQS6Jj10WxLOVp66NC7XxXzBybDcQnatz4XtNN8P5sfekUGSGBeMyMsHl7IJ
 9MT3xym+DWU=
 =LROx
 -----END PGP SIGNATURE-----

Merge tag 'asm-generic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic

Pull asm-generic uaccess.h cleanup from Arnd Bergmann:
 "Like in 3.19, I once more have a multi-stage cleanup for one
  asm-generic header file, this time the work was done by Michael
  Tsirkin and cleans up the uaccess.h file in asm-generic, as well as
  all architectures for which the respective maintainers did not pick up
  his patches directly"

* tag 'asm-generic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: (37 commits)
  sparc32: nocheck uaccess coding style tweaks
  sparc64: nocheck uaccess coding style tweaks
  xtensa: macro whitespace fixes
  sh: macro whitespace fixes
  parisc: macro whitespace fixes
  m68k: macro whitespace fixes
  m32r: macro whitespace fixes
  frv: macro whitespace fixes
  cris: macro whitespace fixes
  avr32: macro whitespace fixes
  arm64: macro whitespace fixes
  arm: macro whitespace fixes
  alpha: macro whitespace fixes
  blackfin: macro whitespace fixes
  sparc64: uaccess_64 macro whitespace fixes
  sparc32: uaccess_32 macro whitespace fixes
  avr32: whitespace fix
  sh: fix put_user sparse errors
  metag: fix put_user sparse errors
  ia64: fix put_user sparse errors
  ...
2015-02-18 10:02:24 -08:00
Tejun Heo
62518994dd xtensa: use %*pb[l] to print bitmaps including cpumasks and nodemasks
printk and friends can now format bitmaps using '%*pb[l]'.  cpumask
and nodemask also provide cpumask_pr_args() and nodemask_pr_args()
respectively which can be used to generate the two printf arguments
necessary to format the specified cpu/nodemask.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-13 21:21:37 -08:00
Andy Lutomirski
f56141e3e2 all arches, signal: move restart_block to struct task_struct
If an attacker can cause a controlled kernel stack overflow, overwriting
the restart block is a very juicy exploit target.  This is because the
restart_block is held in the same memory allocation as the kernel stack.

Moving the restart block to struct task_struct prevents this exploit by
making the restart_block harder to locate.

Note that there are other fields in thread_info that are also easy
targets, at least on some architectures.

It's also a decent simplification, since the restart code is more or less
identical on all architectures.

[james.hogan@imgtec.com: metag: align thread_info::supervisor_stack]
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: David Miller <davem@davemloft.net>
Acked-by: Richard Weinberger <richard@nod.at>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Steven Miao <realmz6@gmail.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Richard Kuo <rkuo@codeaurora.org>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Tested-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Chen Liqin <liqin.linux@gmail.com>
Cc: Lennox Wu <lennox.wu@gmail.com>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-12 18:54:12 -08:00
Kirill A. Shutemov
d016bf7ece mm: make FIRST_USER_ADDRESS unsigned long on all archs
LKP has triggered a compiler warning after my recent patch "mm: account
pmd page tables to the process":

    mm/mmap.c: In function 'exit_mmap':
 >> mm/mmap.c:2857:2: warning: right shift count >= width of type [enabled by default]

The code:

 > 2857                WARN_ON(mm_nr_pmds(mm) >
   2858                                round_up(FIRST_USER_ADDRESS, PUD_SIZE) >> PUD_SHIFT);

In this, on tile, we have FIRST_USER_ADDRESS defined as 0.  round_up() has
the same type -- int.  PUD_SHIFT.

I think the best way to fix it is to define FIRST_USER_ADDRESS as unsigned
long.  On every arch for consistency.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reported-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-11 17:06:03 -08:00
Kirill A. Shutemov
d9ecee281b xtensa: drop _PAGE_FILE and pte_file()-related helpers
We've replaced remap_file_pages(2) implementation with emulation.  Nobody
creates non-linear mapping anymore.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-10 14:30:33 -08:00
Max Filippov
04ddc5b5ad xtensa: xtfpga: provide defconfig with audio subsystem
This is the generic KC705 defconfig with all pieces of xtfpga audio
subsystem enabled: I2C, SPI and ASoC support, I2C master, SPI master,
clock synthesizer, I2S master, audio codec and audio card drivers.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-02-07 12:52:12 +03:00
Max Filippov
c2c62e61fb xtensa: xtfpga: add audio card to xtfpga DTS
This includes OpenCores I2C host controller, TI CDCE706 clock generator,
xtfpga I2S master controller, xtfpga SPI master controller, TI TLV320AIC23
audio codec and a simple audio card.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-02-07 11:21:39 +03:00
Linus Torvalds
33692f2759 vm: add VM_FAULT_SIGSEGV handling support
The core VM already knows about VM_FAULT_SIGBUS, but cannot return a
"you should SIGSEGV" error, because the SIGSEGV case was generally
handled by the caller - usually the architecture fault handler.

That results in lots of duplication - all the architecture fault
handlers end up doing very similar "look up vma, check permissions, do
retries etc" - but it generally works.  However, there are cases where
the VM actually wants to SIGSEGV, and applications _expect_ SIGSEGV.

In particular, when accessing the stack guard page, libsigsegv expects a
SIGSEGV.  And it usually got one, because the stack growth is handled by
that duplicated architecture fault handler.

However, when the generic VM layer started propagating the error return
from the stack expansion in commit fee7e49d45 ("mm: propagate error
from stack expansion even for guard page"), that now exposed the
existing VM_FAULT_SIGBUS result to user space.  And user space really
expected SIGSEGV, not SIGBUS.

To fix that case, we need to add a VM_FAULT_SIGSEGV, and teach all those
duplicate architecture fault handlers about it.  They all already have
the code to handle SIGSEGV, so it's about just tying that new return
value to the existing code, but it's all a bit annoying.

This is the mindless minimal patch to do this.  A more extensive patch
would be to try to gather up the mostly shared fault handling logic into
one generic helper routine, and long-term we really should do that
cleanup.

Just from this patch, you can generally see that most architectures just
copied (directly or indirectly) the old x86 way of doing things, but in
the meantime that original x86 model has been improved to hold the VM
semaphore for shorter times etc and to handle VM_FAULT_RETRY and other
"newer" things, so it would be a good idea to bring all those
improvements to the generic case and teach other architectures about
them too.

Reported-and-tested-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Jan Engelhardt <jengelh@inai.de>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> # "s390 still compiles and boots"
Cc: linux-arch@vger.kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-01-29 10:51:32 -08:00
Michael S. Tsirkin
33a3dcc228 xtensa: macro whitespace fixes
While working on arch/xtensa/include/asm/uaccess.h, I noticed
that some macros within this header are made harder to read because they
violate a coding style rule: space is missing after comma.

Fix it up.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
2015-01-13 15:24:10 +02:00
Linus Torvalds
a643fc7253 Xtensa fixes for 3.19:
- fix nommu support;
 - remove s6000 variant and s6105 platform.
 - fix permissions for kmapped pages so that copy_to_user_page works with them.
 - add power management menu to Kconfig to allow use of runtime PM.
 - disable linker optimizations because of a linker bug.
 - fix sparse error.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJUj+PnAAoJEI9vqH3mFV2s13sP/iNDjBFhYLkPTTTdLKcLwMoS
 ZfWKsKmmmbvSTAN2rpzdRt45hcDpukAbtxBh7zKoIz2w8jnCBVWEWos9J8Wefy4X
 WHuMm8QsQ5dK57F6I36db2ET1cJUlgAKnXUykd8w1HY/9QEUCa1FoAYiIQjQoMDA
 6X6ZvXI4tuneMpE+Hz1xsFxkyY1HOPULnlKHbplaDZtXZ9GCrYMD6t6h5BbpvLmk
 WoSx2aPJvoNIaQgLBNAqDZ7vGd3AaPgztQTho0hWvja9DRECzkjEZoZ5OFwzDl/f
 YGmaY4Vd+RNlhDKBUiqv7KVwPIv6jJwSYQXOYnMBtgr6JSfs8R/0yiylmj9FK/Wb
 f+t3gG9/iFfKNZ7uKDp6uqGUJVQe2tUBFQIFFVpQ7knLy1b7ZYHQm8k+kugBX41+
 4JJcTY7F+SiFLCqinKnstKiLjt9GzPrjPXRNoJ6bcpC0RGY8Eem6hCogSepgEH1w
 E0Wh3E0HMgoQR6rnXpaDHx9ld0zcZkBymVSwQCP89mXbAhxlIV511USmoNaYeJm/
 u6kXyyrvvDrOmSoAufeWf53AV2AxLY6fGRPjCoME4I/qJOyFOdNuuMLv3Emjq+m4
 1bw1BoPVMAXCdRdt8pR1uzsbKyaS4KOZbDP6+p3TTG2L0YJFJ6iJ8hAey9rtEy5Y
 HZqGD4j1ZzWqwfTwz94F
 =ePa2
 -----END PGP SIGNATURE-----

Merge tag 'xtensa-next-20141215' of git://github.com/czankel/xtensa-linux

Pull Xtensa fixes from Chris Zankel:
 - fix nommu support
 - remove s6000 variant and s6105 platform
 - fix permissions for kmapped pages so that copy_to_user_page works with them
 - add power management menu to Kconfig to allow use of runtime PM
 - disable linker optimizations because of a linker bug
 - fix sparse error

* tag 'xtensa-next-20141215' of git://github.com/czankel/xtensa-linux:
  xtensa: disable link optimization
  xtensa/uaccess: fix sparse errors
  xtensa: fix kmap_prot definition
  xtensa: add power management menu to Kconfig
  xtensa: remove s6000 variant and s6105 platform
  xtensa: make PLATFORM_DEFAULT_MEM parameters configurable
  xtensa: nommu: clean up memory map dump
  xtensa: nommu: reserve memory below PLATFORM_DEFAULT_MEM_START
  xtensa: nommu: set up cache and atomctl in initialize_mmu
  xtensa: move vecbase SR initialization to _startup
  xtensa: nommu: fix uImage load address
  xtensa: nommu: fix load address definitions
  xtensa: nommu: fix Image.elf reset code and ld script
  xtensa: nommu: add MMU dependency to DEBUG_TLB_SANITY
  xtensa: nommu: don't build most of the cache flushing code
  xtensa: nommu: don't provide arch_get_unmapped_area
  xtensa: nommu: provide MAP_UNINITIALIZED definition
  xtensa: nommu: provide _PAGE_CHG_MASK definition
  xtensa: nommu: provide __invalidate_dcache_page_alias stub
  xtensa: nommu: move init_mmu stub to nommu_context.h
2014-12-16 14:08:53 -08:00
Chris Zankel
1f2fdbd007 xtensa: disable link optimization
The default linker behavior is to optimize identical literal values
and remove unnecessary overhead. However, because of a bug in the
linker, this currently results in an error ('call target out of range').

Disable link-time optimizations per default until there is a fix
for the linker and add the option to iss_defconfig.

Signed-off-by: Chris Zankel <chris@zankel.net>
2014-12-15 23:47:24 -08:00
Michael S. Tsirkin
4255a8e199 xtensa/uaccess: fix sparse errors
virtio wants to read bitwise types from userspace using get_user.  At the
moment this triggers sparse errors, since the value is passed through an
integer.

Fix that up using __force.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
2014-12-15 20:14:26 -08:00
Chris Zankel
2cb54e8493 Xtensa improvements for 3.19:
- fix permissions for kmapped pages so that copy_to_user_page works with
   them;
 - add power management menu to Kconfig to allow use of runtime PM.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUi7VsAAoJEFH5zJH4P6BEpS8P/jsHzgGyaCmvr8MI+I6wImIt
 orEhkxOYQS4aBAi/azupTPYbu8r2I8+yscWtFxBnvJok3rT2yMtSJZFLUhur0nG4
 DQwQduMeHbzSC4ADqJBalfaOfpcwz/GQoM6IPVZEEW6h4vzCvUm0O1Wq5Z1Thbg2
 skMmVFIX2+YTwUrEKMEqbl1JevNzNH53t/tlTgiXOMkZWwL1R4ToRsFHv9zpIJ1m
 Srm0BWAXAM+h1vx1Pv2vwmTcgPj3MdBccsla/HAybeQraqThdlgAz9Cnk5T5AdWE
 6rLy9mw+LiT1kXnbl4Z526NBzvkf+5+xYiGqI3UwohhFEChq74PBPQnZlpZ2AGlG
 dI/i9CoV0uQgU3rRDvS9NNFXXW59objKIu8f2Od5pS4kgV+mPjKePVTJbchXIf5n
 MC7Dq2GcM8jK4/Q32aHNxDi9jM3jukd7pJHbyxOo0g1SpmSEnNSJ+CcOV5ft6nLB
 xIohvVXg8Om976Xbl6eRii7lNdCZm8j7mDNMl37lwaqitIgZmlGeRhAyYCnjC1Pl
 mxtORfQbGfUHw/o8TlhyINBNQdpLr0CRTL4HCrMyiDDQ0mJH3bMBKuSk7y0Qe8DG
 aJ8Om29CKvawr3irehNRsZiSfoqiPG6F/GzfFxfgSut/AKAMI25kMSoGZCjBMhHn
 76+jWe4WzygZCAUWzmsl
 =9vUt
 -----END PGP SIGNATURE-----

Merge tag 'xtensa-for-next-20141213' of git://github.com/jcmvbkbc/linux-xtensa into for_next

Xtensa improvements for 3.19:

- fix permissions for kmapped pages so that copy_to_user_page works with
  them;
- add power management menu to Kconfig to allow use of runtime PM.
2014-12-15 20:10:39 -08:00
Linus Torvalds
70e71ca0af Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller:

 1) New offloading infrastructure and example 'rocker' driver for
    offloading of switching and routing to hardware.

    This work was done by a large group of dedicated individuals, not
    limited to: Scott Feldman, Jiri Pirko, Thomas Graf, John Fastabend,
    Jamal Hadi Salim, Andy Gospodarek, Florian Fainelli, Roopa Prabhu

 2) Start making the networking operate on IOV iterators instead of
    modifying iov objects in-situ during transfers.  Thanks to Al Viro
    and Herbert Xu.

 3) A set of new netlink interfaces for the TIPC stack, from Richard
    Alpe.

 4) Remove unnecessary looping during ipv6 routing lookups, from Martin
    KaFai Lau.

 5) Add PAUSE frame generation support to gianfar driver, from Matei
    Pavaluca.

 6) Allow for larger reordering levels in TCP, which are easily
    achievable in the real world right now, from Eric Dumazet.

 7) Add a variable of napi_schedule that doesn't need to disable cpu
    interrupts, from Eric Dumazet.

 8) Use a doubly linked list to optimize neigh_parms_release(), from
    Nicolas Dichtel.

 9) Various enhancements to the kernel BPF verifier, and allow eBPF
    programs to actually be attached to sockets.  From Alexei
    Starovoitov.

10) Support TSO/LSO in sunvnet driver, from David L Stevens.

11) Allow controlling ECN usage via routing metrics, from Florian
    Westphal.

12) Remote checksum offload, from Tom Herbert.

13) Add split-header receive, BQL, and xmit_more support to amd-xgbe
    driver, from Thomas Lendacky.

14) Add MPLS support to openvswitch, from Simon Horman.

15) Support wildcard tunnel endpoints in ipv6 tunnels, from Steffen
    Klassert.

16) Do gro flushes on a per-device basis using a timer, from Eric
    Dumazet.  This tries to resolve the conflicting goals between the
    desired handling of bulk vs.  RPC-like traffic.

17) Allow userspace to ask for the CPU upon what a packet was
    received/steered, via SO_INCOMING_CPU.  From Eric Dumazet.

18) Limit GSO packets to half the current congestion window, from Eric
    Dumazet.

19) Add a generic helper so that all drivers set their RSS keys in a
    consistent way, from Eric Dumazet.

20) Add xmit_more support to enic driver, from Govindarajulu
    Varadarajan.

21) Add VLAN packet scheduler action, from Jiri Pirko.

22) Support configurable RSS hash functions via ethtool, from Eyal
    Perry.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1820 commits)
  Fix race condition between vxlan_sock_add and vxlan_sock_release
  net/macb: fix compilation warning for print_hex_dump() called with skb->mac_header
  net/mlx4: Add support for A0 steering
  net/mlx4: Refactor QUERY_PORT
  net/mlx4_core: Add explicit error message when rule doesn't meet configuration
  net/mlx4: Add A0 hybrid steering
  net/mlx4: Add mlx4_bitmap zone allocator
  net/mlx4: Add a check if there are too many reserved QPs
  net/mlx4: Change QP allocation scheme
  net/mlx4_core: Use tasklet for user-space CQ completion events
  net/mlx4_core: Mask out host side virtualization features for guests
  net/mlx4_en: Set csum level for encapsulated packets
  be2net: Export tunnel offloads only when a VxLAN tunnel is created
  gianfar: Fix dma check map error when DMA_API_DEBUG is enabled
  cxgb4/csiostor: Don't use MASTER_MUST for fw_hello call
  net: fec: only enable mdio interrupt before phy device link up
  net: fec: clear all interrupt events to support i.MX6SX
  net: fec: reset fep link status in suspend function
  net: sock: fix access via invalid file descriptor
  net: introduce helper macro for_each_cmsghdr
  ...
2014-12-11 14:27:06 -08:00
Daniel Borkmann
0cb6c969ed net, lib: kill arch_fast_hash library bits
As there are now no remaining users of arch_fast_hash(), lets kill
it entirely.

This basically reverts commit 71ae8aac3e ("lib: introduce arch
optimized hash library") and follow-up work, that is f.e., commit
237217546d ("lib: hash: follow-up fixups for arch hash"),
commit e3fec2f74f ("lib: Add missing arch generic-y entries for
asm-generic/hash.h") and last but not least commit 6a02652df5
("perf tools: Fix include for non x86 architectures").

Cc: Francesco Fusco <fusco@ntop.org>
Cc: Thomas Graf <tgraf@suug.ch>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-10 15:17:46 -05:00
Linus Torvalds
a0e4467726 asm-generic: asm/io.h rewrite
While there normally is no reason to have a pull request for asm-generic
 but have all changes get merged through whichever tree needs them, I do
 have a series for 3.19. There are two sets of patches that change
 significant portions of asm/io.h, and this branch contains both in order
 to resolve the conflicts:
 
 - Will Deacon has done a set of patches to ensure that all architectures
   define {read,write}{b,w,l,q}_relaxed() functions or get them by
   including asm-generic/io.h. These functions are commonly used on ARM
   specific drivers to avoid expensive L2 cache synchronization implied by
   the normal {read,write}{b,w,l,q}, but we need to define them on all
   architectures in order to share the drivers across architectures and
   to enable CONFIG_COMPILE_TEST configurations for them
 
 - Thierry Reding has done an unrelated set of patches that extends
   the asm-generic/io.h file to the degree necessary to make it useful
   on ARM64 and potentially other architectures.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIVAwUAVIdwNmCrR//JCVInAQJWuw/9FHt2ThMnI1J1Jqy4CVwtyjWTSa6Y/uVj
 xSytS7AOvmU/nw1quSoba5mN9fcUQUtK9kqjqNcq71WsQcDE6BF9SFpi9cWtjWcI
 ZfWsC+5kqry/mbnuHefENipem9RqBrLbOBJ3LARf5M8rZJuTz1KbdZs9r9+1QsCX
 ou8jeqVvNKUn9J1WyekJBFSrPOtZ4bCUpeyh23JHRfPtJeAHNOuPuymj6WceAz98
 uMV1icRaCBMySsf9HgsHRYW5HwuCm3MrrYj6ukyPpgxYz7FRq4hJLDs6GnlFtAGb
 71g87NpFdB32qbW+y1ntfYaJyUryMHMVHBWcV5H9m0btdHTRHYZjoOGOPuyLHHO8
 +l4/FaOQhnDL8cNDj0HKfhdlyaFylcWgs1wzj68nv31c1dGjcJcQiyCDwry9mJhr
 erh4EewcerUvWzbBMQ4JP1f8syKMsKwbo1bVU61a1RQJxEqVCzJMLweGSOFmqMX2
 6E4ZJVWv81UFLoFTzYx+7+M45K4NWywKNQdzwKmqKHc4OQyvq4ALJI0A7SGFJdDR
 HJ7VqDiLaSdBitgJcJUxNzKcyXij6wE9jE1fBe3YDFE4LrnZXFVLN+MX6hs7AIFJ
 vJM1UpxRxQUMGIH2m7rbDNazOAsvQGxINOjNor23cNLuf6qLY1LrpHVPQDAfJVvA
 6tROM77bwIQ=
 =xUv6
 -----END PGP SIGNATURE-----

Merge tag 'asm-generic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic

Pull asm-generic asm/io.h rewrite from Arnd Bergmann:
 "While there normally is no reason to have a pull request for
  asm-generic but have all changes get merged through whichever tree
  needs them, I do have a series for 3.19.

  There are two sets of patches that change significant portions of
  asm/io.h, and this branch contains both in order to resolve the
  conflicts:

   - Will Deacon has done a set of patches to ensure that all
     architectures define {read,write}{b,w,l,q}_relaxed() functions or
     get them by including asm-generic/io.h.

     These functions are commonly used on ARM specific drivers to avoid
     expensive L2 cache synchronization implied by the normal
     {read,write}{b,w,l,q}, but we need to define them on all
     architectures in order to share the drivers across architectures
     and to enable CONFIG_COMPILE_TEST configurations for them

   - Thierry Reding has done an unrelated set of patches that extends
     the asm-generic/io.h file to the degree necessary to make it useful
     on ARM64 and potentially other architectures"

* tag 'asm-generic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: (29 commits)
  ARM64: use GENERIC_PCI_IOMAP
  sparc: io: remove duplicate relaxed accessors on sparc32
  ARM: sa11x0: Use void __iomem * in MMIO accessors
  arm64: Use include/asm-generic/io.h
  ARM: Use include/asm-generic/io.h
  asm-generic/io.h: Implement generic {read,write}s*()
  asm-generic/io.h: Reconcile I/O accessor overrides
  /dev/mem: Use more consistent data types
  Change xlate_dev_{kmem,mem}_ptr() prototypes
  ARM: ixp4xx: Properly override I/O accessors
  ARM: ixp4xx: Fix build with IXP4XX_INDIRECT_PCI
  ARM: ebsa110: Properly override I/O accessors
  ARC: Remove redundant PCI_IOBASE declaration
  documentation: memory-barriers: clarify relaxed io accessor semantics
  x86: io: implement dummy relaxed accessor macros for writes
  tile: io: implement dummy relaxed accessor macros for writes
  sparc: io: implement dummy relaxed accessor macros for writes
  powerpc: io: implement dummy relaxed accessor macros for writes
  parisc: io: implement dummy relaxed accessor macros for writes
  mn10300: io: implement dummy relaxed accessor macros for writes
  ...
2014-12-09 17:25:00 -08:00
Max Filippov
ff009ab6d4 xtensa: fix kmap_prot definition
Replace PAGE_KERNEL with PAGE_KERNEL_EXEC to allow copy_to_user_page
invalidate icache for pages mapped with kmap.

Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-12-09 03:22:57 +03:00
Max Filippov
e00d8b2f44 xtensa: add power management menu to Kconfig
This allows using runtime power management feature on Xtensa.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-12-09 03:22:51 +03:00
Alexei Starovoitov
89aa075832 net: sock: allow eBPF programs to be attached to sockets
introduce new setsockopt() command:

setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &prog_fd, sizeof(prog_fd))

where prog_fd was received from syscall bpf(BPF_PROG_LOAD, attr, ...)
and attr->prog_type == BPF_PROG_TYPE_SOCKET_FILTER

setsockopt() calls bpf_prog_get() which increments refcnt of the program,
so it doesn't get unloaded while socket is using the program.

The same eBPF program can be attached to multiple sockets.

User task exit automatically closes socket which calls sk_filter_uncharge()
which decrements refcnt of eBPF program

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-05 21:47:32 -08:00
David S. Miller
076ce44825 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	drivers/net/ethernet/chelsio/cxgb4vf/sge.c
	drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c

sge.c was overlapping two changes, one to use the new
__dev_alloc_page() in net-next, and one to use s->fl_pg_order in net.

ixgbe_phy.c was a set of overlapping whitespace changes.

Signed-off-by: David S. Miller <davem@davemloft.net>
2014-11-14 01:01:12 -05:00
Eric Dumazet
2c8c56e15d net: introduce SO_INCOMING_CPU
Alternative to RPS/RFS is to use hardware support for multiple
queues.

Then split a set of million of sockets into worker threads, each
one using epoll() to manage events on its own socket pool.

Ideally, we want one thread per RX/TX queue/cpu, but we have no way to
know after accept() or connect() on which queue/cpu a socket is managed.

We normally use one cpu per RX queue (IRQ smp_affinity being properly
set), so remembering on socket structure which cpu delivered last packet
is enough to solve the problem.

After accept(), connect(), or even file descriptor passing around
processes, applications can use :

 int cpu;
 socklen_t len = sizeof(cpu);

 getsockopt(fd, SOL_SOCKET, SO_INCOMING_CPU, &cpu, &len);

And use this information to put the socket into the right silo
for optimal performance, as all networking stack should run
on the appropriate cpu, without need to send IPI (RPS/RFS).

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-11-11 13:00:06 -05:00
Chris Zankel
c0d7aa0750 Xtensa improvements for 3.18:
- fix nommu support;
 - remove s6000 variant and s6105 platform.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJURikHAAoJEFH5zJH4P6BEyT4P/RiqRMw5S1X/DxXeEHy2Xhpg
 IJsqF5OMymnWuoXuGje4akm8qfqObuCmsJ7FGLtw7XOQzJ9DwAhpetEtty+bpsvt
 btlay50h62J/GjNz028xlru4FzRW3lc7s4ArUdZLHBeHjG8sSd5SoVPwsH0S9/aL
 LJdRyv0E35PLK4yTHa806KerSBKF1k7VhbEJKEJqIu1w4rJrH8R610IZbP/uTKV2
 DijmP5xqQwcDp+j8gxutkJZqsktEvuERgDywCheoYt8E0mr45C418prw/CChyLez
 EXk0jV0zw8OI1rUPc1PEuLT7jik+j59PVMSZM5pFFZRBZbv82HfSa0ZlL22Q6Saa
 TwpcKybH9bQmWL8sKV6ASmGyqz4vl9ZFIIlDXkFw/Gj13ZXxo12kEqN2dsOFZuIn
 TBdgVvUigpS7U3e4cClavPBaqlSgrnYFbD+9Ehcml83MuNlv37gL4H0X0y2u2/Tl
 0Ixb3QEk69IAuycgX37jTVfwGZ4HTkYPFMZckGNoJ7eBVCahTSQesNm52xD5quz1
 HMY+atTzzKnx3DGFCBbYayuqm3aBVkEmjYnPeag6sY8UkhtF3yr6YNWepf3jxxL7
 cR27gwP/k2YBf9M38Jyh5fnjYST6qj3ByXLNE2aeNnSO+qvZMNPCeDJHrBx+Zvtt
 5BjU5/3HZkAWWhqy6Aim
 =sSwk
 -----END PGP SIGNATURE-----

Merge tag 'xtensa-for-next-20141021-2' of git://github.com/jcmvbkbc/linux-xtensa into for_next

Xtensa improvements for 3.18:

- fix nommu support;
- remove s6000 variant and s6105 platform.
2014-11-10 00:24:48 -08:00
Chris Zankel
66acb0216d Xtensa improvements for 3.18:
- add seccomp, getrandom, and memfd_create syscalls;
 - add defconfigs for KC705 and SMP LX200;
 - fix ISS and xtfpga Kconfig dependencies so that more randconfigs
   are buildable;
 - fix umount syscall;
 - implement pgprot_noncached.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJURijdAAoJEFH5zJH4P6BEOggP/i2VVO18pYPA0f5F6tjHPKz5
 YWTz03ebJE41FJCuhXsoolYGfZjBAv2Vnad5GymqOWXBfq/9w+Lev8UVPBLb+7uu
 Qy6bWcYcHPk2xgUrPXJGfiiX/hItYDdWclEXk9zIdV9/yEzunus9d/OskMk69Lav
 37RT6K78mfkv9F0RzrK2UNpb1CLjXFJ8TmVDGv2Pvi1xNJKih+WEX/S9VmFDmQBP
 iuRCbKPgT1PqELn0Q76NaQzOs7i9C3sy55CLmPPTQjTvSlPwO3OTzOQ4QrDOVZtG
 GvBhbnVkBco5yOLLF+1lHGPyk+2kDfr4c/uqvFnHHM2lKs1pLw/80C5zzo6azzUO
 MgIQHBGwR6VnCY2a6UpK9NFGuGaKW6yl4yaMqKTTFUt8N/cQadjgZ19xPgPZZlg1
 Mll5ZeBs05g6/Ph3nGuBLfa21hnNk2iZjU7/5d1acQTNjCm1HdU3AjcqHBaWIt5o
 Ee0EhNRHRrq/bJv+dgLUXiezAAdMLMvmGSOIu9jNV2LmbwgdrjfcMJbiPfEFDvsA
 4+++z56iu5rqLWxrU+pMDInN3rY2W/s2fLwkmqZcy64g0uiZuNhh+fulBCSnbm+C
 qEyDZXFfPEq+cv9mTH0ieP5YowSCHraYY68ALWt/OVwjahp7b7R5ifIr27eziYkk
 KRQtlJAWIAIvh5fUrYaN
 =F6y4
 -----END PGP SIGNATURE-----

Merge tag 'xtensa-for-next-20141021-1' of git://github.com/jcmvbkbc/linux-xtensa into for_next

Xtensa improvements for 3.18:

- add seccomp, getrandom, and memfd_create syscalls;
- add defconfigs for KC705 and SMP LX200;
- fix ISS and xtfpga Kconfig dependencies so that more randconfigs
  are buildable;
- fix umount syscall;
- implement pgprot_noncached.
2014-10-23 10:30:33 -07:00
Daniel Glöckner
4006e565e1 xtensa: remove s6000 variant and s6105 platform
The Stretch s6000 family support has been merged into mainline 5 years
ago. There appear to be no users of this code since nobody complained
that there is a merge error preventing compilation.

Apart from the s6105 IP camera reference design there are no s6000 devices
known to ever have run Linux and as the chips are out of production there
probably never will be. The successor s7000 no longer uses an Xtensa core
for the OS.

Let's remove the code until someone is found who actually needs it.

Signed-off-by: Daniel Glöckner <dg@emlix.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-10-21 13:29:01 +04:00
Max Filippov
3932b9ca55 xtensa: make PLATFORM_DEFAULT_MEM parameters configurable
This allows using xtfpga platform with both MMU and noMMU cores.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-10-21 13:28:59 +04:00
Max Filippov
5a0b1d78bf xtensa: nommu: clean up memory map dump
noMMU configuration doesn't use special area for vmalloc allocations,
don't print it in the memory map.
PAGE_OFFSET is fixed to 0 in noMMU, use min_low_pfn and max_low_pfn for
lowmem range display.
Make all XCHAL_KSEG_* constants unsigned long for consistency with other
addresses.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-10-21 13:28:58 +04:00
Max Filippov
566fb58ed4 xtensa: nommu: reserve memory below PLATFORM_DEFAULT_MEM_START
Memory accounting code can't handle pages below
PLATFORM_DEFAULT_MEM_START. Reserve those pages if they exist.
When PLATFORM_DEFAULT_MEM_START is zero reserve one page at address 0 to
make sure that successfull memory allocations don't return NULL.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-10-21 13:28:57 +04:00
Max Filippov
2eabc1800d xtensa: nommu: set up cache and atomctl in initialize_mmu
initialize_mmu sets up atomctl SR which is needed for s32c1i to function
correctly even in noMMU configurations. It's also a good place to set up
caching attributes of physical memory.

Allow enabling INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX in noMMU
configurations for setting up atomctl and cache attributes.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-10-21 13:28:56 +04:00
Max Filippov
53490121e9 xtensa: move vecbase SR initialization to _startup
Instead of initializing vecbase in initialize_mmu macro, which may be
expanded either in Image.elf reset vector hadler or in the kernel
head.S, both times only when CONFIG_MMU is enabled, do this
initialization once in _startup function.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-10-21 13:28:55 +04:00
Max Filippov
a4f9846da7 xtensa: nommu: fix uImage load address
Use the same offset from the default physical memory start address as in
LOAD_MEMORY_ADDRESS definition.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-10-21 13:28:54 +04:00
Max Filippov
72bb305fdc xtensa: nommu: fix load address definitions
Change KERNELOFFSET, LOAD_MEMORY_ADDRESS and VIRTUAL_MEMORY_ADDRESS to be
relative to the start of physical memory in noMMU configuration, as
there's no uniform memory remapping to KSEG starting at 0xd0000000.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-10-21 13:28:53 +04:00
Max Filippov
ccd0ef38be xtensa: nommu: fix Image.elf reset code and ld script
Don't hardcode kernel entry address as 0x3000 or 0xd0003000, use
LOAD_MEMORY_ADDRESS macro. Don't compile MMU remapping code and don't try
to link it when building noMMU configuration.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-10-21 13:28:52 +04:00
Max Filippov
be603092cc xtensa: nommu: add MMU dependency to DEBUG_TLB_SANITY
TLB sanity checking code depends on full MMU presence and may not be
built in noMMU confgiuration.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-10-21 13:28:51 +04:00
Max Filippov
b6cee17b7d xtensa: nommu: don't build most of the cache flushing code
Most cache flushing code is only relevant for MMU. Don't build it for
nommu configuration.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-10-21 13:28:50 +04:00