Changeset 41931 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Jun 27, 2012 4:12:16 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 78796
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r41906 r41931 426 426 PVMCPU pVCpu = &pVM->aCpus[i]; 427 427 428 /* 429 * Setup any fixed pointers and offsets. 430 */ 431 pVCpu->cpum.s.pHyperCoreR3 = CPUMCTX2CORE(&pVCpu->cpum.s.Hyper); 432 pVCpu->cpum.s.pHyperCoreR0 = VM_R0_ADDR(pVM, CPUMCTX2CORE(&pVCpu->cpum.s.Hyper)); 433 434 pVCpu->cpum.s.offCPUM = RT_OFFSETOF(VM, aCpus[i].cpum) - RT_OFFSETOF(VM, cpum); 428 pVCpu->cpum.s.offCPUM = RT_OFFSETOF(VM, aCpus[i].cpum) - RT_OFFSETOF(VM, cpum); 435 429 Assert((uintptr_t)&pVCpu->cpum - pVCpu->cpum.s.offCPUM == (uintptr_t)&pVM->cpum); 436 430 } … … 1269 1263 { 1270 1264 LogFlow(("CPUMR3Relocate\n")); 1271 for (VMCPUID i = 0; i < pVM->cCpus; i++) 1272 { 1273 /* 1274 * Switcher pointers. 1275 */ 1276 PVMCPU pVCpu = &pVM->aCpus[i]; 1277 pVCpu->cpum.s.pHyperCoreRC = MMHyperCCToRC(pVM, pVCpu->cpum.s.pHyperCoreR3); 1278 Assert(pVCpu->cpum.s.pHyperCoreRC != NIL_RTRCPTR); 1279 1280 } 1265 /* nothing to do any more. */ 1281 1266 } 1282 1267 … … 2923 2908 cpumR3InfoParseArg(pszArgs, &enmType, &pszComment); 2924 2909 pHlp->pfnPrintf(pHlp, "Hypervisor CPUM state: %s\n", pszComment); 2925 cpumR3InfoOne(pVM, &pVCpu->cpum.s.Hyper, pVCpu->cpum.s.pHyperCoreR3, pHlp, enmType, ".");2910 cpumR3InfoOne(pVM, &pVCpu->cpum.s.Hyper, CPUMCTX2CORE(&pVCpu->cpum.s.Hyper), pHlp, enmType, "."); 2926 2911 pHlp->pfnPrintf(pHlp, "CR4OrMask=%#x CR4AndMask=%#x\n", pVM->cpum.s.CR4.OrMask, pVM->cpum.s.CR4.AndMask); 2927 2912 } -
trunk/src/VBox/VMM/VMMR3/PDMLdr.cpp
r41800 r41931 25 25 #include <VBox/vmm/pdm.h> 26 26 #include <VBox/vmm/mm.h> 27 #include <VBox/vmm/trpm.h> 27 28 #include <VBox/vmm/vmm.h> 28 29 #include <VBox/vmm/vm.h> … … 355 356 else if (!strcmp(pszSymbol, "g_CPUM")) 356 357 *pValue = VM_RC_ADDR(pVM, &pVM->cpum); 357 else if (!strcmp(pszSymbol, "g_TRPM")) 358 *pValue = VM_RC_ADDR(pVM, &pVM->trpm); 359 else if (!strcmp(pszSymbol, "g_TRPMCPU")) 360 *pValue = VM_RC_ADDR(pVM, &pVM->aCpus[0].trpm); 358 else if ( !strncmp(pszSymbol, "g_TRPM", 6) 359 || !strncmp(pszSymbol, "g_trpm", 6) 360 || !strncmp(pszSymbol, "TRPM", 4)) 361 { 362 RTRCPTR RCPtr = 0; 363 rc = TRPMR3GetImportRC(pVM, pszSymbol, &RCPtr); 364 if (RT_SUCCESS(rc)) 365 *pValue = RCPtr; 366 } 361 367 else if ( !strncmp(pszSymbol, "VMM", 3) 362 368 || !strcmp(pszSymbol, "g_Logger") -
trunk/src/VBox/VMM/VMMR3/TRPM.cpp
r41803 r41931 782 782 783 783 /** 784 * Resolve a builtin RC symbol. 785 * 786 * Called by PDM when loading or relocating RC modules. 787 * 788 * @returns VBox status 789 * @param pVM Pointer to the VM. 790 * @param pszSymbol Symbol to resolv 791 * @param pRCPtrValue Where to store the symbol value. 792 * 793 * @remark This has to work before VMMR3Relocate() is called. 794 */ 795 VMMR3_INT_DECL(int) TRPMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue) 796 { 797 if (!strcmp(pszSymbol, "g_TRPM")) 798 *pRCPtrValue = VM_RC_ADDR(pVM, &pVM->trpm); 799 else if (!strcmp(pszSymbol, "g_TRPMCPU")) 800 *pRCPtrValue = VM_RC_ADDR(pVM, &pVM->aCpus[0].trpm); 801 else if (!strcmp(pszSymbol, "g_trpmGuestCtxCore")) 802 { 803 PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(VMMGetCpu0(pVM)); 804 *pRCPtrValue = VM_RC_ADDR(pVM, CPUMCTX2CORE(pCtx)); 805 } 806 else if (!strcmp(pszSymbol, "g_trpmHyperCtxCore")) 807 { 808 PCPUMCTX pCtx = CPUMGetHyperCtxPtr(VMMGetCpu0(pVM)); 809 *pRCPtrValue = VM_RC_ADDR(pVM, CPUMCTX2CORE(pCtx)); 810 } 811 else 812 return VERR_SYMBOL_NOT_FOUND; 813 return VINF_SUCCESS; 814 } 815 816 817 /** 784 818 * Execute state save operation. 785 819 * -
trunk/src/VBox/VMM/VMMR3/VMM.cpp
r41906 r41931 561 561 if (RT_SUCCESS(rc)) 562 562 { 563 CPUMHyperSetCtxCore(pVCpu, NULL);564 563 CPUMSetHyperESP(pVCpu, pVCpu->vmm.s.pbEMTStackBottomRC); /* Clear the stack. */ 565 564 uint64_t u64TS = RTTimeProgramStartNanoTS(); … … 1874 1873 * Setup the call frame using the trampoline. 1875 1874 */ 1876 CPUMHyperSetCtxCore(pVCpu, NULL);1877 1875 memset(pVCpu->vmm.s.pbEMTStackR3, 0xaa, VMM_STACK_SIZE); /* Clear the stack. */ 1878 1876 CPUMSetHyperESP(pVCpu, pVCpu->vmm.s.pbEMTStackBottomRC - cArgs * sizeof(RTGCUINTPTR32)); -
trunk/src/VBox/VMM/VMMR3/VMMTests.cpp
r41906 r41931 61 61 return rc; 62 62 63 CPUMHyperSetCtxCore(pVCpu, NULL);64 63 memset(pVCpu->vmm.s.pbEMTStackR3, 0xaa, VMM_STACK_SIZE); 65 64 CPUMSetHyperESP(pVCpu, pVCpu->vmm.s.pbEMTStackBottomRC); /* Clear the stack. */ … … 101 100 return rc; 102 101 103 CPUMHyperSetCtxCore(pVCpu, NULL);104 102 memset(pVCpu->vmm.s.pbEMTStackR3, 0xaa, VMM_STACK_SIZE); 105 103 CPUMSetHyperESP(pVCpu, pVCpu->vmm.s.pbEMTStackBottomRC); /* Clear the stack. */ … … 339 337 * Interrupt forwarding. 340 338 */ 341 CPUMHyperSetCtxCore(pVCpu, NULL);342 339 CPUMSetHyperESP(pVCpu, pVCpu->vmm.s.pbEMTStackBottomRC); /* Clear the stack. */ 343 340 CPUMPushHyper(pVCpu, 0); … … 403 400 for (i = 0; i < 1000000; i++) 404 401 { 405 CPUMHyperSetCtxCore(pVCpu, NULL);406 402 CPUMSetHyperESP(pVCpu, pVCpu->vmm.s.pbEMTStackBottomRC); /* Clear the stack. */ 407 403 CPUMPushHyper(pVCpu, 0); … … 495 491 AssertRCReturn(rc, rc); 496 492 497 CPUMQueryHyperCtxPtr(pVCpu, &pHyperCtx);493 pHyperCtx = CPUMGetHyperCtxPtr(pVCpu); 498 494 499 495 pHyperCtx->cr0 = X86_CR0_PE | X86_CR0_WP | X86_CR0_PG | X86_CR0_TS | X86_CR0_ET | X86_CR0_NE | X86_CR0_MP; … … 516 512 RTPrintf("VMM: VMMGCEntry=%RRv\n", RCPtrEP); 517 513 518 CPUMQueryHyperCtxPtr(pVCpu, &pHyperCtx);514 pHyperCtx = CPUMGetHyperCtxPtr(pVCpu); 519 515 520 516 /* Fill in hidden selector registers for the hypervisor state. */ … … 537 533 for (i = 0; i < 1000000; i++) 538 534 { 539 CPUMHyperSetCtxCore(pVCpu, NULL);540 541 535 CPUMSetHyperESP(pVCpu, pVCpu->vmm.s.pbEMTStackBottomRC); /* Clear the stack. */ 542 536 CPUMPushHyper(pVCpu, 0); … … 547 541 CPUMSetHyperEIP(pVCpu, pVM->vmm.s.pfnCallTrampolineRC); 548 542 549 CPUMQueryHyperCtxPtr(pVCpu, &pHyperCtx);543 pHyperCtx = CPUMGetHyperCtxPtr(pVCpu); 550 544 pGuestCtx = CPUMQueryGuestCtxPtr(pVCpu); 551 545
Note:
See TracChangeset
for help on using the changeset viewer.