Changeset 41147 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 3, 2012 8:15:27 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 77764
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/Makefile.kmk
r41076 r41147 53 53 ifdef VBOX_WITH_PCI_PASSTHROUGH 54 54 VMM_COMMON_DEFS += VBOX_WITH_PCI_PASSTHROUGH 55 endif 56 ifdef VBOX_WITH_DTRACE_RC 57 VMM_COMMON_DEFS += VBOX_WITH_DTRACE_RC 55 58 endif 56 59 # VMM_COMMON_DEFS += VBOX_WITH_NS_ACCOUNTING_STATS -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r40763 r41147 666 666 { 667 667 RTCCUINTREG uFlags = ASMIntDisableFlags(); 668 VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC); 669 670 TMNotifyStartOfExecution(pVCpu); 671 rc = pVM->vmm.s.pfnHostToGuestR0(pVM); 672 pVCpu->vmm.s.iLastGZRc = rc; 673 TMNotifyEndOfExecution(pVCpu); 674 675 VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED); 668 669 for (;;) 670 { 671 VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC); 672 TMNotifyStartOfExecution(pVCpu); 673 674 rc = pVM->vmm.s.pfnHostToGuestR0(pVM); 675 pVCpu->vmm.s.iLastGZRc = rc; 676 677 TMNotifyEndOfExecution(pVCpu); 678 VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED); 679 680 if (rc != VINF_VMM_CALL_TRACER) 681 break; 682 SUPR0TracerUmodProbeFire(pVM->pSession, &pVCpu->vmm.s.TracerCtx); 683 } 676 684 677 685 /* Re-enable VT-x if previously turned off. */ -
trunk/src/VBox/VMM/VMMR3/PDMLdr.cpp
r39078 r41147 32 32 #include <VBox/err.h> 33 33 #include <VBox/vmm/hwaccm.h> 34 #include <VBox/VBoxTpG.h> 34 35 35 36 #include <VBox/log.h> … … 168 169 169 170 /** 170 * Applies relocations to GC modules.171 * Applies relocations to RC modules. 171 172 * 172 173 * This must be done very early in the relocation 173 * process so that components can resolve GC symbols during relocation.174 * process so that components can resolve RC symbols during relocation. 174 175 * 175 176 * @param pUVM Pointer to the user mode VM structure. … … 182 183 183 184 /* 184 * GC Modules.185 * RC Modules. 185 186 */ 186 187 RTCritSectEnter(&pUVM->pdm.s.ListCritSect); … … 431 432 432 433 /** 433 * Loads a module into the guest context (i.e. into the Hypervisor memory region). 434 * Loads a module into the raw-mode context (i.e. into the Hypervisor memory 435 * region). 434 436 * 435 437 * @returns VBox status code. … … 528 530 if (RT_SUCCESS(rc)) 529 531 { 532 #ifdef VBOX_WITH_DTRACE_RC 533 /* 534 * Register the tracer bits if present. 535 */ 536 RTLDRADDR uValue; 537 rc = RTLdrGetSymbolEx(pModule->hLdrMod, pModule->pvBits, pModule->ImageBase, 538 "g_VTGObjHeader", &uValue); 539 if (RT_SUCCESS(rc)) 540 { 541 PVTGOBJHDR pVtgHdr = (PVTGOBJHDR)MMHyperRCToCC(pVM, (RTRCPTR)uValue); 542 if ( pVtgHdr 543 && !memcmp(pVtgHdr->szMagic, VTGOBJHDR_MAGIC, sizeof(pVtgHdr->szMagic))) 544 rc = SUPR3TracerRegisterModule(~(uintptr_t)0, pModule->szName, pVtgHdr, uValue, 545 SUP_TRACER_UMOD_FLAGS_SHARED); 546 else 547 rc = pVtgHdr ? VERR_INVALID_MAGIC : VERR_INVALID_POINTER; 548 if (RT_FAILURE(rc)) 549 LogRel(("PDM: Failed to register tracepoints for '%s': %Rrc\n", pModule->szName, rc)); 550 } 551 #endif 552 530 553 /* 531 554 * Insert the module. … … 542 565 pUVM->pdm.s.pModules = pModule; /* (pNext is zeroed by alloc) */ 543 566 Log(("PDM: RC Module at %RRv %s (%s)\n", (RTRCPTR)pModule->ImageBase, pszName, pszFilename)); 567 544 568 RTCritSectLeave(&pUVM->pdm.s.ListCritSect); 545 569 RTMemTmpFree(pszFile); 546 570 RTMemTmpFree(paPages); 571 547 572 return VINF_SUCCESS; 548 573 } -
trunk/src/VBox/VMM/VMMRC/VMMRC.cpp
r39078 r41147 210 210 211 211 /** 212 * Calls the ring-0 host code. 213 * 214 * @param pVM The VM handle. 215 */ 216 DECLASM(void) vmmRCProbeFireHelper(PVM pVM) 217 { 218 pVM->vmm.s.pfnGuestToHostRC(VINF_VMM_CALL_TRACER); 219 } 220 221 222 223 /** 212 224 * Execute the trap testcase. 213 225 * -
trunk/src/VBox/VMM/VMMRC/VMMRC.def
r39357 r41147 66 66 MMGCRamReadNoTrapHandler 67 67 VMMGetSvnRev 68 VMMRCProbeFire 68 69 vmmGCLoggerFlush 69 70 vmmGCLoggerWrapper -
trunk/src/VBox/VMM/VMMRC/VMMRCA.asm
r37955 r41147 4 4 ; 5 5 6 ; Copyright (C) 2006-2007 Oracle Corporation 6 ; 7 ; Copyright (C) 2006-2012 Oracle Corporation 7 8 ; 8 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 20 21 %include "VBox/asmdefs.mac" 21 22 %include "iprt/x86.mac" 23 %include "VBox/sup.mac" 24 %include "VBox/vmm/vm.mac" 25 %include "VMMInternal.mac" 22 26 23 27 … … 48 52 ;* External Symbols * 49 53 ;******************************************************************************* 54 extern IMPNAME(g_VM) 50 55 extern IMPNAME(g_Logger) 51 56 extern IMPNAME(g_RelLogger) 52 57 extern NAME(RTLogLogger) 58 extern NAME(vmmRCProbeFireHelper) 53 59 54 60 … … 214 220 ENDPROC vmmGCTestTrap0e 215 221 222 223 224 ;; 225 ; The raw-mode context equivalent of SUPTracerFireProbe. 226 ; 227 ; See also SUPLibTracerA.asm. 228 ; 229 EXPORTEDNAME VMMRCProbeFire 230 push ebp 231 mov ebp, esp 232 233 ; 234 ; Save edx and eflags so we can use them. 235 ; 236 pushf 237 push edx 238 239 ; 240 ; Get the address of the tracer context record after first checking 241 ; that host calls hasn't been disabled. 242 ; 243 mov edx, IMP(g_VM) 244 add edx, [ecx + VM.offVMCPU] 245 cmp dword [edx + VMMCPU.cCallRing3Disabled], 0 246 jnz .return 247 add edx, [VMCPU.vmm + VMMCPU.TracerCtx] 248 249 ; 250 ; Save the X86 context. 251 ; 252 mov [edx + SUPDRVTRACERUSRCTX32.u.X86.eax], eax 253 mov [edx + SUPDRVTRACERUSRCTX32.u.X86.ecx], ecx 254 pop eax 255 mov [edx + SUPDRVTRACERUSRCTX32.u.X86.edx], eax 256 mov [edx + SUPDRVTRACERUSRCTX32.u.X86.ebx], ebx 257 mov [edx + SUPDRVTRACERUSRCTX32.u.X86.esi], esi 258 mov [edx + SUPDRVTRACERUSRCTX32.u.X86.edi], edi 259 pop eax 260 mov [edx + SUPDRVTRACERUSRCTX32.u.X86.eflags], eax 261 mov eax, [ebp + 4] 262 mov [edx + SUPDRVTRACERUSRCTX32.u.X86.eip], eax 263 mov eax, [ebp] 264 mov [edx + SUPDRVTRACERUSRCTX32.u.X86.ebp], eax 265 lea eax, [ebp + 4*2] 266 mov [edx + SUPDRVTRACERUSRCTX32.u.X86.esp], eax 267 268 mov ecx, [ebp + 4*2] 269 mov [edx + SUPDRVTRACERUSRCTX32.u.X86.uVtgProbeLoc], ecx 270 271 mov eax, [ecx + 4] ; VTGPROBELOC::idProbe. 272 mov [edx + SUPDRVTRACERUSRCTX32.idProbe], eax 273 mov dword [edx + SUPDRVTRACERUSRCTX32.cBits], 32 274 275 ; Copy the arguments off the stack. 276 %macro COPY_ONE_ARG 1 277 mov eax, [ebp + 8 + %1 * 4] 278 mov [edx + SUPDRVTRACERUSRCTX32.u.X86.aArgs + %1*4], eax 279 %endmacro 280 COPY_ONE_ARG 0 281 COPY_ONE_ARG 1 282 COPY_ONE_ARG 2 283 COPY_ONE_ARG 3 284 COPY_ONE_ARG 4 285 COPY_ONE_ARG 5 286 COPY_ONE_ARG 6 287 COPY_ONE_ARG 7 288 COPY_ONE_ARG 8 289 COPY_ONE_ARG 9 290 COPY_ONE_ARG 10 291 COPY_ONE_ARG 11 292 COPY_ONE_ARG 12 293 COPY_ONE_ARG 13 294 COPY_ONE_ARG 14 295 COPY_ONE_ARG 15 296 COPY_ONE_ARG 16 297 COPY_ONE_ARG 17 298 COPY_ONE_ARG 18 299 COPY_ONE_ARG 19 300 301 ; 302 ; Call the helper (too lazy to do the VMM structure stuff). 303 ; 304 mov ecx, IMP(g_VM) 305 push ecx 306 call NAME(vmmRCProbeFireHelper) 307 308 .return: 309 leave 310 ret 311 ENDPROC VMMRCProbeFire 312 -
trunk/src/VBox/VMM/include/VMMInternal.h
r39303 r41147 20 20 21 21 #include <VBox/cdefs.h> 22 #include <VBox/sup.h> 22 23 #include <VBox/vmm/stam.h> 23 24 #include <VBox/log.h> … … 425 426 * attempts at recursive rendezvous. */ 426 427 bool volatile fInRendezvous; 427 bool afPadding[HC_ARCH_BITS == 32 ? 7 : 3];428 bool afPadding[HC_ARCH_BITS == 32 ? 3 : 7]; 428 429 /** @} */ 430 431 /** @name Raw-mode context tracting data. 432 * @{ */ 433 SUPDRVTRACERUSRCTX TracerCtx; 434 /** @} */ 435 436 /** Alignment padding, making sure u64CallRing3Arg is nicly aligned. */ 437 uint32_t u32Padding1; 429 438 430 439 /** @name Call Ring-3 … … 439 448 /** The argument to the operation. */ 440 449 uint64_t u64CallRing3Arg; 441 /** The Ring-0 jmp buffer. */ 450 /** The Ring-0 jmp buffer. 451 * @remarks The size of this type isn't stable in assembly, so don't put 452 * anything that needs to be accessed from assembly after it. */ 442 453 VMMR0JMPBUF CallRing3JmpBufR0; 443 454 /** @} */ 444 455 445 456 } VMMCPU; 457 AssertCompileMemberAlignment(VMMCPU, TracerCtx, 8); 446 458 /** Pointer to VMMCPU. */ 447 459 typedef VMMCPU *PVMMCPU; -
trunk/src/VBox/VMM/include/VMMInternal.mac
r35333 r41147 17 17 18 18 %include "VBox/asmdefs.mac" 19 %include "VBox/sup.mac" 19 20 20 21 ; … … 95 96 endstruc 96 97 98 99 struc VMMCPU 100 101 .offVMCPU resd 1 102 .iLastGZRc resd 1 103 .pbEMTStackR3 RTR3PTR_RES 1 104 .pbEMTStackRC RTRCPTR_RES 1 105 .pbEMTStackBottomRC RTRCPTR_RES 1 106 %ifdef LOG_ENABLED 107 .pR0LoggerR3 RTR3PTR_RES 1 108 .pR0LoggerR0 RTR0PTR_RES 1 109 %endif 110 111 .fInRendezvous resb 1 112 %if HC_ARCH_BITS == 32 113 .afPadding resb 7 114 %else 115 .afPadding resb 3 116 %endif 117 118 alignb 8 119 .TracerCtx resb SUPDRVTRACERUSRCTX64_size 120 121 122 .cCallRing3Disabled resd 1 123 .enmCallRing3Operation resd 1 124 .rcCallRing3 resd 1 125 .u64CallRing3Arg resq 1 126 ; .CallRing3JmpBufR0 resb no-can-do 127 128 endstruc 129
Note:
See TracChangeset
for help on using the changeset viewer.