Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1494024

Re: NMI for ARC

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: NMI for ARC
Date 2016-09-30 12:50 +0200
Message-ID <sn3ya-FI-11@gated-at.bofh.it> (permalink)
References (5 earlier) <smykF-5Vn-1@gated-at.bofh.it> <smDkm-ut-7@gated-at.bofh.it> <smMH0-6yY-35@gated-at.bofh.it> <smOIO-7Q7-21@gated-at.bofh.it> <smPvc-8lN-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Sep 29, 2016 at 12:48:03PM -0700, Vineet Gupta wrote:
> > [1] There's an exception on 64-bit AMD CPUs because AMD blew it.
> > Also, x86 NMI return is itself severely overcomplicated because we don't
> > have good control over NMI nesting.
> 
> For ARC (HS38 cores), there are 16 interrupt priorities (0-high, 15-lowest) and
> each active interrupt has a bit in AUX_IRQ_ACTIVE. If a prio X is active, another
> prio X can't be taken (you can only take higher prio). In that sense nmi (aka prio
> 0) can't nest for us.

Forget you ever read this; the reason for the nested NMIs on x86 is
horrid, but here goes:

The problem is that IRET, the only instruction capable of returning from
_any_ trap/fault/interrupt context automagically unmasks NMIs. And we
'want' to take debug-traps and page-faults from NMI context.

We use debug-traps to synchronize against self-modifying code without
halting the entire machine.

We 'need' page-faults for vmalloc backed memory, the vmalloc page tables
are not globally propagated and we need (minor) faults to populate the
page-tables on demand. And we need page-faults to do user-space access
from NMI context (for the fixup_exception stuff).

Returning from either trap or fault is done through IRET, which then
unmasks NMIs, allowing another NMI to come in while we're still
servicing one.

We have quite the horror cabinet for dealing with this ;-)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: NMI for ARC Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-09-28 02:30 +0200
  Re: NMI for ARC Peter Zijlstra <peterz@infradead.org> - 2016-09-28 09:20 +0200
    Re: NMI for ARC Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-09-28 20:10 +0200
    Re: NMI for ARC Andy Lutomirski <luto@amacapital.net> - 2016-09-28 21:30 +0200
      Re: NMI for ARC Peter Zijlstra <peterz@infradead.org> - 2016-09-28 22:40 +0200
        Re: NMI for ARC Andy Lutomirski <luto@amacapital.net> - 2016-09-29 00:30 +0200
          Re: NMI for ARC Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-09-29 00:50 +0200
            Re: NMI for ARC Andy Lutomirski <luto@amacapital.net> - 2016-09-29 00:50 +0200
          Re: NMI for ARC Vineet Gupta <vgupta@synopsys.com> - 2016-09-29 03:30 +0200
            Re: NMI for ARC Peter Zijlstra <peterz@infradead.org> - 2016-09-29 08:50 +0200
              Re: NMI for ARC Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-09-29 18:50 +0200
                Re: NMI for ARC Andy Lutomirski <luto@amacapital.net> - 2016-09-29 21:00 +0200
                Re: NMI for ARC Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-09-29 21:50 +0200
                Re: NMI for ARC Peter Zijlstra <peterz@infradead.org> - 2016-09-30 12:50 +0200
            Re: NMI for ARC Andy Lutomirski <luto@amacapital.net> - 2016-09-29 19:40 +0200

csiph-web