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


Groups > linux.kernel > #1196147

Re: Dealing with the NMI mess

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: Dealing with the NMI mess
Date 2015-07-30 17:50 +0200
Message-ID <pRYfL-2Gd-7@gated-at.bofh.it> (permalink)
References (7 earlier) <pPPTk-5kZ-7@gated-at.bofh.it> <pPRir-7g3-31@gated-at.bofh.it> <pPRLs-86t-9@gated-at.bofh.it> <pPSeu-cZ-19@gated-at.bofh.it> <pPSo9-DT-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 24/07/2015 23:08, Andy Lutomirski wrote:
> user_icebp is set if int $0x01 happens, except it isn't because user
> code can't actually do that -- it'll cause #GP instead.
> 
> user_icebp is also set if the user has a bloody in-circuit emulator,
> given the name.  But who on Earth has one of those on a system new
> enough to run Linux and, even if they have one, why on Earth are they
> using it to send SIGTRAP.

You do not need either "int $0x01" or an ICE to set user_icebp = 1.  You
can use the 0xf1 opcode, which is kinda like 0xcc but generates #DB
instead of #BP.

The historical name is ICEBP because in-circuit emulators used it for
software breakpoints, just like your usual debugger used 0xcc aka int3.
 And just like 0xcc it's unprivileged, so you can actually get a SIGTRAP
with asm(".byte 0xf1").

So...

> In any event, user_icebp is only set if user_mode(regs), so it's safe
> locking-wise.  But please let's delete it.

... it's safe, but it has some use (!).

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

Re: Dealing with the NMI mess Steven Rostedt <rostedt@goodmis.org> - 2015-07-23 23:40 +0200
  Re: Dealing with the NMI mess Linus Torvalds <torvalds@linux-foundation.org> - 2015-07-23 23:50 +0200
    Re: Dealing with the NMI mess Andy Lutomirski <luto@amacapital.net> - 2015-07-24 00:00 +0200
      Re: Dealing with the NMI mess Linus Torvalds <torvalds@linux-foundation.org> - 2015-07-24 00:10 +0200
        Re: Dealing with the NMI mess Peter Zijlstra <peterz@infradead.org> - 2015-07-24 10:20 +0200
          Re: Dealing with the NMI mess Willy Tarreau <w@1wt.eu> - 2015-07-24 11:10 +0200
          Re: Dealing with the NMI mess Steven Rostedt <rostedt@goodmis.org> - 2015-07-24 14:00 +0200
            Re: Dealing with the NMI mess Peter Zijlstra <peterz@infradead.org> - 2015-07-24 14:50 +0200
              Re: Dealing with the NMI mess Steven Rostedt <rostedt@goodmis.org> - 2015-07-24 15:10 +0200
                Re: Dealing with the NMI mess Willy Tarreau <w@1wt.eu> - 2015-07-24 15:30 +0200
                Re: Dealing with the NMI mess Peter Zijlstra <peterz@infradead.org> - 2015-07-24 15:40 +0200
                Re: Dealing with the NMI mess Peter Zijlstra <peterz@infradead.org> - 2015-07-24 15:40 +0200
                Re: Dealing with the NMI mess Paolo Bonzini <pbonzini@redhat.com> - 2015-07-30 17:50 +0200
                Re: Dealing with the NMI mess Borislav Petkov <bp@alien8.de> - 2015-07-31 06:30 +0200
          Re: Dealing with the NMI mess Paolo Bonzini <pbonzini@redhat.com> - 2015-07-30 18:00 +0200
  Re: Dealing with the NMI mess Andy Lutomirski <luto@amacapital.net> - 2015-07-23 23:50 +0200
    Re: Dealing with the NMI mess Willy Tarreau <w@1wt.eu> - 2015-07-24 00:00 +0200
  Re: Dealing with the NMI mess Willy Tarreau <w@1wt.eu> - 2015-07-23 23:50 +0200

csiph-web