Changeset 12579 in vbox
- Timestamp:
- Sep 18, 2008 3:58:14 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 36801
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vm.h
r12545 r12579 42 42 * @{ 43 43 */ 44 45 46 /** 47 * The state of a virtual CPU. 48 * 49 * The VM running states are a sub-states of the VMSTATE_RUNNING state. While 50 * VMCPUSTATE_NOT_RUNNING is a place holder for the other VM states. 51 */ 52 typedef enum VMCPUSTATE 53 { 54 /** The customary invalid zero. */ 55 VMCPUSTATE_INVALID = 0, 56 57 /** Running guest code (VM running). */ 58 VMCPUSTATE_RUN_EXEC, 59 /** Running guest code in the recompiler (VM running). */ 60 VMCPUSTATE_RUN_EXEC_REM, 61 /** Halted (VM running). */ 62 VMCPUSTATE_RUN_HALTED, 63 /** All the other bits we do while running a VM (VM running). */ 64 VMCPUSTATE_RUN_MISC, 65 /** VM not running, we're servicing requests or whatever. */ 66 VMCPUSTATE_NOT_RUNNING, 67 /** The end of valid virtual CPU states. */ 68 VMCPUSTATE_END, 69 70 /** Ensure 32-bit type. */ 71 VMCPUSTATE_32BIT_HACK = 0x7fffffff 72 } VMCPUSTATE; 73 74 75 /** 76 * Per virtual CPU data. 77 */ 78 typedef struct VMCPU 79 { 80 /** Per CPU forced action. 81 * See the VMCPU_FF_* \#defines. Updated atomically. */ 82 uint32_t volatile fForcedActions; 83 /** The CPU state. */ 84 VMCPUSTATE volatile enmState; 85 86 /** Ring-3 Host Context VM Pointer. */ 87 PVMR3 pVMR3; 88 /** Ring-0 Host Context VM Pointer. */ 89 PVMR0 pVMR0; 90 /** Raw-mode Context VM Pointer. */ 91 PVMRC pVMRC; 92 /** The CPU ID. 93 * This is the index into the VM::aCpus array. */ 94 uint32_t idCpu; 95 /** The ring-3 thread handle of the emulation thread for this CPU. 96 * @todo Use the VM_IS_EMT() macro to check if executing in EMT? */ 97 RTTHREAD hThreadR3; 98 /** The native ring-3 handle. */ 99 RTNATIVETHREAD hNativeThreadR3; 100 /** The native ring-0 handle. */ 101 RTNATIVETHREAD hNativeThreadR0; 102 103 /** Align the next bit on a 64-byte boundrary. */ 104 uint32_t au32Alignment[HC_ARCH_BITS == 32 ? 7 : 2]; 105 106 /** CPUM part. */ 107 union 108 { 109 #if 0 /*def ___CPUMInternal_h */ 110 struct VMCPUCPUM s; 111 #endif 112 char padding[64]; 113 } cpum; 114 } VMCPU; 115 44 116 45 117 /** The name of the Guest Context VMM Core module. */ … … 562 634 #endif 563 635 } rem; 636 637 #if HC_ARCH_BITS == 64 638 /** Padding for aligning the cpu array on a 64 byte boundrary. */ 639 uint32_t u32Reserved2[HC_ARCH_BITS == 32 ? 0 : 8]; 640 #endif 641 642 /** 643 * Per virtual CPU state. 644 */ 645 VMCPU aCpus[1]; 564 646 } VM; 565 647 -
trunk/src/VBox/VMM/MMHyper.cpp
r11164 r12579 105 105 { 106 106 pVM->pVMGC = (RTGCPTR32)GCPtr; 107 for (uint32_t i = 0; i < pVM->cCPUs; i++) 108 pVM->aCpus[i].pVMRC = pVM->pVMGC; 107 109 108 110 /* Reserve a page for fencing. */ … … 282 284 pVM->mm.s.pHyperHeapHC->pbHeapGC += offDelta; 283 285 pVM->mm.s.pHyperHeapHC->pVMGC += pVM->pVMGC; 286 for (uint32_t i = 0; i < pVM->cCPUs; i++) 287 pVM->aCpus[i].pVMRC = pVM->pVMGC; 284 288 285 289 /* relocate the rest. */ -
trunk/src/VBox/VMM/VM.cpp
r12497 r12579 293 293 "If you have built VirtualBox yourself, make sure that you do " 294 294 "not have the vboxdrv kernel module from a different install loaded."); 295 # endif 295 # endif 296 296 #endif 297 297 break; … … 438 438 */ 439 439 pVM->pUVM = pUVM; 440 pVM->ThreadEMT = p UVM->vm.s.ThreadEMT;441 pVM->NativeThreadEMT = p UVM->vm.s.NativeThreadEMT;440 pVM->ThreadEMT = pVM->aCpus[0].hThreadR3 = pUVM->vm.s.ThreadEMT; 441 pVM->NativeThreadEMT = pVM->aCpus[0].hNativeThreadR3 = pUVM->vm.s.NativeThreadEMT; 442 442 443 443 pVM->vm.s.offVM = RT_OFFSETOF(VM, vm.s); -
trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
r12310 r12579 602 602 pVM->pVMR3 = RTR0MemObjAddressR3(pGVM->gvmm.s.VMMapObj); 603 603 AssertPtr((void *)pVM->pVMR3); 604 605 /** @todo SMP - need to get the cpu count and initialize all the VM pointers. */ 606 pVM->aCpus[0].pVMR0 = pVM; 607 pVM->aCpus[0].pVMR3 = pVM->pVMR3; 604 608 605 609 rc = RTR0MemObjMapUser(&pGVM->gvmm.s.VMPagesMapObj, pGVM->gvmm.s.VMPagesMemObj, (RTR3PTR)-1, 0, -
trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp
r11515 r12579 169 169 CHECK_MEMBER_ALIGNMENT(VM, rem.s.StatsInQEMU, 8); 170 170 CHECK_MEMBER_ALIGNMENT(VM, rem.s.Env, 32); 171 CHECK_MEMBER_ALIGNMENT(VM, aCpus, 64); 172 173 /* vmcpu */ 174 CHECK_MEMBER_ALIGNMENT(VMCPU, cpum, 64); 175 CHECK_SIZE_ALIGNMENT(VMCPU, 64); 171 176 172 177 /* cpumctx */
Note:
See TracChangeset
for help on using the changeset viewer.