Changeset 45533 in vbox for trunk/src/VBox/VMM/VMMR3/TRPM.cpp
- Timestamp:
- Apr 13, 2013 4:13:22 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/TRPM.cpp
r45528 r45533 424 424 425 425 426 /** Enable or disable tracking of Guest's IDT. */ 426 #ifdef VBOX_WITH_RAW_MODE 427 / ** Enable or disable tracking of Guest's IDT. */ 427 428 #define TRPM_TRACK_GUEST_IDT_CHANGES 428 429 429 /** Enable or disable tracking of Shadow IDT. */ 430 #define TRPM_TRACK_SHADOW_IDT_CHANGES 430 # define TRPM_TRACK_SHADOW_IDT_CHANGES 431 #endif 431 432 432 433 /** TRPM saved state version. */ … … 440 441 static DECLCALLBACK(int) trpmR3Save(PVM pVM, PSSMHANDLE pSSM); 441 442 static DECLCALLBACK(int) trpmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass); 443 #ifdef TRPM_TRACK_GUEST_IDT_CHANGES 442 444 static DECLCALLBACK(int) trpmR3GuestIDTWriteHandler(PVM pVM, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser); 445 #endif 443 446 444 447 … … 571 574 STAM_REG(pVM, &pVM->trpm.s.StatTrap0dRdTsc, STAMTYPE_COUNTER, "/TRPM/RC/Traps/0d/RdTsc", STAMUNIT_OCCURENCES, "Number of RDTSC #GPs."); 572 575 576 #ifdef VBOX_WITH_RAW_MODE 573 577 /* 574 578 * Default action when entering raw mode for the first time … … 576 580 PVMCPU pVCpu = &pVM->aCpus[0]; /* raw mode implies on VCPU */ 577 581 VMCPU_FF_SET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT); 582 #endif 578 583 return 0; 579 584 } … … 773 778 TRPMR3Relocate(pVM, 0); 774 779 780 #ifdef VBOX_WITH_RAW_MODE 775 781 /* 776 782 * Default action when entering raw mode for the first time … … 778 784 PVMCPU pVCpu = &pVM->aCpus[0]; /* raw mode implies on VCPU */ 779 785 VMCPU_FF_SET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT); 786 #endif 780 787 } 781 788 … … 847 854 SSMR3PutBool(pSSM, pTrpm->fDisableMonitoring); 848 855 PVMCPU pVCpu = &pVM->aCpus[0]; /* raw mode implies 1 VCPU */ 849 SSMR3PutUInt(pSSM, VM CPU_FF_ISSET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT));856 SSMR3PutUInt(pSSM, VM_WHEN_RAW_MODE(VMCPU_FF_ISSET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT), 0)); 850 857 SSMR3PutMem(pSSM, &pTrpm->au32IdtPatched[0], sizeof(pTrpm->au32IdtPatched)); 851 858 SSMR3PutU32(pSSM, ~0); /* separator. */ … … 947 954 return VERR_SSM_DATA_UNIT_FORMAT_CHANGED; 948 955 } 956 #ifdef VBOX_WITH_RAW_MODE 949 957 if (fSyncIDT) 950 958 { … … 953 961 } 954 962 /* else: cleared by reset call above. */ 963 #endif 955 964 956 965 SSMR3GetMem(pSSM, &pTrpm->au32IdtPatched[0], sizeof(pTrpm->au32IdtPatched)); … … 1000 1009 } 1001 1010 1011 #ifdef VBOX_WITH_RAW_MODE 1002 1012 1003 1013 /** … … 1021 1031 } 1022 1032 1023 #ifdef VBOX_WITH_RAW_MODE1024 1033 if (fRawRing0 && CSAMIsEnabled(pVM)) 1025 1034 { … … 1033 1042 CSAMR3CheckGates(pVM, 0, 256); 1034 1043 } 1035 #endif /* VBOX_WITH_RAW_MODE */1036 1044 1037 1045 /* … … 1046 1054 } 1047 1055 1048 # ifdef TRPM_TRACK_GUEST_IDT_CHANGES1056 # ifdef TRPM_TRACK_GUEST_IDT_CHANGES 1049 1057 /* 1050 1058 * Check if Guest's IDTR has changed. … … 1068 1076 0, trpmR3GuestIDTWriteHandler, "trpmRCGuestIDTWriteHandler", 0, "Guest IDT write access handler"); 1069 1077 1070 # ifdef VBOX_WITH_RAW_MODE1071 1078 if (rc == VERR_PGM_HANDLER_VIRTUAL_CONFLICT) 1072 1079 { … … 1079 1086 0, trpmR3GuestIDTWriteHandler, "trpmRCGuestIDTWriteHandler", 0, "Guest IDT write access handler"); 1080 1087 } 1081 # endif /* VBOX_WITH_RAW_MODE */1082 1088 1083 1089 AssertRCReturn(rc, rc); … … 1087 1093 pVM->trpm.s.GuestIdtr = IDTR; 1088 1094 } 1089 # endif1095 # endif 1090 1096 1091 1097 /* … … 1125 1131 * Deregister any virtual handlers. 1126 1132 */ 1127 # ifdef TRPM_TRACK_GUEST_IDT_CHANGES1133 # ifdef TRPM_TRACK_GUEST_IDT_CHANGES 1128 1134 if (pVM->trpm.s.GuestIdtr.pIdt != RTRCPTR_MAX) 1129 1135 { … … 1136 1142 } 1137 1143 pVM->trpm.s.GuestIdtr.cbIdt = 0; 1138 # endif1139 1140 # ifdef TRPM_TRACK_SHADOW_IDT_CHANGES1144 # endif 1145 1146 # ifdef TRPM_TRACK_SHADOW_IDT_CHANGES 1141 1147 if (pVM->trpm.s.pvMonShwIdtRC != RTRCPTR_MAX) 1142 1148 { … … 1145 1151 pVM->trpm.s.pvMonShwIdtRC = RTRCPTR_MAX; 1146 1152 } 1147 # endif1153 # endif 1148 1154 1149 1155 PVMCPU pVCpu = &pVM->aCpus[0]; /* raw mode implies on VCPU */ … … 1181 1187 } 1182 1188 1183 #ifdef VBOX_WITH_RAW_MODE1184 1189 1185 1190 /**
Note:
See TracChangeset
for help on using the changeset viewer.