From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 3/4] KVM: VMX: Emulated real mode interrupt injection Date: Tue, 21 Sep 2010 12:36:38 -0300 Message-ID: <20100921153638.GA21304@amt.cnet> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, Mohammed Gamal To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:25629 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753469Ab0IUP7P (ORCPT ); Tue, 21 Sep 2010 11:59:15 -0400 Content-Disposition: inline In-Reply-To: <4C989D82.7030905@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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? Yes, can't undo it...