public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 2/2] Interrupt unhalts vcpu when it shouldn't
Date: Mon, 23 Mar 2009 16:31:28 +0200	[thread overview]
Message-ID: <49C79D40.4000101@redhat.com> (raw)
In-Reply-To: <20090323101211.25798.89641.stgit@dhcp-1-237.tlv.redhat.com>

Gleb Natapov wrote:
> kvm_vcpu_block() unhalts vpu on an interrupt/timer without checking
> if interrupt window is actually opened.
>
>  
> +static int svm_interrupt_allowed(struct kvm_vcpu *vcpu)
> +{
> +	struct vcpu_svm *svm = to_svm(vcpu);
> +	struct vmcb *vmcb = svm->vmcb;
> +	return (vmcb->save.rflags & X86_EFLAGS_IF) && 
> +		!(vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) &&
> +		(svm->vcpu.arch.hflags & HF_GIF_MASK);
> +}
> +
>  
> +static int vmx_interrupt_allowed(struct kvm_vcpu *vcpu)
> +{
> +	vmx_update_window_states(vcpu);
> +	return vcpu->arch.interrupt_window_open;
> +}
> +
>  static void kvm_do_inject_irq(struct kvm_vcpu *vcpu)
>  }
> +
> +int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu)
> +{
> +	return kvm_x86_ops->interrupt_allowed(vcpu);
> +}
>   

If the guest enables interrupts but sets tpr/cr8 to block interrupts, 
we'll spin (like we do now).

So I think this should be called kvm_arch_can_accept_interrupt() and 
take tpr into account.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2009-03-23 14:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-23 10:12 [PATCH 1/2] Timer event should not unconditionally unhalt vcpu Gleb Natapov
2009-03-23 10:12 ` [PATCH 2/2] Interrupt unhalts vcpu when it shouldn't Gleb Natapov
2009-03-23 14:31   ` Avi Kivity [this message]
2009-03-23 15:17     ` Avi Kivity
2009-03-24  5:24       ` Sheng Yang
2009-03-24 10:13   ` Avi Kivity
2009-03-23 13:11 ` [PATCH 1/2] Timer event should not unconditionally unhalt vcpu Gleb Natapov
2009-03-23 14:26   ` Avi Kivity
2009-03-23 16:50     ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49C79D40.4000101@redhat.com \
    --to=avi@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox