Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754618AbbGXRVo (ORCPT ); Fri, 24 Jul 2015 13:21:44 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:9599 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754584AbbGXRVm (ORCPT ); Fri, 24 Jul 2015 13:21:42 -0400 Date: Fri, 24 Jul 2015 19:21:00 +0200 From: Willy Tarreau To: Andy Lutomirski Cc: Peter Zijlstra , Linus Torvalds , Steven Rostedt , X86 ML , "linux-kernel@vger.kernel.org" , Borislav Petkov , Thomas Gleixner , Brian Gerst Subject: Re: Dealing with the NMI mess Message-ID: <20150724172100.GA3725@1wt.eu> References: <20150723173105.6795c0dc@gandalf.local.home> <20150724081326.GO25159@twins.programming.kicks-ass.net> <20150724171018.GH3612@1wt.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150724171018.GH3612@1wt.eu> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1108 Lines: 23 On Fri, Jul 24, 2015 at 07:10:18PM +0200, Willy Tarreau wrote: > The OS has to set the RSP by itself before doing SYSRET, which opens a > race between "mov rsp" and "sysret", but if we only take that path once > we figure we come from NMI (using just IF+RSP), we know that IRQs and > NMIs are still disabled and cannot strike at this instant. Maybe MCEs > can, but they would execute within the NMI's stack just as if they were > triggered inside the NMI as well so I don't see a problem here. OK too bad I just found the response here in the code :-( * SYSRET can't restore RF. SYSRET can restore TF, but unlike IRET, * restoring TF results in a trap from userspace immediately after * SYSRET. This would cause an infinite loop whenever #DB happens * with register state that satisfies the opportunistic SYSRET * conditions. Willy -- 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/