From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/2] deal with interrupt shadow state for emulated instruction Date: Sun, 10 May 2009 16:09:48 +0300 Message-ID: <4A06D21C.2060008@redhat.com> References: <1241814187-5973-1-git-send-email-glommer@redhat.com> <1241814187-5973-2-git-send-email-glommer@redhat.com> <1241814187-5973-3-git-send-email-glommer@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, "H. Peter Anvin" , Gleb Natapov To: Glauber Costa Return-path: Received: from mx2.redhat.com ([66.187.237.31]:34581 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752024AbZEJNKt (ORCPT ); Sun, 10 May 2009 09:10:49 -0400 In-Reply-To: <1241814187-5973-3-git-send-email-glommer@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Glauber Costa wrote: > we currently unblock shadow interrupt state when we skip an instruction, > but failing to do so when we actually emulate one. This blocks interrupts > in key instruction blocks, in particular sti; hlt; sequences > > If the instruction emulated is an sti, we have to block shadow interrupts. > The same goes for mov ss. pop ss also needs it, but we don't currently > emulate it. > > Without this patch, I cannot boot gpxe option roms at vmx machines. > This is described at https://bugzilla.redhat.com/show_bug.cgi?id=494469 > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 3d8fcc5..c456aa5 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -2362,7 +2362,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu, > u16 error_code, > int emulation_type) > { > - int r; > + int r, shadow_mask; > struct decode_cache *c; > > kvm_clear_exception_queue(vcpu); > @@ -2415,7 +2415,12 @@ int emulate_instruction(struct kvm_vcpu *vcpu, > return EMULATE_DONE; > } > > + vcpu->arch.emulate_ctxt.interruptibility = 0; > If the instruction is sti or mov ss, this is ouput only. Otherwise, it is an input/output parameter. To reduce confusion suggest moving this statement to x86_emulate_insn, so it can be an output-only parameter. -- error compiling committee.c: too many arguments to function