From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] KVM: VMX: Fix race between pending IRQ and NMI Date: Tue, 25 Nov 2008 15:55:23 +0100 Message-ID: <492C11DB.3060800@siemens.com> References: <491858C8.2040401@siemens.com> <49201213.1080305@redhat.com> <49203513.2080800@web.de> <4920392F.9020303@redhat.com> <49203EAF.3000800@web.de> <49244F20.3030803@redhat.com> <49248514.9020605@redhat.com> <49256649.6060801@siemens.com> <49256D38.4090908@redhat.com> <492687BE.9030307@siemens.com> <4927FA30.5020900@redhat.com> <492A7A0F.8020704@siemens.com> <492C0F6C.7060604@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: kvm-devel , "Xu, Jiajun" , "Yang, Sheng" To: Avi Kivity Return-path: Received: from lizzard.sbs.de ([194.138.37.39]:23876 "EHLO lizzard.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895AbYKYO5i (ORCPT ); Tue, 25 Nov 2008 09:57:38 -0500 In-Reply-To: <492C0F6C.7060604@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > Jan Kiszka wrote: >>>>> But I think I see a bigger issue - if we inject an regular interrupt >>>>> while another is pending, then we will encounter this problem. Looks >>>>> like we have to enable the interrupt window after injecting an >>>>> interrupt >>>>> if there are still pending interrupts. >>>>> >>>> Yeah, probably. I'm just wondering now if we can set >>>> exit-on-interrupt-window while the vcpu state is interruptible (ie. >>>> _before_ the injection). There is some entry check like this for NMIs, >>>> but maybe no for interrupts. Need to check. >>>> >>> Turns out it's not necessary, since the guest eoi will cause an exit and >>> allow the code to request an interrupt window. >>> >> >> But you added explicit handling now nevertheless? >> > > Yes, in case some eoi-less mode is introduced either by hardware or > paravirt. I regard the fact that it works as accidental (though applies > to x86 virtualization in general). > >>> I've added an apic test program so we can track these issues >>> (user/test/x86/apic.c). >>> >>> >> >> That's good. BTW, your NMI race fix is still lacking support for the >> -no-kvm-irqchip case. Will post an according patch later today. >> > > Actually, I couldn't get the 5.2 guest to boot with -no-kvm-irqchip: it > hangs and needs some help by running 'info registers'. Oh, yes, someone borked something here. That must have happened just recently I think. And it must be a userspace bug as some older kvm that happened to hang around here (-74) works fine against latest kernel. No time to investigate further right now, sorry. Jan -- Siemens AG, Corporate Technology, CT SE 2 ES-OS Corporate Competence Center Embedded Linux