1. 20 9月, 2011 1 次提交
  2. 03 8月, 2011 1 次提交
  3. 24 7月, 2011 2 次提交
    • J
      [S390] fix s390 assembler code alignments · 144d634a
      Jan Glauber 提交于
      The alignment is missing for various global symbols in s390 assembly code.
      With a recent gcc and an instruction like stgrl this can lead to a
      specification exception if the instruction uses such a mis-aligned address.
      
      Specify the alignment explicitely and while add it define __ALIGN for s390
      and use the ENTRY define to save some lines of code.
      Signed-off-by: NJan Glauber <jang@linux.vnet.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      144d634a
    • M
      [S390] move sie code to entry.S · 603d1a50
      Martin Schwidefsky 提交于
      The entry to / exit from sie has subtle dependencies to the first level
      interrupt handler. Move the sie assembler code to entry64.S and replace
      the SIE_HOOK callback with a test and the new _TIF_SIE bit.
      In addition this patch fixes several problems in regard to the check for
      the_TIF_EXIT_SIE bits. The old code checked the TIF bits before executing
      the interrupt handler and it only modified the instruction address if it
      pointed directly to the sie instruction. In both cases it could miss
      a TIF bit that normally would cause an exit from the guest and would
      reenter the guest context.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      603d1a50
  4. 23 5月, 2011 1 次提交
    • H
      [S390] pfault: cpu hotplug vs missing completion interrupts · f2db2e6c
      Heiko Carstens 提交于
      On cpu hot remove a PFAULT CANCEL command is sent to the hypervisor
      which in turn will cancel all outstanding pfault requests that have
      been issued on that cpu (the same happens with a SIGP cpu reset).
      
      The result is that we end up with uninterruptible processes where
      the interrupt that would wake up these processes never arrives.
      
      In order to solve this all processes which wait for a pfault
      completion interrupt get woken up after a cpu hot remove. The worst
      case that could happen is that they fault again and in turn need to
      wait again.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      f2db2e6c
  5. 10 5月, 2011 1 次提交
    • M
      [S390] kernel: Initialize register 14 when starting new CPU · 8eb4bd66
      Michael Holzheu 提交于
      When starting a new CPU we currently jump to start_secondary() without
      setting register 14 (the return address) correctly. Therefore on the stack
      frame for start_secondary an invalid return address is stored. This leads
      to wrong stack back traces in kernel dumps.
      
      Example:
      
       #00 [1f33fe48] cpu_idle at 10614a
       #1 [1f33fe90] start_secondary at 54fa88
       #2 [1f33feb8] (null) at 0                 <--- invalid
      
      To fix this start_secondary() is called now with basr/brasl that sets
      register 14 correctly. The output of the stack backtrace looks then
      like the following:
      
       #00 [1f33fe48] cpu_idle at 10614a
       #1 [1f33fe90] start_secondary at 54fa88
       #2 [1f33feb8] restart_base at 54f41e      <--- correct
      Signed-off-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      8eb4bd66
  6. 05 1月, 2011 2 次提交
  7. 29 10月, 2010 1 次提交
  8. 25 10月, 2010 3 次提交
  9. 28 7月, 2010 1 次提交
  10. 27 5月, 2010 1 次提交
  11. 17 5月, 2010 5 次提交
    • M
      [S390] add breaking event address for user space · 86f2552b
      Martin Schwidefsky 提交于
      Copy the last breaking event address from the lowcore to a new
      field in the thread_struct on each system entry. Add a new
      ptrace request PTRACE_GET_LAST_BREAK and a new utrace regset
      REGSET_LAST_BREAK to query the last breaking event.
      
      This is useful for debugging wild branches in user space code.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      86f2552b
    • C
      [S390] virtualization aware cpu measurement · cd3b70f5
      Carsten Otte 提交于
      Use the SPP instruction to set a tag on entry to / exit of the virtual
      machine context. This allows the cpu measurement facility to distinguish
      the samples from the host and the different guests.
      Signed-off-by: NCarsten Otte <cotte@de.ibm.com>
      cd3b70f5
    • M
      [S390] idle time accounting vs. machine checks · 6377981f
      Martin Schwidefsky 提交于
      A machine check can interrupt the i/o and external interrupt handler
      anytime. If the machine check occurs while the interrupt handler is
      waking up from idle vtime_start_cpu can get executed a second time
      and the int_clock / async_enter_timer values in the lowcore get
      clobbered. This can confuse the cpu time accounting.
      To fix this problem two changes are needed. First the machine check
      handler has to use its own copies of int_clock and async_enter_timer,
      named mcck_clock and mcck_enter_timer. Second the nested execution
      of vtime_start_cpu has to be prevented. This is done in s390_idle_check
      by checking the wait bit in the program status word.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      6377981f
    • M
      [S390] improve irq tracing code in entry[64].S · 6a2df3a8
      Martin Schwidefsky 提交于
      The system call path in entry[64].S is run with interrupts enabled.
      Remove the irq tracing check from the system call exit code. If a
      program check interrupted a context enabled for interrupts do a
      call to trace_irq_off_caller in the program check handler before
      branching to the system call exit code.
      Restructure the system call and io interrupt return code to avoid
      avoid the lpsw[e] to disable machine checks.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      6a2df3a8
    • M
      [S390] cleanup sysc_work and io_work code · 43d399d2
      Martin Schwidefsky 提交于
      Cleanup the #ifdef mess at io_work in entry[64].S and streamline the
      TIF work code of the system call and io exit path.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      43d399d2
  12. 09 4月, 2010 1 次提交
    • M
      [S390] fix io_return critical section cleanup · 176b1803
      Martin Schwidefsky 提交于
      If a machine check interrupts the io interrupt handler on one of the
      instructions between io_return and io_leave the critical section
      cleanup code will move the return psw to io_work_loop. By doing that
      the switch from the asynchronous interrupt stack to the process stack
      is skipped. If e.g. TIF_NEED_RESCHED is set things break because
      the scheduler is called with the asynchronous interrupts stack.
      Moving the psw back to io_return instead fixes the problem.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      176b1803
  13. 27 2月, 2010 1 次提交
  14. 27 1月, 2010 1 次提交
  15. 13 11月, 2009 1 次提交
    • C
      [S390] s390: fix single stepping on svc0 · bcc6525f
      Christian Borntraeger 提交于
      On s390 there are two ways of specifying the system call number for
      the svc instruction. The standard way is to use the immediate field
      in the instruction (or to use EXecute for values unknown during
      assemble time). This can encode 256 system calls.
      The kernel ABI also allows to put the system call number in r1 and
      then execute svc 0 to enable system call numbers > 255.
      
      It turns out that single stepping svc 0 is broken, since the PER
      program check handler uses r1. We have to use a different register.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      bcc6525f
  16. 11 9月, 2009 1 次提交
  17. 26 8月, 2009 1 次提交
    • J
      tracing: Rename FTRACE_SYSCALLS for tracepoints · 66700001
      Josh Stone 提交于
      s/HAVE_FTRACE_SYSCALLS/HAVE_SYSCALL_TRACEPOINTS/g
      s/TIF_SYSCALL_FTRACE/TIF_SYSCALL_TRACEPOINT/g
      
      The syscall enter/exit tracing is no longer specific to just ftrace, so
      they now have names that reflect their tie to tracepoints instead.
      Signed-off-by: NJosh Stone <jistone@redhat.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Jiaying Zhang <jiayingz@google.com>
      Cc: Martin Bligh <mbligh@google.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      LKML-Reference: <1251150194-1713-2-git-send-email-jistone@redhat.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      66700001
  18. 12 6月, 2009 2 次提交
  19. 14 4月, 2009 1 次提交
  20. 31 12月, 2008 2 次提交
  21. 25 12月, 2008 2 次提交
    • M
      [S390] Remove config options. · c185b783
      Martin Schwidefsky 提交于
      On s390 we always want to run with precise cputime accounting.
      Remove the config options VIRT_TIMER and VIRT_CPU_ACCOUNTING.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      c185b783
    • A
      [S390] audit: get s390 ret_from_fork in sync with other architectures · 8f2961c3
      Al Viro 提交于
      	On s390 we have ret_from_fork jump not to the "do all work we
      normally do on return from syscall" as on x86, ppc, etc., but to the
      "do all such work except audit".  Historical reasons - the codepath
      triggered when we have AUDIT process flag set is separated from the
      normall one and they converge at sysc_return, which is the common
      part of post-syscall work.  And does not include calling audit_syscall_exit() -
      that's done in the end of sysc_tracesys path, just before that path jumps
      to sysc_return.
      
      	IOW, the child returning from fork()/clone()/vfork() doesn't
      call audit_syscall_exit() at all, so no matter what we do with its
      audit context, we are not going to see the audit entry.
      
      	The fix is simple: have ret_from_fork go to the point just past
      the call of sys_.... in the 'we have AUDIT flag set' path.  There we
      have (64bit variant; for 31bit the situation is the same):
      sysc_tracenogo:
              tm      __TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
              jz      sysc_return
              la      %r2,SP_PTREGS(%r15)     # load pt_regs
              larl    %r14,sysc_return        # return point is sysc_return
              jg      do_syscall_trace_exit
      which is precisely what we need - check the flag, bugger off to sysc_return
      if not set, otherwise call do_syscall_trace_exit() and bugger off to
      sysc_return.  r9 has just been properly set by ret_from_fork itself,
      so we are fine.
      
      	Tested on s390x, seems to work fine.  WARNING: it's been about
      16 years since my last contact with 3X0 assembler[1], so additional
      review would be very welcome.  I don't think I've managed to screw it
      up, but...
      
      [1] that *was* in another country and besides, the box is dead...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      8f2961c3
  22. 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
  23. 15 11月, 2008 1 次提交
  24. 11 10月, 2008 1 次提交
  25. 07 5月, 2008 2 次提交
    • C
      [S390] s390-kvm: leave sie context on work. Removes preemption requirement · 0eaeafa1
      Christian Borntraeger 提交于
      From: Martin Schwidefsky <schwidefsky@de.ibm.com>
      
      This patch fixes a bug with cpu bound guest on kvm-s390. Sometimes it
      was impossible to deliver a signal to a spinning guest. We used
      preemption as a circumvention. The preemption notifiers called
      vcpu_load, which checked for pending signals and triggered a host
      intercept. But even with preemption, a sigkill was not delivered
      immediately.
      
      This patch changes the low level host interrupt handler to check for the
      SIE  instruction, if TIF_WORK is set. In that case we change the
      instruction pointer of the return PSW to rerun the vcpu_run loop. The kvm
      code sees an intercept reason 0 if that happens. This patch adds accounting
      for these types of intercept as well.
      
      The advantages:
      - works with and without preemption
      - signals are delivered immediately
      - much better host latencies without preemption
      Acked-by: NCarsten Otte <cotte@de.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      0eaeafa1
    • M
      [S390] s390: Optimize user and work TIF check · 2688905e
      Martin Schwidefsky 提交于
      On return from syscall or interrupt, we have to check if we return to
      userspace (likely) and if there is work todo (less likely) to decide
      if we handle the work. We can optimize this check: we first check for
      the less likely work case and then check for userspace.
      
      This patch is also a preparation for an additional patch, that fixes a bug
      in KVM dealing with cpu bound guests.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      2688905e
  26. 30 4月, 2008 1 次提交
  27. 17 4月, 2008 1 次提交
    • C
      [S390] kernel: show last breaking-event-address on oops · 9e74a6b8
      Christian Borntraeger 提交于
      Newer s390 models have a breaking-event-address-recording register.
      Each time an instruction causes a break in the sequential instruction
      execution, the address is saved in that hardware register. On a program
      interrupt the address is copied to the lowcore address 272-279, which
      makes it software accessible.
      
      This patch changes the program check handler and the stack overflow
      checker to copy the value into the pt_regs argument.
      The oops output is enhanced to show the last known breaking address.
      It might give additional information if the stack trace is corrupted.
      
      The feature is only available on 64 bit.
      
      The new oops output looks like:
      
      [---------snip----------]
      Modules linked in: vmcp sunrpc qeth_l2 dm_mod qeth ccwgroup
      CPU: 2 Not tainted 2.6.24zlive-host #8
      Process modprobe (pid: 4788, task: 00000000bf3d8718, ksp: 00000000b2b0b8e0)
      Krnl PSW : 0704200180000000 000003e000020028 (vmcp_init+0x28/0xe4 [vmcp])
                 R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:0 CC:2 PM:0 EA:3
      Krnl GPRS: 0000000004000002 000003e000020000 0000000000000000 0000000000000001
                 000000000015734c ffffffffffffffff 000003e0000b3b00 0000000000000000
                 000003e00007ca30 00000000b5bb5d40 00000000b5bb5800 000003e0000b3b00
                 000003e0000a2000 00000000003ecf50 00000000b2b0bd50 00000000b2b0bcb0
      Krnl Code: 000003e000020018: c0c000040ff4       larl    %r12,3e0000a2000
                 000003e00002001e: e3e0f0000024       stg     %r14,0(%r15)
                 000003e000020024: a7f40001           brc     15,3e000020026
                >000003e000020028: e310c0100004       lg      %r1,16(%r12)
                 000003e00002002e: c020000413dc       larl    %r2,3e0000a27e6
                 000003e000020034: c0a00004aee6       larl    %r10,3e0000b5e00
                 000003e00002003a: a7490001           lghi    %r4,1
                 000003e00002003e: a75900f0           lghi    %r5,240
      Call Trace:
      ([<000000000014b300>] blocking_notifier_call_chain+0x2c/0x40)
       [<000000000015735c>] sys_init_module+0x19d8/0x1b08
       [<0000000000110afc>] sysc_noemu+0x10/0x16
       [<000002000011cda2>] 0x2000011cda2
      Last Breaking-Event-Address:
       [<000003e000020024>] vmcp_init+0x24/0xe4 [vmcp]
      [---------snip----------]
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      9e74a6b8
  28. 05 2月, 2008 1 次提交