1. 30 Apr, 2008 14 commits
    • Martin Schwidefsky's avatar
      [S390] use generic sys_ptrace · 941af343
      Martin Schwidefsky authored
      
      
      After the PT_IEEE_IP hack has been removed s390 can now use
      the common code sys_ptrace function.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      941af343
    • Martin Schwidefsky's avatar
      [S390] Remove self ptrace IEEE_IP hack. · 613e1def
      Martin Schwidefsky authored
      
      
      The self referential PT_IEEE_IP ptrace peek & poke calls have been
      broken for that last 6 years. For peek the code always returns 0
      instead of the last ieee fault and for poke the code does nothing.
      Since nobody noticed the code seems to be superfluous. So lets
      remove it.
      
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      613e1def
    • Heiko Carstens's avatar
      [S390] Convert to SPARSEMEM & SPARSEMEM_VMEMMAP · 17f34580
      Heiko Carstens authored
      
      
      Convert s390 to SPARSEMEM and SPARSEMEM_VMEMMAP. We do a select
      of SPARSEMEM_VMEMMAP since it is configurable. This is because
      SPARSEMEM without SPARSEMEM_VMEMMAP gives us a hell of broken
      include dependencies that I don't want to fix.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      17f34580
    • Gerald Schaefer's avatar
      [S390] System z large page support. · 53492b1d
      Gerald Schaefer authored
      
      
      This adds hugetlbfs support on System z, using both hardware large page
      support if available and software large page emulation on older hardware.
      Shared (large) page tables are implemented in software emulation mode,
      by using page->index of the first tail page from a compound large page
      to store page table information.
      Signed-off-by: default avatarGerald Schaefer <geraldsc@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      53492b1d
    • Heiko Carstens's avatar
      [S390] Convert machine feature detection code to C. · 2e5061e4
      Heiko Carstens authored
      
      
      From: Heiko Carstens <heiko.carstens@de.ibm.com>
      From: Carsten Otte <cotte@de.ibm.com>
      
      This lets us use defines for the magic bits in machine flags instead
      of using plain numbers all over the place.
      In addition on newer machines features/facilities are indicated by the
      result of the stfl instruction. So we use these bits instead of trying
      to execute new instructions and check wether we get an exception or
      not.
      Also the mvpg instruction is always available when in zArch mode,
      whereas the idte instruction is only available in zArch mode. This
      results in some minor optimizations.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarCarsten Otte <cotte@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      2e5061e4
    • Heiko Carstens's avatar
      [S390] vmemmap: use clear_table to initialise page tables. · 8fc63658
      Heiko Carstens authored
      
      
      Always use clear_table to initialise page tables. The overlapping
      memcpy is just a leftover of a previous version that wasn't fully
      converted to clear_table.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      8fc63658
    • Heiko Carstens's avatar
    • Heiko Carstens's avatar
      [S390] uaccess_mvcos: #ifdef config dependent code. · ccf183e4
      Heiko Carstens authored
      
      
      arch/s390/lib/uaccess_mvcos.c:166:
       warning: 'strnlen_user_mvcos' defined but not used
      arch/s390/lib/uaccess_mvcos.c:186:
       warning: 'strncpy_from_user_mvcos' defined but not used
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      ccf183e4
    • Heiko Carstens's avatar
      [S390] cpu topology: Fix possible deadlock. · fd781fa2
      Heiko Carstens authored
      When we get a notification that cpu topology changed, we schedule a
      work struct which just calls arch_reinit_sched_domains. This function
      in turn calls get_online_cpus() which results int the lockdep warning
      below.
      
      After all it turnded out that it's not legal to call get_online_cpus()
      from the context of a multi-threaded work queue.
      It could deadlock this way:
      
      process 0 (events/cpu-x):
      -> run_workqueue
      -> removes my work_struct from the work queue
      -> calls work_struct->fn
      -> get_online_cpus()
      -> locks on cpu_hotplug.lock since process 1 below is doing cpu hotplug
      
      process 1:
      -> cpu_down (for cpu-x)
      -> cpu_hotplug_begin (holds cpu_hotplug.lock now)
      -> cpu-x dead
      -> notifier_call_chain with CPU_DEAD
      -> cleanup_workqueue_thread
      -> flush_cpu_workqueue (succeeds)
      -> kthread_stop for events/cpu-x
        -> now kthread_stop waits for my work_struct to complete from within
           process 0. -> dead.
      
      A single threaded workqueue wouldn't have such problems, however there is
      no such common queue available and it's not worth to create one for the
      very rare calls to arch_reinit_sched_domains.
      
      So we just create a kernel thread from our work struct which calls
      arch_reinit_sched_domains and are done with it.
      
      Thanks to Oleg Nesterov and Peter Zijlstra for helping me figuring out
      that this isn't a false positive lockdep warning:
      
      =======================================================
      [ INFO: possible circular locking dependency detected ]
      2.6.25-03562-g3dc50637-dirty #12
      -------------------------------------------------------
      events/3/14 is trying to acquire lock:
       (&cpu_hotplug.lock){--..}, at: [<0000000000076094>] get_online_cpus+0x50/0x78
      
      but task is already holding lock:
       (topology_work){--..}, at: [<0000000000059cde>] run_workqueue+0x106/0x278
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #2 (topology_work){--..}:
             [<000000000006fc74>] __lock_acquire+0x1010/0x111c
             [<000000000006fe40>] lock_acquire+0xc0/0xf8
             [<0000000000059d48>] run_workqueue+0x170/0x278
             [<0000000000059edc>] worker_thread+0x8c/0xf0
             [<000000000005f5bc>] kthread+0x68/0xa0
             [<000000000001a33e>] kernel_thread_starter+0x6/0xc
             [<000000000001a338>] kernel_thread_starter+0x0/0xc
      
      -> #1 (events){--..}:
             [<000000000006fc74>] __lock_acquire+0x1010/0x111c
             [<000000000006fe40>] lock_acquire+0xc0/0xf8
             [<000000000005a23c>] cleanup_workqueue_thread+0x60/0xa8
             [<00000000003b2ab8>] workqueue_cpu_callback+0xbc/0x170
             [<00000000003bba80>] notifier_call_chain+0x5c/0xa4
             [<00000000000655a2>] __raw_notifier_call_chain+0x26/0x38
             [<00000000000655e2>] raw_notifier_call_chain+0x2e/0x40
             [<0000000000075e00>] cpu_down+0x228/0x31c
             [<00000000003b1dd8>] store_online+0x64/0xb8
             [<00000000001e7128>] sysdev_store+0x48/0x58
             [<0000000000121cd2>] sysfs_write_file+0x126/0x1c0
             [<00000000000c1944>] vfs_write+0xb0/0x15c
             [<00000000000c20e6>] sys_write+0x56/0x88
             [<0000000000027a68>] sys32_write+0x34/0x4c
             [<0000000000023f70>] sysc_noemu+0x10/0x16
             [<0000000077f3f186>] 0x77f3f186
      
      -> #0 (&cpu_hotplug.lock){--..}:
             [<000000000006fa84>] __lock_acquire+0xe20/0x111c
             [<000000000006fe40>] lock_acquire+0xc0/0xf8
             [<00000000003b701c>] mutex_lock_nested+0xd0/0x364
             [<0000000000076094>] get_online_cpus+0x50/0x78
             [<000000000003a03e>] arch_reinit_sched_domains+0x26/0x58
             [<000000000002700e>] topology_work_fn+0x26/0x34
             [<0000000000059d4e>] run_workqueue+0x176/0x278
             [<0000000000059edc>] worker_thread+0x8c/0xf0
             [<000000000005f5bc>] kthread+0x68/0xa0
             [<000000000001a33e>] kernel_thread_starter+0x6/0xc
             [<000000000001a338>] kernel_thread_starter+0x0/0xc
      
      other info that might help us debug this:
      
      2 locks held by events/3/14:
       #0:  (events){--..}, at: [<0000000000059cde>] run_workqueue+0x106/0x278
       #1:  (topology_work){--..}, at: [<0000000000059cde>] run_workqueue+0x106/0x278
      
      stack backtrace:
      CPU: 3 Not tainted 2.6.25-03562-g3dc50637
      
      -dirty #12
      Process events/3 (pid: 14, task: 000000002fb04038, ksp: 000000002fb0bd70)
      0400000000000000 000000002fb0ba40 0000000000000002 0000000000000000
             000000002fb0bae0 000000002fb0ba58 000000002fb0ba58 0000000000016488
             0000000000000000 000000002fb0bd70 0000000000000000 0000000000000000
             000000002fb0ba40 000000000000000c 000000002fb0ba40 000000002fb0bab0
             00000000003c99e0 0000000000016488 000000002fb0ba40 000000002fb0ba90
      Call Trace:
      ([<00000000000163fc>] show_trace+0x138/0x158)
       [<00000000000164e2>] show_stack+0xc6/0xf8
       [<0000000000016624>] dump_stack+0xb0/0xc0
       [<000000000006cd36>] print_circular_bug_tail+0xa2/0xb4
       [<000000000006fa84>] __lock_acquire+0xe20/0x111c
       [<000000000006fe40>] lock_acquire+0xc0/0xf8
       [<00000000003b701c>] mutex_lock_nested+0xd0/0x364
       [<0000000000076094>] get_online_cpus+0x50/0x78
       [<000000000003a03e>] arch_reinit_sched_domains+0x26/0x58
       [<000000000002700e>] topology_work_fn+0x26/0x34
       [<0000000000059d4e>] run_workqueue+0x176/0x278
       [<0000000000059edc>] worker_thread+0x8c/0xf0
       [<000000000005f5bc>] kthread+0x68/0xa0
       [<000000000001a33e>] kernel_thread_starter+0x6/0xc
       [<000000000001a338>] kernel_thread_starter+0x0/0xc
      INFO: lockdep is turned off.
      
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      fd781fa2
    • Heiko Carstens's avatar
      [S390] Add topology_core_siblings to topology.h · d00aa4e7
      Heiko Carstens authored
      
      
      This exposes the core siblings to user space via sysfs.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      d00aa4e7
    • Mathieu Desnoyers's avatar
      [S390] remove -traditional · 47494f6a
      Mathieu Desnoyers authored
      
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      CC: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      47494f6a
    • Heiko Carstens's avatar
    • Heiko Carstens's avatar
      [S390] smp: Fix locking order. · 0b18d318
      Heiko Carstens authored
      
      
      On some smp sysfs store attributes get_online_cpus() may block on
      cpu_hotplug.lock, but we hold already smp_cpu_state_mutex. Since the
      locking order on cpu hotplug via arch_update_cpu_topology is inverse
      this might lead to deadlocks.
      So make sure locking order is always the same.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      0b18d318
    • Heiko Carstens's avatar
      [S390] Move show_regs to traps.c. · 4e83be7b
      Heiko Carstens authored
      
      
      This is where it should be and we can get rid of some externs
      and a static inline function.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      4e83be7b
  2. 29 Apr, 2008 3 commits
  3. 27 Apr, 2008 14 commits
  4. 20 Apr, 2008 3 commits
  5. 18 Apr, 2008 1 commit
  6. 17 Apr, 2008 1 commit
  7. 16 Apr, 2008 4 commits
    • Martin Schwidefsky's avatar
      [S390] Remove code duplication from monreader / dcssblk. · ca68305b
      Martin Schwidefsky authored
      
      
      Move the function that prints the segment warning messages found in the
      monreader driver and the dcssblk driver to the extmem base code.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      ca68305b
    • Christian Borntraeger's avatar
      [S390] kernel: show last breaking-event-address on oops · 9e74a6b8
      Christian Borntraeger authored
      
      
      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: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      9e74a6b8
    • Heiko Carstens's avatar
      [S390] uaccess: Always access the correct address space. · 3f12ebce
      Heiko Carstens authored
      
      
      The current uaccess page table walk code assumes at a few places that
      any access is a user space access. This is not correct if somebody
      has issued a set_fs(KERNEL_DS) in advance.
      Add code which checks which address space we are in and with this make
      sure we access the correct address space. This way we get also rid of
      the dirty
      if (!currrent-mm)
      	return -EFAULT;
      hack in futex_atomic_cmpxchg_pt.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      3f12ebce
    • Heiko Carstens's avatar
      [S390] Fix a lot of sparse warnings. · a806170e
      Heiko Carstens authored
      
      
      Most noteable part of this commit is the new local header file entry.h
      which contains all the function declarations of functions that get only
      called from asm code or are arch internal. That way we can avoid extern
      declarations in C files.
      This is more or less the same that was done for sparc64.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      a806170e