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 18:00:08 +0200 Message-ID: <4C98D688.2080303@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> <4C989D82.7030905@redhat.com> <20100921153638.GA21304@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]:5824 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757393Ab0IUQAP (ORCPT ); Tue, 21 Sep 2010 12:00:15 -0400 In-Reply-To: <20100921153638.GA21304@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 09/21/2010 05:36 PM, Marcelo Tosatti wrote: > On Tue, Sep 21, 2010 at 01:56:50PM +0200, Avi Kivity wrote: > > 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). > > Aren't you going to push EFLAGS,CS,EIP on the stack twice if that > occurs? > No, since we clear the pending flag (we do that even for vmx-injected interrupts; then cancel or injection failure re-sets the flag). -- error compiling committee.c: too many arguments to function