Changeset 41728 in vbox
- Timestamp:
- Jun 14, 2012 11:04:57 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/dis.h
r41727 r41728 309 309 /** @} */ 310 310 311 #define USE_REG_FP0 0 312 #define USE_REG_FP1 1 313 #define USE_REG_FP2 2 314 #define USE_REG_FP3 3 315 #define USE_REG_FP4 4 316 #define USE_REG_FP5 5 317 #define USE_REG_FP6 6 318 #define USE_REG_FP7 7 319 320 #define USE_REG_CR0 0 321 #define USE_REG_CR1 1 322 #define USE_REG_CR2 2 323 #define USE_REG_CR3 3 324 #define USE_REG_CR4 4 325 #define USE_REG_CR8 8 326 327 #define USE_REG_DR0 0 328 #define USE_REG_DR1 1 329 #define USE_REG_DR2 2 330 #define USE_REG_DR3 3 331 #define USE_REG_DR4 4 332 #define USE_REG_DR5 5 333 #define USE_REG_DR6 6 334 #define USE_REG_DR7 7 335 336 #define USE_REG_MMX0 0 337 #define USE_REG_MMX1 1 338 #define USE_REG_MMX2 2 339 #define USE_REG_MMX3 3 340 #define USE_REG_MMX4 4 341 #define USE_REG_MMX5 5 342 #define USE_REG_MMX6 6 343 #define USE_REG_MMX7 7 344 345 #define USE_REG_XMM0 0 346 #define USE_REG_XMM1 1 347 #define USE_REG_XMM2 2 348 #define USE_REG_XMM3 3 349 #define USE_REG_XMM4 4 350 #define USE_REG_XMM5 5 351 #define USE_REG_XMM6 6 352 #define USE_REG_XMM7 7 353 /** @todo missing XMM8-XMM15 */ 311 /** @name FPU register indexes. 312 * This matches the AMD64 register encoding. It is found used in 313 * DISOPPARAM::base.reg_fp. 314 * @{ 315 */ 316 #define DISFPREG_ST0 UINT8_C(0) 317 #define DISFPREG_ST1 UINT8_C(1) 318 #define DISFPREG_ST2 UINT8_C(2) 319 #define DISFPREG_ST3 UINT8_C(3) 320 #define DISFPREG_ST4 UINT8_C(4) 321 #define DISFPREG_ST5 UINT8_C(5) 322 #define DISFPREG_ST6 UINT8_C(6) 323 #define DISFPREG_ST7 UINT8_C(7) 324 /** @} */ 325 326 /** @name Control register indexes. 327 * This matches the AMD64 register encoding. It is found used in 328 * DISOPPARAM::base.reg_ctrl. 329 * @{ 330 */ 331 #define DISCREG_CR0 UINT8_C(0) 332 #define DISCREG_CR1 UINT8_C(1) 333 #define DISCREG_CR2 UINT8_C(2) 334 #define DISCREG_CR3 UINT8_C(3) 335 #define DISCREG_CR4 UINT8_C(4) 336 #define DISCREG_CR8 UINT8_C(8) 337 /** @} */ 338 339 /** @name Debug register indexes. 340 * This matches the AMD64 register encoding. It is found used in 341 * DISOPPARAM::base.reg_dbg. 342 * @{ 343 */ 344 #define DISDREG_DR0 UINT8_C(0) 345 #define DISDREG_DR1 UINT8_C(1) 346 #define DISDREG_DR2 UINT8_C(2) 347 #define DISDREG_DR3 UINT8_C(3) 348 #define DISDREG_DR4 UINT8_C(4) 349 #define DISDREG_DR5 UINT8_C(5) 350 #define DISDREG_DR6 UINT8_C(6) 351 #define DISDREG_DR7 UINT8_C(7) 352 /** @} */ 353 354 /** @name MMX register indexes. 355 * This matches the AMD64 register encoding. It is found used in 356 * DISOPPARAM::base.reg_mmx. 357 * @{ 358 */ 359 #define DISMREG_MMX0 UINT8_C(0) 360 #define DISMREG_MMX1 UINT8_C(1) 361 #define DISMREG_MMX2 UINT8_C(2) 362 #define DISMREG_MMX3 UINT8_C(3) 363 #define DISMREG_MMX4 UINT8_C(4) 364 #define DISMREG_MMX5 UINT8_C(5) 365 #define DISMREG_MMX6 UINT8_C(6) 366 #define DISMREG_MMX7 UINT8_C(7) 367 /** @} */ 368 369 /** @name SSE register indexes. 370 * This matches the AMD64 register encoding. It is found used in 371 * DISOPPARAM::base.reg_xmm. 372 * @{ 373 */ 374 #define DISXREG_XMM0 UINT8_C(0) 375 #define DISXREG_XMM1 UINT8_C(1) 376 #define DISXREG_XMM2 UINT8_C(2) 377 #define DISXREG_XMM3 UINT8_C(3) 378 #define DISXREG_XMM4 UINT8_C(4) 379 #define DISXREG_XMM5 UINT8_C(5) 380 #define DISXREG_XMM6 UINT8_C(6) 381 #define DISXREG_XMM7 UINT8_C(7) 382 /** @} */ 354 383 355 384 /** Used by DISQueryParamVal & EMIQueryParamVal … … 424 453 /** DISGREG_XXX. */ 425 454 uint8_t reg_gen; 426 /** ST(0) - ST(7)*/455 /** DISFPREG_XXX */ 427 456 uint8_t reg_fp; 428 /** MMX0 - MMX7*/457 /** DISMREG_XXX. */ 429 458 uint8_t reg_mmx; 430 /** XMM0 - XMM7*/459 /** DISXREG_XXX. */ 431 460 uint8_t reg_xmm; 432 /** {ES, CS, SS, DS, FS, GS} (DISSELREG). */461 /** DISSELREG_XXX. */ 433 462 uint8_t reg_seg; 434 /** TR0-TR7 (?)*/463 /** TR0-TR7 (no defines for these). */ 435 464 uint8_t reg_test; 436 /** CR0-CR4*/465 /** DISCREG_XXX */ 437 466 uint8_t reg_ctrl; 438 /** D R0-DR7*/467 /** DISDREG_XXX */ 439 468 uint8_t reg_dbg; 440 469 } base; -
trunk/src/VBox/Disassembler/DisasmCore.cpp
r41727 r41728 743 743 { 744 744 pCpu->prefix &= ~DISPREFIX_LOCK; 745 pParam->base.reg_ctrl = USE_REG_CR8;745 pParam->base.reg_ctrl = DISCREG_CR8; 746 746 } 747 747 else -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r40235 r41728 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 … … 1265 1265 { 1266 1266 uint64_t u64; 1267 int rc = CPUMGetGuestCRx(pVCpu, USE_REG_CR8, &u64);1267 int rc = CPUMGetGuestCRx(pVCpu, DISCREG_CR8, &u64); 1268 1268 if (RT_FAILURE(rc)) 1269 1269 u64 = 0; … … 1348 1348 switch (iReg) 1349 1349 { 1350 case USE_REG_CR0:1350 case DISCREG_CR0: 1351 1351 *pValue = pVCpu->cpum.s.Guest.cr0; 1352 1352 break; 1353 1353 1354 case USE_REG_CR2:1354 case DISCREG_CR2: 1355 1355 *pValue = pVCpu->cpum.s.Guest.cr2; 1356 1356 break; 1357 1357 1358 case USE_REG_CR3:1358 case DISCREG_CR3: 1359 1359 *pValue = pVCpu->cpum.s.Guest.cr3; 1360 1360 break; 1361 1361 1362 case USE_REG_CR4:1362 case DISCREG_CR4: 1363 1363 *pValue = pVCpu->cpum.s.Guest.cr4; 1364 1364 break; 1365 1365 1366 case USE_REG_CR8:1366 case DISCREG_CR8: 1367 1367 { 1368 1368 uint8_t u8Tpr; … … 1423 1423 VMMDECL(int) CPUMGetGuestDRx(PVMCPU pVCpu, uint32_t iReg, uint64_t *pValue) 1424 1424 { 1425 AssertReturn(iReg <= USE_REG_DR7, VERR_INVALID_PARAMETER);1425 AssertReturn(iReg <= DISDREG_DR7, VERR_INVALID_PARAMETER); 1426 1426 /* DR4 is an alias for DR6, and DR5 is an alias for DR7. */ 1427 1427 if (iReg == 4 || iReg == 5) … … 1970 1970 VMMDECL(int) CPUMSetGuestDRx(PVMCPU pVCpu, uint32_t iReg, uint64_t Value) 1971 1971 { 1972 AssertReturn(iReg <= USE_REG_DR7, VERR_INVALID_PARAMETER);1972 AssertReturn(iReg <= DISDREG_DR7, VERR_INVALID_PARAMETER); 1973 1973 /* DR4 is an alias for DR6, and DR5 is an alias for DR7. */ 1974 1974 if (iReg == 4 || iReg == 5) -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r41727 r41728 2209 2209 switch (DestRegCrx) 2210 2210 { 2211 case USE_REG_CR0:2211 case DISCREG_CR0: 2212 2212 oldval = CPUMGetGuestCR0(pVCpu); 2213 2213 #ifdef IN_RC … … 2262 2262 return rc2 == VINF_SUCCESS ? rc : rc2; 2263 2263 2264 case USE_REG_CR2:2264 case DISCREG_CR2: 2265 2265 rc = CPUMSetGuestCR2(pVCpu, val); AssertRC(rc); 2266 2266 return VINF_SUCCESS; 2267 2267 2268 case USE_REG_CR3:2268 case DISCREG_CR3: 2269 2269 /* Reloading the current CR3 means the guest just wants to flush the TLBs */ 2270 2270 rc = CPUMSetGuestCR3(pVCpu, val); AssertRC(rc); … … 2277 2277 return rc; 2278 2278 2279 case USE_REG_CR4:2279 case DISCREG_CR4: 2280 2280 oldval = CPUMGetGuestCR4(pVCpu); 2281 2281 rc = CPUMSetGuestCR4(pVCpu, val); AssertRC(rc); … … 2315 2315 return rc2 == VINF_SUCCESS ? rc : rc2; 2316 2316 2317 case USE_REG_CR8:2317 case DISCREG_CR8: 2318 2318 return PDMApicSetTPR(pVCpu, val << 4); /* cr8 bits 3-0 correspond to bits 7-4 of the task priority mmio register. */ 2319 2319 2320 2320 default: 2321 2321 AssertFailed(); 2322 case USE_REG_CR1: /* illegal op */2322 case DISCREG_CR1: /* illegal op */ 2323 2323 break; 2324 2324 } … … 2377 2377 | (u16Data & (X86_CR0_PE | X86_CR0_MP | X86_CR0_EM | X86_CR0_TS)); 2378 2378 2379 return emUpdateCRx(pVM, pVCpu, pRegFrame, USE_REG_CR0, NewCr0);2379 return emUpdateCRx(pVM, pVCpu, pRegFrame, DISCREG_CR0, NewCr0); 2380 2380 } 2381 2381 -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r41727 r41728 4169 4169 Assert( !pVM->hwaccm.s.fNestedPaging 4170 4170 || !CPUMIsGuestInPagedProtectedModeEx(pCtx) 4171 || VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification) != USE_REG_CR3);4171 || VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification) != DISCREG_CR3); 4172 4172 4173 4173 /* CR8 reads only cause an exit when the TPR shadow feature isn't present. */ -
trunk/src/VBox/VMM/VMMR3/EMRaw.cpp
r41727 r41728 994 994 //read 995 995 Assert(Cpu.param2.fUse & DISUSE_REG_CR); 996 Assert(Cpu.param2.base.reg_ctrl <= USE_REG_CR4);996 Assert(Cpu.param2.base.reg_ctrl <= DISCREG_CR4); 997 997 STAM_COUNTER_INC(&pStats->StatMovReadCR[Cpu.param2.base.reg_ctrl]); 998 998 } … … 1001 1001 //write 1002 1002 Assert(Cpu.param1.fUse & DISUSE_REG_CR); 1003 Assert(Cpu.param1.base.reg_ctrl <= USE_REG_CR4);1003 Assert(Cpu.param1.base.reg_ctrl <= DISCREG_CR4); 1004 1004 STAM_COUNTER_INC(&pStats->StatMovWriteCR[Cpu.param1.base.reg_ctrl]); 1005 1005 } -
trunk/src/VBox/VMM/VMMR3/PATMPatch.cpp
r41727 r41728 1151 1151 { 1152 1152 int rc = VINF_SUCCESS; 1153 intreg, mod, rm, dbgreg;1153 unsigned reg, mod, rm, dbgreg; 1154 1154 uint32_t offset; 1155 1155 … … 1183 1183 pPB[1] = MAKE_MODRM(mod, reg, rm); 1184 1184 1185 AssertReturn(dbgreg <= USE_REG_DR7, VERR_INVALID_PARAMETER);1185 AssertReturn(dbgreg <= DISDREG_DR7, VERR_INVALID_PARAMETER); 1186 1186 offset = RT_OFFSETOF(CPUMCTX, dr[dbgreg]); 1187 1187 … … 1235 1235 switch (ctrlreg) 1236 1236 { 1237 case USE_REG_CR0:1237 case DISCREG_CR0: 1238 1238 offset = RT_OFFSETOF(CPUMCTX, cr0); 1239 1239 break; 1240 case USE_REG_CR2:1240 case DISCREG_CR2: 1241 1241 offset = RT_OFFSETOF(CPUMCTX, cr2); 1242 1242 break; 1243 case USE_REG_CR3:1243 case DISCREG_CR3: 1244 1244 offset = RT_OFFSETOF(CPUMCTX, cr3); 1245 1245 break; 1246 case USE_REG_CR4:1246 case DISCREG_CR4: 1247 1247 offset = RT_OFFSETOF(CPUMCTX, cr4); 1248 1248 break; -
trunk/src/VBox/VMM/include/EMInternal.h
r41692 r41728 272 272 STAMCOUNTER StatInvlpg; 273 273 STAMCOUNTER StatHlt; 274 STAMCOUNTER StatMovReadCR[ USE_REG_CR4 + 1];275 STAMCOUNTER StatMovWriteCR[ USE_REG_CR4 + 1];274 STAMCOUNTER StatMovReadCR[DISCREG_CR4 + 1]; 275 STAMCOUNTER StatMovWriteCR[DISCREG_CR4 + 1]; 276 276 STAMCOUNTER StatMovDRx; 277 277 STAMCOUNTER StatIret;
Note:
See TracChangeset
for help on using the changeset viewer.