Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752300AbbGaJ1V (ORCPT ); Fri, 31 Jul 2015 05:27:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57018 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751158AbbGaJ1S (ORCPT ); Fri, 31 Jul 2015 05:27:18 -0400 Subject: Re: Dealing with the NMI mess To: Borislav Petkov , Andy Lutomirski References: <20150724153054.GK19282@twins.programming.kicks-ass.net> <20150724195509.GM2859@worktop.programming.kicks-ass.net> <20150724205119.GM19282@twins.programming.kicks-ass.net> <55BA45A2.8050909@redhat.com> <20150731042205.GB32117@nazgul.tnic> <20150731080303.GA2128@nazgul.tnic> Cc: Peter Zijlstra , Linus Torvalds , Willy Tarreau , Steven Rostedt , X86 ML , "linux-kernel@vger.kernel.org" , Thomas Gleixner , Brian Gerst From: Paolo Bonzini X-Enigmail-Draft-Status: N1110 Message-ID: <55BB3F71.1060307@redhat.com> Date: Fri, 31 Jul 2015 11:27:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150731080303.GA2128@nazgul.tnic> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1819 Lines: 45 On 31/07/2015 10:03, Borislav Petkov wrote: > $ ./icebp > Trace/breakpoint trap > > ^ this in qemu. Is the strace different between KVM and baremetal? QEMU dynamic translation is broken I think, but KVM should be the same as baremetal. >> Fortunately, it looks like the vm86 case is correct (or as correct as >> any of the vm86 junk can be), although I haven't tested it. I bet >> that icebp is like int3 in that it punches through vm86 mode instead >> of sending #GP. > > Yeah, INT 1. I wonder whether INT 1, i.e. CD imm8 does the same thing. No, it sends #GP. > But why do you say it is special - it simply raises #DB, i.e. vector 1. > Web page seems to say so when interrupt redirection is disabled. It > sounds like a nice and quick way to generate a breakpoint. You can do > that with INT 01, i.e., the CD opcode, too. > > If I'd had to guess, it isn't documented because of the proprietary ICE > aspect. And no one uses ICEs anymore so it is going to be forgotten with > people popping off and on and asking about the undocumented opcode. The reason why it isn't documented is probably hidden within Intel. Besides ICEBP, which is a bit fringe, there's no reason not to document SALC which Thomas mentioned. SALC all has been there since the 8086, and has been undocumented for thirty-odd years. The AAM/AAD variants with immediates other than 10 also have been undocumented for fifteen years or so (an instruction doing a division by 10 where the second byte of the opcode is 10? oh, certainly no one is going to try changing the second byte...) 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/