From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v4 0/6] Nonatomic interrupt injection Date: Sun, 19 Sep 2010 11:25:40 +0200 Message-ID: <4C95D714.9080408@redhat.com> References: <1283168222-2242-1-git-send-email-avi@redhat.com> <4C921D17.3010603@redhat.com> <20100917191254.GA22281@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Gleb Natapov To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:48659 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751790Ab0ISJZp (ORCPT ); Sun, 19 Sep 2010 05:25:45 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8J9Pj1m014829 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 19 Sep 2010 05:25:45 -0400 In-Reply-To: <20100917191254.GA22281@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 09/17/2010 09:12 PM, Marcelo Tosatti wrote: > > This is now merged, with the change pointed out by Marcelo. Windows > > XP x64 fails installation without > > > > (vmx.c handle_cr()) > > case 8: { > > u8 cr8_prev = kvm_get_cr8(vcpu); > > u8 cr8 = kvm_register_read(vcpu, reg); > > kvm_set_cr8(vcpu, cr8); > > skip_emulated_instruction(vcpu); > > if (irqchip_in_kernel(vcpu->kvm)) > > return 1; > > - if (cr8_prev<= cr8) > > - return 1; > > vcpu->run->exit_reason = KVM_EXIT_SET_TPR; > > return 0; > > } > > > > Which doesn't make any sense (anyone?). The failure is present even > > without the patchset, and is fixed by the same hack, so a regression > > was not introduced. > > If userspace does not have an uptodate TPR value, it can signal an > interrupt that is now blocked? Say: > > - cr8 write 0 > - cr8 write 5 > - no exit to userspace > - userspace signals interrupt with priority > 4 because it knows about tpr == 0. > To signal an interrupt, userspace needs to force an exit. The exit will sync cr8. However, it may be that the decision to inject the interrupt is taken before the exit, so the interrupt is injected even though it shouldn't be. Let's assume that this is so (I'll check). Is this a bug in the kernel or userspace? My feeling is that this is a kernel bug, and the optimization should be removed. -- error compiling committee.c: too many arguments to function