From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC PATCH 3/3] VMX: Emulated real mode interrupt injection Date: Mon, 09 Aug 2010 23:03:26 -0400 Message-ID: <4C60C17E.1090606@redhat.com> References: <1281295456-11114-1-git-send-email-m.gamal005@gmail.com> <1281295456-11114-4-git-send-email-m.gamal005@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, kvm@vger.kernel.org, Jan Kiszka To: Mohammed Gamal Return-path: Received: from mx1.redhat.com ([209.132.183.28]:18584 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755532Ab0HJDDl (ORCPT ); Mon, 9 Aug 2010 23:03:41 -0400 In-Reply-To: <1281295456-11114-4-git-send-email-m.gamal005@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/08/2010 03:24 PM, Mohammed Gamal wrote: > Signed-off-by: Mohammed Gamal > --- > arch/x86/kvm/vmx.c | 11 +---------- > 1 files changed, 1 insertions(+), 10 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 652d317..d6cb7eb 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -2838,16 +2838,7 @@ static void vmx_inject_irq(struct kvm_vcpu *vcpu) > > ++vcpu->stat.irq_injections; > if (vmx->rmode.vm86_active) { > - vmx->rmode.irq.pending = true; > - vmx->rmode.irq.vector = irq; > - vmx->rmode.irq.rip = kvm_rip_read(vcpu); > - if (vcpu->arch.interrupt.soft) > - vmx->rmode.irq.rip += > - vmx->vcpu.arch.event_exit_inst_len; This has to be covered somehow. Not sure exactly - probably keep the same code. Jan? > - vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, > - irq | INTR_TYPE_SOFT_INTR | INTR_INFO_VALID_MASK); > - vmcs_write32(VM_ENTRY_INSTRUCTION_LEN, 1); > - kvm_rip_write(vcpu, vmx->rmode.irq.rip - 1); > + inject_realmode_interrupt(vcpu, irq); > return; > } Error checks? Need to do same to vmx_inject_nmi(). fixup_rmode_irq() just became dead code, you can remove it. Also remove the entire vmx->rmode.irq thing. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.