All of lore.kernel.org
 help / color / mirror / Atom feed
* arm/arm64 HARDLOCKUP Detector and PERF NMI support
       [not found] <569199C0.9030500@samsung.com>
@ 2016-01-10  0:13 ` Mario Smarduch
  2016-01-11 10:26     ` Mark Rutland
  0 siblings, 1 reply; 7+ messages in thread
From: Mario Smarduch @ 2016-01-10  0:13 UTC (permalink / raw)
  To: linux-arm-kernel, mark.rutland, Will Deacon, Marc Zyngier,
	Catalin Marinas, Russell King - ARM Linux
  Cc: wim, Christoffer Dall, linux-watchdog

I'm trying to get HARDLOCKUP detector to work on arm (on foundation
model and Juno, but armv7 should have the same issue). Turns out there is no
PERF NMI support (HAVE_PERF_EVENTS_NMI), which I guess would be PMU NMI - I
tested overflow on cycle counter and PMU interrupts can be masked. HARDLOCKUP
assumes perf interrupts are non-maskable and uses the PMU to program an NMI to
detect hard lockup and that in turn drives softlockup detection.

Is there something, someplace in ARM manuals that addresses this, searched the
manuals but couldn't find anything?

Or other approaches that I'm not aware off or have floated on the mailing list.

It's a pretty important feature for some environments.

- Mario






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: arm/arm64 HARDLOCKUP Detector and PERF NMI support
  2016-01-10  0:13 ` arm/arm64 HARDLOCKUP Detector and PERF NMI support Mario Smarduch
@ 2016-01-11 10:26     ` Mark Rutland
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Rutland @ 2016-01-11 10:26 UTC (permalink / raw)
  To: Mario Smarduch, Daniel Thompson, Marc Zyngier, Will Deacon
  Cc: linux-arm-kernel, Catalin Marinas, Russell King - ARM Linux, wim,
	Christoffer Dall, linux-watchdog

Hi,

On Sat, Jan 09, 2016 at 04:13:48PM -0800, Mario Smarduch wrote:
> I'm trying to get HARDLOCKUP detector to work on arm (on foundation
> model and Juno, but armv7 should have the same issue). Turns out there is no
> PERF NMI support (HAVE_PERF_EVENTS_NMI), which I guess would be PMU NMI - I
> tested overflow on cycle counter and PMU interrupts can be masked. HARDLOCKUP
> assumes perf interrupts are non-maskable and uses the PMU to program an NMI to
> detect hard lockup and that in turn drives softlockup detection.
> 
> Is there something, someplace in ARM manuals that addresses this, searched the
> manuals but couldn't find anything?
> 
> Or other approaches that I'm not aware off or have floated on the mailing list.

Russell and Daniel did some work [1,2] to use FIQs as NMIs on arm, for
backtracing and PMU overflow.

For arm64 the kernel always runs on the non-secure side, so we don't
expect to have access to FIQ. It's possible to implement NMIs using
priorities (which it looks like Daniel was looking into [3]).

Thanks,
Mark.

[1] http://thread.gmane.org/gmane.linux.ports.arm.kernel/353795/
[2] http://www.linaro.org/blog/core-dump/debugging-arm-kernels-using-nmifiq/
[3] https://git.linaro.org/people/daniel.thompson/linux.git/shortlog/refs/heads/dev/arm64_nmi-v5

^ permalink raw reply	[flat|nested] 7+ messages in thread

* arm/arm64 HARDLOCKUP Detector and PERF NMI support
@ 2016-01-11 10:26     ` Mark Rutland
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Rutland @ 2016-01-11 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Sat, Jan 09, 2016 at 04:13:48PM -0800, Mario Smarduch wrote:
> I'm trying to get HARDLOCKUP detector to work on arm (on foundation
> model and Juno, but armv7 should have the same issue). Turns out there is no
> PERF NMI support (HAVE_PERF_EVENTS_NMI), which I guess would be PMU NMI - I
> tested overflow on cycle counter and PMU interrupts can be masked. HARDLOCKUP
> assumes perf interrupts are non-maskable and uses the PMU to program an NMI to
> detect hard lockup and that in turn drives softlockup detection.
> 
> Is there something, someplace in ARM manuals that addresses this, searched the
> manuals but couldn't find anything?
> 
> Or other approaches that I'm not aware off or have floated on the mailing list.

Russell and Daniel did some work [1,2] to use FIQs as NMIs on arm, for
backtracing and PMU overflow.

For arm64 the kernel always runs on the non-secure side, so we don't
expect to have access to FIQ. It's possible to implement NMIs using
priorities (which it looks like Daniel was looking into [3]).

Thanks,
Mark.

[1] http://thread.gmane.org/gmane.linux.ports.arm.kernel/353795/
[2] http://www.linaro.org/blog/core-dump/debugging-arm-kernels-using-nmifiq/
[3] https://git.linaro.org/people/daniel.thompson/linux.git/shortlog/refs/heads/dev/arm64_nmi-v5

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: arm/arm64 HARDLOCKUP Detector and PERF NMI support
  2016-01-11 10:26     ` Mark Rutland
@ 2016-01-11 11:25       ` Daniel Thompson
  -1 siblings, 0 replies; 7+ messages in thread
From: Daniel Thompson @ 2016-01-11 11:25 UTC (permalink / raw)
  To: Mark Rutland, Mario Smarduch, Marc Zyngier, Will Deacon
  Cc: linux-arm-kernel, Catalin Marinas, Russell King - ARM Linux, wim,
	Christoffer Dall, linux-watchdog

On 11/01/16 10:26, Mark Rutland wrote:
> Hi,
>
> On Sat, Jan 09, 2016 at 04:13:48PM -0800, Mario Smarduch wrote:
>> I'm trying to get HARDLOCKUP detector to work on arm (on foundation
>> model and Juno, but armv7 should have the same issue). Turns out there is no
>> PERF NMI support (HAVE_PERF_EVENTS_NMI), which I guess would be PMU NMI - I
>> tested overflow on cycle counter and PMU interrupts can be masked. HARDLOCKUP
>> assumes perf interrupts are non-maskable and uses the PMU to program an NMI to
>> detect hard lockup and that in turn drives softlockup detection.
>>
>> Is there something, someplace in ARM manuals that addresses this, searched the
>> manuals but couldn't find anything?
>>
>> Or other approaches that I'm not aware off or have floated on the mailing list.
>
> Russell and Daniel did some work [1,2] to use FIQs as NMIs on arm, for
> backtracing and PMU overflow.
 >
> For arm64 the kernel always runs on the non-secure side, so we don't
> expect to have access to FIQ. It's possible to implement NMIs using
> priorities (which it looks like Daniel was looking into [3]).

Thanks Mark.

The blog post is still pretty much describes my ambitions and the 
benefits these features can bring. It also has a link to a fairly 
elderly kernel that contains all the features fully integrated.

There are more patchsets for both ARM (if/f FIQ is available) and ARM64 
(if/f device has GICv3). However these only provide NMI backtrace.

arm:   http://thread.gmane.org/gmane.linux.kernel/2112583

arm64: http://thread.gmane.org/gmane.linux.kernel/2037735 (Mark's
        link to my git repo is more up to date than this patchset)

To get the hard lockup and profiling support upstream then my old code 
to integrate NMIs into the irq subsystem (which was just a cut down 
clone of the existing irq infrastructure) needs to be redesigned. 
However I decided to put the rewrite on ice until I get the foundational 
patches right.


Daniel.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* arm/arm64 HARDLOCKUP Detector and PERF NMI support
@ 2016-01-11 11:25       ` Daniel Thompson
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Thompson @ 2016-01-11 11:25 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/01/16 10:26, Mark Rutland wrote:
> Hi,
>
> On Sat, Jan 09, 2016 at 04:13:48PM -0800, Mario Smarduch wrote:
>> I'm trying to get HARDLOCKUP detector to work on arm (on foundation
>> model and Juno, but armv7 should have the same issue). Turns out there is no
>> PERF NMI support (HAVE_PERF_EVENTS_NMI), which I guess would be PMU NMI - I
>> tested overflow on cycle counter and PMU interrupts can be masked. HARDLOCKUP
>> assumes perf interrupts are non-maskable and uses the PMU to program an NMI to
>> detect hard lockup and that in turn drives softlockup detection.
>>
>> Is there something, someplace in ARM manuals that addresses this, searched the
>> manuals but couldn't find anything?
>>
>> Or other approaches that I'm not aware off or have floated on the mailing list.
>
> Russell and Daniel did some work [1,2] to use FIQs as NMIs on arm, for
> backtracing and PMU overflow.
 >
> For arm64 the kernel always runs on the non-secure side, so we don't
> expect to have access to FIQ. It's possible to implement NMIs using
> priorities (which it looks like Daniel was looking into [3]).

Thanks Mark.

The blog post is still pretty much describes my ambitions and the 
benefits these features can bring. It also has a link to a fairly 
elderly kernel that contains all the features fully integrated.

There are more patchsets for both ARM (if/f FIQ is available) and ARM64 
(if/f device has GICv3). However these only provide NMI backtrace.

arm:   http://thread.gmane.org/gmane.linux.kernel/2112583

arm64: http://thread.gmane.org/gmane.linux.kernel/2037735 (Mark's
        link to my git repo is more up to date than this patchset)

To get the hard lockup and profiling support upstream then my old code 
to integrate NMIs into the irq subsystem (which was just a cut down 
clone of the existing irq infrastructure) needs to be redesigned. 
However I decided to put the rewrite on ice until I get the foundational 
patches right.


Daniel.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: arm/arm64 HARDLOCKUP Detector and PERF NMI support
  2016-01-11 11:25       ` Daniel Thompson
@ 2016-01-11 20:06         ` Mario Smarduch
  -1 siblings, 0 replies; 7+ messages in thread
From: Mario Smarduch @ 2016-01-11 20:06 UTC (permalink / raw)
  To: Daniel Thompson, Mark Rutland, Marc Zyngier, Will Deacon
  Cc: linux-arm-kernel, Catalin Marinas, Russell King - ARM Linux, wim,
	Christoffer Dall, linux-watchdog



On 1/11/2016 3:25 AM, Daniel Thompson wrote:
> On 11/01/16 10:26, Mark Rutland wrote:
>> Hi,
>>
>> On Sat, Jan 09, 2016 at 04:13:48PM -0800, Mario Smarduch wrote:
>>> I'm trying to get HARDLOCKUP detector to work on arm (on foundation
>>> model and Juno, but armv7 should have the same issue). Turns out there is no
>>> PERF NMI support (HAVE_PERF_EVENTS_NMI), which I guess would be PMU NMI - I
>>> tested overflow on cycle counter and PMU interrupts can be masked. HARDLOCKUP
>>> assumes perf interrupts are non-maskable and uses the PMU to program an NMI to
>>> detect hard lockup and that in turn drives softlockup detection.
>>>
>>> Is there something, someplace in ARM manuals that addresses this, searched the
>>> manuals but couldn't find anything?
>>>
>>> Or other approaches that I'm not aware off or have floated on the mailing list.
>>
>> Russell and Daniel did some work [1,2] to use FIQs as NMIs on arm, for
>> backtracing and PMU overflow.
>  >
>> For arm64 the kernel always runs on the non-secure side, so we don't
>> expect to have access to FIQ. It's possible to implement NMIs using
>> priorities (which it looks like Daniel was looking into [3]).
> 
> Thanks Mark.
> 
> The blog post is still pretty much describes my ambitions and the 
> benefits these features can bring. It also has a link to a fairly 
> elderly kernel that contains all the features fully integrated.
> 
> There are more patchsets for both ARM (if/f FIQ is available) and ARM64 
> (if/f device has GICv3). However these only provide NMI backtrace.
> 
> arm:   http://thread.gmane.org/gmane.linux.kernel/2112583
> 
> arm64: http://thread.gmane.org/gmane.linux.kernel/2037735 (Mark's
>         link to my git repo is more up to date than this patchset)
> 
> To get the hard lockup and profiling support upstream then my old code 
> to integrate NMIs into the irq subsystem (which was just a cut down 
> clone of the existing irq infrastructure) needs to be redesigned. 
> However I decided to put the rewrite on ice until I get the foundational 
> patches right.
> 
> 
> Daniel.
> 

Daniel, Mark - thanks for the info. I'll research the work done so far and
probably comeback later.

- Mario

^ permalink raw reply	[flat|nested] 7+ messages in thread

* arm/arm64 HARDLOCKUP Detector and PERF NMI support
@ 2016-01-11 20:06         ` Mario Smarduch
  0 siblings, 0 replies; 7+ messages in thread
From: Mario Smarduch @ 2016-01-11 20:06 UTC (permalink / raw)
  To: linux-arm-kernel



On 1/11/2016 3:25 AM, Daniel Thompson wrote:
> On 11/01/16 10:26, Mark Rutland wrote:
>> Hi,
>>
>> On Sat, Jan 09, 2016 at 04:13:48PM -0800, Mario Smarduch wrote:
>>> I'm trying to get HARDLOCKUP detector to work on arm (on foundation
>>> model and Juno, but armv7 should have the same issue). Turns out there is no
>>> PERF NMI support (HAVE_PERF_EVENTS_NMI), which I guess would be PMU NMI - I
>>> tested overflow on cycle counter and PMU interrupts can be masked. HARDLOCKUP
>>> assumes perf interrupts are non-maskable and uses the PMU to program an NMI to
>>> detect hard lockup and that in turn drives softlockup detection.
>>>
>>> Is there something, someplace in ARM manuals that addresses this, searched the
>>> manuals but couldn't find anything?
>>>
>>> Or other approaches that I'm not aware off or have floated on the mailing list.
>>
>> Russell and Daniel did some work [1,2] to use FIQs as NMIs on arm, for
>> backtracing and PMU overflow.
>  >
>> For arm64 the kernel always runs on the non-secure side, so we don't
>> expect to have access to FIQ. It's possible to implement NMIs using
>> priorities (which it looks like Daniel was looking into [3]).
> 
> Thanks Mark.
> 
> The blog post is still pretty much describes my ambitions and the 
> benefits these features can bring. It also has a link to a fairly 
> elderly kernel that contains all the features fully integrated.
> 
> There are more patchsets for both ARM (if/f FIQ is available) and ARM64 
> (if/f device has GICv3). However these only provide NMI backtrace.
> 
> arm:   http://thread.gmane.org/gmane.linux.kernel/2112583
> 
> arm64: http://thread.gmane.org/gmane.linux.kernel/2037735 (Mark's
>         link to my git repo is more up to date than this patchset)
> 
> To get the hard lockup and profiling support upstream then my old code 
> to integrate NMIs into the irq subsystem (which was just a cut down 
> clone of the existing irq infrastructure) needs to be redesigned. 
> However I decided to put the rewrite on ice until I get the foundational 
> patches right.
> 
> 
> Daniel.
> 

Daniel, Mark - thanks for the info. I'll research the work done so far and
probably comeback later.

- Mario

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-11 20:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <569199C0.9030500@samsung.com>
2016-01-10  0:13 ` arm/arm64 HARDLOCKUP Detector and PERF NMI support Mario Smarduch
2016-01-11 10:26   ` Mark Rutland
2016-01-11 10:26     ` Mark Rutland
2016-01-11 11:25     ` Daniel Thompson
2016-01-11 11:25       ` Daniel Thompson
2016-01-11 20:06       ` Mario Smarduch
2016-01-11 20:06         ` Mario Smarduch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.