From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752694Ab1LIJWv (ORCPT ); Fri, 9 Dec 2011 04:22:51 -0500 Received: from merlin.infradead.org ([205.233.59.134]:56727 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751326Ab1LIJWt convert rfc822-to-8bit (ORCPT ); Fri, 9 Dec 2011 04:22:49 -0500 Message-ID: <1323422521.17673.47.camel@twins> Subject: Re: [RFC][PATCH 3/3] x86: Add workaround to NMI iret woes From: Peter Zijlstra To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Thomas Gleixner , Linus Torvalds , "H. Peter Anvin" , Frederic Weisbecker , Jason Baron , Mathieu Desnoyers , "H. Peter Anvin" , Paul Turner Date: Fri, 09 Dec 2011 10:22:01 +0100 In-Reply-To: <1323398616.30977.167.camel@frodo> References: <20111208193003.112037550@goodmis.org> <20111208193136.366941904@goodmis.org> <1323373012.30977.123.camel@frodo> <1323398616.30977.167.camel@frodo> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Mailer: Evolution 3.2.1- Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2011-12-08 at 21:43 -0500, Steven Rostedt wrote: > On Thu, 2011-12-08 at 14:36 -0500, Steven Rostedt wrote: > > > I'm not sure how to handle this case. We could do something similar in > > the break point code to handle the same thing. But this just seems > > really ugly. > > > > Anyone with any better ideas? > > On IRC, Peter Zijlstra mentioned changing the IDT in NMI. I'm not sure > if he was joking or not. But I decided to try it out. It seems to > work :) Its was definitely tongue in cheek, also I did say this'll be a massive pain with paravirt since I doubt paravirt calls are NMI safe. But yeah, it might all be slightly less painful than trying to teach the INT3 handler about this recursion. This all started with wanting to do pagefaults from NMI context, those too will have this recursion, although for faults we'll end up in the double fault handler, which seems to allow a slightly saner way out.