1. 09 3月, 2012 2 次提交
    • B
      powerpc: Rework lazy-interrupt handling · 7230c564
      Benjamin Herrenschmidt 提交于
      The current implementation of lazy interrupts handling has some
      issues that this tries to address.
      
      We don't do the various workarounds we need to do when re-enabling
      interrupts in some cases such as when returning from an interrupt
      and thus we may still lose or get delayed decrementer or doorbell
      interrupts.
      
      The current scheme also makes it much harder to handle the external
      "edge" interrupts provided by some BookE processors when using the
      EPR facility (External Proxy) and the Freescale Hypervisor.
      
      Additionally, we tend to keep interrupts hard disabled in a number
      of cases, such as decrementer interrupts, external interrupts, or
      when a masked decrementer interrupt is pending. This is sub-optimal.
      
      This is an attempt at fixing it all in one go by reworking the way
      we do the lazy interrupt disabling from the ground up.
      
      The base idea is to replace the "hard_enabled" field with a
      "irq_happened" field in which we store a bit mask of what interrupt
      occurred while soft-disabled.
      
      When re-enabling, either via arch_local_irq_restore() or when returning
      from an interrupt, we can now decide what to do by testing bits in that
      field.
      
      We then implement replaying of the missed interrupts either by
      re-using the existing exception frame (in exception exit case) or via
      the creation of a new one from an assembly trampoline (in the
      arch_local_irq_enable case).
      
      This removes the need to play with the decrementer to try to create
      fake interrupts, among others.
      
      In addition, this adds a few refinements:
      
       - We no longer  hard disable decrementer interrupts that occur
      while soft-disabled. We now simply bump the decrementer back to max
      (on BookS) or leave it stopped (on BookE) and continue with hard interrupts
      enabled, which means that we'll potentially get better sample quality from
      performance monitor interrupts.
      
       - Timer, decrementer and doorbell interrupts now hard-enable
      shortly after removing the source of the interrupt, which means
      they no longer run entirely hard disabled. Again, this will improve
      perf sample quality.
      
       - On Book3E 64-bit, we now make the performance monitor interrupt
      act as an NMI like Book3S (the necessary C code for that to work
      appear to already be present in the FSL perf code, notably calling
      nmi_enter instead of irq_enter). (This also fixes a bug where BookE
      perfmon interrupts could clobber r14 ... oops)
      
       - We could make "masked" decrementer interrupts act as NMIs when doing
      timer-based perf sampling to improve the sample quality.
      
      Signed-off-by-yet: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      ---
      
      v2:
      
      - Add hard-enable to decrementer, timer and doorbells
      - Fix CR clobber in masked irq handling on BookE
      - Make embedded perf interrupt act as an NMI
      - Add a PACA_HAPPENED_EE_EDGE for use by FSL if they want
        to retrigger an interrupt without preventing hard-enable
      
      v3:
      
       - Fix or vs. ori bug on Book3E
       - Fix enabling of interrupts for some exceptions on Book3E
      
      v4:
      
       - Fix resend of doorbells on return from interrupt on Book3E
      
      v5:
      
       - Rebased on top of my latest series, which involves some significant
      rework of some aspects of the patch.
      
      v6:
       - 32-bit compile fix
       - more compile fixes with various .config combos
       - factor out the asm code to soft-disable interrupts
       - remove the C wrapper around preempt_schedule_irq
      
      v7:
       - Fix a bug with hard irq state tracking on native power7
      7230c564
    • B
      powerpc/xmon: Add display of soft & hard irq states · 7ac21cd4
      Benjamin Herrenschmidt 提交于
      Also use local_paca instead of get_paca() to avoid getting into
      the smp_processor_id() debugging code from the debugger
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7ac21cd4
  2. 25 11月, 2011 2 次提交
  3. 01 11月, 2011 1 次提交
  4. 29 9月, 2011 1 次提交
    • J
      powerpc: Fix xmon for systems without MSR[RI] · 66857b3a
      Jimi Xenidis 提交于
      Based on patch by David Gibson <dwg@au1.ibm.com>
      
      xmon has a longstanding bug on systems which are SMP-capable but lack
      the MSR[RI] bit.  In these cases, xmon invoked by IPI on secondary
      CPUs will not properly keep quiet, but will print stuff, thereby
      garbling the primary xmon's output.  This patch fixes it, by ignoring
      the RI bit if the processor does not support it.
      
      There's already a version of this for 4xx upstream, which we'll need
      to extend to other RI-lacking CPUs at some point.  For now this adds
      Book3e processors to the mix.
      Signed-off-by: NJimi Xenidis <jimix@pobox.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      66857b3a
  5. 19 5月, 2011 1 次提交
    • M
      powerpc: Remove call sites of MSG_ALL_BUT_SELF · e0476371
      Milton Miller 提交于
      The only user of MSG_ALL_BUT_SELF in the whole kernel tree is powerpc,
      and it only uses it to start the debugger. Both debuggers always call
      smp_send_debugger_break with MSG_ALL_BUT_SELF, and only mpic can do
      anything more optimal than a loop over all online cpus, but all message
      passing implementations have to code for this special delivery target.
      
      Convert smp_send_debugger_break to take void and loop calling the smp_ops
      message_pass function for each of the other cpus in the online cpumask.
      
      Use raw_smp_processor_id() because we are either entering the debugger
      or trying to start kdump and the additional warning it not useful were
      it to trigger.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e0476371
  6. 04 5月, 2011 2 次提交
  7. 27 4月, 2011 2 次提交
  8. 25 3月, 2011 1 次提交
  9. 20 8月, 2010 1 次提交
  10. 14 7月, 2010 1 次提交
  11. 03 2月, 2010 1 次提交
  12. 24 11月, 2009 1 次提交
  13. 27 10月, 2009 1 次提交
  14. 24 9月, 2009 1 次提交
  15. 20 8月, 2009 1 次提交
  16. 09 6月, 2009 1 次提交
  17. 21 5月, 2009 1 次提交
  18. 23 12月, 2008 1 次提交
  19. 31 10月, 2008 1 次提交
    • P
      powerpc: Fix compile errors with CONFIG_BUG=n · ebdba9af
      Paul Mackerras 提交于
      This makes sure we don't try to call find_bug or is_warning_bug when
      CONFIG_BUG=n and CONFIG_XMON=y.  Otherwise we get these errors:
      
      arch/powerpc/xmon/xmon.c: In function ‘print_bug_trap’:
      arch/powerpc/xmon/xmon.c:1364: error: implicit declaration of function ‘find_bug’
      arch/powerpc/xmon/xmon.c:1364: warning: assignment makes pointer from integer without a cast
      arch/powerpc/xmon/xmon.c:1367: error: implicit declaration of function ‘is_warning_bug’
      arch/powerpc/xmon/xmon.c:1374: error: dereferencing pointer to incomplete type
      make[2]: *** [arch/powerpc/xmon/xmon.o] Error 1
      make[1]: *** [arch/powerpc/xmon] Error 2
      make: *** [sub-make] Error 2
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      ebdba9af
  20. 16 6月, 2008 1 次提交
  21. 14 5月, 2008 2 次提交
    • M
      [POWERPC] Make cpus_in_xmon static and remove extern mess from hvc_console.c · 1c8950ff
      Michael Ellerman 提交于
      This is a little messier than I'd like because xmon.h only exists
      on powerpc and we can't have a static inline and an extern declaration
      visible at the same time.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      1c8950ff
    • M
      [POWERPC] Fix sparse warnings in xmon.c · 9f1067c2
      Michael Ellerman 提交于
      warning: Using plain integer as NULL pointer
      warning: Using plain integer as NULL pointer
      warning: symbol 'excprint' was not declared. Should it be static?
      warning: symbol 'prregs' was not declared. Should it be static?
      warning: symbol 'cacheflush' was not declared. Should it be static?
      warning: symbol 'read_spr' was not declared. Should it be static?
      warning: symbol 'write_spr' was not declared. Should it be static?
      warning: symbol 'super_regs' was not declared. Should it be static?
      warning: symbol 'mread' was not declared. Should it be static?
      warning: symbol 'mwrite' was not declared. Should it be static?
      warning: symbol 'byterev' was not declared. Should it be static?
      warning: symbol 'memex' was not declared. Should it be static?
      warning: symbol 'bsesc' was not declared. Should it be static?
      warning: symbol 'dump' was not declared. Should it be static?
      warning: symbol 'prdump' was not declared. Should it be static?
      warning: symbol 'generic_inst_dump' was not declared. Should it be static?
      warning: symbol 'ppc_inst_dump' was not declared. Should it be static?
      warning: symbol 'memops' was not declared. Should it be static?
      warning: symbol 'memdiffs' was not declared. Should it be static?
      warning: symbol 'memlocate' was not declared. Should it be static?
      warning: symbol 'memzcan' was not declared. Should it be static?
      warning: symbol 'proccall' was not declared. Should it be static?
      warning: symbol 'scannl' was not declared. Should it be static?
      warning: symbol 'hexdigit' was not declared. Should it be static?
      warning: symbol 'flush_input' was not declared. Should it be static?
      warning: symbol 'inchar' was not declared. Should it be static?
      warning: symbol 'take_input' was not declared. Should it be static?
      warning: symbol 'xmon_init' was not declared. Should it be static?
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      9f1067c2
  22. 05 5月, 2008 1 次提交
  23. 18 4月, 2008 1 次提交
  24. 15 4月, 2008 1 次提交
  25. 25 1月, 2008 1 次提交
  26. 11 12月, 2007 2 次提交
    • W
      [POWERPC] Update xmon slb code · b3b9595f
      will schmidt 提交于
      This adds a bit more detail to the xmon SLB output.  When the valid
      bit is set, this displays the ESID and VSID values, as well as
      decoding the segment size -- 1T or 256M -- and displaying the LLP
      bits.  This supresses the output for any slb entries that contain only
      zeros.
      
      sample output from power6 (1T segment support):
      00 c000000008000000 40004f7ca3000500  1T  ESID=   c00000  VSID=       4f7ca3 LLP:100
      01 d000000008000000 4000eb71b0000400  1T  ESID=   d00000  VSID=       eb71b0 LLP:  0
      08 0000000018000000 0000c8499f8ccc80 256M ESID=        1  VSID=    c8499f8cc LLP:  0
      09 00000000f8000000 0000d2c1a8e46c80 256M ESID=        f  VSID=    d2c1a8e46 LLP:  0
      10 0000000048000000 0000ca87eab1dc80 256M ESID=        4  VSID=    ca87eab1d LLP:  0
      43 cf00000008000000 400011b260000500  1T  ESID=   cf0000  VSID=       11b260 LLP:100
      
      sample output from power5 (notice the non-valid but non-zero entries)
      10 0000000008000000 00004fd0e077ac80 256M ESID=        0  VSID=    4fd0e077a LLP:  0
      11 00000000f8000000 00005b085830fc80 256M ESID=        f  VSID=    5b085830f LLP:  0
      12 0000000048000000 000052ce99fe6c80 256M ESID=        4  VSID=    52ce99fe6 LLP:  0
      13 0000000018000000 000050904ed95c80 256M ESID=        1  VSID=    50904ed95 LLP:  0
      14 cf00000008000000 0000d59aca40f500 256M ESID=cf0000000  VSID=    d59aca40f LLP:100
      15 c000000078000000 000045cb97751500 256M ESID=c00000007  VSID=    45cb97751 LLP:100
      
      Tested on power5 and power6.
      Signed-Off-By: NWill Schmidt <will_schmidt@vnet.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      b3b9595f
    • M
      [POWERPC] Use SLB size from the device tree · 584f8b71
      Michael Neuling 提交于
      Currently we hardwire the number of SLBs to 64, but PAPR says we
      should use the ibm,slb-size property to obtain the number of SLB
      entries.  This uses this property instead of assuming 64.  If no
      property is found, we assume 64 entries as before.
      
      This soft patches the SLB handler, so it shouldn't change performance
      at all.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      584f8b71
  27. 03 12月, 2007 1 次提交
  28. 22 7月, 2007 1 次提交
  29. 10 7月, 2007 1 次提交
  30. 09 5月, 2007 1 次提交
  31. 27 4月, 2007 1 次提交
    • A
      [POWERPC] Fix WARN_ON when entering xmon · f13659e0
      Anton Blanchard 提交于
      Whenever we enter xmon we get a WARN_ON out of the rtas code since it
      thinks interrupts are still on:
      
      Unable to handle kernel paging request for data at address 0x00000000
      Faulting instruction address: 0xd000000000080008
      cpu 0x3: Vector: 300 (Data Access) at [c0000000075dba00]
          pc: d000000000080008: .doit+0x8/0x40 [oopser]
          lr: c000000000077704: .sys_init_module+0x1664/0x1824
          sp: c0000000075dbc80
         msr: 9000000000009032
         dar: 0
       dsisr: 42000000
        current = 0xc000000003fa64b0
        paca    = 0xc000000000694280
          pid   = 2260, comm = insmod
      
      ------------[ cut here ]------------
      Badness at arch/powerpc/kernel/entry_64.S:651
      Call Trace:
      [C0000000075DAE70] [C00000000000EB64] .show_stack+0x68/0x1b0 (unreliable)
      [C0000000075DAF10] [C000000000216254] .report_bug+0x94/0xe8
      [C0000000075DAFA0] [C00000000047B140] __kprobes_text_start+0x178/0x584
      [C0000000075DB040] [C0000000000044F4] program_check_common+0xf4/0x100
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      f13659e0
  32. 09 3月, 2007 1 次提交
  33. 08 3月, 2007 1 次提交
  34. 14 2月, 2007 1 次提交