2 * QEMU Hypervisor.framework (HVF) support
4 * Copyright 2017 Google Inc
6 * Adapted from target-i386/hax-i386.h:
7 * Copyright (c) 2011 Intel Corporation
11 * This work is licensed under the terms of the GNU GPL, version 2 or later.
12 * See the COPYING file in the top-level directory.
19 #include "sysemu/accel.h"
20 #include "sysemu/hvf.h"
24 #define HVF_MAX_VCPU 0x10
26 extern struct hvf_state hvf_global;
30 struct hvf_vcpu_state *vcpus[HVF_MAX_VCPU];
40 #define HVF_SLOT_LOG (1 << 0)
42 typedef struct hvf_slot {
51 typedef struct hvf_vcpu_caps {
52 uint64_t vmx_cap_pinbased;
53 uint64_t vmx_cap_procbased;
54 uint64_t vmx_cap_procbased2;
55 uint64_t vmx_cap_entry;
56 uint64_t vmx_cap_exit;
57 uint64_t vmx_cap_preemption_timer;
60 typedef struct HVFState {
65 hvf_vcpu_caps *hvf_caps;
67 extern HVFState *hvf_state;
69 void hvf_set_phys_mem(MemoryRegionSection *, bool);
70 void hvf_handle_io(CPUArchState *, uint16_t, void *, int, int, int);
71 hvf_slot *hvf_find_overlap_slot(uint64_t, uint64_t);
74 /* Functions exported to host specific mode */
76 /* Host specific functions */
77 int hvf_inject_interrupt(CPUArchState *env, int vector);
78 int hvf_vcpu_run(struct hvf_vcpu_state *vcpu);