Changeset 4958 in vbox
- Timestamp:
- Sep 21, 2007 2:54:04 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vm.h
r4787 r4958 235 235 */ 236 236 R3PTRTYPE(struct VM *) pNext; 237 /** Host Context VM Pointer.238 * @obsolete don't use in new code! */239 R3PTRTYPE(struct VM *) pVMHC;240 237 /** Ring-3 Host Context VM Pointer. */ 241 238 R3PTRTYPE(struct VM *) pVMR3; … … 244 241 /** Guest Context VM Pointer. */ 245 242 GCPTRTYPE(struct VM *) pVMGC; 243 244 /** The GVM VM handle. Only the GVM should modify this field. */ 245 uint32_t hSelf; 246 /** Reserved / padding. */ 247 uint32_t u32Reserved; 246 248 247 249 /** @name Public VMM Switcher APIs … … 317 319 318 320 /* padding to make gnuc put the StatQemuToGC where msc does. */ 319 /*#if HC_ARCH_BITS == 32321 #if HC_ARCH_BITS == 32 320 322 uint32_t padding0; 321 #endif */323 #endif 322 324 323 325 /** Profiling the total time from Qemu to GC. */ … … 346 348 347 349 /* padding - the unions must be aligned on 32 bytes boundraries. */ 348 uint32_t padding[HC_ARCH_BITS == 32 ? 6: 6];350 uint32_t padding[HC_ARCH_BITS == 32 ? 4 : 6]; 349 351 350 352 /** CPUM part. */ -
trunk/include/VBox/vm.mac
r4071 r4958 38 38 .pSession RTR3PTR_RES 1 39 39 .pNext RTHCPTR_RES 1 40 .pVMHC RTHCPTR_RES 141 40 .pVMR3 RTR3PTR_RES 1 42 41 .pVMR0 RTR0PTR_RES 1 43 42 .pVMGC RTGCPTR_RES 1 43 .hSelf resd 1 44 .u32Reserved resd 1 44 45 45 46 .pfnVMMGCGuestToHostAsmGuestCtx RTGCPTR_RES 1 -
trunk/src/VBox/VMM/CPUM.cpp
r4953 r4958 99 99 pVM->cpum.s.offVM = RT_OFFSETOF(VM, cpum); 100 100 pVM->cpum.s.pCPUMHC = &pVM->cpum.s; 101 pVM->cpum.s.pHyperCoreHC = CPUMCTX2CORE(&pVM->cpum.s.Hyper); 101 pVM->cpum.s.pHyperCoreR3 = CPUMCTX2CORE(&pVM->cpum.s.Hyper); 102 pVM->cpum.s.pHyperCoreR0 = VM_R0_ADDR(pVM, CPUMCTX2CORE(&pVM->cpum.s.Hyper)); 102 103 103 104 /* Hidden selector registers are invalid by default. */ … … 399 400 */ 400 401 pVM->cpum.s.pCPUMGC = VM_GUEST_ADDR(pVM, &pVM->cpum.s); 401 pVM->cpum.s.pHyperCoreGC = MMHyperHC2GC(pVM, pVM->cpum.s.pHyperCoreHC); 402 pVM->cpum.s.pHyperCoreGC = MMHyperCCToGC(pVM, pVM->cpum.s.pHyperCoreR3); 403 Assert(pVM->cpum.s.pHyperCoreGC != NIL_RTGCPTR); 402 404 } 403 405 … … 857 859 cpumR3InfoParseArg(pszArgs, &enmType, &pszComment); 858 860 pHlp->pfnPrintf(pHlp, "Hypervisor CPUM state: %s\n", pszComment); 859 cpumR3InfoOne(&pVM->cpum.s.Hyper, pVM->cpum.s.pHyperCore HC, pHlp, enmType, ".");861 cpumR3InfoOne(&pVM->cpum.s.Hyper, pVM->cpum.s.pHyperCoreR3, pHlp, enmType, "."); 860 862 pHlp->pfnPrintf(pHlp, "CR4OrMask=%#x CR4AndMask=%#x\n", pVM->cpum.s.CR4.OrMask, pVM->cpum.s.CR4.AndMask); 861 863 } -
trunk/src/VBox/VMM/CPUMInternal.h
r4787 r4958 284 284 285 285 286 /** Pointer to the current hypervisor core context - HCPtr. */ 287 R3R0PTRTYPE(PCPUMCTXCORE) pHyperCoreHC; 286 /** Pointer to the current hypervisor core context - R3Ptr. */ 287 R3PTRTYPE(PCPUMCTXCORE) pHyperCoreR3; 288 /** Pointer to the current hypervisor core context - R3Ptr. */ 289 R0PTRTYPE(PCPUMCTXCORE) pHyperCoreR0; 288 290 /** Pointer to the current hypervisor core context - GCPtr. */ 289 291 GCPTRTYPE(PCPUMCTXCORE) pHyperCoreGC; … … 324 326 /** Have we entered rawmode? */ 325 327 bool fRawEntered; 326 uint8_t abPadding[3 + (HC_ARCH_BITS == 32) * 4];328 uint8_t abPadding[3 + (HC_ARCH_BITS == 64) * 4]; 327 329 328 330 /** The standard set of CpuId leafs. */ -
trunk/src/VBox/VMM/CPUMInternal.mac
r4071 r4958 357 357 alignb 32 358 358 ; hypervisor core context. 359 .pHyperCoreHC RTHCPTR_RES 1 359 .pHyperCoreR3 RTR3PTR_RES 1 360 .pHyperCoreR0 RTR0PTR_RES 1 360 361 .pHyperCoreGC RTGCPTR_RES 1 361 362 ;... … … 373 374 .fRawEntered resb 1 374 375 %if RTHCPTR_CB == 8 376 .abPadding resb 7 377 %else 375 378 .abPadding resb 3 376 %else377 .abPadding resb 7378 379 %endif 379 380 -
trunk/src/VBox/VMM/TM.cpp
r4787 r4958 672 672 { 673 673 pTimer->pVMGC = pVM->pVMGC; 674 pTimer->pVMR0 = (PVMR0)pVM->pVMHC; /// @todo pTimer->pVMR0 =pVM->pVMR0;674 pTimer->pVMR0 = pVM->pVMR0; 675 675 } 676 676 } -
trunk/src/VBox/VMM/VM.cpp
r4900 r4958 198 198 */ 199 199 memset(pVM, 0, sizeof(*pVM)); 200 pVM->pVMHC = pVM;201 200 pVM->pVMR0 = pVMR0; 202 201 pVM->pVMR3 = pVM; -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r4208 r4958 54 54 CPUMDECL(void) CPUMHyperSetCtxCore(PVM pVM, PCPUMCTXCORE pCtxCore) 55 55 { 56 LogFlow(("CPUMHyperSetCtxCore: %p -> %p\n", pVM->cpum.s.CTXSUFF(pHyperCore), pCtxCore));56 LogFlow(("CPUMHyperSetCtxCore: %p/%p/%p -> %p\n", pVM->cpum.s.CTXALLSUFF(pHyperCore), pCtxCore)); 57 57 if (!pCtxCore) 58 58 { 59 59 pCtxCore = CPUMCTX2CORE(&pVM->cpum.s.Hyper); 60 #ifdef IN_GC 61 pVM->cpum.s.pHyperCoreHC = VM_HOST_ADDR(pVM, pCtxCore); 62 #else 63 pVM->cpum.s.pHyperCoreGC = VM_GUEST_ADDR(pVM, pCtxCore); 64 #endif 60 pVM->cpum.s.pHyperCoreR3 = (R3PTRTYPE(PCPUMCTXCORE))VM_R3_ADDR(pVM, pCtxCore); 61 pVM->cpum.s.pHyperCoreR0 = (R0PTRTYPE(PCPUMCTXCORE))VM_R0_ADDR(pVM, pCtxCore); 62 pVM->cpum.s.pHyperCoreGC = (GCPTRTYPE(PCPUMCTXCORE))VM_GUEST_ADDR(pVM, pCtxCore); 65 63 } 66 64 else 67 65 { 68 #ifdef IN_GC 69 pVM->cpum.s.pHyperCoreHC = MMHyperGC2HC(pVM, pCtxCore); 70 #else 71 pVM->cpum.s.pHyperCoreGC = MMHyperHC2GC(pVM, pCtxCore); 72 #endif 66 pVM->cpum.s.pHyperCoreR3 = (R3PTRTYPE(PCPUMCTXCORE))MMHyperCCToR3(pVM, pCtxCore); 67 pVM->cpum.s.pHyperCoreR0 = (R0PTRTYPE(PCPUMCTXCORE))MMHyperCCToR0(pVM, pCtxCore); 68 pVM->cpum.s.pHyperCoreGC = (GCPTRTYPE(PCPUMCTXCORE))MMHyperCCToGC(pVM, pCtxCore); 73 69 } 74 pVM->cpum.s.CTXSUFF(pHyperCore) = pCtxCore;75 70 } 76 71 … … 84 79 CPUMDECL(PCCPUMCTXCORE) CPUMGetHyperCtxCore(PVM pVM) 85 80 { 86 return pVM->cpum.s.CTX SUFF(pHyperCore);81 return pVM->cpum.s.CTXALLSUFF(pHyperCore); 87 82 } 88 83 … … 129 124 CPUMDECL(void) CPUMSetHyperCS(PVM pVM, RTSEL SelCS) 130 125 { 131 pVM->cpum.s.CTX SUFF(pHyperCore)->cs = SelCS;126 pVM->cpum.s.CTXALLSUFF(pHyperCore)->cs = SelCS; 132 127 } 133 128 134 129 CPUMDECL(void) CPUMSetHyperDS(PVM pVM, RTSEL SelDS) 135 130 { 136 pVM->cpum.s.CTX SUFF(pHyperCore)->ds = SelDS;131 pVM->cpum.s.CTXALLSUFF(pHyperCore)->ds = SelDS; 137 132 } 138 133 139 134 CPUMDECL(void) CPUMSetHyperES(PVM pVM, RTSEL SelES) 140 135 { 141 pVM->cpum.s.CTX SUFF(pHyperCore)->es = SelES;136 pVM->cpum.s.CTXALLSUFF(pHyperCore)->es = SelES; 142 137 } 143 138 144 139 CPUMDECL(void) CPUMSetHyperFS(PVM pVM, RTSEL SelFS) 145 140 { 146 pVM->cpum.s.CTX SUFF(pHyperCore)->fs = SelFS;141 pVM->cpum.s.CTXALLSUFF(pHyperCore)->fs = SelFS; 147 142 } 148 143 149 144 CPUMDECL(void) CPUMSetHyperGS(PVM pVM, RTSEL SelGS) 150 145 { 151 pVM->cpum.s.CTX SUFF(pHyperCore)->gs = SelGS;146 pVM->cpum.s.CTXALLSUFF(pHyperCore)->gs = SelGS; 152 147 } 153 148 154 149 CPUMDECL(void) CPUMSetHyperSS(PVM pVM, RTSEL SelSS) 155 150 { 156 pVM->cpum.s.CTX SUFF(pHyperCore)->ss = SelSS;151 pVM->cpum.s.CTXALLSUFF(pHyperCore)->ss = SelSS; 157 152 } 158 153 159 154 CPUMDECL(void) CPUMSetHyperESP(PVM pVM, uint32_t u32ESP) 160 155 { 161 pVM->cpum.s.CTX SUFF(pHyperCore)->esp = u32ESP;156 pVM->cpum.s.CTXALLSUFF(pHyperCore)->esp = u32ESP; 162 157 } 163 158 164 159 CPUMDECL(int) CPUMSetHyperEFlags(PVM pVM, uint32_t Efl) 165 160 { 166 pVM->cpum.s.CTX SUFF(pHyperCore)->eflags.u32 = Efl;161 pVM->cpum.s.CTXALLSUFF(pHyperCore)->eflags.u32 = Efl; 167 162 return VINF_SUCCESS; 168 163 } … … 170 165 CPUMDECL(void) CPUMSetHyperEIP(PVM pVM, uint32_t u32EIP) 171 166 { 172 pVM->cpum.s.CTX SUFF(pHyperCore)->eip = u32EIP;167 pVM->cpum.s.CTXALLSUFF(pHyperCore)->eip = u32EIP; 173 168 } 174 169 … … 222 217 CPUMDECL(RTSEL) CPUMGetHyperCS(PVM pVM) 223 218 { 224 return pVM->cpum.s.CTX SUFF(pHyperCore)->cs;219 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->cs; 225 220 } 226 221 227 222 CPUMDECL(RTSEL) CPUMGetHyperDS(PVM pVM) 228 223 { 229 return pVM->cpum.s.CTX SUFF(pHyperCore)->ds;224 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->ds; 230 225 } 231 226 232 227 CPUMDECL(RTSEL) CPUMGetHyperES(PVM pVM) 233 228 { 234 return pVM->cpum.s.CTX SUFF(pHyperCore)->es;229 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->es; 235 230 } 236 231 237 232 CPUMDECL(RTSEL) CPUMGetHyperFS(PVM pVM) 238 233 { 239 return pVM->cpum.s.CTX SUFF(pHyperCore)->fs;234 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->fs; 240 235 } 241 236 242 237 CPUMDECL(RTSEL) CPUMGetHyperGS(PVM pVM) 243 238 { 244 return pVM->cpum.s.CTX SUFF(pHyperCore)->gs;239 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->gs; 245 240 } 246 241 247 242 CPUMDECL(RTSEL) CPUMGetHyperSS(PVM pVM) 248 243 { 249 return pVM->cpum.s.CTX SUFF(pHyperCore)->ss;244 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->ss; 250 245 } 251 246 … … 276 271 CPUMDECL(uint32_t) CPUMGetHyperEAX(PVM pVM) 277 272 { 278 return pVM->cpum.s.CTX SUFF(pHyperCore)->eax;273 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->eax; 279 274 } 280 275 281 276 CPUMDECL(uint32_t) CPUMGetHyperEBX(PVM pVM) 282 277 { 283 return pVM->cpum.s.CTX SUFF(pHyperCore)->ebx;278 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->ebx; 284 279 } 285 280 286 281 CPUMDECL(uint32_t) CPUMGetHyperECX(PVM pVM) 287 282 { 288 return pVM->cpum.s.CTX SUFF(pHyperCore)->ecx;283 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->ecx; 289 284 } 290 285 291 286 CPUMDECL(uint32_t) CPUMGetHyperEDX(PVM pVM) 292 287 { 293 return pVM->cpum.s.CTX SUFF(pHyperCore)->edx;288 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->edx; 294 289 } 295 290 296 291 CPUMDECL(uint32_t) CPUMGetHyperESI(PVM pVM) 297 292 { 298 return pVM->cpum.s.CTX SUFF(pHyperCore)->esi;293 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->esi; 299 294 } 300 295 301 296 CPUMDECL(uint32_t) CPUMGetHyperEDI(PVM pVM) 302 297 { 303 return pVM->cpum.s.CTX SUFF(pHyperCore)->edi;298 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->edi; 304 299 } 305 300 306 301 CPUMDECL(uint32_t) CPUMGetHyperEBP(PVM pVM) 307 302 { 308 return pVM->cpum.s.CTX SUFF(pHyperCore)->ebp;303 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->ebp; 309 304 } 310 305 311 306 CPUMDECL(uint32_t) CPUMGetHyperESP(PVM pVM) 312 307 { 313 return pVM->cpum.s.CTX SUFF(pHyperCore)->esp;308 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->esp; 314 309 } 315 310 316 311 CPUMDECL(uint32_t) CPUMGetHyperEFlags(PVM pVM) 317 312 { 318 return pVM->cpum.s.CTX SUFF(pHyperCore)->eflags.u32;313 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->eflags.u32; 319 314 } 320 315 321 316 CPUMDECL(uint32_t) CPUMGetHyperEIP(PVM pVM) 322 317 { 323 return pVM->cpum.s.CTX SUFF(pHyperCore)->eip;318 return pVM->cpum.s.CTXALLSUFF(pHyperCore)->eip; 324 319 } 325 320
Note:
See TracChangeset
for help on using the changeset viewer.