- Timestamp:
- Mar 20, 2007 8:08:01 PM (18 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/SELM.cpp
r1552 r1580 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 AssertRelease(sizeof(pVM->selm.s.Tss.IntRedirBitmap) == 0x20); 111 111 112 112 /* … … 153 153 pVM->selm.s.Tss.offIoBitmap = sizeof(VBOXTSS); 154 154 /* bit set to 1 means no redirection */ 155 memset(pVM->selm.s.Tss. redirBitmap, 0xff, sizeof(pVM->selm.s.Tss.redirBitmap));155 memset(pVM->selm.s.Tss.IntRedirBitmap, 0xff, sizeof(pVM->selm.s.Tss.IntRedirBitmap)); 156 156 157 157 /* … … 1430 1430 || pDesc->Gen.u4Type == X86_SEL_TYPE_SYS_386_TSS_BUSY; 1431 1431 1432 /* * @note we should monitor the whole TSS to catch accesses to the virtual interrupt redirection bitmap, but1433 * 1434 * 1432 /* Note: We should monitor the whole TSS to catch accesses to the virtual interrupt redirection bitmap, but 1433 * that causes some problems and with Windows guests some overhead as the entire TSS is rather big (3 pages). 1434 * We'll assume for now that the bitmap is static. 1435 1435 */ 1436 1436 #if 1 … … 1517 1517 if (CPUMGetGuestCR4(pVM) & X86_CR4_VME) 1518 1518 { 1519 uint32_t offRedirBitmap = tss.offIoBitmap - sizeof(tss. redirBitmap);1519 uint32_t offRedirBitmap = tss.offIoBitmap - sizeof(tss.IntRedirBitmap); 1520 1520 1521 1521 /** @todo not sure how the partial case is handled; probably not allowed */ 1522 if (offRedirBitmap + sizeof(tss. redirBitmap) <= cbTss)1522 if (offRedirBitmap + sizeof(tss.IntRedirBitmap) <= cbTss) 1523 1523 { 1524 rc = PGMPhysReadGCPtr(pVM, &pVM->selm.s.Tss. redirBitmap, GCPtrTss + offRedirBitmap, sizeof(tss.redirBitmap));1524 rc = PGMPhysReadGCPtr(pVM, &pVM->selm.s.Tss.IntRedirBitmap, GCPtrTss + offRedirBitmap, sizeof(tss.IntRedirBitmap)); 1525 1525 AssertRC(rc); 1526 1526 Log2(("Redirection bitmap:\n")); 1527 Log2(("%.*Vhxd\n", sizeof(tss. redirBitmap), &pVM->selm.s.Tss.redirBitmap));1527 Log2(("%.*Vhxd\n", sizeof(tss.IntRedirBitmap), &pVM->selm.s.Tss.IntRedirBitmap)); 1528 1528 } 1529 1529 } -
trunk/src/VBox/VMM/TRPMInternal.mac
r1524 r1580 113 113 .fDebugTrap resw 1 114 114 .offIoBitmap resw 1 115 . redirBitmapresb 32115 .IntRedirBitmap resb 32 116 116 endstruc 117 117 -
trunk/src/VBox/VMM/VMMGC/SELMGC.cpp
r1504 r1580 287 287 if (CPUMGetGuestCR4(pVM) & X86_CR4_VME) 288 288 { 289 uint32_t off RedirBitmap = pGuestTSS->offIoBitmap - sizeof(pVM->selm.s.Tss.redirBitmap);289 uint32_t offIntRedirBitmap = pGuestTSS->offIoBitmap - sizeof(pVM->selm.s.Tss.IntRedirBitmap); 290 290 291 291 /** @todo not sure how the partial case is handled; probably not allowed */ 292 if ( off RedirBitmap <= offRange293 && off RedirBitmap + sizeof(pVM->selm.s.Tss.redirBitmap) >= offRange + cb294 && off RedirBitmap + sizeof(pVM->selm.s.Tss.redirBitmap) <= pVM->selm.s.cbGuestTss)292 if ( offIntRedirBitmap <= offRange 293 && offIntRedirBitmap + sizeof(pVM->selm.s.Tss.IntRedirBitmap) >= offRange + cb 294 && offIntRedirBitmap + sizeof(pVM->selm.s.Tss.IntRedirBitmap) <= pVM->selm.s.cbGuestTss) 295 295 { 296 Log(("offIoBitmap=%x off RedirBitmap=%x cbTSS=%x\n", pGuestTSS->offIoBitmap, offRedirBitmap, pVM->selm.s.cbGuestTss));296 Log(("offIoBitmap=%x offIntRedirBitmap=%x cbTSS=%x\n", pGuestTSS->offIoBitmap, offIntRedirBitmap, pVM->selm.s.cbGuestTss)); 297 297 /** @todo only update the changed part. */ 298 for (uint32_t i =0;i<sizeof(pVM->selm.s.Tss.redirBitmap)/8;i++)298 for (uint32_t i = 0; i < sizeof(pVM->selm.s.Tss.IntRedirBitmap) / 8;i++) 299 299 { 300 rc = MMGCRamRead(pVM, &pVM->selm.s.Tss. redirBitmap[i*8], (uint8_t *)pGuestTSS + offRedirBitmap + i*8, 8);300 rc = MMGCRamRead(pVM, &pVM->selm.s.Tss.IntRedirBitmap[i * 8], (uint8_t *)pGuestTSS + offIntRedirBitmap + i * 8, 8); 301 301 if (VBOX_FAILURE(rc)) 302 302 { 303 303 /* Shadow page table might be out of sync */ 304 rc = PGMPrefetchPage(pVM, (uint8_t *)pGuestTSS + off RedirBitmap + i*8);304 rc = PGMPrefetchPage(pVM, (uint8_t *)pGuestTSS + offIntRedirBitmap + i*8); 305 305 if (VBOX_FAILURE(rc)) 306 306 { 307 AssertMsg(rc == VINF_SUCCESS, ("PGMPrefetchPage %VGv failed with %Vrc\n", (uint8_t *)pGuestTSS + off RedirBitmap + i*8, rc));307 AssertMsg(rc == VINF_SUCCESS, ("PGMPrefetchPage %VGv failed with %Vrc\n", (uint8_t *)pGuestTSS + offIntRedirBitmap + i*8, rc)); 308 308 break; 309 309 } 310 rc = MMGCRamRead(pVM, &pVM->selm.s.Tss. redirBitmap[i*8], (uint8_t *)pGuestTSS + offRedirBitmap + i*8, 8);310 rc = MMGCRamRead(pVM, &pVM->selm.s.Tss.IntRedirBitmap[i * 8], (uint8_t *)pGuestTSS + offIntRedirBitmap + i * 8, 8); 311 311 } 312 AssertMsg(rc == VINF_SUCCESS, ("MMGCRamRead %VGv failed with %Vrc\n", (uint8_t *)pGuestTSS + off RedirBitmap + i*8, rc));312 AssertMsg(rc == VINF_SUCCESS, ("MMGCRamRead %VGv failed with %Vrc\n", (uint8_t *)pGuestTSS + offIntRedirBitmap + i * 8, rc)); 313 313 } 314 314 STAM_COUNTER_INC(&pVM->selm.s.StatGCWriteGuestTSSRedir);
Note:
See TracChangeset
for help on using the changeset viewer.