From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932854Ab0I0J1W (ORCPT ); Mon, 27 Sep 2010 05:27:22 -0400 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 Message-ID: <4CA06373.5030501@redhat.com> Date: Mon, 27 Sep 2010 11:27:15 +0200 From: Avi Kivity User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Lightning/1.0b3pre Thunderbird/3.1.4 MIME-Version: 1.0 To: Alexander Graf CC: x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH] x86, nmi: workaround sti; hlt race vs nmi; intr 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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