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