1. 16 Jul, 2016 1 commit
  2. 28 Feb, 2016 1 commit
  3. 28 Jul, 2014 1 commit
  4. 23 Apr, 2014 2 commits
  5. 14 Aug, 2013 1 commit
  6. 09 Mar, 2012 1 commit
    • Benjamin Herrenschmidt's avatar
      powerpc: Rework lazy-interrupt handling · 7230c564
      Benjamin Herrenschmidt authored
      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
      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
      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>
      - 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
       - Fix or vs. ori bug on Book3E
       - Fix enabling of interrupts for some exceptions on Book3E
       - Fix resend of doorbells on return from interrupt on Book3E
       - Rebased on top of my latest series, which involves some significant
      rework of some aspects of the patch.
       - 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
       - Fix a bug with hard irq state tracking on native power7
  7. 21 Jan, 2011 1 commit
    • Steven Rostedt's avatar
      powerpc/ppc64/tracing: Add stack frame to calls of trace_hardirqs_on/off · 3cb5f1a3
      Steven Rostedt authored
          When an interrupt occurs in userspace, we can call trace_hardirqs_on/off()
          With one level stack. But if we have irqsoff tracing enabled,
          it checks both CALLER_ADDR0 and CALLER_ADDR1. The second call
          goes two stack frames up. If this is from user space, then there may
          not exist a second stack.
          Add a second stack when calling trace_hardirqs_on/off() otherwise
          the following oops might occur:
          Oops: Kernel access of bad area, sig: 11 [#1]
          PREEMPT SMP NR_CPUS=2 PA Semi PWRficient
          last sysfs file: /sys/block/sda/size
          Modules linked in: ohci_hcd ehci_hcd usbcore
          NIP: c0000000000e1c00 LR: c0000000000034d4 CTR: 000000011012c440
          REGS: c00000003e2f3af0 TRAP: 0300   Not tainted  (2.6.37-rc6+)
          MSR: 9000000000001032 <ME,IR,DR>  CR: 48044444  XER: 20000000
          DAR: 00000001ffb9db50, DSISR: 0000000040000000
          TASK = c00000003e1a00a0[2088] 'emacs' THREAD: c00000003e2f0000 CPU: 1
          GPR00: 0000000000000001 c00000003e2f3d70 c00000000084e0d0 c0000000008816e8
          GPR04: 000000001034c678 000000001032e8f9 0000000010336540 0000000040020000
          GPR08: 0000000040020000 00000001ffb9db40 c00000003e2f3e30 0000000060000000
          GPR12: 100000000000f032 c00000000fff0280 000000001032e8c9 0000000000000008
          GPR16: 00000000105be9c0 00000000105be950 00000000105be9b0 00000000105be950
          GPR20: 00000000ffb9dc50 00000000ffb9dbf0 00000000102f0000 00000000102f0000
          GPR24: 00000000102e0000 00000000102f0000 0000000010336540 c0000000009ded38
          GPR28: 00000000102e0000 c0000000000034d4 c0000000007ccb10 c00000003e2f3d70
          NIP [c0000000000e1c00] .trace_hardirqs_off+0xb0/0x1d0
          LR [c0000000000034d4] decrementer_common+0xd4/0x100
          Call Trace:
          [c00000003e2f3d70] [c00000003e2f3e30] 0xc00000003e2f3e30 (unreliable)
          [c00000003e2f3e30] [c0000000000034d4] decrementer_common+0xd4/0x100
          Instruction dump:
          81690000 7f8b0000 419e0018 f84a0028 60000000 60000000 60000000 e95f0000
          80030000 e92a0000 eb6301f8 2f800000 <eb890010> 41fe00dc a06d000a eb1e8050
          ---[ end trace 4ec7fd2be9240928 ]---
      Reported-by: default avatarJoerg Sommer <joerg@alea.gnuu.de>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
  8. 07 Oct, 2010 1 commit
    • David Howells's avatar
      Fix IRQ flag handling naming · df9ee292
      David Howells authored
      Fix the IRQ flag handling naming.  In linux/irqflags.h under one configuration,
      it maps:
      	local_irq_enable() -> raw_local_irq_enable()
      	local_irq_disable() -> raw_local_irq_disable()
      	local_irq_save() -> raw_local_irq_save()
      and under the other configuration, it maps:
      	raw_local_irq_enable() -> local_irq_enable()
      	raw_local_irq_disable() -> local_irq_disable()
      	raw_local_irq_save() -> local_irq_save()
      This is quite confusing.  There should be one set of names expected of the
      arch, and this should be wrapped to give another set of names that are expected
      by users of this facility.
      Change this to have the arch provide:
      	flags = arch_local_save_flags()
      	flags = arch_local_irq_save()
      Then linux/irqflags.h wraps these to provide:
      with type checking on the flags 'arguments', and then wraps those to provide:
      with tracing included if enabled.
      The arch functions can now all be inline functions rather than some of them
      having to be macros.
      Signed-off-by: David Howells <dhowells@redhat.com> [X86, FRV, MN10300]
      Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> [Tile]
      Signed-off-by: Michal Simek <monstr@monstr.eu> [Microblaze]
      Tested-by: Catalin Marinas <catalin.marinas@arm.com> [ARM]
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> [AVR]
      Acked-by: Tony Luck <tony.luck@intel.com> [IA-64]
      Acked-by: Hirokazu Takata <takata@linux-m32r.org> [M32R]
      Acked-by: Greg Ungerer <gerg@uclinux.org> [M68K/M68KNOMMU]
      Acked-by: Ralf Baechle <ralf@linux-mips.org> [MIPS]
      Acked-by: Kyle McMartin <kyle@mcmartin.ca> [PA-RISC]
      Acked-by: Paul Mackerras <paulus@samba.org> [PowerPC]
      Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> [S390]
      Acked-by: Chen Liqin <liqin.chen@sunplusct.com> [Score]
      Acked-by: Matt Fleming <matt@console-pimps.org> [SH]
      Acked-by: David S. Miller <davem@davemloft.net> [Sparc]
      Acked-by: Chris Zankel <chris@zankel.net> [Xtensa]
      Reviewed-by: Richard Henderson <rth@twiddle.net> [Alpha]
      Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp> [H8300]
      Cc: starvik@axis.com [CRIS]
      Cc: jesper.nilsson@axis.com [CRIS]
      Cc: linux-cris-kernel@axis.com
  9. 18 Aug, 2008 1 commit
  10. 04 Aug, 2008 1 commit
  11. 18 Apr, 2008 1 commit
  12. 03 Jul, 2006 1 commit