From: Jan Kiszka <jan.kiszka@siemens.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm <kvm@vger.kernel.org>
Subject: Re: qemu-kvm: event writeback can overwrite interrupts with -no-kvm-irqchip
Date: Tue, 04 May 2010 10:45:31 +0200 [thread overview]
Message-ID: <4BDFDEAB.90608@siemens.com> (raw)
In-Reply-To: <20100504021555.GA31205@amt.cnet>
Marcelo Tosatti wrote:
> Interrupts that are injected during a vcpu event save/writeback cycle
> are lost.
>
> Fix by writebacking the state before injecting interrupts.
Good catch.
If that code were to stay, I would now suggest to move the injection
into pre_kvm_run instead, just like upstream does. But it I guess that
doesn't matters anymore.
Jan
>
> 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)
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2010-05-04 8:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-04 2:15 qemu-kvm: event writeback can overwrite interrupts with -no-kvm-irqchip Marcelo Tosatti
2010-05-04 8:45 ` Jan Kiszka [this message]
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=4BDFDEAB.90608@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/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.