1. 28 7月, 2009 1 次提交
    • B
      mm: Pass virtual address to [__]p{te,ud,md}_free_tlb() · 9e1b32ca
      Benjamin Herrenschmidt 提交于
      mm: Pass virtual address to [__]p{te,ud,md}_free_tlb()
      
      Upcoming paches to support the new 64-bit "BookE" powerpc architecture
      will need to have the virtual address corresponding to PTE page when
      freeing it, due to the way the HW table walker works.
      
      Basically, the TLB can be loaded with "large" pages that cover the whole
      virtual space (well, sort-of, half of it actually) represented by a PTE
      page, and which contain an "indirect" bit indicating that this TLB entry
      RPN points to an array of PTEs from which the TLB can then create direct
      entries. Thus, in order to invalidate those when PTE pages are deleted,
      we need the virtual address to pass to tlbilx or tlbivax instructions.
      
      The old trick of sticking it somewhere in the PTE page struct page sucks
      too much, the address is almost readily available in all call sites and
      almost everybody implemets these as macros, so we may as well add the
      argument everywhere. I added it to the pmd and pud variants for consistency.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: David Howells <dhowells@redhat.com> [MN10300 & FRV]
      Acked-by: NNick Piggin <npiggin@suse.de>
      Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> [s390]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9e1b32ca
  2. 24 7月, 2009 4 次提交
    • M
      [S390] vdso: clock_gettime of CLOCK_THREAD_CPUTIME_ID with noexec=on · 1277580f
      Martin Schwidefsky 提交于
      The combination of noexec=on and a clock_gettime call with clock id
      CLOCK_THREAD_CPUTIME_ID is broken. The vdso code switches to the
      access register mode to get access to the per-cpu data structure to
      execute the magic ectg instruction. After the ectg instruction the
      code always switches back to the primary mode but for noexec=on the
      correct mode is the secondary mode. The effect of the bug is that the
      user space program looses the access to all mappings without PROT_EXEC,
      e.g. the stack. The problem is fixed by restoring the mode that has
      been active before the switch to the access register mode.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      1277580f
    • H
      [S390] vdso: fix per cpu area allocation · 3a6ba460
      Heiko Carstens 提交于
      vdso per cpu area allocation in smp_prepare_cpus() happens with GFP_KERNEL
      but irqs disabled. Triggers this one:
      
      Badness at kernel/lockdep.c:2280
      Modules linked in:
      CPU: 0 Not tainted 2.6.30 #2
      Process swapper (pid: 1, task: 000000003fe88000, ksp: 000000003fe87eb8)
      Krnl PSW : 0400c00180000000 0000000000083360 (lockdep_trace_alloc+0xec/0xf8)
      [...]
      Call Trace:
      ([<00000000000832b6>] lockdep_trace_alloc+0x42/0xf8)
       [<00000000000b1880>] __alloc_pages_internal+0x3e8/0x5c4
       [<00000000000b1b4a>] __get_free_pages+0x3a/0xb0
       [<0000000000026546>] vdso_alloc_per_cpu+0x6a/0x18c
       [<00000000005eff82>] smp_prepare_cpus+0x322/0x594
       [<00000000005e8232>] kernel_init+0x76/0x398
       [<000000000001bb1e>] kernel_thread_starter+0x6/0xc
       [<000000000001bb18>] kernel_thread_starter+0x0/0xc
      
      Fix this by moving the allocation out of the irqs disabled section.
      Reported-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      3a6ba460
    • H
      [S390] hibernation: fix register corruption on machine checks · c63b196a
      Heiko Carstens 提交于
      swsusp_arch_suspend() actually saves all cpu register contents on
      hibernation.
      Machine checks must be disabled since swsusp_arch_suspend() stores
      register contents to their lowcore save areas. That's the same
      place where register contents on machine checks would be saved.
      To avoid register corruption disable machine checks.
      We must also disable machine checks in the new psw mask for
      program checks, since swsusp_arch_suspend() may generate program
      checks.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      c63b196a
    • H
      [S390] hibernation: fix lowcore handling · 5f954c34
      Heiko Carstens 提交于
      Our swsusp_arch_suspend() backend implementation disables prefixing
      by setting the contents of the prefix register to 0.
      However afterwards common code functions are called which might
      access percpu data structures.
      Since the lowcore contains e.g. the percpu base pointer this isn't
      a good idea. So fix this by copying the hibernating cpu's lowcore to
      absolute address zero.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      5f954c34
  3. 13 7月, 2009 1 次提交
  4. 11 7月, 2009 1 次提交
  5. 07 7月, 2009 7 次提交
    • M
      [S390] define KTIME_SCALAR for 32-bit s390 · 07606309
      Martin Schwidefsky 提交于
      32-bit s390 has efficient support for 64/32-bit conversions, define
      KTIME_SCALAR to enable the use of the plain scalar nanosecond based
      representation of ktime.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      07606309
    • H
      [S390] add generic atomic64 support for 31 bit · 25ca1251
      Heiko Carstens 提交于
      Performance counters need 64 bit atomic operations.
      To keep the patch small we use the simple generic atomic64_t implementation.
      The native implementation follows with the next kernel.
      
      Fixes this build bug:
      
      In file included from kernel/sched.c:42:
      include/linux/perf_counter.h:427: error: expected specifier-qualifier-list before 'atomic64_t'
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      25ca1251
    • M
      [S390] set SCHED_OMIT_FRAME_POINTER for s390 · fca3e357
      Martin Schwidefsky 提交于
      The frame pointer is useless for s390 in the sched.c code.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      fca3e357
    • H
      [S390] add __ucmpdi2() helper function · 5075baca
      Heiko Carstens 提交于
      Provide __ucmpdi2() helper function on 31 bit so we don't run
      again and again in compile errors like this one:
      
      kernel/built-in.o: In function `T.689':
      perf_counter.c:(.text+0x56c86): undefined reference to `__ucmpdi2'
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      5075baca
    • H
      [S390] perf_counter build fix · 2651fa2b
      Heiko Carstens 提交于
      Add PERF_COUNTER_INDEX_OFFSET define to fix this build bug:
      
      kernel/perf_counter.c: In function 'perf_counter_index':
      kernel/perf_counter.c:1889: error: 'PERF_COUNTER_INDEX_OFFSET' undeclared
      
      Same fix as for FRV since s390 doesn't support hw counters.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      2651fa2b
    • F
      [S390] shutdown actions: save/return rc from init function · 81088819
      Frank Munzert 提交于
      We always returned -EINVAL when setting of a shutdown action failed. This was
      misleading, if for example the hardware did not support the shutdown action.
      Now we save each shutdown action's init return code and return it when the
      action is being set.
      Signed-off-by: NFrank Munzert <munzert@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      81088819
    • H
      [S390] udelay: disable lockdep to avoid false positives · bb8c29ca
      Heiko Carstens 提交于
      Our udelay implementation enables interrupts to receive a special timer
      interrupt regardless of the context it is called from.
      This might lead to false positive lockdep reports. Since lockdep isn't
      aware of the fact that only a single interrupt source is enabled it
      warns about possible deadlocks that in reality won't happen, like
      the one below.
      To fix this disable lockdep before enabling interrupts.
      
      [ 254.040888] =================================
      [ 254.040904] [ INFO: inconsistent lock state ]
      [ 254.040910] 2.6.30 #9
      [ 254.040914] ---------------------------------
      [ 254.040920] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
      [ 254.040927] swapper/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
      [ 254.040934] (sch->lock){?.-...}, at: [<00000000002e4778>] ccw_device_timeout+0x48/0x2f0
      [ 254.040961] {IN-HARDIRQ-W} state was registered at:
      [ 254.040969] [<0000000000096f74>] __lock_acquire+0x9d4/0x188c
      [ 254.040985] [<0000000000097f68>] lock_acquire+0x13c/0x16c
      [ 254.040998] [<00000000004527e0>] _spin_lock+0x74/0xb8
      [ 254.041016] [<0000000000457eb2>] do_IRQ+0xde/0x208
      [ 254.041031] [<000000000002d190>] io_return+0x0/0x8
      [ 254.041049] [<0000000000029faa>] vtime_stop_cpu+0xbe/0x114
      [ 254.041066] irq event stamp: 259629
      [ 254.041076] hardirqs last enabled at (259628): [<000000000045238e>] _spin_unlock_irq+0x5e/0x9c
      [ 254.041095] hardirqs last disabled at (259629): [<000000000045292e>] _spin_lock_irq+0x4a/0xc4
      [ 254.041126] softirqs last enabled at (259614): [<000000000006500e>] __do_softirq+0x296/0x2b0
      [ 254.041137] softirqs last disabled at (259619): [<0000000000024cf6>] do_softirq+0x102/0x108
      [ 254.041147]
      [ 254.041148] other info that might help us debug this:
      [ 254.041153] 2 locks held by swapper/0:
      [ 254.041157] #0: (&priv->timer){+.-...}, at: [<000000000006bf9a>] run_timer_softirq+0x19a/0x340
      [ 254.041170] #1: (sch->lock){?.-...}, at: [<00000000002e4778>] ccw_device_timeout+0x48/0x2f0
      [ 254.041182]
      [ 254.041310] Call Trace:
      [ 254.041313] ([<00000000000174fc>] show_trace+0x16c/0x170)
      [ 254.041321] [<0000000000017578>] show_stack+0x78/0x104
      [ 254.041327] [<000000000044d0ca>] dump_stack+0xc6/0xd4
      [ 254.041342] [<00000000000949b4>] print_usage_bug+0x1c8/0x1fc
      [ 254.041353] [<0000000000094e8a>] mark_lock+0x4a2/0x670
      [ 254.041364] [<00000000000950e2>] mark_held_locks+0x8a/0xb4
      [ 254.041375] [<0000000000095398>] trace_hardirqs_on_caller+0x74/0x1ac
      [ 254.041388] [<00000000000954fa>] trace_hardirqs_on+0x2a/0x38
      [ 254.041402] [<000000000025f1ec>] __udelay_disabled+0xac/0xfc
      [ 254.041419] [<000000000025f432>] __udelay+0x12a/0x148
      [ 254.041433] [<00000000002d64d8>] cio_commit_config+0x170/0x290
      [ 254.041451] [<00000000002d6978>] cio_disable_subchannel+0x120/0x1cc
      [ 254.041468] [<00000000002e32a4>] ccw_device_recog_done+0x54/0x2f4
      [ 254.041485] [<00000000002e3638>] ccw_device_sense_id_done+0x50/0x90
      [ 254.041508] [<00000000002e615a>] snsid_callback+0xfa/0x3a8
      [ 254.041515] [<00000000002dd96c>] ccwreq_stop+0x80/0x90
      [ 254.041523] [<00000000002dda8e>] ccw_request_timeout+0xc2/0xd0
      [ 254.041530] [<00000000002e2f70>] ccw_device_request_event+0x58/0x90
      [ 254.041537] [<00000000002e47ae>] ccw_device_timeout+0x7e/0x2f0
      [ 254.041555] [<000000000006c02a>] run_timer_softirq+0x22a/0x340
      [ 254.041566] [<0000000000064eb0>] __do_softirq+0x138/0x2b0
      [ 254.041578] [<0000000000024cf6>] do_softirq+0x102/0x108
      [ 254.041590] [<00000000000647ce>] irq_exit+0xee/0x114
      [ 254.041603] [<0000000000457d88>] do_extint+0x130/0x17c
      [ 254.041617] [<000000000002d41e>] ext_no_vtime+0x1e/0x22
      [ 254.041631] [<0000000000029faa>] vtime_stop_cpu+0xbe/0x114
      [ 254.041646] ([<0000000000029f58>] vtime_stop_cpu+0x6c/0x114)
      [ 254.041662] [<000000000001d842>] cpu_idle+0x122/0x1c0
      [ 254.041679] [<00000000004482c6>] start_secondary+0xce/0xe0
      [ 254.041696] [<0000000000000000>] 0x0
      [ 254.041715] [<0000000000000000>] 0x0
      [ 254.041745] INFO: lockdep is turned off.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      bb8c29ca
  6. 28 6月, 2009 1 次提交
    • C
      KVM: s390: Allow stfle instruction in the guest · ef50f7ac
      Christian Borntraeger 提交于
      2.6.31-rc introduced an architecture level set checker based on facility
      bits. e.g. if the kernel is compiled to run only on z9, several facility
      bits are checked very early and the kernel refuses to boot if a z9 specific
      facility is missing.
      Until now kvm on s390 did not implement the store facility extended (STFLE)
      instruction. A 2.6.31-rc kernel that was compiled for z9 or higher did not
      boot in kvm. This patch implements stfle.
      
      This patch should go in before 2.6.31.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      ef50f7ac
  7. 22 6月, 2009 9 次提交
  8. 19 6月, 2009 2 次提交
    • S
      function-graph: add stack frame test · 71e308a2
      Steven Rostedt 提交于
      In case gcc does something funny with the stack frames, or the return
      from function code, we would like to detect that.
      
      An arch may implement passing of a variable that is unique to the
      function and can be saved on entering a function and can be tested
      when exiting the function. Usually the frame pointer can be used for
      this purpose.
      
      This patch also implements this for x86. Where it passes in the stack
      frame of the parent function, and will test that frame on exit.
      
      There was a case in x86_32 with optimize for size (-Os) where, for a
      few functions, gcc would align the stack frame and place a copy of the
      return address into it. The function graph tracer modified the copy and
      not the actual return address. On return from the funtion, it did not go
      to the tracer hook, but returned to the parent. This broke the function
      graph tracer, because the return of the parent (where gcc did not do
      this funky manipulation) returned to the location that the child function
      was suppose to. This caused strange kernel crashes.
      
      This test detected the problem and pointed out where the issue was.
      
      This modifies the parameters of one of the functions that the arch
      specific code calls, so it includes changes to arch code to accommodate
      the new prototype.
      
      Note, I notice that the parsic arch implements its own push_return_trace.
      This is now a generic function and the ftrace_push_return_trace should be
      used instead. This patch does not touch that code.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      71e308a2
    • O
      ptrace: remove PT_DTRACE from avr32, mn10300, parisc, s390, sh, xtensa · bba7fc0a
      Oleg Nesterov 提交于
      avr32, mn10300, parisc, s390, sh, xtensa:
      
      They never set PT_DTRACE, but clear it after do_execve().
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Cc: David Howells <dhowells@redhat.com>
      Acked-by: NKyle McMartin <kyle@mcmartin.ca>
      Cc: Grant Grundler <grundler@parisc-linux.org>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Acked-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Acked-by: NPaul Mundt <lethal@linux-sh.org>
      Acked-by: NChris Zankel <chris@zankel.net>
      Acked-by: NRoland McGrath <roland@redhat.com>
      Acked-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bba7fc0a
  9. 17 6月, 2009 2 次提交
    • R
      kmap_types: make most arches use generic header file · e4c9dd0f
      Randy Dunlap 提交于
      Convert most arches to use asm-generic/kmap_types.h.
      
      Move the KM_FENCE_ macro additions into asm-generic/kmap_types.h,
      controlled by __WITH_KM_FENCE from each arch's kmap_types.h file.
      
      Would be nice to be able to add custom KM_types per arch, but I don't yet
      see a nice, clean way to do that.
      
      Built on x86_64, i386, mips, sparc, alpha(tonyb), powerpc(tonyb), and
      68k(tonyb).
      
      Note: avr32 should be able to remove KM_PTE2 (since it's not used) and
      then just use the generic kmap_types.h file.  Get avr32 maintainer
      approval.
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Cc: <linux-arch@vger.kernel.org>
      Acked-by: NMike Frysinger <vapier@gentoo.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Bryan Wu <cooloney@kernel.org>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: "Luck Tony" <tony.luck@intel.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e4c9dd0f
    • A
      mm: consolidate init_mm definition · bb1f17b0
      Alexey Dobriyan 提交于
      * create mm/init-mm.c, move init_mm there
      * remove INIT_MM, initialize init_mm with C99 initializer
      * unexport init_mm on all arches:
      
        init_mm is already unexported on x86.
      
        One strange place is some OMAP driver (drivers/video/omap/) which
        won't build modular, but it's already wants get_vm_area() export.
        Somebody should look there.
      
      [akpm@linux-foundation.org: add missing #includes]
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Cc: Mike Frysinger <vapier.adi@gmail.com>
      Cc: Americo Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bb1f17b0
  10. 16 6月, 2009 6 次提交
  11. 13 6月, 2009 2 次提交
  12. 12 6月, 2009 4 次提交