4 * Copyright (c) 2011 Intel Corporation
6 * Jiang Yunhong<yunhong.jiang@intel.com>
8 * This work is licensed under the terms of the GNU GPL, version 2 or later.
9 * See the COPYING file in the top-level directory.
17 #include "sysemu/hax.h"
24 typedef HANDLE hax_fd
;
27 extern struct hax_state hax_global
;
28 struct hax_vcpu_state
{
31 struct hax_tunnel
*tunnel
;
36 hax_fd fd
; /* the global hax device interface */
40 bool supports_64bit_ramblock
;
43 #define HAX_MAX_VCPU 0x10
44 #define MAX_VM_ID 0x40
45 #define MAX_VCPU_ID 0x40
50 struct hax_vcpu_state
*vcpus
[HAX_MAX_VCPU
];
54 /* Functions exported to host specific mode */
55 hax_fd
hax_vcpu_get_fd(CPUArchState
*env
);
56 int valid_hax_tunnel_size(uint16_t size
);
58 /* Host specific functions */
59 int hax_mod_version(struct hax_state
*hax
, struct hax_module_version
*version
);
60 int hax_inject_interrupt(CPUArchState
*env
, int vector
);
61 struct hax_vm
*hax_vm_create(struct hax_state
*hax
);
62 int hax_vcpu_run(struct hax_vcpu_state
*vcpu
);
63 int hax_vcpu_create(int id
);
64 int hax_sync_vcpu_state(CPUArchState
*env
, struct vcpu_state_t
*state
,
66 int hax_sync_msr(CPUArchState
*env
, struct hax_msr_data
*msrs
, int set
);
67 int hax_sync_fpu(CPUArchState
*env
, struct fx_layout
*fl
, int set
);
70 int hax_vm_destroy(struct hax_vm
*vm
);
71 int hax_capability(struct hax_state
*hax
, struct hax_capabilityinfo
*cap
);
72 int hax_notify_qemu_version(hax_fd vm_fd
, struct hax_qemu_version
*qversion
);
73 int hax_set_ram(uint64_t start_pa
, uint32_t size
, uint64_t host_va
, int flags
);
75 /* Common host function */
76 int hax_host_create_vm(struct hax_state
*hax
, int *vm_id
);
77 hax_fd
hax_host_open_vm(struct hax_state
*hax
, int vm_id
);
78 int hax_host_create_vcpu(hax_fd vm_fd
, int vcpuid
);
79 hax_fd
hax_host_open_vcpu(int vmid
, int vcpuid
);
80 int hax_host_setup_vcpu_channel(struct hax_vcpu_state
*vcpu
);
81 hax_fd
hax_mod_open(void);
82 void hax_memory_init(void);
86 #include "target/i386/hax-posix.h"
90 #include "target/i386/hax-windows.h"
93 #include "target/i386/hax-interface.h"