An error occurred fetching the project authors.
  1. 09 Dec, 2020 1 commit
    • Nicholas Piggin's avatar
      powerpc/64: irq replay remove decrementer overflow check · 59d512e4
      Nicholas Piggin authored
      This is way to catch some cases of decrementer overflow, when the
      decrementer has underflowed an odd number of times, while MSR[EE] was
      disabled.
      
      With a typical small decrementer, a timer that fires when MSR[EE] is
      disabled will be "lost" if MSR[EE] remains disabled for between 4.3 and
      8.6 seconds after the timer expires. In any case, the decrementer
      interrupt would be taken at 8.6 seconds and the timer would be found at
      that point.
      
      So this check is for catching extreme latency events, and it prevents
      those latencies from being a further few seconds long.  It's not obvious
      this is a good tradeoff. This is already a watchdog magnitude event and
      that situation is not improved a significantly with this check. For
      large decrementers, it's useless.
      
      Therefore remove this check, which avoids a mftb when enabling hard
      disabled interrupts (e.g., when enabling after coming from hardware
      interrupt handlers). Perhaps more importantly, it also removes the
      clunky MSR[EE] vs PACA_IRQ_HARD_DIS incoherency in soft-interrupt replay
      which simplifies the code.
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20201107014336.2337337-1-npiggin@gmail.com
      59d512e4
  2. 08 Oct, 2020 1 commit
  3. 06 Oct, 2020 5 commits
  4. 29 Jul, 2020 1 commit
  5. 09 Jun, 2020 2 commits
    • Mike Rapoport's avatar
      mm: reorder includes after introduction of linux/pgtable.h · 65fddcfc
      Mike Rapoport authored
      The replacement of <asm/pgrable.h> with <linux/pgtable.h> made the include
      of the latter in the middle of asm includes.  Fix this up with the aid of
      the below script and manual adjustments here and there.
      
      	import sys
      	import re
      
      	if len(sys.argv) is not 3:
      	    print "USAGE: %s <file> <header>" % (sys.argv[0])
      	    sys.exit(1)
      
      	hdr_to_move="#include <linux/%s>" % sys.argv[2]
      	moved = False
      	in_hdrs = False
      
      	with open(sys.argv[1], "r") as f:
      	    lines = f.readlines()
      	    for _line in lines:
      		line = _line.rstrip('
      ')
      		if line == hdr_to_move:
      		    continue
      		if line.startswith("#include <linux/"):
      		    in_hdrs = True
      		elif not moved and in_hdrs:
      		    moved = True
      		    print hdr_to_move
      		print line
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: http://lkml.kernel.org/r/20200514170327.31389-4-rppt@kernel.orgSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      65fddcfc
    • Mike Rapoport's avatar
      mm: introduce include/linux/pgtable.h · ca5999fd
      Mike Rapoport authored
      The include/linux/pgtable.h is going to be the home of generic page table
      manipulation functions.
      
      Start with moving asm-generic/pgtable.h to include/linux/pgtable.h and
      make the latter include asm/pgtable.h.
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: http://lkml.kernel.org/r/20200514170327.31389-3-rppt@kernel.orgSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ca5999fd
  6. 02 Jun, 2020 1 commit
    • Christoph Hellwig's avatar
      powerpc: use __vmalloc_node in alloc_vm_stack · cb0849a9
      Christoph Hellwig authored
      alloc_vm_stack can use a slightly higher level vmalloc function.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-29-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cb0849a9
  7. 02 Apr, 2020 1 commit
    • Nicholas Piggin's avatar
      powerpc/64s: Fix doorbell wakeup msgclr optimisation · 0c89649a
      Nicholas Piggin authored
      Commit 3282a3da ("powerpc/64: Implement soft interrupt replay in C")
      broke the doorbell wakeup optimisation introduced by commit a9af97aa
      ("powerpc/64s: msgclr when handling doorbell exceptions from system
      reset").
      
      This patch restores the msgclr, in C code. It's now done in the system
      reset wakeup path rather than doorbell interrupt replay where it used
      to be, because it is always the right thing to do in the wakeup case,
      but it may be rarely of use in other interrupt replay situations in
      which case it's wasted work - we would have to run measurements to see
      if that was a worthwhile optimisation, and I suspect it would not be.
      
      The results are similar to those in the original commit, test on POWER8
      of context_switch selftests benchmark with polling idle disabled (e.g.,
      always nap, giving cross-CPU IPIs) gives the following results:
      
                                        broken           patched
        Different threads, same core:   317k/s           375k/s    +18.7%
        Different cores:                280k/s           282k/s     +1.0%
      
      Fixes: 3282a3da ("powerpc/64: Implement soft interrupt replay in C")
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20200402121212.1118218-1-npiggin@gmail.com
      0c89649a
  8. 01 Apr, 2020 2 commits
    • Nicholas Piggin's avatar
      powerpc/64s: Implement interrupt exit logic in C · 6cc0c16d
      Nicholas Piggin authored
      Implement the bulk of interrupt return logic in C. The asm return code
      must handle a few cases: restoring full GPRs, and emulating stack
      store.
      
      The stack store emulation is significantly simplfied, rather than
      creating a new return frame and switching to that before performing
      the store, it uses the PACA to keep a scratch register around to
      perform the store.
      
      The asm return code is moved into 64e for now. The new logic has made
      allowance for 64e, but I don't have a full environment that works well
      to test it, and even booting in emulated qemu is not great for stress
      testing. 64e shouldn't be too far off working with this, given a bit
      more testing and auditing of the logic.
      
      This is slightly faster on a POWER9 (page fault speed increases about
      1.1%), probably due to reduced mtmsrd.
      
      mpe: Includes fixes from Nick for _TIF_EMULATE_STACK_STORE
      handling (including the fast_interrupt_return path), to remove
      trace_hardirqs_on(), and fixes the interrupt-return part of the
      MSR_VSX restore bug caught by tm-unavailable selftest.
      
      mpe: Incorporate fix from Nick:
      
      The return-to-kernel path has to replay any soft-pending interrupts if
      it is returning to a context that had interrupts soft-enabled. It has
      to do this carefully and avoid plain enabling interrupts if this is an
      irq context, which can cause multiple nesting of interrupts on the
      stack, and other unexpected issues.
      
      The code which avoided this case got the soft-mask state wrong, and
      marked interrupts as enabled before going around again to retry. This
      seems to be mostly harmless except when PREEMPT=y, this calls
      preempt_schedule_irq with irqs apparently enabled and runs into a BUG
      in kernel/sched/core.c
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichal Suchanek <msuchanek@suse.de>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20200225173541.1549955-29-npiggin@gmail.com
      6cc0c16d
    • Nicholas Piggin's avatar
      powerpc/64: Implement soft interrupt replay in C · 3282a3da
      Nicholas Piggin authored
      When local_irq_enable() finds a pending soft-masked interrupt, it
      "replays" it by setting up registers like the initial interrupt entry,
      then calls into the low level handler to set up an interrupt stack
      frame and process the interrupt.
      
      This is not necessary, and uses more stack than needed. The high level
      interrupt handler can be called directly from C, with just pt_regs set
      up on stack. This should be faster and use less stack.
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20200225173541.1549955-28-npiggin@gmail.com
      3282a3da
  9. 04 Mar, 2020 4 commits
  10. 27 Jan, 2020 1 commit
  11. 13 Dec, 2019 1 commit
  12. 10 Jul, 2019 1 commit
  13. 30 May, 2019 1 commit
  14. 02 May, 2019 2 commits
    • Nicholas Piggin's avatar
      powerpc/64: Don't trace code that runs with the soft irq mask unreconciled · e2b36d59
      Nicholas Piggin authored
      "Reconciling" in terms of interrupt handling, is to bring the soft irq
      mask state in to synch with the hardware, after an interrupt causes
      MSR[EE] to be cleared (while the soft mask may be enabled, and hard
      irqs not marked disabled).
      
      General kernel code should not be called while unreconciled, because
      local_irq_disable, etc. manipulations can cause surprising irq traces,
      and it's fragile because the soft irq code does not really expect to
      be called in this situation.
      
      When exiting from an interrupt, MSR[EE] is cleared to prevent races,
      but soft irq state is enabled for the returned-to context, so this is
      now an unreconciled state. restore_math is called in this state, and
      that can be ftraced, and the ftrace subsystem disables local irqs.
      
      Mark restore_math and its callees as notrace. Restore a sanity check
      in the soft irq code that had to be disabled for this case, by commit
      4da1f792 ("powerpc/64: Disable irq restore warning for now").
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      e2b36d59
    • Christophe Leroy's avatar
      powerpc/irq: drop __irq_offset_value · 502523fd
      Christophe Leroy authored
      This patch drops__irq_offset_value which has not been used since
      commit 9c4cb825 ("powerpc: Remove use of CONFIG_PPC_MERGE")
      
      This removes a sparse warning.
      
      Fixes: 9c4cb825 ("powerpc: Remove use of CONFIG_PPC_MERGE")
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      502523fd
  15. 23 Feb, 2019 5 commits
  16. 14 Jan, 2019 1 commit
  17. 07 Aug, 2018 1 commit
    • Michael Ellerman's avatar
      powerpc/64: Disable irq restore warning for now · 4da1f792
      Michael Ellerman authored
      We recently added a warning in arch_local_irq_restore() to check that
      the soft masking state matches reality.
      
      Unfortunately it trips in a few places, which are not entirely trivial
      to fix. The key problem is if we're doing function_graph tracing of
      restore_math(), the warning pops and then seems to recurse. It's not
      entirely clear because the system continuously oopses on all CPUs,
      with the output interleaved and unreadable.
      
      It's also been observed on a G5 coming out of idle.
      
      Until we can fix those cases disable the warning for now.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      4da1f792
  18. 24 Jul, 2018 1 commit
    • Nicholas Piggin's avatar
      powerpc/64s: make PACA_IRQ_HARD_DIS track MSR[EE] closely · 9b81c021
      Nicholas Piggin authored
      When the masked interrupt handler clears MSR[EE] for an interrupt in
      the PACA_IRQ_MUST_HARD_MASK set, it does not set PACA_IRQ_HARD_DIS.
      This makes them get out of synch.
      
      With that taken into account, it's only low level irq manipulation
      (and interrupt entry before reconcile) where they can be out of synch.
      This makes the code less surprising.
      
      It also allows the IRQ replay code to rely on the IRQ_HARD_DIS value
      and not have to mtmsrd again in this case (e.g., for an external
      interrupt that has been masked). The bigger benefit might just be
      that there is not such an element of surprise in these two bits of
      state.
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      9b81c021
  19. 03 Jun, 2018 1 commit
  20. 25 May, 2018 1 commit
    • Mathieu Malaterre's avatar
      powerpc/tau: Synchronize function prototypes and body · bd13ac95
      Mathieu Malaterre authored
      Some function prototypes and body for Thermal Assist Units were not in
      sync. Update the function definition to match the existing function
      declaration found in `setup-common.c`, changing an `int` return type to a
      `u32` return type. Move the prototypes to a header file. Fix the following
      warnings, treated as error with W=1:
      
        arch/powerpc/kernel/tau_6xx.c:257:5: error: no previous prototype for ‘cpu_temp_both’ [-Werror=missing-prototypes]
        arch/powerpc/kernel/tau_6xx.c:262:5: error: no previous prototype for ‘cpu_temp’ [-Werror=missing-prototypes]
        arch/powerpc/kernel/tau_6xx.c:267:5: error: no previous prototype for ‘tau_interrupts’ [-Werror=missing-prototypes]
      
      Compile tested with CONFIG_TAU_INT.
      Suggested-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      bd13ac95
  21. 22 Mar, 2018 1 commit
    • Nicholas Piggin's avatar
      powerpc/64s: Fix lost pending interrupt due to race causing lost update to irq_happened · ff6781fd
      Nicholas Piggin authored
      force_external_irq_replay() can be called in the do_IRQ path with
      interrupts hard enabled and soft disabled if may_hard_irq_enable() set
      MSR[EE]=1. It updates local_paca->irq_happened with a load, modify,
      store sequence. If a maskable interrupt hits during this sequence, it
      will go to the masked handler to be marked pending in irq_happened.
      This update will be lost when the interrupt returns and the store
      instruction executes. This can result in unpredictable latencies,
      timeouts, lockups, etc.
      
      Fix this by ensuring hard interrupts are disabled before modifying
      irq_happened.
      
      This could cause any maskable asynchronous interrupt to get lost, but
      it was noticed on P9 SMP system doing RDMA NVMe target over 100GbE,
      so very high external interrupt rate and high IPI rate. The hang was
      bisected down to enabling doorbell interrupts for IPIs. These provided
      an interrupt type that could run at high rates in the do_IRQ path,
      stressing the race.
      
      Fixes: 1d607bb3 ("powerpc/irq: Add mechanism to force a replay of interrupts")
      Cc: stable@vger.kernel.org # v4.8+
      Reported-by: default avatarCarol L. Soto <clsoto@us.ibm.com>
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      ff6781fd
  22. 19 Jan, 2018 5 commits
    • Madhavan Srinivasan's avatar
      powerpc: Add new kconfig CONFIG_PPC_IRQ_SOFT_MASK_DEBUG · 9aa88188
      Madhavan Srinivasan authored
      New Kconfig is added "CONFIG_PPC_IRQ_SOFT_MASK_DEBUG" to add WARN_ON
      to alert the invalid transitions. Also moved the code under the
      CONFIG_TRACE_IRQFLAGS in arch_local_irq_restore() to new Kconfig.
      Reviewed-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      [mpe: Fix name of CONFIG option in change log]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      9aa88188
    • Madhavan Srinivasan's avatar
      powerpc/64s: Add support to mask perf interrupts and replay them · f442d004
      Madhavan Srinivasan authored
      Two new bit mask field "IRQ_DISABLE_MASK_PMU" is introduced to support
      the masking of PMI and "IRQ_DISABLE_MASK_ALL" to aid interrupt masking
      checking.
      
      Couple of new irq #defs "PACA_IRQ_PMI" and "SOFTEN_VALUE_0xf0*" added
      to use in the exception code to check for PMI interrupts.
      
      In the masked_interrupt handler, for PMIs we reset the MSR[EE] and
      return. In the __check_irq_replay(), replay the PMI interrupt by
      calling performance_monitor_common handler.
      Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      f442d004
    • Madhavan Srinivasan's avatar
      powerpc/64: Rename soft_enabled to irq_soft_mask · 4e26bc4a
      Madhavan Srinivasan authored
      Rename the paca->soft_enabled to paca->irq_soft_mask as it is no
      longer used as a flag for interrupt state, but a mask.
      Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      4e26bc4a
    • Madhavan Srinivasan's avatar
      powerpc/64: Change soft_enabled from flag to bitmask · 01417c6c
      Madhavan Srinivasan authored
      "paca->soft_enabled" is used as a flag to mask some of interrupts.
      Currently supported flags values and their details:
      
      soft_enabled    MSR[EE]
      
      0               0       Disabled (PMI and HMI not masked)
      1               1       Enabled
      
      "paca->soft_enabled" is initialized to 1 to make the interripts as
      enabled. arch_local_irq_disable() will toggle the value when
      interrupts needs to disbled. At this point, the interrupts are not
      actually disabled, instead, interrupt vector has code to check for the
      flag and mask it when it occurs. By "mask it", it update interrupt
      paca->irq_happened and return. arch_local_irq_restore() is called to
      re-enable interrupts, which checks and replays interrupts if any
      occured.
      
      Now, as mentioned, current logic doesnot mask "performance monitoring
      interrupts" and PMIs are implemented as NMI. But this patchset depends
      on local_irq_* for a successful local_* update. Meaning, mask all
      possible interrupts during local_* update and replay them after the
      update.
      
      So the idea here is to reserve the "paca->soft_enabled" logic. New
      values and details:
      
      soft_enabled    MSR[EE]
      
      1               0       Disabled  (PMI and HMI not masked)
      0               1       Enabled
      
      Reason for the this change is to create foundation for a third mask
      value "0x2" for "soft_enabled" to add support to mask PMIs. When
      ->soft_enabled is set to a value "3", PMI interrupts are mask and when
      set to a value of "1", PMI are not mask. With this patch also extends
      soft_enabled as interrupt disable mask.
      
      Current flags are renamed from IRQ_[EN?DIS}ABLED to
      IRQS_ENABLED and IRQS_DISABLED.
      
      Patch also fixes the ptrace call to force the user to see the softe
      value to be alway 1. Reason being, even though userspace has no
      business knowing about softe, it is part of pt_regs. Like-wise in
      signal context.
      Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      01417c6c
    • Madhavan Srinivasan's avatar
      powerpc/64: Move set_soft_enabled() and rename · 0b63acf4
      Madhavan Srinivasan authored
      Move set_soft_enabled() from powerpc/kernel/irq.c to asm/hw_irq.c, to
      encourage updates to paca->soft_enabled done via these access
      function. Add "memory" clobber to hint compiler since
      paca->soft_enabled memory is the target here.
      
      Renaming it as soft_enabled_set() will make namespaces works better as
      prefix than a postfix when new soft_enabled manipulation functions are
      introduced.
      Reviewed-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      0b63acf4