* qemu-kvm: event writeback can overwrite interrupts with -no-kvm-irqchip
@ 2010-05-04 2:15 Marcelo Tosatti
2010-05-04 8:45 ` Jan Kiszka
2010-05-05 8:46 ` Avi Kivity
0 siblings, 2 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2010-05-04 2:15 UTC (permalink / raw)
To: kvm; +Cc: Jan Kiszka
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)
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: qemu-kvm: event writeback can overwrite interrupts with -no-kvm-irqchip
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
2010-05-05 8:46 ` Avi Kivity
1 sibling, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2010-05-04 8:45 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: qemu-kvm: event writeback can overwrite interrupts with -no-kvm-irqchip
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
@ 2010-05-05 8:46 ` Avi Kivity
1 sibling, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2010-05-05 8:46 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm, Jan Kiszka
On 05/04/2010 05:15 AM, Marcelo Tosatti wrote:
> Interrupts that are injected during a vcpu event save/writeback cycle
> are lost.
>
> Fix by writebacking the state before injecting interrupts.
>
Applied, thanks.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-05-05 8:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2010-05-05 8:46 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox