This repository was archived by the owner on Jun 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathvmm.h
More file actions
49 lines (37 loc) · 1.25 KB
/
vmm.h
File metadata and controls
49 lines (37 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef NOAH_VMM_H
#define NOAH_VMM_H
#include <Hypervisor/hv.h>
#include <Hypervisor/hv_vmx.h>
#include <Hypervisor/hv_arch_vmx.h>
#include "types.h"
#include "noah.h"
#include "x86/vmx.h"
struct vcpu_snapshot {
uint64_t vcpu_reg[NR_X86_REG_LIST];
uint64_t vmcs[NR_VMCS_FIELD_MASKED];
char fpu_states[2496] __attribute__((aligned(16)));
};
struct vmm_snapshot {
struct vcpu_snapshot first_vcpu_snapshot;
};
void vmm_create(void);
void vmm_destroy(void);
void vmm_snapshot(struct vmm_snapshot*);
void vmm_reentry(struct vmm_snapshot*);
void vmm_snapshot_vcpu(struct vcpu_snapshot*);
void vmm_restore_vcpu(struct vcpu_snapshot*);
void vmm_create_vcpu(struct vcpu_snapshot *);
void vmm_destroy_vcpu(void);
int vmm_run(void);
void vmm_read_register(hv_x86_reg_t, uint64_t *);
void vmm_write_register(hv_x86_reg_t, uint64_t);
void vmm_read_msr(uint32_t, uint64_t *);
void vmm_write_msr(uint32_t, uint64_t);
void vmm_read_vmcs(uint32_t, uint64_t *);
void vmm_write_vmcs(uint32_t, uint64_t);
void vmm_write_fpstate(void *, size_t);
void vmm_enable_native_msr(uint32_t, bool);
/* prot is obtained by or'ing HV_MEMORY_READ, HV_MEMORY_EXEC, HV_MEMORY_WRITE */
void vmm_mmap(gaddr_t addr, size_t len, int prot, void *ptr);
void vmm_munmap(gaddr_t addr, size_t len);
#endif