1. 16 12月, 2013 1 次提交
  2. 20 11月, 2013 1 次提交
    • H
      s390/signal: always restore saved runtime instrumentation psw bit · aa7e04b3
      Hendrik Brueckner 提交于
      Commit "s390: fix handling of runtime instrumentation psw bit" (5ebf250d)
      changed the behavior of setting the runtime instrumentation psw bit.  This
      commit restores the original logic:
      
      1. When returning from the signal handler, the runtime instrumentation psw bit
         is restored to its saved state.
      2. If the runtime instrumentation psw bit is enabled during the signal handler,
         it is always turned off when leaving the signal handler.  The saved state
         is restored as described in 1.  That also implies that turning on runtime
         instrumentation in the signal handler is only effective while running in the
         signal context.
      Signed-off-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      aa7e04b3
  3. 09 11月, 2013 1 次提交
  4. 24 10月, 2013 5 次提交
  5. 15 10月, 2013 1 次提交
  6. 07 9月, 2013 1 次提交
  7. 17 4月, 2013 1 次提交
  8. 28 2月, 2013 1 次提交
  9. 04 2月, 2013 3 次提交
  10. 12 11月, 2012 1 次提交
    • M
      s390/signal: set correct address space control · fa968ee2
      Martin Schwidefsky 提交于
      If user space is running in primary mode it can switch to secondary
      or access register mode, this is used e.g. in the clock_gettime code
      of the vdso. If a signal is delivered to the user space process while
      it has been running in access register mode the signal handler is
      executed in access register mode as well which will result in a crash
      most of the time.
      
      Set the address space control bits in the PSW to the default for the
      execution of the signal handler and make sure that the previous
      address space control is restored on signal return. Take care
      that user space can not switch to the kernel address space by
      modifying the registers in the signal frame.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      fa968ee2
  11. 20 7月, 2012 1 次提交
    • H
      s390/comments: unify copyright messages and remove file names · a53c8fab
      Heiko Carstens 提交于
      Remove the file name from the comment at top of many files. In most
      cases the file name was wrong anyway, so it's rather pointless.
      
      Also unify the IBM copyright statement. We did have a lot of sightly
      different statements and wanted to change them one after another
      whenever a file gets touched. However that never happened. Instead
      people start to take the old/"wrong" statements to use as a template
      for new files.
      So unify all of them in one go.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      a53c8fab
  12. 02 6月, 2012 3 次提交
  13. 16 5月, 2012 1 次提交
  14. 29 3月, 2012 1 次提交
  15. 11 3月, 2012 1 次提交
  16. 27 12月, 2011 2 次提交
    • M
      [S390] return address of compat signals · 207a0549
      Martin Schwidefsky 提交于
      A 31-bit kernel always sets the high order bit in the return address
      for a signal handler.
      git commit d4e81b35 "[S390] allow all addressing modes" makes
      sure that the high order bit is set in the signal return address for
      standard signals of a 31-bit compat process but fails to do the same
      for real-time signals. To make things consistent the bit needs to be
      set by setup_rt_frame32 as well.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      207a0549
    • M
      [S390] cleanup trap handling · aa33c8cb
      Martin Schwidefsky 提交于
      Move the program interruption code and the translation exception identifier
      to the pt_regs structure as 'int_code' and 'int_parm_long' and make the
      first level interrupt handler in entry[64].S store the two values. That
      makes it possible to drop 'prot_addr' and 'trap_no' from the thread_struct
      and to reduce the number of arguments to a lot of functions. Finally
      un-inline do_trap. Overall this saves 5812 bytes in the .text section of
      the 64 bit kernel.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      aa33c8cb
  17. 30 10月, 2011 6 次提交
    • M
      [S390] sparse: fix sparse warnings with __user pointers · 3c52e49d
      Martin Schwidefsky 提交于
      Use __force to quiet sparse warnings about user address space.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      3c52e49d
    • M
      [S390] sparse: fix access past end of array warnings · 399c1d8d
      Martin Schwidefsky 提交于
      Remove unnecessary code to avoid false positives from sparse, e.g.
      
      arch/s390/kernel/compat_signal.c:221:61: warning: invalid access past the end of 'set32' (8 8)
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      399c1d8d
    • M
      [S390] allow all addressing modes · d4e81b35
      Martin Schwidefsky 提交于
      The user space program can change its addressing mode between the
      24-bit, 31-bit and the 64-bit mode if the kernel is 64 bit. Currently
      the kernel always forces the standard amode on signal delivery and
      signal return and on ptrace: 64-bit for a 64-bit process, 31-bit for
      a compat process and 31-bit kernels. Change the signal and ptrace code
      to allow the full range of addressing modes. Signal handlers are
      run in the standard addressing mode for the process.
      
      One caveat is that even an 31-bit compat process can switch to the
      64-bit mode. The next signal will switch back into the 31-bit mode
      and there is no room in the 31-bit compat signal frame to store the
      information that the program came from the 64-bit mode.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      d4e81b35
    • M
      [S390] cleanup psw related bits and pieces · b50511e4
      Martin Schwidefsky 提交于
      Split out addressing mode bits from PSW_BASE_BITS, rename PSW_BASE_BITS
      to PSW_MASK_BASE, get rid of psw_user32_bits, remove unused function
      enabled_wait(), introduce PSW_MASK_USER, and drop PSW_MASK_MERGE macros.
      Change psw_kernel_bits / psw_user_bits to contain only the bits that
      are always set in the respective mode.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      b50511e4
    • M
      [S390] add TIF_SYSCALL thread flag · b6ef5bb3
      Martin Schwidefsky 提交于
      Add an explicit TIF_SYSCALL bit that indicates if a task is inside
      a system call. The svc_code in the pt_regs structure is now only
      valid if TIF_SYSCALL is set. With this definition TIF_RESTART_SVC
      can be replaced with TIF_SYSCALL. Overall do_signal is a bit more
      readable and it saves a few lines of code.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      b6ef5bb3
    • M
      [S390] signal race with restarting system calls · 20b40a79
      Martin Schwidefsky 提交于
      For a ERESTARTNOHAND/ERESTARTSYS/ERESTARTNOINTR restarting system call
      do_signal will prepare the restart of the system call with a rewind of
      the PSW before calling get_signal_to_deliver (where the debugger might
      take control). For A ERESTART_RESTARTBLOCK restarting system call
      do_signal will set -EINTR as return code.
      There are two issues with this approach:
      1) strace never sees ERESTARTNOHAND, ERESTARTSYS, ERESTARTNOINTR or
         ERESTART_RESTARTBLOCK as the rewinding already took place or the
         return code has been changed to -EINTR
      2) if get_signal_to_deliver does not return with a signal to deliver
         the restart via the repeat of the svc instruction is left in place.
         This opens a race if another signal is made pending before the
         system call instruction can be reexecuted. The original system call
         will be restarted even if the second signal would have ended the
         system call with -EINTR.
      
      These two issues can be solved by dropping the early rewind of the
      system call before get_signal_to_deliver has been called and by using
      the TIF_RESTART_SVC magic to do the restart if no signal has to be
      delivered. The only situation where the system call restart via the
      repeat of the svc instruction is appropriate is when a SA_RESTART
      signal is delivered to user space.
      
      Unfortunately this breaks inferior calls by the debugger again. The
      system call number and the length of the system call instruction is
      lost over the inferior call and user space will see ERESTARTNOHAND/
      ERESTARTSYS/ERESTARTNOINTR/ERESTART_RESTARTBLOCK. To correct this a
      new ptrace interface is added to save/restore the system call number
      and system call instruction length.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      20b40a79
  18. 03 8月, 2011 1 次提交
  19. 06 10月, 2009 1 次提交
  20. 27 11月, 2008 1 次提交
    • M
      [S390] fix system call parameter functions. · 59da2139
      Martin Schwidefsky 提交于
      syscall_get_nr() currently returns a valid result only if the call
      chain of the traced process includes do_syscall_trace_enter(). But
      collect_syscall() can be called for any sleeping task, the result of
      syscall_get_nr() in general is completely bogus.
      
      To make syscall_get_nr() work for any sleeping task the traps field
      in pt_regs is replace with svcnr - the system call number the process
      is executing. If svcnr == 0 the process is not on a system call path.
      
      The syscall_get_arguments and syscall_set_arguments use regs->gprs[2]
      for the first system call parameter. This is incorrect since gprs[2]
      may have been overwritten with the system call number if the call
      chain includes do_syscall_trace_enter. Use regs->orig_gprs2 instead.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      59da2139
  21. 17 4月, 2008 2 次提交
  22. 09 5月, 2007 1 次提交
  23. 27 4月, 2007 1 次提交
  24. 06 2月, 2007 2 次提交
    • G
      [S390] noexec protection · c1821c2e
      Gerald Schaefer 提交于
      This provides a noexec protection on s390 hardware. Our hardware does
      not have any bits left in the pte for a hw noexec bit, so this is a
      different approach using shadow page tables and a special addressing
      mode that allows separate address spaces for code and data.
      
      As a special feature of our "secondary-space" addressing mode, separate
      page tables can be specified for the translation of data addresses
      (storage operands) and instruction addresses. The shadow page table is
      used for the instruction addresses and the standard page table for the
      data addresses.
      The shadow page table is linked to the standard page table by a pointer
      in page->lru.next of the struct page corresponding to the page that
      contains the standard page table (since page->private is not really
      private with the pte_lock and the page table pages are not in the LRU
      list).
      Depending on the software bits of a pte, it is either inserted into
      both page tables or just into the standard (data) page table. Pages of
      a vma that does not have the VM_EXEC bit set get mapped only in the
      data address space. Any try to execute code on such a page will cause a
      page translation exception. The standard reaction to this is a SIGSEGV
      with two exceptions: the two system call opcodes 0x0a77 (sys_sigreturn)
      and 0x0aad (sys_rt_sigreturn) are allowed. They are stored by the
      kernel to the signal stack frame. Unfortunately, the signal return
      mechanism cannot be modified to use an SA_RESTORER because the
      exception unwinding code depends on the system call opcode stored
      behind the signal stack frame.
      
      This feature requires that user space is executed in secondary-space
      mode and the kernel in home-space mode, which means that the addressing
      modes need to be switched and that the noexec protection only works
      for user space.
      After switching the addressing modes, we cannot use the mvcp/mvcs
      instructions anymore to copy between kernel and user space. A new
      mvcos instruction has been added to the z9 EC/BC hardware which allows
      to copy between arbitrary address spaces, but on older hardware the
      page tables need to be walked manually.
      Signed-off-by: NGerald Schaefer <geraldsc@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      c1821c2e
    • H