aboutsummaryrefslogtreecommitdiff
path: root/target-s390x
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2015-06-18 18:47:23 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-07-01 15:45:51 +0200
commit4b8523ee896750c37b4fa224a40d34703cbdf4c6 (patch)
tree1083d1e6c59b33c68808094d4b6844ddf935c9f0 /target-s390x
parent4840f10eff37eebc609fcc933ab985dc66df95c6 (diff)
downloadqemu-4b8523ee896750c37b4fa224a40d34703cbdf4c6.zip
qemu-4b8523ee896750c37b4fa224a40d34703cbdf4c6.tar.gz
qemu-4b8523ee896750c37b4fa224a40d34703cbdf4c6.tar.bz2
kvm: First step to push iothread lock out of inner run loop
This opens the path to get rid of the iothread lock on vmexits in KVM mode. On x86, the in-kernel irqchips has to be used because we otherwise need to synchronize APIC and other per-cpu state accesses that could be changed concurrently. Regarding pre/post-run callbacks, s390x and ARM should be fine without specific locking as the callbacks are empty. MIPS and POWER require locking for the pre-run callback. For the handle_exit callback, it is non-empty in x86, POWER and s390. Some POWER cases could do without the locking, but it is left in place for now. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1434646046-27150-7-git-send-email-pbonzini@redhat.com>
Diffstat (limited to 'target-s390x')
-rw-r--r--target-s390x/kvm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 135111a..ae3a0af 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -2007,6 +2007,8 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
S390CPU *cpu = S390_CPU(cs);
int ret = 0;
+ qemu_mutex_lock_iothread();
+
switch (run->exit_reason) {
case KVM_EXIT_S390_SIEIC:
ret = handle_intercept(cpu);
@@ -2027,6 +2029,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
fprintf(stderr, "Unknown KVM exit: %d\n", run->exit_reason);
break;
}
+ qemu_mutex_unlock_iothread();
if (ret == 0) {
ret = EXCP_INTERRUPT;