Changeset 42371 in vbox
- Timestamp:
- Jul 24, 2012 7:34:46 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/SELM.cpp
r41965 r42371 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 80 80 #include <iprt/string.h> 81 81 82 83 /**84 * Enable or disable tracking of Guest's GDT/LDT/TSS.85 * @{86 */87 #define SELM_TRACK_GUEST_GDT_CHANGES88 #define SELM_TRACK_GUEST_LDT_CHANGES89 #define SELM_TRACK_GUEST_TSS_CHANGES90 /** @} */91 82 92 83 /** … … 539 530 */ 540 531 int rc; 541 #ifdef SELM_TRACK_GUEST_GDT_CHANGES542 532 if (pVM->selm.s.GuestGdtr.pGdt != RTRCPTR_MAX && pVM->selm.s.fGDTRangeRegistered) 543 533 { … … 548 538 } 549 539 pVM->selm.s.fGDTRangeRegistered = false; 550 #endif551 #ifdef SELM_TRACK_GUEST_LDT_CHANGES552 540 if (pVM->selm.s.GCPtrGuestLdt != RTRCPTR_MAX) 553 541 { … … 556 544 pVM->selm.s.GCPtrGuestLdt = RTRCPTR_MAX; 557 545 } 558 #endif559 #ifdef SELM_TRACK_GUEST_TSS_CHANGES560 546 if (pVM->selm.s.GCPtrGuestTss != RTRCPTR_MAX) 561 547 { … … 565 551 pVM->selm.s.GCSelTss = RTSEL_MAX; 566 552 } 567 #endif568 553 569 554 /* … … 596 581 */ 597 582 int rc; 598 #ifdef SELM_TRACK_GUEST_GDT_CHANGES599 583 if (pVM->selm.s.GuestGdtr.pGdt != RTRCPTR_MAX && pVM->selm.s.fGDTRangeRegistered) 600 584 { … … 605 589 } 606 590 pVM->selm.s.fGDTRangeRegistered = false; 607 #endif608 #ifdef SELM_TRACK_GUEST_LDT_CHANGES609 591 if (pVM->selm.s.GCPtrGuestLdt != RTRCPTR_MAX) 610 592 { … … 613 595 pVM->selm.s.GCPtrGuestLdt = RTRCPTR_MAX; 614 596 } 615 #endif616 #ifdef SELM_TRACK_GUEST_TSS_CHANGES617 597 if (pVM->selm.s.GCPtrGuestTss != RTRCPTR_MAX) 618 598 { … … 622 602 pVM->selm.s.GCSelTss = RTSEL_MAX; 623 603 } 624 #endif625 604 626 605 /* … … 1040 1019 if (pVM->selm.s.GuestGdtr.cbGdt > GDTR.cbGdt) 1041 1020 memset(pGDTE, 0, pVM->selm.s.GuestGdtr.cbGdt - GDTR.cbGdt); 1042 #ifndef SELM_TRACK_GUEST_GDT_CHANGES 1043 pVM->selm.s.GuestGdtr.cbGdt = GDTR.cbGdt; 1044 #endif 1045 } 1046 1047 #ifdef SELM_TRACK_GUEST_GDT_CHANGES 1021 } 1022 1048 1023 /* 1049 1024 * Check if Guest's GDTR is changed. 1050 1025 */ 1051 if ( GDTR.pGdt != pVM->selm.s.GuestGdtr.pGdt1026 if ( GDTR.pGdt != pVM->selm.s.GuestGdtr.pGdt 1052 1027 || GDTR.cbGdt != pVM->selm.s.GuestGdtr.cbGdt) 1053 1028 { … … 1072 1047 pVM->selm.s.fGDTRangeRegistered = true; 1073 1048 } 1074 #endif1075 1049 } 1076 1050 … … 1113 1087 /* ldtr = 0 - update hyper LDTR and deregister any active handler. */ 1114 1088 CPUMSetHyperLDTR(pVCpu, 0); 1115 #ifdef SELM_TRACK_GUEST_LDT_CHANGES1116 1089 if (pVM->selm.s.GCPtrGuestLdt != RTRCPTR_MAX) 1117 1090 { … … 1120 1093 pVM->selm.s.GCPtrGuestLdt = RTRCPTR_MAX; 1121 1094 } 1122 #endif1123 1095 STAM_PROFILE_STOP(&pVM->selm.s.StatUpdateFromCPUM, a); 1124 1096 return VINF_SUCCESS; … … 1149 1121 */ 1150 1122 CPUMSetHyperLDTR(pVCpu, 0); 1151 #ifdef SELM_TRACK_GUEST_LDT_CHANGES1152 1123 if (pVM->selm.s.GCPtrGuestLdt != RTRCPTR_MAX) 1153 1124 { … … 1156 1127 pVM->selm.s.GCPtrGuestLdt = RTRCPTR_MAX; 1157 1128 } 1158 #endif1159 1129 STAM_PROFILE_STOP(&pVM->selm.s.StatUpdateFromCPUM, a); 1160 1130 return VINF_SUCCESS; … … 1171 1141 1172 1142 1173 #ifdef SELM_TRACK_GUEST_LDT_CHANGES1174 1143 /** @todo Handle only present LDT segments. */ 1175 1144 // if (pDesc->Gen.u1Present) … … 1218 1187 } 1219 1188 } 1220 #else1221 pVM->selm.s.cbLdtLimit = cbLdt;1222 #endif1223 1189 1224 1190 /*
Note:
See TracChangeset
for help on using the changeset viewer.