1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19#ifndef X86_MMU_H
20#define X86_MMU_H
21
22#define PT_PRESENT (1 << 0)
23#define PT_WRITE (1 << 1)
24#define PT_USER (1 << 2)
25#define PT_WT (1 << 3)
26#define PT_CD (1 << 4)
27#define PT_ACCESSED (1 << 5)
28#define PT_DIRTY (1 << 6)
29#define PT_PS (1 << 7)
30#define PT_GLOBAL (1 << 8)
31#define PT_NX (1llu << 63)
32
33
34#define MMU_PAGE_PT (1 << 0)
35#define MMU_PAGE_WT (1 << 1)
36#define MMU_PAGE_US (1 << 2)
37#define MMU_PAGE_NX (1 << 3)
38
39bool mmu_gva_to_gpa(struct CPUState *cpu, target_ulong gva, uint64_t *gpa);
40
41void vmx_write_mem(struct CPUState *cpu, target_ulong gva, void *data, int bytes);
42void vmx_read_mem(struct CPUState *cpu, void *data, target_ulong gva, int bytes);
43
44#endif
45