summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-08 19:50:24 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-08 19:50:24 +0000
commit9e472e101f37233f4e32d181d2fee29014c1cf2f (patch)
tree11355529c87a6dce782b8500ce53236b4744600c /vl.c
parent235262cf364a839d94e7e9d5b469ac8efb703285 (diff)
downloadqemu-9e472e101f37233f4e32d181d2fee29014c1cf2f.zip
Fix IO performance regression in sparc
Replace signalfd with signal handler/pipe. There is no way to interrupt the CPU execution loop when a file descriptor becomes readable. This results in a large performance regression in sparc emulation during bootup. This patch switches us to signal handler/pipe which was originally suggested by Ian Jackson. The signal handler lets us interrupt the CPU emulation loop while the write to a pipe lets us avoid the select/signal race condition. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5451 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index 5fe288e086..e8410a8a1b 100644
--- a/vl.c
+++ b/vl.c
@@ -7475,6 +7475,19 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
return 0;
}
+void qemu_service_io(void)
+{
+ CPUState *env = cpu_single_env;
+ if (env) {
+ cpu_interrupt(env, CPU_INTERRUPT_EXIT);
+#ifdef USE_KQEMU
+ if (env->kqemu_enabled) {
+ kqemu_cpu_interrupt(env);
+ }
+#endif
+ }
+}
+
/***********************************************************/
/* bottom halves (can be seen as timers which expire ASAP) */