- Timestamp:
- Apr 12, 2013 5:32:57 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 85008
- Location:
- trunk/src
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp
r44399 r45528 295 295 return autoCaller.rc(); 296 296 297 #ifdef VBOX_WITH_RAW_MODE 297 298 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 298 299 … … 301 302 *aEnabled = PATMR3IsEnabled (ptrVM.rawUVM()); 302 303 else 304 #endif 303 305 *aEnabled = false; 304 306 … … 319 321 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 320 322 323 #ifdef VBOX_WITH_RAW_MODE 321 324 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 322 325 … … 336 339 return setError(VBOX_E_VM_ERROR, tr("PATMR3AllowPatching returned %Rrc"), vrc); 337 340 341 #else /* !VBOX_WITH_RAW_MODE */ 342 if (aEnable) 343 return setError(VBOX_E_VM_ERROR, tr("PATM not present"), VERR_NOT_SUPPORTED); 344 #endif /* !VBOX_WITH_RAW_MODE */ 338 345 return S_OK; 339 346 } … … 352 359 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 353 360 361 #ifdef VBOX_WITH_RAW_MODE 354 362 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 355 363 … … 359 367 *aEnabled = CSAMR3IsEnabled(ptrVM.rawUVM()); 360 368 else 369 #endif /* VBOX_WITH_RAW_MODE */ 361 370 *aEnabled = false; 362 371 … … 377 386 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 378 387 388 #ifdef VBOX_WITH_RAW_MODE 379 389 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 380 390 … … 394 404 return setError(VBOX_E_VM_ERROR, tr("CSAMR3SetScanningEnabled returned %Rrc"), vrc); 395 405 406 #else /* !VBOX_WITH_RAW_MODE */ 407 if (aEnable) 408 return setError(VBOX_E_VM_ERROR, tr("CASM not present"), VERR_NOT_SUPPORTED); 409 #endif /* !VBOX_WITH_RAW_MODE */ 396 410 return S_OK; 397 411 } -
trunk/src/VBox/VMM/Makefile.kmk
r45293 r45528 105 105 VBoxVMM_INCS = \ 106 106 include \ 107 PATM107 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,) 108 108 VBoxVMM_ASINCS = . 109 109 … … 171 171 VMMR3/VMMTests.cpp \ 172 172 VMMR3/HM.cpp \ 173 $(if-expr defined(VBOX_WITH_RAW_MODE), \ 173 174 VMMR3/CSAM.cpp \ 174 175 VMMR3/PATM.cpp \ … … 177 178 VMMR3/PATMA.asm \ 178 179 VMMR3/PATMSSM.cpp \ 180 ,) \ 179 181 VMMAll/CPUMAllRegs.cpp \ 180 182 VMMAll/CPUMStack.cpp \ … … 212 214 VMMAll/VMMAll.cpp \ 213 215 VMMAll/VMMAllA.asm \ 216 $(if-expr defined(VBOX_WITH_RAW_MODE), \ 214 217 VMMAll/CSAMAll.cpp \ 215 VMMAll/PATMAll.cpp 218 VMMAll/PATMAll.cpp \ 219 ,) 216 220 ifdef VBOX_WITH_VUSB 217 221 VBoxVMM_SOURCES += VMMR3/PDMUsb.cpp … … 375 379 include \ 376 380 VMMRC \ 377 PATM381 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,) 378 382 379 383 VMMRC_LIBS = \ … … 404 408 VMMRC/VMMRCA.asm \ 405 409 VMMRC/HMRCA.asm \ 406 VMMRC/CSAMRC.cpp \ 410 $(if-expr defined(VBOX_WITH_RAW_MODE), \ 411 VMMRC/CSAMRC.cpp \ 407 412 VMMRC/PATMRC.cpp \ 413 ,) \ 408 414 VMMRZ/DBGFRZ.cpp \ 409 415 VMMRZ/PGMRZDynMap.cpp \ … … 439 445 VMMAll/VMMAll.cpp \ 440 446 VMMAll/VMMAllA.asm \ 441 VMMAll/CSAMAll.cpp \ 442 VMMAll/PATMAll.cpp 447 $(if-expr defined(VBOX_WITH_RAW_MODE), 448 VMMAll/CSAMAll.cpp \ 449 VMMAll/PATMAll.cpp \ 450 ,) 443 451 ifeq ($(VBOX_LDR_FMT32),pe) 444 452 VMMRC_SOURCES += VMMRC/VMMRC.def … … 495 503 VMMR0_INCS = \ 496 504 include \ 497 PATM505 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,) 498 506 499 507 VMMR0_SOURCES = \ -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r45485 r45528 334 334 cbToRead = cbMinRead; 335 335 336 #if defined( IN_RC) || defined(IN_RING3)336 #if defined(VBOX_WITH_RAW_MODE) && (defined(IN_RC) || defined(IN_RING3)) 337 337 /* 338 338 * We might be called upon to interpret an instruction in a patch. -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r45103 r45528 776 776 } 777 777 778 # ifdef VBOX_WITH_RAW_MODE 778 779 /* 779 780 * Inform CSAM about the flush … … 783 784 */ 784 785 CSAMR3FlushPage(pVM, GCPtrPage); 786 # endif 785 787 #endif /* IN_RING3 */ 786 788 -
trunk/src/VBox/VMM/VMMAll/TRPMAll.cpp
r45485 r45528 847 847 848 848 849 #ifdef VBOX_WITH_RAW_MODE 849 850 /** 850 851 * Clear guest trap/interrupt gate handler … … 866 867 867 868 if (ASMBitTest(&pVM->trpm.s.au32IdtPatched[0], iTrap)) 868 # ifdef IN_RING3869 # ifdef IN_RING3 869 870 trpmR3ClearPassThroughHandler(pVM, iTrap); 870 # else871 # else 871 872 AssertFailed(); 872 # endif873 # endif 873 874 874 875 pVM->trpm.s.aGuestTrapHandler[iTrap] = TRPM_INVALID_HANDLER; 875 876 return VINF_SUCCESS; 876 877 } 877 878 #endif /* VBOX_WITH_RAW_MODE */ 879 -
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r45485 r45528 4170 4170 } 4171 4171 4172 #ifdef VBOX_WITH_RAW_MODE 4172 4173 4173 4174 /** … … 4314 4315 if (!pCtxCore->eflags.Bits.u1VM) 4315 4316 { 4316 # ifdef VBOX_WITH_RAW_RING14317 # ifdef VBOX_WITH_RAW_RING1 4317 4318 if ( EMIsRawRing1Enabled(pVM) 4318 4319 && (pCtxCore->ss.Sel & X86_SEL_RPL) == 2) … … 4338 4339 else 4339 4340 { 4340 # endif4341 # endif 4341 4342 /** @todo See what happens if we remove this. */ 4342 4343 if ((pCtxCore->ds.Sel & X86_SEL_RPL) == 1) … … 4348 4349 if ((pCtxCore->gs.Sel & X86_SEL_RPL) == 1) 4349 4350 pCtxCore->gs.Sel &= ~X86_SEL_RPL; 4350 # ifdef VBOX_WITH_RAW_RING14351 # ifdef VBOX_WITH_RAW_RING1 4351 4352 } 4352 # endif4353 # endif 4353 4354 } 4354 4355 } … … 4356 4357 return rc; 4357 4358 } 4359 4360 #endif /* VBOX_WITH_RAW_MODE */ 4358 4361 4359 4362 -
trunk/src/VBox/VMM/VMMR3/EM.cpp
r45485 r45528 163 163 164 164 pVCpu->em.s.pCtx = CPUMQueryGuestCtxPtr(pVCpu); 165 #ifdef VBOX_WITH_RAW_MODE 165 166 pVCpu->em.s.pPatmGCState = PATMR3QueryGCStateHC(pVM); 166 167 AssertMsg(pVCpu->em.s.pPatmGCState, ("PATMR3QueryGCStateHC failed!\n")); 168 #endif 167 169 168 170 /* Force reset of the time slice. */ … … 1352 1354 } 1353 1355 1356 # ifdef VBOX_WITH_RAW_MODE 1354 1357 if (PATMShouldUseRawMode(pVM, (RTGCPTR)pCtx->eip)) 1355 1358 { 1356 1359 Log2(("raw r0 mode forced: patch code\n")); 1357 # ifdef VBOX_WITH_SAFE_STR1360 # ifdef VBOX_WITH_SAFE_STR 1358 1361 Assert(pCtx->tr.Sel); 1359 # endif1362 # endif 1360 1363 return EMSTATE_RAW; 1361 1364 } 1365 # endif /* VBOX_WITH_RAW_MODE */ 1362 1366 1363 1367 # if !defined(VBOX_ALLOW_IF0) && !defined(VBOX_RUN_INTERRUPT_GATE_HANDLERS) … … 1471 1475 } 1472 1476 1477 #ifdef VBOX_WITH_RAW_MODE 1473 1478 if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_CSAM_PENDING_ACTION)) 1474 1479 CSAMR3DoPendingAction(pVM, pVCpu); 1480 #endif 1475 1481 1476 1482 if (VM_FF_ISPENDING(pVM, VM_FF_PGM_NO_MEMORY)) … … 1600 1606 Log(("Forced action VMCPU_FF_CSAM_SCAN_PAGE\n")); 1601 1607 1608 #ifdef VBOX_WITH_RAW_MODE 1602 1609 CSAMR3CheckCodeEx(pVM, CPUMCTX2CORE(pCtx), pCtx->eip); 1603 1610 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_CSAM_SCAN_PAGE); 1611 #endif 1604 1612 } 1605 1613 … … 1788 1796 && (!rc || rc >= VINF_EM_RESCHEDULE_HM) 1789 1797 && !TRPMHasTrap(pVCpu) /* an interrupt could already be scheduled for dispatching in the recompiler. */ 1798 #ifdef VBOX_WITH_RAW_MODE 1790 1799 && PATMAreInterruptsEnabled(pVM) 1800 #else 1801 && (pVCpu->em.s.pCtx->eflags.u32 & X86_EFL_IF) 1802 #endif 1791 1803 && !HMR3IsEventPending(pVCpu)) 1792 1804 { -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r45517 r45528 724 724 static void hmR3DisableRawMode(PVM pVM) 725 725 { 726 #ifdef VBOX_WITH_RAW_MODE 726 727 /* Disable PATM & CSAM. */ 727 728 PATMR3AllowPatching(pVM->pUVM, false); 728 729 CSAMDisableScanning(pVM); 730 #endif 729 731 730 732 /* Turn off IDT/LDT/GDT and TSS monitoring and sycing. */ -
trunk/src/VBox/VMM/VMMR3/TRPM.cpp
r45485 r45528 781 781 782 782 783 # ifdef VBOX_WITH_RAW_MODE 783 784 /** 784 785 * Resolve a builtin RC symbol. … … 813 814 return VINF_SUCCESS; 814 815 } 816 #endif /* VBOX_WITH_RAW_MODE */ 815 817 816 818 … … 1019 1021 } 1020 1022 1023 #ifdef VBOX_WITH_RAW_MODE 1021 1024 if (fRawRing0 && CSAMIsEnabled(pVM)) 1022 1025 { … … 1030 1033 CSAMR3CheckGates(pVM, 0, 256); 1031 1034 } 1035 #endif /* VBOX_WITH_RAW_MODE */ 1032 1036 1033 1037 /* … … 1064 1068 0, trpmR3GuestIDTWriteHandler, "trpmRCGuestIDTWriteHandler", 0, "Guest IDT write access handler"); 1065 1069 1070 # ifdef VBOX_WITH_RAW_MODE 1066 1071 if (rc == VERR_PGM_HANDLER_VIRTUAL_CONFLICT) 1067 1072 { … … 1074 1079 0, trpmR3GuestIDTWriteHandler, "trpmRCGuestIDTWriteHandler", 0, "Guest IDT write access handler"); 1075 1080 } 1081 # endif /* VBOX_WITH_RAW_MODE */ 1076 1082 1077 1083 AssertRCReturn(rc, rc); … … 1175 1181 } 1176 1182 1183 #ifdef VBOX_WITH_RAW_MODE 1177 1184 1178 1185 /** … … 1484 1491 } 1485 1492 1493 #endif /* VBOX_WITH_RAW_MODE */ 1486 1494 1487 1495 /** … … 1496 1504 { 1497 1505 PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu); 1506 #ifdef VBOX_WITH_RAW_MODE 1498 1507 Assert(!PATMIsPatchGCAddr(pVM, pCtx->eip)); 1508 #endif 1499 1509 Assert(!VMCPU_FF_ISSET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)); 1500 1510 -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r45525 r45528 931 931 if (RT_SUCCESS(rc)) 932 932 { 933 #ifdef VBOX_WITH_RAW_MODE 933 934 rc = CSAMR3Init(pVM); 934 935 if (RT_SUCCESS(rc)) … … 937 938 if (RT_SUCCESS(rc)) 938 939 { 940 #endif 939 941 rc = IOMR3Init(pVM); 940 942 if (RT_SUCCESS(rc)) … … 955 957 if (RT_SUCCESS(rc)) 956 958 rc = MMR3HyperInitFinalize(pVM); 959 #ifdef VBOX_WITH_RAW_MODE 957 960 if (RT_SUCCESS(rc)) 958 961 rc = PATMR3InitFinalize(pVM); 962 #endif 959 963 if (RT_SUCCESS(rc)) 960 964 rc = PGMR3InitFinalize(pVM); … … 995 999 AssertRC(rc2); 996 1000 } 1001 #ifdef VBOX_WITH_RAW_MODE 997 1002 int rc2 = PATMR3Term(pVM); 998 1003 AssertRC(rc2); … … 1001 1006 AssertRC(rc2); 1002 1007 } 1008 #endif 1003 1009 int rc2 = TRPMR3Term(pVM); 1004 1010 AssertRC(rc2); … … 1190 1196 SELMR3Relocate(pVM); /* !hack! fix stack! */ 1191 1197 TRPMR3Relocate(pVM, offDelta); 1198 #ifdef VBOX_WITH_RAW_MODE 1192 1199 PATMR3Relocate(pVM); 1193 1200 CSAMR3Relocate(pVM, offDelta); 1201 #endif 1194 1202 IOMR3Relocate(pVM, offDelta); 1195 1203 EMR3Relocate(pVM); … … 2425 2433 rc = IOMR3Term(pVM); 2426 2434 AssertRC(rc); 2435 #ifdef VBOX_WITH_RAW_MODE 2427 2436 rc = CSAMR3Term(pVM); 2428 2437 AssertRC(rc); 2429 2438 rc = PATMR3Term(pVM); 2430 2439 AssertRC(rc); 2440 #endif 2431 2441 rc = TRPMR3Term(pVM); 2432 2442 AssertRC(rc); … … 2696 2706 if (pVCpu->idCpu == 0) 2697 2707 { 2708 #ifdef VBOX_WITH_RAW_MODE 2698 2709 PATMR3Reset(pVM); 2699 2710 CSAMR3Reset(pVM); 2711 #endif 2700 2712 PDMR3Reset(pVM); 2701 2713 PGMR3Reset(pVM); -
trunk/src/VBox/VMM/include/EMInternal.h
r44528 r45528 347 347 RTGCUINTPTR GCPtrInhibitInterrupts; 348 348 349 #ifdef VBOX_WITH_RAW_MODE 349 350 /** Pointer to the PATM status structure. (R3 Ptr) */ 350 351 R3PTRTYPE(PPATMGCSTATE) pPatmGCState; 352 #endif 351 353 352 354 /** Pointer to the guest CPUM state. (R3 Ptr) */ -
trunk/src/VBox/VMM/include/REMInternal.h
r44528 r45528 235 235 bool remR3CanExecuteRaw(CPUState *env, RTGCPTR eip, unsigned fFlags, int *piException); 236 236 void remR3CSAMCheckEIP(CPUState *env, RTGCPTR GCPtrCode); 237 # ifdef VBOX_WITH_RAW_MODE 237 238 bool remR3GetOpcode(CPUState *env, RTGCPTR GCPtrInstr, uint8_t *pu8Byte); 239 # endif 238 240 bool remR3DisasInstr(CPUState *env, int f32BitCode, char *pszPrefix); 239 241 void remR3FlushPage(CPUState *env, RTGCPTR GCPtr); -
trunk/src/VBox/VMM/testcase/tstVMStructDTrace.cpp
r43387 r45528 43 43 #include "REMInternal.h" 44 44 #include "HMInternal.h" 45 #include "PATMInternal.h"46 45 #include "VMMInternal.h" 47 46 #include "DBGFInternal.h" 48 47 #include "STAMInternal.h" 49 #include "CSAMInternal.h"50 48 #include "EMInternal.h" 51 49 #include "IEMInternal.h" 52 50 #include "REMInternal.h" 51 #ifdef VBOX_WITH_RAW_MODE 52 # include "CSAMInternal.h" 53 # include "PATMInternal.h" 54 #endif 53 55 #include <VBox/vmm/vm.h> 54 56 #include <VBox/param.h> -
trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp
r45503 r45528 42 42 #include "SSMInternal.h" 43 43 #include "HMInternal.h" 44 #include "PATMInternal.h"45 44 #include "VMMInternal.h" 46 45 #include "DBGFInternal.h" 47 46 #include "STAMInternal.h" 48 47 #include "VMInternal.h" 49 #include "CSAMInternal.h"50 48 #include "EMInternal.h" 51 49 #include "IEMInternal.h" … … 53 51 #include "../VMMR0/GMMR0Internal.h" 54 52 #include "../VMMR0/GVMMR0Internal.h" 53 #ifdef VBOX_WITH_RAW_MODE 54 # include "CSAMInternal.h" 55 # include "PATMInternal.h" 56 #endif 55 57 #include <VBox/vmm/vm.h> 56 58 #include <VBox/vmm/uvm.h> … … 214 216 CHECK_PADDING_VM(64, pdm); 215 217 CHECK_PADDING_VM(64, iom); 218 #ifdef VBOX_WITH_RAW_MODE 216 219 CHECK_PADDING_VM(64, patm); 217 220 CHECK_PADDING_VM(64, csam); 221 #endif 218 222 CHECK_PADDING_VM(64, em); 219 223 /*CHECK_PADDING_VM(64, iem);*/ … … 380 384 CHECK_PADDING3(EMCPU, u.FatalLongJump, u.achPaddingFatalLongJump); 381 385 CHECK_SIZE_ALIGNMENT(VMMR0JMPBUF, 8); 386 #ifdef VBOX_WITH_RAW_MODE 382 387 CHECK_SIZE_ALIGNMENT(PATCHINFO, 8); 388 #endif 383 389 #if 0 384 390 PRINT_OFFSET(VM, fForcedActions); -
trunk/src/recompiler/VBoxRecompiler.c
r45485 r45528 1657 1657 } 1658 1658 1659 #ifdef VBOX_WITH_RAW_MODE 1659 1660 if (PATMIsPatchGCAddr(env->pVM, eip)) 1660 1661 { … … 1663 1664 return true; 1664 1665 } 1666 #endif 1665 1667 1666 1668 #if !defined(VBOX_ALLOW_IF0) && !defined(VBOX_RUN_INTERRUPT_GATE_HANDLERS) … … 1741 1743 1742 1744 1745 #ifdef VBOX_WITH_RAW_MODE 1743 1746 /** 1744 1747 * Fetches a code byte. … … 1756 1759 return false; 1757 1760 } 1761 #endif /* VBOX_WITH_RAW_MODE */ 1758 1762 1759 1763 … … 2089 2093 void remR3RecordCall(CPUX86State *env) 2090 2094 { 2095 #ifdef VBOX_WITH_RAW_MODE 2091 2096 CSAMR3RecordCallAddress(env->pVM, env->eip); 2097 #endif 2092 2098 } 2093 2099 -
trunk/src/recompiler/target-i386/translate.c
r42601 r45528 107 107 uint8_t b; 108 108 109 # ifdef VBOX_WITH_RAW_MODE 109 110 if (!remR3GetOpcode(cpu_single_env, pc, &b)) 111 # endif 110 112 b = ldub_code(pc); 111 113 return b;
Note:
See TracChangeset
for help on using the changeset viewer.