From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750946AbbIGKT4 (ORCPT ); Mon, 7 Sep 2015 06:19:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36396 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbbIGKTy (ORCPT ); Mon, 7 Sep 2015 06:19:54 -0400 Subject: Re: Dealing with the NMI mess To: "Maciej W. Rozycki" , Ingo Molnar References: <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> <20150907074218.GC19280@gmail.com> Cc: Borislav Petkov , Andy Lutomirski , 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: <55ED64C1.9090607@redhat.com> Date: Mon, 7 Sep 2015 12:19:45 +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: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/09/2015 10:19, Maciej W. Rozycki wrote: >> > Essentially the ICE breakpoint instruction enters SMM mode? > I didn't do stuff at the probe firmware level so I can't say for sure, > but my gut feeling is the debug mode is indeed very close if not the same > as SMM. I think duplicating the logic would be an unnecessary waste of > silicon. I researched SMM a bit recently in order to implement it in KVM, and the best source of folklore seems to be http://www.rcollins.org/ddj (which I also have on paper :)). The author there says that SMM design was roughly based on the 386's probe/ICE mode design, but it's actually separate. Most notably, on the 386 the state save areas almost mirror each other, but when I say mirror... I do mean mirror: directions are reversed, and what is on top for probe mode is on bottom for SMM. :) In addition, AMD tried reusing ICE mode for SMM, and was sued by Intel who actually won the lawsuit. I couldn't find more information about the lawsuit. It's probably diverged more and more over time, for example because SMM is now considered security-sensitive while probe mode isn't. In addition, the same DDJ article says that Pentium JTAG probe mode "doesn't resemble SMM at all, doesn't use a state save map, or even execute any code of its own", whatever that means. Paolo > And obviously it's any cause of #DB that enters this mode. The probe can > also request it right at the exit from the reset state, so that you can > debug software (e.g BIOS startup) right from the reset vector. You don't > need working RAM for that.