diff options
author | Xin Xiaohui <xiaohui.xin@intel.com> | 2013-01-08 11:21:56 +0800 |
---|---|---|
committer | Zhai Edwin <edwin.zhai@intel.com> | 2013-01-08 13:23:13 +0800 |
commit | 7277e47f8620332991a644c7964445a3340c4ce0 (patch) | |
tree | 8ffa951182051a340278bfa0c2fa4d2bdb8acaf3 | |
parent | ed1f5b04b2d9dacd4742b5dc8f117b7c05ba7c5c (diff) | |
download | qemu-7277e47f8620332991a644c7964445a3340c4ce0.tar.gz qemu-7277e47f8620332991a644c7964445a3340c4ce0.tar.bz2 qemu-7277e47f8620332991a644c7964445a3340c4ce0.zip |
From 8fdd165fa910de700649f05f2b074a21e18500d4 Mon Sep 17 00:00:00 2001
Subject: [PATCH] Re-add qemu_notify_hax_event()
Signed-off-by: Xin Xiaohui <xiaohui.xin@intel.com>
Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | cpus.c | 11 | ||||
-rw-r--r-- | hax-stub.c | 2 | ||||
-rw-r--r-- | hax.h | 18 | ||||
-rw-r--r-- | main-loop.c | 9 | ||||
-rw-r--r-- | main-loop.h | 8 | ||||
-rw-r--r-- | target-i386/hax-all.c | 2 |
7 files changed, 34 insertions, 17 deletions
@@ -156,6 +156,7 @@ tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \ qemu-timer-common.o main-loop.o notify.o \ iohandler.o cutils.o iov.o async.o tools-obj-$(CONFIG_POSIX) += compatfd.o +tools-obj-$(CONFIG_HAX_BACKEND) += hax-stub.o qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y) qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y) @@ -1349,12 +1349,15 @@ void qmp_inject_nmi(Error **errp) #endif } -#ifdef CONFIG_HAX +#ifdef CONFIG_HAX void qemu_notify_hax_event(void) { - CPUArchState *env = cpu_single_env; + CPUArchState *env = NULL; - if (hax_enabled() && env) - hax_raise_event(env); + if (hax_enabled()) { + for (env = first_cpu; env != NULL; env = env->next_cpu) { + hax_raise_event(env); + } + } } #endif diff --git a/hax-stub.c b/hax-stub.c index 9e200a07b2..c939f452fe 100644 --- a/hax-stub.c +++ b/hax-stub.c @@ -35,7 +35,7 @@ void hax_disable(int disable) return; } -int hax_pre_init(ram_addr_t ram_size) +int hax_pre_init(uint64_t ram_size) { return 0; } @@ -22,20 +22,22 @@ #include "config-host.h" #include "qemu-common.h" -//#include "cpu.h" -#include "kvm.h" -#include "hw/hw.h" -#include "bitops.h" -#include "memory.h" #define dprint printf #ifdef CONFIG_HAX_BACKEND int hax_enabled(void); void hax_disable(int disable); -int hax_pre_init(ram_addr_t ram_size); +int hax_pre_init(uint64_t ram_size); int hax_accel_init(void); int hax_sync_vcpus(void); + #ifdef CONFIG_HAX +//#include "cpu.h" +#include "kvm.h" +#include "hw/hw.h" +#include "bitops.h" +#include "memory.h" + int hax_init_vcpu(CPUArchState *env); int hax_vcpu_exec(CPUArchState *env); void hax_vcpu_sync_state(CPUArchState *env, int modified); @@ -53,16 +55,18 @@ void hax_raise_event(CPUArchState *env); int need_handle_intr_request(CPUArchState *env); int hax_handle_io(CPUArchState *env, uint32_t df, uint16_t port, int direction, int size, int count, void *buffer); -void qemu_notify_hax_event(void); void hax_reset_vcpu_state(void *opaque); #include "target-i386/hax-interface.h" #include "target-i386/hax-i386.h" #endif + #else + #define hax_enabled() (0) #define hax_sync_vcpus() #define hax_accel_init() (0) #define hax_pre_init(x) + #endif #endif diff --git a/main-loop.c b/main-loop.c index 907f3670c2..b09a82ab67 100644 --- a/main-loop.c +++ b/main-loop.c @@ -42,6 +42,9 @@ void qemu_notify_event(void) if (io_thread_fd == -1) { return; } + + qemu_notify_hax_event(); + do { ret = write(io_thread_fd, &val, sizeof(val)); } while (ret < 0 && errno == EINTR); @@ -181,16 +184,14 @@ static int qemu_event_init(void) return 0; } -extern void qemu_notify_hax_event(void); - void qemu_notify_event(void) { if (!qemu_event_handle) { return; } -#ifdef CONFIG_HAX + qemu_notify_hax_event(); -#endif + if (!SetEvent(qemu_event_handle)) { fprintf(stderr, "qemu_notify_event: SetEvent failed: %ld\n", GetLastError()); diff --git a/main-loop.h b/main-loop.h index dce1cd9d7c..b84d15dfee 100644 --- a/main-loop.h +++ b/main-loop.h @@ -104,6 +104,14 @@ int main_loop_wait(int nonblocking); */ void qemu_notify_event(void); +#ifdef CONFIG_HAX_BACKEND +void qemu_notify_hax_event(void); +#else +static inline void qemu_notify_hax_event(void) +{ +} +#endif + #ifdef _WIN32 /* return TRUE if no sleep should be done afterwards */ typedef int PollingFunc(void *opaque); diff --git a/target-i386/hax-all.c b/target-i386/hax-all.c index 9792b06639..a939f1d66f 100644 --- a/target-i386/hax-all.c +++ b/target-i386/hax-all.c @@ -438,7 +438,7 @@ static void hax_handle_interrupt(CPUArchState *env, int mask) } } -int hax_pre_init(ram_addr_t ram_size) +int hax_pre_init(uint64_t ram_size) { struct hax_state *hax = NULL; |