From: Marcelo Tosatti <mtosatti@redhat.com>
To: kvm <kvm@vger.kernel.org>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Subject: qemu-kvm: event writeback can overwrite interrupts with -no-kvm-irqchip
Date: Mon, 3 May 2010 23:15:55 -0300 [thread overview]
Message-ID: <20100504021555.GA31205@amt.cnet> (raw)
Interrupts that are injected during a vcpu event save/writeback cycle
are lost.
Fix by writebacking the state before injecting interrupts.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
diff --git a/qemu-kvm.c b/qemu-kvm.c
index 91f0222..90ace20 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -885,11 +885,6 @@ int pre_kvm_run(kvm_context_t kvm, CPUState *env)
{
kvm_arch_pre_run(env, env->kvm_run);
- if (env->kvm_vcpu_dirty) {
- kvm_arch_load_regs(env, KVM_PUT_RUNTIME_STATE);
- env->kvm_vcpu_dirty = 0;
- }
-
pthread_mutex_unlock(&qemu_mutex);
return 0;
}
@@ -907,6 +902,10 @@ int kvm_run(CPUState *env)
int fd = env->kvm_fd;
again:
+ if (env->kvm_vcpu_dirty) {
+ kvm_arch_load_regs(env, KVM_PUT_RUNTIME_STATE);
+ env->kvm_vcpu_dirty = 0;
+ }
push_nmi(kvm);
#if !defined(__s390__)
if (!kvm->irqchip_in_kernel)
next reply other threads:[~2010-05-04 2:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-04 2:15 Marcelo Tosatti [this message]
2010-05-04 8:45 ` qemu-kvm: event writeback can overwrite interrupts with -no-kvm-irqchip Jan Kiszka
2010-05-05 8:46 ` Avi Kivity
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=20100504021555.GA31205@amt.cnet \
--to=mtosatti@redhat.com \
--cc=jan.kiszka@siemens.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 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.