VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMGC/PGMGC.cpp@ 35298

Last change on this file since 35298 was 31402, checked in by vboxsync, 14 years ago

PGM: Replaced the hazzardous raw-mode context dynamic mapping code with the PGMR0DynMap code used by darwin/x86. This is a risky change but it should pay off once stable by providing 100% certainty that dynamically mapped pages aren't resued behind our back (this has been observed in seemingly benign code paths recently).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.6 KB
Line 
1/* $Id: PGMGC.cpp 31402 2010-08-05 12:28:18Z 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/pgm.h>
24#include <VBox/cpum.h>
25#include <VBox/mm.h>
26#include <VBox/em.h>
27#include <VBox/selm.h>
28#include <VBox/iom.h>
29#include <VBox/trpm.h>
30#include <VBox/rem.h>
31#include "../PGMInternal.h"
32#include <VBox/vm.h>
33#include "../PGMInline.h"
34
35#include <iprt/asm.h>
36#include <iprt/assert.h>
37#include <VBox/log.h>
38#include <VBox/param.h>
39#include <VBox/err.h>
40#include <VBox/dis.h>
41#include <VBox/disopcode.h>
42
43
44
45/*******************************************************************************
46* Internal Functions *
47*******************************************************************************/
48
49
50
51#ifndef RT_ARCH_AMD64
52/*
53 * Shadow - 32-bit mode
54 */
55#define PGM_SHW_TYPE PGM_TYPE_32BIT
56#define PGM_SHW_NAME(name) PGM_SHW_NAME_32BIT(name)
57#include "PGMGCShw.h"
58
59/* Guest - real mode */
60#define PGM_GST_TYPE PGM_TYPE_REAL
61#define PGM_GST_NAME(name) PGM_GST_NAME_REAL(name)
62#define PGM_BTH_NAME(name) PGM_BTH_NAME_32BIT_REAL(name)
63#include "PGMGCGst.h"
64#include "PGMGCBth.h"
65#undef PGM_BTH_NAME
66#undef PGM_GST_TYPE
67#undef PGM_GST_NAME
68
69/* Guest - protected mode */
70#define PGM_GST_TYPE PGM_TYPE_PROT
71#define PGM_GST_NAME(name) PGM_GST_NAME_PROT(name)
72#define PGM_BTH_NAME(name) PGM_BTH_NAME_32BIT_PROT(name)
73#include "PGMGCGst.h"
74#include "PGMGCBth.h"
75#undef PGM_BTH_NAME
76#undef PGM_GST_TYPE
77#undef PGM_GST_NAME
78
79/* Guest - 32-bit mode */
80#define PGM_GST_TYPE PGM_TYPE_32BIT
81#define PGM_GST_NAME(name) PGM_GST_NAME_32BIT(name)
82#define PGM_BTH_NAME(name) PGM_BTH_NAME_32BIT_32BIT(name)
83#include "PGMGCGst.h"
84#include "PGMGCBth.h"
85#undef PGM_BTH_NAME
86#undef PGM_GST_TYPE
87#undef PGM_GST_NAME
88
89#undef PGM_SHW_TYPE
90#undef PGM_SHW_NAME
91#endif /* !RT_ARCH_AMD64 */
92
93
94/*
95 * Shadow - PAE mode
96 */
97#define PGM_SHW_TYPE PGM_TYPE_PAE
98#define PGM_SHW_NAME(name) PGM_SHW_NAME_PAE(name)
99#define PGM_BTH_NAME(name) PGM_BTH_NAME_PAE_REAL(name)
100#include "PGMGCShw.h"
101
102/* Guest - real mode */
103#define PGM_GST_TYPE PGM_TYPE_REAL
104#define PGM_GST_NAME(name) PGM_GST_NAME_REAL(name)
105#define PGM_BTH_NAME(name) PGM_BTH_NAME_PAE_REAL(name)
106#include "PGMGCBth.h"
107#undef PGM_BTH_NAME
108#undef PGM_GST_TYPE
109#undef PGM_GST_NAME
110
111/* Guest - protected mode */
112#define PGM_GST_TYPE PGM_TYPE_PROT
113#define PGM_GST_NAME(name) PGM_GST_NAME_PROT(name)
114#define PGM_BTH_NAME(name) PGM_BTH_NAME_PAE_PROT(name)
115#include "PGMGCBth.h"
116#undef PGM_BTH_NAME
117#undef PGM_GST_TYPE
118#undef PGM_GST_NAME
119
120/* Guest - 32-bit mode */
121#define PGM_GST_TYPE PGM_TYPE_32BIT
122#define PGM_GST_NAME(name) PGM_GST_NAME_32BIT(name)
123#define PGM_BTH_NAME(name) PGM_BTH_NAME_PAE_32BIT(name)
124#include "PGMGCBth.h"
125#undef PGM_BTH_NAME
126#undef PGM_GST_TYPE
127#undef PGM_GST_NAME
128
129/* Guest - PAE mode */
130#define PGM_GST_TYPE PGM_TYPE_PAE
131#define PGM_GST_NAME(name) PGM_GST_NAME_PAE(name)
132#define PGM_BTH_NAME(name) PGM_BTH_NAME_PAE_PAE(name)
133#include "PGMGCGst.h"
134#include "PGMGCBth.h"
135#undef PGM_BTH_NAME
136#undef PGM_GST_TYPE
137#undef PGM_GST_NAME
138
139#undef PGM_SHW_TYPE
140#undef PGM_SHW_NAME
141
142
143/*
144 * Shadow - AMD64 mode
145 */
146#define PGM_SHW_TYPE PGM_TYPE_AMD64
147#define PGM_SHW_NAME(name) PGM_SHW_NAME_AMD64(name)
148#include "PGMGCShw.h"
149
150#ifdef VBOX_WITH_64_BITS_GUESTS
151/* Guest - AMD64 mode */
152#define PGM_GST_TYPE PGM_TYPE_AMD64
153#define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name)
154#define PGM_BTH_NAME(name) PGM_BTH_NAME_AMD64_AMD64(name)
155#include "PGMGCGst.h"
156#include "PGMGCBth.h"
157#undef PGM_BTH_NAME
158#undef PGM_GST_TYPE
159#undef PGM_GST_NAME
160#endif
161
162#undef PGM_SHW_TYPE
163#undef PGM_SHW_NAME
164
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette