1. 09 12月, 2010 1 次提交
  2. 13 10月, 2010 1 次提交
  3. 05 8月, 2010 1 次提交
    • B
      memblock: Remove rmo_size, burry it in arch/powerpc where it belongs · cd3db0c4
      Benjamin Herrenschmidt 提交于
      The RMA (RMO is a misnomer) is a concept specific to ppc64 (in fact
      server ppc64 though I hijack it on embedded ppc64 for similar purposes)
      and represents the area of memory that can be accessed in real mode
      (aka with MMU off), or on embedded, from the exception vectors (which
      is bolted in the TLB) which pretty much boils down to the same thing.
      
      We take that out of the generic MEMBLOCK data structure and move it into
      arch/powerpc where it belongs, renaming it to "RMA" while at it.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      cd3db0c4
  4. 14 7月, 2010 1 次提交
  5. 09 7月, 2010 1 次提交
  6. 07 4月, 2010 1 次提交
    • A
      powerpc/pseries: Call ibm,os-term if the ibm,extended-os-term is present · e9bbc8cd
      Anton Blanchard 提交于
      We have had issues in the past with ibm,os-term initiating shutdown of a
      partition. This is confusing to the user, especially if panic_timeout is
      non zero.
      
      The temporary fix was to avoid calling ibm,os-term if a panic_timeout was set
      and since we set it on every boot we basically never call ibm,os-term.
      
      An extended version of ibm,os-term has since been implemented which gives us
      the behaviour we want:
      
        "When the platform supports extended ibm,os-term behavior, the return to the
        RTAS will always occur unless there is a kernel assisted dump active as
        initiated by an ibm,configure-kernel-dump call."
      
      This patch checks for the ibm,extended-os-term property and calls ibm,os-term
      if it exists.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e9bbc8cd
  7. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  8. 15 12月, 2009 3 次提交
  9. 02 9月, 2009 1 次提交
    • B
      powerpc/pseries: Fix to handle slb resize across migration · 46db2f86
      Brian King 提交于
      The SLB can change sizes across a live migration, which was not
      being handled, resulting in possible machine crashes during
      migration if migrating to a machine which has a smaller max SLB
      size than the source machine. Fix this by first reducing the
      SLB size to the minimum possible value, which is 32, prior to
      migration. Then during the device tree update which occurs after
      migration, we make the call to ensure the SLB gets updated. Also
      add the slb_size to the lparcfg output so that the migration
      tools can check to make sure the kernel has this capability
      before allowing migration in scenarios where the SLB size will change.
      
      BenH: Fixed #include <asm/mmu-hash64.h> -> <asm/mmu.h> to avoid
            breaking ppc32 build
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      46db2f86
  10. 26 6月, 2009 2 次提交
    • B
      powerpc: Use one common impl. of RTAS timebase sync and use raw spinlock · c4007a2f
      Benjamin Herrenschmidt 提交于
      Several platforms use their own copy of what is essentially the same code,
      using RTAS to synchronize the timebases when bringing up new CPUs. This
      moves it all into a single common implementation and additionally
      turns the spinlock into a raw spinlock since the former can rely on
      the timebase not being frozen when spinlock debugging is enabled, and finally
      masks interrupts while the timebase is disabled.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      c4007a2f
    • B
      powerpc/rtas: Turn rtas lock into a raw spinlock · f97bb36f
      Benjamin Herrenschmidt 提交于
      RTAS currently uses a normal spinlock. However it can be called from
      contexts where this is not necessarily a good idea. For example, it
      can be called while syncing timebases, with the core timebase being
      frozen. Unfortunately, that will deadlock in case of lock contention
      when spinlock debugging is enabled as the spin lock debugging code
      will try to use __delay() which ... relies on the timebase being
      enabled.
      
      Also RTAS can be used in some low level IRQ handling code path so it
      may as well be a raw spinlock for -rt sake.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      f97bb36f
  11. 23 2月, 2009 1 次提交
    • B
      powerpc/pseries: Fix partition migration hang under load · f52862f4
      Brian King 提交于
      While testing partition migration with heavy CPU load using
      shared processors, it was observed that sometimes the migration
      would never complete and would appear to hang. Currently, the
      migration code assumes that if H_SUCCESS is returned from the H_JOIN
      then the migration is complete and the processor is waking up on
      the target system. If there was an outstanding PROD to the processor
      when the H_JOIN is called, however, it will return H_SUCCESS on the source
      system, causing the migration to hang, or in some scenarios cause
      the kernel to crash on the complete call waking the caller
      of rtas_percpu_suspend_me. Fix this by calling H_JOIN multiple times
      if necessary during the migration.
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      f52862f4
  12. 16 12月, 2008 1 次提交
  13. 11 8月, 2008 1 次提交
    • N
      powerpc: Zero fill the return values of rtas argument buffer · b79998fc
      Nathan Fontenot 提交于
      The kernel copy of the rtas args struct contains the return
      value(s) for the specified rtas call.  These are copied back
      to user space with the assumption that every value has been
      set by the rtas call, which turns out to be not always true.
      Thus userspace can see random values and think the call failed
      when in fact it succeeded, but for some reason didn't set one
      of the return values.
      
      This fixes the problem by zeroing out the return value fields
      of the rtas args struct before processing the rtas call.
      Signed-off-by: NNathan Fontenot <nfont@austin.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      b79998fc
  14. 26 6月, 2008 1 次提交
  15. 14 5月, 2008 1 次提交
    • M
      [POWERPC] Fix sparse warnings in arch/powerpc/kernel · 1c21a293
      Michael Ellerman 提交于
      Make a few things static in lparcfg.c
      Make init and exit routines static in rtas_flash.c
      Make things static in rtas_pci.c
      Make some functions static in rtas.c
      Make fops static in rtas-proc.c
      Remove unneeded extern for do_gtod in smp.c
      Make clocksource_init() static in time.c
      Make last_tick_len and ticklen_to_xs static in time.c
      Move the declaration of the pvr per-cpu into smp.h
      Make kexec_smp_down() and kexec_stack static in machine_kexec_64.c
      Don't return void in arch_teardown_msi_irqs() in msi.c
      Move declaration of GregorianDay()into asm/time.h
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      1c21a293
  16. 19 4月, 2008 1 次提交
  17. 01 4月, 2008 1 次提交
  18. 14 2月, 2008 1 次提交
  19. 03 12月, 2007 1 次提交
  20. 20 11月, 2007 1 次提交
    • L
      [POWERPC] Fix RTAS os-term usage on kernel panic · a2b51812
      Linas Vepstas 提交于
      The rtas_os_term() routine was being called at the wrong time.
      The actual rtas call "os-term" will not ever return, and so
      calling it from the panic notifier is too early.  Instead,
      call it from the machine_reset() call.
      
      This splits the rtas_os_term() routine into two: one part to capture
      the kernel panic message, invoked during the panic notifier, and
      another part that is invoked during machine_reset().
      
      Prior to this patch, the os-term call was never being made,
      because panic_timeout was always non-zero.  Calling os-term
      helps keep the hypervisor happy!  We have to keep the hypervisor
      happy to avoid service, dump and error reporting problems.
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      a2b51812
  21. 19 11月, 2007 1 次提交
    • N
      [POWERPC] Fix multiple bugs in rtas_ibm_suspend_me code · 8f5c7579
      Nathan Lynch 提交于
      There are several issues with the rtas_ibm_suspend_me code, which
      enables platform-assisted suspension of an LPAR as covered in PAPR
      2.2.
      
      1.) rtas_ibm_suspend_me uses on_each_cpu() to invoke
      rtas_percpu_suspend_me on all cpus via IPI:
      
      if (on_each_cpu(rtas_percpu_suspend_me, &data, 1, 0))
      ...
      
      'data' is on the calling task's stack, but rtas_ibm_suspend_me takes
      no measures to ensure that all instances of rtas_percpu_suspend_me are
      finished accessing 'data' before returning.  This can result in the
      IPI'd cpus accessing random stack data and getting stuck in H_JOIN.
      
      This is addressed by using an atomic count of workers and a completion
      on the stack.
      
      2.) rtas_percpu_suspend_me is needlessly calling H_JOIN in a loop.
      The only event that can cause a cpu to return from H_JOIN is an H_PROD
      from another cpu or a NMI/system reset.  Each cpu need call H_JOIN
      only once per suspend operation.
      
      Remove the loop and the now unnecessary 'waiting' state variable.
      
      3.) H_JOIN must be called with MSR[EE] off, but lazy interrupt
      disabling may cause the caller of rtas_ibm_suspend_me to call H_JOIN
      with it on; the local_irq_disable() in on_each_cpu() is not
      sufficient.
      
      Fix this by explicitly saving the MSR and clearing the EE bit before
      calling H_JOIN.
      
      4.) H_PROD is being called with the Linux logical cpu number as the
      parameter, not the platform interrupt server value.  (It's also being
      called for all possible cpus, which is harmless, but unnecessary.)
      
      This is fixed by calling H_PROD for each online cpu using
      get_hard_smp_processor_id(cpu) for the argument.
      Signed-off-by: NNathan Lynch <ntl@pobox.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      8f5c7579
  22. 24 4月, 2007 1 次提交
  23. 13 4月, 2007 1 次提交
  24. 18 2月, 2007 1 次提交
  25. 08 12月, 2006 2 次提交
  26. 04 12月, 2006 1 次提交
  27. 25 8月, 2006 2 次提交
  28. 08 8月, 2006 1 次提交
    • H
      [POWERPC] Fix might-sleep warning on removing cpus · 81b73dd9
      Haren Myneni 提交于
      Noticing the following might_sleep warning (dump_stack()) during kdump
      testing when CONFIG_DEBUG_SPINLOCK_SLEEP is enabled. All secondary CPUs
      will be calling rtas_set_indicator with interrupts disabled to remove
      them from global interrupt queue.
      
      BUG: sleeping function called from invalid context at
      arch/powerpc/kernel/rtas.c:463
      in_atomic():1, irqs_disabled():1
      Call Trace:
      [C00000000FFFB970] [C000000000010234] .show_stack+0x68/0x1b0 (unreliable)
      [C00000000FFFBA10] [C000000000059354] .__might_sleep+0xd8/0xf4
      [C00000000FFFBA90] [C00000000001D1BC] .rtas_busy_delay+0x20/0x5c
      [C00000000FFFBB20] [C00000000001D8A8] .rtas_set_indicator+0x6c/0xcc
      [C00000000FFFBBC0] [C000000000048BF4] .xics_teardown_cpu+0x118/0x134
      [C00000000FFFBC40] [C00000000004539C]
      .pseries_kexec_cpu_down_xics+0x74/0x8c
      [C00000000FFFBCC0] [C00000000002DF08] .crash_ipi_callback+0x15c/0x188
      [C00000000FFFBD50] [C0000000000296EC] .smp_message_recv+0x84/0xdc
      [C00000000FFFBDC0] [C000000000048E08] .xics_ipi_dispatch+0xf0/0x130
      [C00000000FFFBE50] [C00000000009EF10] .handle_IRQ_event+0x7c/0xf8
      [C00000000FFFBF00] [C0000000000A0A14] .handle_percpu_irq+0x90/0x10c
      [C00000000FFFBF90] [C00000000002659C] .call_handle_irq+0x1c/0x2c
      [C00000000058B9C0] [C00000000000CA10] .do_IRQ+0xf4/0x1a4
      [C00000000058BA50] [C0000000000044EC] hardware_interrupt_entry+0xc/0x10
       --- Exception: 501 at .plpar_hcall_norets+0x14/0x1c
         LR = .pseries_dedicated_idle_sleep+0x190/0x1d4
      [C00000000058BD40] [C00000000058BDE0] 0xc00000000058bde0 (unreliable)
      [C00000000058BDF0] [C00000000001270C] .cpu_idle+0x10c/0x1e0
      [C00000000058BE70] [C000000000009274] .rest_init+0x44/0x5c
      
      To fix this issue, rtas_set_indicator_fast() is added so that will not
      wait for RTAS 'busy' delay and this new function is used for kdump (in
      xics_teardown_cpu()) and for CPU hotplug ( xics_migrate_irqs_away() and
      xics_setup_cpu()).
      
      Note that the platform architecture spec says that set-indicator
      on the indicator we're using here is not permitted to return the
      busy or extended busy status codes.
      Signed-off-by: NHaren Myneni <haren@us.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      81b73dd9
  29. 01 8月, 2006 1 次提交
    • A
      [POWERPC] clean up pseries hcall interfaces · b9377ffc
      Anton Blanchard 提交于
      Our pseries hcall interfaces are out of control:
      
      	plpar_hcall_norets
      	plpar_hcall
      	plpar_hcall_8arg_2ret
      	plpar_hcall_4out
      	plpar_hcall_7arg_7ret
      	plpar_hcall_9arg_9ret
      
      Create 3 interfaces to cover all cases:
      
      	plpar_hcall_norets:	7 arguments no returns
      	plpar_hcall:		6 arguments 4 returns
      	plpar_hcall9:		9 arguments 9 returns
      
      There are only 2 cases in the kernel that need plpar_hcall9, hopefully
      we can keep it that way.
      
      Pass in a buffer to stash return parameters so we avoid the &dummy1,
      &dummy2 madness.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      --
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      b9377ffc
  30. 31 7月, 2006 1 次提交
  31. 28 6月, 2006 4 次提交
  32. 21 6月, 2006 1 次提交