1 | /* $Id: PGMRC.cpp 40274 2012-02-28 13:17:35Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * PGM - Page Monitor, Guest Context.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2010 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 |
|
---|
19 | /*******************************************************************************
|
---|
20 | * Header Files *
|
---|
21 | *******************************************************************************/
|
---|
22 | #define LOG_GROUP LOG_GROUP_PGM
|
---|
23 | #include <VBox/vmm/pgm.h>
|
---|
24 | #include <VBox/vmm/cpum.h>
|
---|
25 | #include <VBox/vmm/mm.h>
|
---|
26 | #include <VBox/vmm/em.h>
|
---|
27 | #include <VBox/vmm/selm.h>
|
---|
28 | #include <VBox/vmm/iom.h>
|
---|
29 | #include <VBox/vmm/trpm.h>
|
---|
30 | #ifdef VBOX_WITH_REM
|
---|
31 | # include <VBox/vmm/rem.h>
|
---|
32 | #endif
|
---|
33 | #include "PGMInternal.h"
|
---|
34 | #include <VBox/vmm/vm.h>
|
---|
35 | #include "PGMInline.h"
|
---|
36 |
|
---|
37 | #include <iprt/asm.h>
|
---|
38 | #include <iprt/assert.h>
|
---|
39 | #include <VBox/log.h>
|
---|
40 | #include <VBox/param.h>
|
---|
41 | #include <VBox/err.h>
|
---|
42 | #include <VBox/dis.h>
|
---|
43 | #include <VBox/disopcode.h>
|
---|
44 |
|
---|
45 |
|
---|
46 |
|
---|
47 | /*******************************************************************************
|
---|
48 | * Internal Functions *
|
---|
49 | *******************************************************************************/
|
---|
50 |
|
---|
51 |
|
---|
52 |
|
---|
53 | #ifndef RT_ARCH_AMD64
|
---|
54 | /*
|
---|
55 | * Shadow - 32-bit mode
|
---|
56 | */
|
---|
57 | #define PGM_SHW_TYPE PGM_TYPE_32BIT
|
---|
58 | #define PGM_SHW_NAME(name) PGM_SHW_NAME_32BIT(name)
|
---|
59 | #include "PGMRCShw.h"
|
---|
60 |
|
---|
61 | /* Guest - real mode */
|
---|
62 | #define PGM_GST_TYPE PGM_TYPE_REAL
|
---|
63 | #define PGM_GST_NAME(name) PGM_GST_NAME_REAL(name)
|
---|
64 | #define PGM_BTH_NAME(name) PGM_BTH_NAME_32BIT_REAL(name)
|
---|
65 | #include "PGMRCGst.h"
|
---|
66 | #include "PGMRCBth.h"
|
---|
67 | #undef PGM_BTH_NAME
|
---|
68 | #undef PGM_GST_TYPE
|
---|
69 | #undef PGM_GST_NAME
|
---|
70 |
|
---|
71 | /* Guest - protected mode */
|
---|
72 | #define PGM_GST_TYPE PGM_TYPE_PROT
|
---|
73 | #define PGM_GST_NAME(name) PGM_GST_NAME_PROT(name)
|
---|
74 | #define PGM_BTH_NAME(name) PGM_BTH_NAME_32BIT_PROT(name)
|
---|
75 | #include "PGMRCGst.h"
|
---|
76 | #include "PGMRCBth.h"
|
---|
77 | #undef PGM_BTH_NAME
|
---|
78 | #undef PGM_GST_TYPE
|
---|
79 | #undef PGM_GST_NAME
|
---|
80 |
|
---|
81 | /* Guest - 32-bit mode */
|
---|
82 | #define PGM_GST_TYPE PGM_TYPE_32BIT
|
---|
83 | #define PGM_GST_NAME(name) PGM_GST_NAME_32BIT(name)
|
---|
84 | #define PGM_BTH_NAME(name) PGM_BTH_NAME_32BIT_32BIT(name)
|
---|
85 | #include "PGMRCGst.h"
|
---|
86 | #include "PGMRCBth.h"
|
---|
87 | #undef PGM_BTH_NAME
|
---|
88 | #undef PGM_GST_TYPE
|
---|
89 | #undef PGM_GST_NAME
|
---|
90 |
|
---|
91 | #undef PGM_SHW_TYPE
|
---|
92 | #undef PGM_SHW_NAME
|
---|
93 | #endif /* !RT_ARCH_AMD64 */
|
---|
94 |
|
---|
95 |
|
---|
96 | /*
|
---|
97 | * Shadow - PAE mode
|
---|
98 | */
|
---|
99 | #define PGM_SHW_TYPE PGM_TYPE_PAE
|
---|
100 | #define PGM_SHW_NAME(name) PGM_SHW_NAME_PAE(name)
|
---|
101 | #define PGM_BTH_NAME(name) PGM_BTH_NAME_PAE_REAL(name)
|
---|
102 | #include "PGMRCShw.h"
|
---|
103 |
|
---|
104 | /* Guest - real mode */
|
---|
105 | #define PGM_GST_TYPE PGM_TYPE_REAL
|
---|
106 | #define PGM_GST_NAME(name) PGM_GST_NAME_REAL(name)
|
---|
107 | #define PGM_BTH_NAME(name) PGM_BTH_NAME_PAE_REAL(name)
|
---|
108 | #include "PGMRCBth.h"
|
---|
109 | #undef PGM_BTH_NAME
|
---|
110 | #undef PGM_GST_TYPE
|
---|
111 | #undef PGM_GST_NAME
|
---|
112 |
|
---|
113 | /* Guest - protected mode */
|
---|
114 | #define PGM_GST_TYPE PGM_TYPE_PROT
|
---|
115 | #define PGM_GST_NAME(name) PGM_GST_NAME_PROT(name)
|
---|
116 | #define PGM_BTH_NAME(name) PGM_BTH_NAME_PAE_PROT(name)
|
---|
117 | #include "PGMRCBth.h"
|
---|
118 | #undef PGM_BTH_NAME
|
---|
119 | #undef PGM_GST_TYPE
|
---|
120 | #undef PGM_GST_NAME
|
---|
121 |
|
---|
122 | /* Guest - 32-bit mode */
|
---|
123 | #define PGM_GST_TYPE PGM_TYPE_32BIT
|
---|
124 | #define PGM_GST_NAME(name) PGM_GST_NAME_32BIT(name)
|
---|
125 | #define PGM_BTH_NAME(name) PGM_BTH_NAME_PAE_32BIT(name)
|
---|
126 | #include "PGMRCBth.h"
|
---|
127 | #undef PGM_BTH_NAME
|
---|
128 | #undef PGM_GST_TYPE
|
---|
129 | #undef PGM_GST_NAME
|
---|
130 |
|
---|
131 | /* Guest - PAE mode */
|
---|
132 | #define PGM_GST_TYPE PGM_TYPE_PAE
|
---|
133 | #define PGM_GST_NAME(name) PGM_GST_NAME_PAE(name)
|
---|
134 | #define PGM_BTH_NAME(name) PGM_BTH_NAME_PAE_PAE(name)
|
---|
135 | #include "PGMRCGst.h"
|
---|
136 | #include "PGMRCBth.h"
|
---|
137 | #undef PGM_BTH_NAME
|
---|
138 | #undef PGM_GST_TYPE
|
---|
139 | #undef PGM_GST_NAME
|
---|
140 |
|
---|
141 | #undef PGM_SHW_TYPE
|
---|
142 | #undef PGM_SHW_NAME
|
---|
143 |
|
---|
144 |
|
---|
145 | /*
|
---|
146 | * Shadow - AMD64 mode
|
---|
147 | */
|
---|
148 | #define PGM_SHW_TYPE PGM_TYPE_AMD64
|
---|
149 | #define PGM_SHW_NAME(name) PGM_SHW_NAME_AMD64(name)
|
---|
150 | #include "PGMRCShw.h"
|
---|
151 |
|
---|
152 | #ifdef VBOX_WITH_64_BITS_GUESTS
|
---|
153 | /* Guest - AMD64 mode */
|
---|
154 | #define PGM_GST_TYPE PGM_TYPE_AMD64
|
---|
155 | #define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name)
|
---|
156 | #define PGM_BTH_NAME(name) PGM_BTH_NAME_AMD64_AMD64(name)
|
---|
157 | #include "PGMRCGst.h"
|
---|
158 | #include "PGMRCBth.h"
|
---|
159 | #undef PGM_BTH_NAME
|
---|
160 | #undef PGM_GST_TYPE
|
---|
161 | #undef PGM_GST_NAME
|
---|
162 | #endif
|
---|
163 |
|
---|
164 | #undef PGM_SHW_TYPE
|
---|
165 | #undef PGM_SHW_NAME
|
---|
166 |
|
---|