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