kvm: Unconditionally reenter kernel after IO exits
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 1 Feb 2011 21:16:00 +0000 (22:16 +0100)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 14 Feb 2011 14:39:45 +0000 (12:39 -0200)
commite05258a7b463e94a6c3b30990b0b9ed583159707
treecee730527305c5762b2288a26c86227d3981d987
parentb2f7f2bd40b718f4c928d6767b9b666b5ce2b2df
kvm: Unconditionally reenter kernel after IO exits

KVM requires to reenter the kernel after IO exits in order to complete
instruction emulation. Failing to do so will leave the kernel state
inconsistently behind. To ensure that we will get back ASAP, we issue a
self-signal that will cause KVM_RUN to return once the pending
operations are completed.

We can move kvm_arch_process_irqchip_events out of the inner VCPU loop.
The only state that mattered at its old place was a pending INIT
request. Catch it in kvm_arch_pre_run and also trigger a self-signal to
process the request on next kvm_cpu_exec.

This patch also fixes the missing exit_request check in kvm_cpu_exec in
the CONFIG_IOTHREAD case.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
CC: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
kvm-all.c
target-i386/kvm.c