Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752655AbbG3XAJ (ORCPT ); Thu, 30 Jul 2015 19:00:09 -0400 Received: from www.linutronix.de ([62.245.132.108]:49025 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752266AbbG3XAD (ORCPT ); Thu, 30 Jul 2015 19:00:03 -0400 Date: Fri, 31 Jul 2015 00:59:20 +0200 (CEST) From: Thomas Gleixner To: Andy Lutomirski cc: Paolo Bonzini , Peter Zijlstra , Linus Torvalds , Willy Tarreau , Steven Rostedt , X86 ML , "linux-kernel@vger.kernel.org" , Borislav Petkov , Brian Gerst Subject: Re: Dealing with the NMI mess In-Reply-To: Message-ID: References: <20150724090342.6d11e16d@gandalf.local.home> <20150724132128.GA3612@1wt.eu> <20150724103127.3c3f4693@gandalf.local.home> <20150724145901.GB3612@1wt.eu> <20150724111621.34713023@gandalf.local.home> <20150724152637.GC3612@1wt.eu> <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> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1750 Lines: 53 On Thu, 30 Jul 2015, Andy Lutomirski wrote: > On Thu, Jul 30, 2015 at 8:41 AM, Paolo Bonzini wrote: > > > > > > 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. > > Great. There's an opcode that invokes an interrupt gate that's not > marked as allowing unprivileged access, and that opcode doesn't appear > in the SDM. It appears in the APM opcode map with no explanation at > all. The only SDM reference I found is: "The opcodes D6 and F1 are undefined opcodes reserved by the Intel 64 and IA-32 architectures. These opcodes, even though undefined, do not generate an invalid opcode exception." D6 is actually something useful: if (carry flag set) AL = FF else AL = 0 It's been there since i386. It has been conveniant for return code magic from ASM to C. I haven't thought of it for at least a decade :) So all we need to worry about is F1, but thats bad enough :( Thanks, tglx -- 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/