From: Paolo Bonzini <pbonzini@redhat.com>
To: Nadav Amit <namit@cs.technion.ac.il>
Cc: gleb@kernel.org, tglx@linutronix.de, mingo@redhat.com,
x86@kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] KVM: x86: Pending interrupt may be delivered after INIT
Date: Wed, 09 Jul 2014 18:10:28 +0200 [thread overview]
Message-ID: <53BD6974.8010306@redhat.com> (raw)
In-Reply-To: <1404118982-9429-1-git-send-email-namit@cs.technion.ac.il>
Il 30/06/2014 11:03, Nadav Amit ha scritto:
> We encountered a scenario in which after an INIT is delivered, a pending
> interrupt is delivered, although it was sent before the INIT. As the SDM
> states in section 10.4.7.1, the ISR and the IRR should be cleared after INIT as
> KVM does. This also means that pending interrupts should be cleared. This
> patch clears upon reset (and INIT) the pending interrupts; and at the same
> occassion clears the pending exceptions, since they may cause a similar issue.
>
> Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
> ---
> arch/x86/kvm/x86.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index f32a025..6425a31 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -6835,6 +6835,8 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcpu)
> atomic_set(&vcpu->arch.nmi_queued, 0);
> vcpu->arch.nmi_pending = 0;
> vcpu->arch.nmi_injected = false;
> + kvm_clear_interrupt_queue(vcpu);
> + kvm_clear_exception_queue(vcpu);
>
> memset(vcpu->arch.db, 0, sizeof(vcpu->arch.db));
> vcpu->arch.dr6 = DR6_FIXED_1;
>
Applied to kvm/queue, thanks.
Paolo
prev parent reply other threads:[~2014-07-09 16:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-30 8:35 [PATCH] KVM: x86: Pending interrupt may be delivered after INIT Nadav Amit
2014-06-30 8:47 ` Gleb Natapov
2014-06-30 9:03 ` [PATCH v2] " Nadav Amit
2014-07-09 16:10 ` Paolo Bonzini [this message]
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=53BD6974.8010306@redhat.com \
--to=pbonzini@redhat.com \
--cc=gleb@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namit@cs.technion.ac.il \
--cc=tglx@linutronix.de \
--cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.