1. 06 8月, 2014 2 次提交
  2. 26 6月, 2014 1 次提交
    • P
      Revert "MIPS: Save/restore MSA context around signals" · 16f77de8
      Paul Burton 提交于
      This reverts commit eec43a22 "MIPS: Save/restore MSA context around
      signals" and the MSA parts of ca750649 "MIPS: kernel: signal:
      Prevent save/restore FPU context in user memory" (the restore path of
      which appears incorrect anyway...).
      
      The reverted patch took care not to break compatibility with userland
      users of struct sigcontext, but inadvertantly changed the offset of the
      uc_sigmask field of struct ucontext. Thus Linux v3.15 breaks the
      userland ABI. The MSA context will need to be saved via some other
      opt-in mechanism, but for now revert the change to reduce the fallout.
      
      This will have minimal impact upon use of MSA since the only supported
      CPU which includes it (the P5600) is 32-bit and therefore requires that
      the experimental CONFIG_MIPS_O32_FP64_SUPPORT Kconfig option be selected
      before the kernel will set FR=1 for a task, a requirement for MSA use.
      Thus the users of MSA are limited to known small groups of people & this
      patch won't be breaking any previously working MSA-using userland
      outside of experimental settings.
      
      [ralf@linux-mips.org: Fixed rejects.]
      
      Cc: stable@vger.kernel.org
      Reported-by: NJoseph S. Myers <joseph@codesourcery.com>
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: stable@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/7107/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      16f77de8
  3. 27 3月, 2014 5 次提交
  4. 14 1月, 2014 1 次提交
    • P
      MIPS: Support for 64-bit FP with O32 binaries · 597ce172
      Paul Burton 提交于
      CPUs implementing MIPS32 R2 may include a 64-bit FPU, just as MIPS64 CPUs
      do. In order to preserve backwards compatibility a 64-bit FPU will act
      like a 32-bit FPU (by accessing doubles from the least significant 32
      bits of an even-odd pair of FP registers) when the Status.FR bit is
      zero, again just like a mips64 CPU. The standard O32 ABI is defined
      expecting a 32-bit FPU, however recent toolchains support use of a
      64-bit FPU from an O32 MIPS32 executable. When an ELF executable is
      built to use a 64-bit FPU a new flag (EF_MIPS_FP64) is set in the ELF
      header.
      
      With this patch the kernel will check the EF_MIPS_FP64 flag when
      executing an O32 binary, and set Status.FR accordingly. The addition
      of O32 64-bit FP support lessens the opportunity for optimisation in
      the FPU emulator, so a CONFIG_MIPS_O32_FP64_SUPPORT Kconfig option is
      introduced to allow this support to be disabled for those that don't
      require it.
      
      Inspired by an earlier patch by Leonid Yegoshin, but implemented more
      cleanly & correctly.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Paul Burton <paul.burton@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/6154/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      597ce172
  5. 11 6月, 2013 1 次提交
  6. 09 5月, 2013 1 次提交
  7. 04 2月, 2013 4 次提交
  8. 01 2月, 2013 1 次提交
  9. 12 12月, 2012 1 次提交
    • R
      MIPS: Fix harmlessly missing else statement. · 9ec9b5ac
      Ralf Baechle 提交于
      The actual bug is a missing else statement - but really this should be
      expressed using a switch() statement.
      
      Found by Al Viro who writes "the funny thing is, it *does* work only
      because r2 is syscall number and syscall number around 512 => return
      value being ENOSYS and not one of ERESTART...  so we really can't hit
      the first if and emerge from it with ERESTART_RESTARTBLOCK.  still
      wrong to write it that way..."
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      9ec9b5ac
  10. 01 10月, 2012 1 次提交
  11. 22 9月, 2012 1 次提交
  12. 02 6月, 2012 6 次提交
  13. 24 5月, 2012 1 次提交
  14. 22 5月, 2012 1 次提交
  15. 27 4月, 2012 1 次提交
    • M
      MIPS: Use set_current_blocked() and block_sigmask() · 8598f3cd
      Matt Fleming 提交于
      As described in e6fa16ab ("signal: sigprocmask() should do
      retarget_shared_pending()") the modification of current->blocked is
      incorrect as we need to check whether the signal we're about to block
      is pending in the shared queue.
      
      Also, use the new helper function introduced in commit 5e6292c0
      ("signal: add block_sigmask() for adding sigmask to current->blocked")
      which centralises the code for updating current->blocked after
      successfully delivering a signal and reduces the amount of duplicate
      code across architectures. In the past some architectures got this
      code wrong, so using this helper function should stop that from
      happening again.
      
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: linux-kernel@vger.kernel.org
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: David Daney <ddaney@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      Patchwork: https://patchwork.linux-mips.org/patch/3363/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      8598f3cd
  16. 29 3月, 2012 1 次提交
  17. 21 9月, 2011 1 次提交
    • R
      MIPS: Handle __put_user() sleeping. · 1f717929
      Ralf Baechle 提交于
      do_signal() does __put_user() which can fault, resulting in a might_sleep()
      warning in down_read(&mm->mmap_sem) and a "scheduling while atomic" warning
      when mmap_sem is contented. On Swarm this also results in:
      
      WARNING: at kernel/smp.c:459 smp_call_function_many+0x148/0x398()
      Modules linked in:
      Call Trace:
      
      [<ffffffff804b48a4>] dump_stack+0x1c/0x50
      [<ffffffff8013dc94>] warn_slowpath_common+0x8c/0xc8
      [<ffffffff8013dcfc>] warn_slowpath_null+0x2c/0x40
      [<ffffffff801864a0>] smp_call_function_many+0x148/0x398
      [<ffffffff80186748>] smp_call_function+0x58/0xa8
      [<ffffffff80119b5c>] r4k_flush_data_cache_page+0x54/0xd8
      [<ffffffff801f39bc>] handle_pte_fault+0xa9c/0xad0
      [<ffffffff801f40d0>] handle_mm_fault+0x158/0x200
      [<ffffffff80115548>] do_page_fault+0x218/0x3b0
      [<ffffffff80102744>] ret_from_exception+0x0/0x10
      [<ffffffff8010eb18>] copy_siginfo_to_user32+0x50/0x298
      [<ffffffff8010edf0>] setup_rt_frame_32+0x90/0x250
      [<ffffffff80106414>] do_notify_resume+0x154/0x358
      [<ffffffff80102930>] work_notifysig+0xc/0x14
      
      Fixed by enabling interrupts in do_notify_resume before delivering signals.
      
      [ralf@linux-mips.org: Reported and original fix by tglx but I wanted to
      minimize the amount of code being run with interrupts disabled so I moved
      the local_irq_disable() call right into do_notify_resume.  Which is saner
      than doing it in entry.S.]
      Reported-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      1f717929
  18. 15 3月, 2011 1 次提交
  19. 18 10月, 2010 3 次提交
  20. 13 4月, 2010 1 次提交
    • D
      MIPS: Move signal trampolines off of the stack. · d814c28c
      David Daney 提交于
      This is a follow on to the vdso patch.
      
      Since all processes now have signal trampolines permanently mapped, we
      can use those instead of putting the trampoline on the stack and
      invalidating the corresponding icache across all CPUs.  We also get rid
      of a bunch of ICACHE_REFILLS_WORKAROUND_WAR code.
      
      [Ralf: GDB 7.1 which has the necessary modifications to allow backtracing
      over signal frames will supposedly be released tomorrow.  The old signal
      frame format obsoleted by this patch exists in two variations, for sane
      processors and for those requiring ICACHE_REFILLS_WORKAROUND_WAR.  So
      there was never a GDB which did support backtracing over signal frames
      on all MIPS systems.  This convinved me this series should be applied and
      pushed upstream as soon as possible.]
      Signed-off-by: NDavid Daney <ddaney@caviumnetworks.com>
      To: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/974/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      d814c28c
  21. 17 12月, 2009 1 次提交
  22. 09 9月, 2009 1 次提交
  23. 02 9月, 2009 2 次提交
    • D
      KEYS: Add a keyctl to install a process's session keyring on its parent [try #6] · ee18d64c
      David Howells 提交于
      Add a keyctl to install a process's session keyring onto its parent.  This
      replaces the parent's session keyring.  Because the COW credential code does
      not permit one process to change another process's credentials directly, the
      change is deferred until userspace next starts executing again.  Normally this
      will be after a wait*() syscall.
      
      To support this, three new security hooks have been provided:
      cred_alloc_blank() to allocate unset security creds, cred_transfer() to fill in
      the blank security creds and key_session_to_parent() - which asks the LSM if
      the process may replace its parent's session keyring.
      
      The replacement may only happen if the process has the same ownership details
      as its parent, and the process has LINK permission on the session keyring, and
      the session keyring is owned by the process, and the LSM permits it.
      
      Note that this requires alteration to each architecture's notify_resume path.
      This has been done for all arches barring blackfin, m68k* and xtensa, all of
      which need assembly alteration to support TIF_NOTIFY_RESUME.  This allows the
      replacement to be performed at the point the parent process resumes userspace
      execution.
      
      This allows the userspace AFS pioctl emulation to fully emulate newpag() and
      the VIOCSETTOK and VIOCSETTOK2 pioctls, all of which require the ability to
      alter the parent process's PAG membership.  However, since kAFS doesn't use
      PAGs per se, but rather dumps the keys into the session keyring, the session
      keyring of the parent must be replaced if, for example, VIOCSETTOK is passed
      the newpag flag.
      
      This can be tested with the following program:
      
      	#include <stdio.h>
      	#include <stdlib.h>
      	#include <keyutils.h>
      
      	#define KEYCTL_SESSION_TO_PARENT	18
      
      	#define OSERROR(X, S) do { if ((long)(X) == -1) { perror(S); exit(1); } } while(0)
      
      	int main(int argc, char **argv)
      	{
      		key_serial_t keyring, key;
      		long ret;
      
      		keyring = keyctl_join_session_keyring(argv[1]);
      		OSERROR(keyring, "keyctl_join_session_keyring");
      
      		key = add_key("user", "a", "b", 1, keyring);
      		OSERROR(key, "add_key");
      
      		ret = keyctl(KEYCTL_SESSION_TO_PARENT);
      		OSERROR(ret, "KEYCTL_SESSION_TO_PARENT");
      
      		return 0;
      	}
      
      Compiled and linked with -lkeyutils, you should see something like:
      
      	[dhowells@andromeda ~]$ keyctl show
      	Session Keyring
      	       -3 --alswrv   4043  4043  keyring: _ses
      	355907932 --alswrv   4043    -1   \_ keyring: _uid.4043
      	[dhowells@andromeda ~]$ /tmp/newpag
      	[dhowells@andromeda ~]$ keyctl show
      	Session Keyring
      	       -3 --alswrv   4043  4043  keyring: _ses
      	1055658746 --alswrv   4043  4043   \_ user: a
      	[dhowells@andromeda ~]$ /tmp/newpag hello
      	[dhowells@andromeda ~]$ keyctl show
      	Session Keyring
      	       -3 --alswrv   4043  4043  keyring: hello
      	340417692 --alswrv   4043  4043   \_ user: a
      
      Where the test program creates a new session keyring, sticks a user key named
      'a' into it and then installs it on its parent.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      ee18d64c
    • D
      KEYS: Extend TIF_NOTIFY_RESUME to (almost) all architectures [try #6] · d0420c83
      David Howells 提交于
      Implement TIF_NOTIFY_RESUME for most of those architectures in which isn't yet
      available, and, whilst we're at it, have it call the appropriate tracehook.
      
      After this patch, blackfin, m68k* and xtensa still lack support and need
      alteration of assembly code to make it work.
      
      Resume notification can then be used (by a later patch) to install a new
      session keyring on the parent of a process.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      
      cc: linux-arch@vger.kernel.org
      Signed-off-by: NJames Morris <jmorris@namei.org>
      d0420c83
  24. 28 2月, 2009 1 次提交