xref: /qemu/target/i386/hvf/hvf-i386.h (revision c97d6d2cdf97edb4aebe832fdba65d701ad7bcb6)
1*c97d6d2cSSergio Andres Gomez Del Real /*
2*c97d6d2cSSergio Andres Gomez Del Real  * QEMU Hypervisor.framework (HVF) support
3*c97d6d2cSSergio Andres Gomez Del Real  *
4*c97d6d2cSSergio Andres Gomez Del Real  * Copyright 2017 Google Inc
5*c97d6d2cSSergio Andres Gomez Del Real  *
6*c97d6d2cSSergio Andres Gomez Del Real  * Adapted from target-i386/hax-i386.h:
7*c97d6d2cSSergio Andres Gomez Del Real  * Copyright (c) 2011 Intel Corporation
8*c97d6d2cSSergio Andres Gomez Del Real  *  Written by:
9*c97d6d2cSSergio Andres Gomez Del Real  *  Jiang Yunhong<yunhong.jiang@intel.com>
10*c97d6d2cSSergio Andres Gomez Del Real  *
11*c97d6d2cSSergio Andres Gomez Del Real  * This work is licensed under the terms of the GNU GPL, version 2 or later.
12*c97d6d2cSSergio Andres Gomez Del Real  * See the COPYING file in the top-level directory.
13*c97d6d2cSSergio Andres Gomez Del Real  *
14*c97d6d2cSSergio Andres Gomez Del Real  */
15*c97d6d2cSSergio Andres Gomez Del Real 
16*c97d6d2cSSergio Andres Gomez Del Real #ifndef _HVF_I386_H
17*c97d6d2cSSergio Andres Gomez Del Real #define _HVF_I386_H
18*c97d6d2cSSergio Andres Gomez Del Real 
19*c97d6d2cSSergio Andres Gomez Del Real #include "sysemu/hvf.h"
20*c97d6d2cSSergio Andres Gomez Del Real #include "cpu.h"
21*c97d6d2cSSergio Andres Gomez Del Real #include "hvf-utils/x86.h"
22*c97d6d2cSSergio Andres Gomez Del Real 
23*c97d6d2cSSergio Andres Gomez Del Real #define HVF_MAX_VCPU 0x10
24*c97d6d2cSSergio Andres Gomez Del Real #define MAX_VM_ID 0x40
25*c97d6d2cSSergio Andres Gomez Del Real #define MAX_VCPU_ID 0x40
26*c97d6d2cSSergio Andres Gomez Del Real 
27*c97d6d2cSSergio Andres Gomez Del Real extern struct hvf_state hvf_global;
28*c97d6d2cSSergio Andres Gomez Del Real 
29*c97d6d2cSSergio Andres Gomez Del Real struct hvf_vm {
30*c97d6d2cSSergio Andres Gomez Del Real     int id;
31*c97d6d2cSSergio Andres Gomez Del Real     struct hvf_vcpu_state *vcpus[HVF_MAX_VCPU];
32*c97d6d2cSSergio Andres Gomez Del Real };
33*c97d6d2cSSergio Andres Gomez Del Real 
34*c97d6d2cSSergio Andres Gomez Del Real struct hvf_state {
35*c97d6d2cSSergio Andres Gomez Del Real     uint32_t version;
36*c97d6d2cSSergio Andres Gomez Del Real     struct hvf_vm *vm;
37*c97d6d2cSSergio Andres Gomez Del Real     uint64_t mem_quota;
38*c97d6d2cSSergio Andres Gomez Del Real };
39*c97d6d2cSSergio Andres Gomez Del Real 
40*c97d6d2cSSergio Andres Gomez Del Real #ifdef NEED_CPU_H
41*c97d6d2cSSergio Andres Gomez Del Real /* Functions exported to host specific mode */
42*c97d6d2cSSergio Andres Gomez Del Real 
43*c97d6d2cSSergio Andres Gomez Del Real /* Host specific functions */
44*c97d6d2cSSergio Andres Gomez Del Real int hvf_inject_interrupt(CPUArchState *env, int vector);
45*c97d6d2cSSergio Andres Gomez Del Real int hvf_vcpu_run(struct hvf_vcpu_state *vcpu);
46*c97d6d2cSSergio Andres Gomez Del Real #endif
47*c97d6d2cSSergio Andres Gomez Del Real 
48*c97d6d2cSSergio Andres Gomez Del Real #endif
49