From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 3/4] KVM: VMX: Emulated real mode interrupt injection Date: Tue, 21 Sep 2010 13:56:50 +0200 Message-ID: <4C989D82.7030905@redhat.com> References: <1284899648-19958-1-git-send-email-avi@redhat.com> <1284899648-19958-4-git-send-email-avi@redhat.com> <20100920173004.GA25233@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, Mohammed Gamal To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46901 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750771Ab0IUL45 (ORCPT ); Tue, 21 Sep 2010 07:56:57 -0400 In-Reply-To: <20100920173004.GA25233@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 09/20/2010 07:30 PM, Marcelo Tosatti wrote: > > static void __vmx_complete_interrupts(struct vcpu_vmx *vmx, > > u32 idt_vectoring_info, > > int instr_len_field, > > @@ -3864,9 +3814,6 @@ static void __vmx_complete_interrupts(struct vcpu_vmx *vmx, > > int type; > > bool idtv_info_valid; > > > > - if (vmx->rmode.irq.pending) > > - fixup_rmode_irq(vmx,&idt_vectoring_info); > > - > > Don't you have to undo kvm_inject_realmode_interrupt if injection fails? > > Injection cannot fail (at least, in the same sense as the vmx injections). It's actually not about failures, it's about guest entry being cancelled due to a signal or some KVM_REQ that needs attention. For vmx style injections, we need to undo the injection to keep things in a consistent state. To realmode emulated injection, everything is in a consistent state already, so no need to undo anything (it's also impossible, since we overwrote memory on the stack). -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.