sev: update sev-inject-launch-secret to make gpa optional
[qemu/ar7.git] / target / i386 / hvf / hvf-i386.h
blob50b914fd678436b3d6d9eefea0174bd6c2f97b23
1 /*
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
8 * Written by:
9 * Jiang Yunhong<yunhong.jiang@intel.com>
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.
16 #ifndef HVF_I386_H
17 #define HVF_I386_H
19 #include "qemu/accel.h"
20 #include "sysemu/hvf.h"
21 #include "cpu.h"
22 #include "x86.h"
24 #define HVF_MAX_VCPU 0x10
26 extern struct hvf_state hvf_global;
28 struct hvf_vm {
29 int id;
30 struct hvf_vcpu_state *vcpus[HVF_MAX_VCPU];
33 struct hvf_state {
34 uint32_t version;
35 struct hvf_vm *vm;
36 uint64_t mem_quota;
39 /* hvf_slot flags */
40 #define HVF_SLOT_LOG (1 << 0)
42 typedef struct hvf_slot {
43 uint64_t start;
44 uint64_t size;
45 uint8_t *mem;
46 int slot_id;
47 uint32_t flags;
48 MemoryRegion *region;
49 } 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;
58 } hvf_vcpu_caps;
60 struct HVFState {
61 AccelState parent;
62 hvf_slot slots[32];
63 int num_slots;
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);
73 #ifdef NEED_CPU_H
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);
79 #endif
81 #endif