lkml.org 
[lkml]   [2021]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC] IRQ handlers run with some high-priority interrupts(not NMI) enabled on some platform
On Sat, Feb 13, 2021 at 12:00 AM Song Bao Hua (Barry Song)
<song.bao.hua@hisilicon.com> wrote:
> > -----Original Message-----
> > From: Arnd Bergmann [mailto:arnd@kernel.org]
> > Sent: Saturday, February 13, 2021 11:34 AM
> > To: Song Bao Hua (Barry Song) <song.bao.hua@hisilicon.com>
> > Cc: tglx@linutronix.de; gregkh@linuxfoundation.org; arnd@arndb.de;
> > geert@linux-m68k.org; funaho@jurai.org; philb@gnu.org; corbet@lwn.net;
> > mingo@redhat.com; linux-m68k@lists.linux-m68k.org;
> > fthain@telegraphics.com.au; linux-kernel@vger.kernel.org
> > Subject: Re: [RFC] IRQ handlers run with some high-priority interrupts(not NMI)
> > enabled on some platform
> >
> > On Fri, Feb 12, 2021 at 2:18 AM Song Bao Hua (Barry Song)
> > <song.bao.hua@hisilicon.com> wrote:
> >
> > > So I am requesting comments on:
> > > 1. are we expecting all interrupts except NMI to be disabled in irq handler,
> > > or do we actually allow some high-priority interrupts between low and NMI
> > to
> > > come in some platforms?
> >
> > I tried to come to an answer but this does not seem particularly well-defined.
> > There are a few things I noticed:
> >
> > - going through the local_irq_save()/restore() implementations on all
> > architectures, I did not find any other ones besides m68k that leave
> > high-priority interrupts enabled. I did see that at least alpha and openrisc
> > are designed to support that in hardware, but the code just leaves the
> > interrupts disabled.
>
> The case is a little different. Explicit local_irq_save() does disable all
> high priority interrupts on m68k. The only difference is arch_irqs_disabled()
> of m68k will return true while low-priority interrupts are masked and high
> -priority are still open. M68k's hardIRQ also runs in this context with high
> priority interrupts enabled.

My point was that on most other architectures, local_irq_save()/restore()
always disables/enables all interrupts, while on m68k it restores the
specific level they were on before. On alpha, it does the same as on m68k,
but then the top-level interrupt handler just disables them all before calling
into any other code.

It's possible that I missed some other implementation doing the same
as m68k, as this code is fairly subtle on some architectures.

Arnd

\
 
 \ /
  Last update: 2021-02-13 00:08    [W:0.124 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site