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)
#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
return;
}
-int hax_pre_init(ram_addr_t ram_size)
+int hax_pre_init(uint64_t ram_size)
{
return 0;
}
#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);
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
if (io_thread_fd == -1) {
return;
}
+
+ qemu_notify_hax_event();
+
do {
ret = write(io_thread_fd, &val, sizeof(val));
} while (ret < 0 && errno == EINTR);
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());
*/
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);
}
}
-int hax_pre_init(ram_addr_t ram_size)
+int hax_pre_init(uint64_t ram_size)
{
struct hax_state *hax = NULL;