From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] x86, nmi: workaround sti; hlt race vs nmi; intr Date: Mon, 27 Sep 2010 11:27:15 +0200 Message-ID: <4CA06373.5030501@redhat.com> References: <1284913699-14986-1-git-send-email-avi@redhat.com> <4CA057EA.7000609@redhat.com> <768A5DC0-131A-4BC8-ADDD-044D8169545E@suse.de> <61284934-1AD3-4F7A-9488-D46FCEE9B753@suse.de> <4CA06147.7080805@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org To: Alexander Graf Return-path: Received: from mx1.redhat.com ([209.132.183.28]:61491 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932376Ab0I0J1V (ORCPT ); Mon, 27 Sep 2010 05:27:21 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 09/27/2010 11:22 AM, Alexander Graf wrote: > On 27.09.2010, at 11:17, Avi Kivity wrote: > > > On 09/27/2010 11:15 AM, Alexander Graf wrote: > >> > > >> > Wow, this is incredibly ugly :). Can't we just mask NMIs when the interrupt shadow is active? > > > > I plan to do that, for all the code that's out there relying on on STI interrupt shadow masking NMIs. > > > >> Yeah, that's me writing without thinking. So this means that the race can also happen on real hardware? > >> > > > > Yes. At least on documented hardware. Some (most? all?) hardware does mask NMIs after STI. > > If all hardware masks NMIs after STI, wouldn't it be better to update the spec and declare KVM buggy for injecting NMIs there? > I don't have write permissions for the spec. If you can verify that all existing and future hardware will mask NMI after STI and convince the spec owners to update the specifications, I'm all for it; it's certainly a cleaner solution. Note these days hardware includes virtual hardware; though it's less affected. Missing a wakeup is critical for real time systems -- virtualized systems are unlikely to notice it unless they have exactly one interrupt source. -- error compiling committee.c: too many arguments to function