- Timestamp:
- Mar 15, 2007 10:00:42 AM (18 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/SELM.cpp
r1501 r1502 108 108 AssertRelease((RT_OFFSETOF(VM, selm.s.Tss) & PAGE_OFFSET_MASK) <= PAGE_SIZE - sizeof(pVM->selm.s.Tss)); 109 109 AssertRelease((RT_OFFSETOF(VM, selm.s.TssTrap08) & PAGE_OFFSET_MASK) <= PAGE_SIZE - sizeof(pVM->selm.s.TssTrap08)); 110 AssertRelease(sizeof(pVM->selm.s.Tss.redirBitmap) == 0x20); 110 111 111 112 /* … … 170 171 STAM_REG(pVM, &pVM->selm.s.StatGCWriteGuestLDT, STAMTYPE_COUNTER, "/SELM/GC/Write/Guest/LDT", STAMUNIT_OCCURENCES, "The number of writes to the Guest LDT was detected."); 171 172 STAM_REG(pVM, &pVM->selm.s.StatGCWriteGuestTSSHandled, STAMTYPE_COUNTER, "/SELM/GC/Write/Guest/TSSInt", STAMUNIT_OCCURENCES, "The number of handled writes to the Guest TSS."); 173 STAM_REG(pVM, &pVM->selm.s.StatGCWriteGuestTSSRedir, STAMTYPE_COUNTER, "/SELM/GC/Write/Guest/TSSRedir",STAMUNIT_OCCURENCES, "The number of handled redir bitmap writes to the Guest TSS."); 172 174 STAM_REG(pVM, &pVM->selm.s.StatGCWriteGuestTSSHandledChanged,STAMTYPE_COUNTER, "/SELM/GC/Write/Guest/TSSIntChg", STAMUNIT_OCCURENCES, "The number of handled writes to the Guest TSS where the R0 stack changed."); 173 175 STAM_REG(pVM, &pVM->selm.s.StatGCWriteGuestTSSUnhandled, STAMTYPE_COUNTER, "/SELM/GC/Write/Guest/TSSEmu", STAMUNIT_OCCURENCES, "The number of unhandled writes to the Guest TSS."); … … 1489 1491 /* feeling very lazy; reading too much */ 1490 1492 VBOXTSS tss; 1491 rc = PGMPhysReadGCPtr(pVM, &tss, GCPtrTss, sizeof(VBOXTSS));1493 rc = PGMPhysReadGCPtr(pVM, &tss, GCPtrTss, RT_OFFSETOF(VBOXTSS, offIoBitmap) + sizeof(tss.offIoBitmap)); 1492 1494 if (VBOX_SUCCESS(rc)) 1493 1495 { … … 1504 1506 /* Update our TSS structure for the guest's ring 1 stack */ 1505 1507 SELMSetRing1Stack(pVM, tss.ss0 | 1, tss.esp0); 1508 1509 /* Should we sync the virtual interrupt redirection bitmap as well? */ 1510 if (CPUMGetGuestCR4(pVM) & X86_CR4_VME) 1511 { 1512 uint32_t offRedirBitmap = tss.offIoBitmap - sizeof(tss.redirBitmap); 1513 1514 /** @todo not sure how the partial case is handled; probably not allowed */ 1515 if (offRedirBitmap + sizeof(tss.redirBitmap) <= cbTss) 1516 { 1517 rc = PGMPhysReadGCPtr(pVM, &pVM->selm.s.Tss.redirBitmap, GCPtrTss + offRedirBitmap, sizeof(tss.redirBitmap)); 1518 AssertRC(rc); 1519 } 1520 } 1506 1521 } 1507 1522 else … … 1509 1524 /* Note: the ring 0 stack selector and base address are updated on demand in this case. */ 1510 1525 1511 /* Note:handle these dependencies better! */1526 /** @todo handle these dependencies better! */ 1512 1527 TRPMR3SetGuestTrapHandler(pVM, 0x2E, TRPM_INVALID_HANDLER); 1513 1528 TRPMR3SetGuestTrapHandler(pVM, 0x80, TRPM_INVALID_HANDLER); -
trunk/src/VBox/VMM/SELMInternal.h
r1480 r1502 150 150 STAMPROFILE StatTSSSync; 151 151 152 /** GC: The number of handled write to the Guest's GDT. */152 /** GC: The number of handled writes to the Guest's GDT. */ 153 153 STAMCOUNTER StatGCWriteGuestGDTHandled; 154 154 /** GC: The number of unhandled write to the Guest's GDT. */ 155 155 STAMCOUNTER StatGCWriteGuestGDTUnhandled; 156 /** GC: The number of times write to Guest's LDT was detected. */156 /** GC: The number of times writes to Guest's LDT was detected. */ 157 157 STAMCOUNTER StatGCWriteGuestLDT; 158 /** GC: The number of handled write to the Guest's TSS. */158 /** GC: The number of handled writes to the Guest's TSS. */ 159 159 STAMCOUNTER StatGCWriteGuestTSSHandled; 160 /** GC: The number of handled write to the Guest's TSS where we detected a change. */160 /** GC: The number of handled writes to the Guest's TSS where we detected a change. */ 161 161 STAMCOUNTER StatGCWriteGuestTSSHandledChanged; 162 /** GC: The number of unhandled write to the Guest's TSS. */ 162 /** GC: The number of handled redir writes to the Guest's TSS where we detected a change. */ 163 STAMCOUNTER StatGCWriteGuestTSSRedir; 164 /** GC: The number of unhandled writes to the Guest's TSS. */ 163 165 STAMCOUNTER StatGCWriteGuestTSSUnhandled; 164 166 /** The number of times we had to relocate our hypervisor selectors. */ -
trunk/src/VBox/VMM/VMMGC/SELMGC.cpp
r1444 r1502 284 284 STAM_COUNTER_INC(&pVM->selm.s.StatGCWriteGuestTSSHandledChanged); 285 285 } 286 if (CPUMGetGuestCR4(pVM) & X86_CR4_VME) 287 { 288 uint32_t offRedirBitmap = pGuestTSS->offIoBitmap - sizeof(pVM->selm.s.Tss.redirBitmap); 289 290 /** @todo not sure how the partial case is handled; probably not allowed */ 291 if (offRedirBitmap + sizeof(pVM->selm.s.Tss.redirBitmap) <= pVM->selm.s.cbGuestTss) 292 { 293 /** @todo check if fault was in this range and, if so, only update the changed part. */ 294 for (uint32_t i=0;i<sizeof(pVM->selm.s.Tss.redirBitmap)/8;i++) 295 { 296 rc = MMGCRamRead(pVM, &pVM->selm.s.Tss.redirBitmap[i*8], (uint8_t *)pGuestTSS + offRedirBitmap + i*8, 8); 297 AssertRC(rc); 298 } 299 STAM_COUNTER_INC(&pVM->selm.s.StatGCWriteGuestTSSRedir); 300 } 301 302 } 286 303 STAM_COUNTER_INC(&pVM->selm.s.StatGCWriteGuestTSSHandled); 287 304 }
Note:
See TracChangeset
for help on using the changeset viewer.