Changeset 80050 in vbox for trunk/src/VBox/VMM/VMMR3/CPUMDbg.cpp
- Timestamp:
- Jul 29, 2019 8:04:35 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUMDbg.cpp
r76553 r80050 676 676 * @interface_method_impl{DBGFREGDESC,pfnGet} 677 677 */ 678 static DECLCALLBACK(int) cpumR3RegHyperGet_crX(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue)679 {680 PVMCPU pVCpu = (PVMCPU)pvUser;681 VMCPU_ASSERT_EMT(pVCpu);682 683 uint64_t u64Value;684 switch (pDesc->offRegister)685 {686 case 0: u64Value = UINT64_MAX; break;687 case 2: u64Value = UINT64_MAX; break;688 case 3: u64Value = CPUMGetHyperCR3(pVCpu); break;689 case 4: u64Value = UINT64_MAX; break;690 case 8: u64Value = UINT64_MAX; break;691 default:692 AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);693 }694 switch (pDesc->enmType)695 {696 case DBGFREGVALTYPE_U64: pValue->u64 = u64Value; break;697 case DBGFREGVALTYPE_U32: pValue->u32 = (uint32_t)u64Value; break;698 default:699 AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);700 }701 return VINF_SUCCESS;702 }703 704 705 /**706 * @interface_method_impl{DBGFREGDESC,pfnGet}707 */708 static DECLCALLBACK(int) cpumR3RegHyperSet_crX(void *pvUser, PCDBGFREGDESC pDesc, PCDBGFREGVAL pValue, PCDBGFREGVAL pfMask)709 {710 /* Not settable, prevents killing your host. */711 NOREF(pvUser); NOREF(pDesc); NOREF(pValue); NOREF(pfMask);712 return VERR_ACCESS_DENIED;713 }714 715 716 /**717 * @interface_method_impl{DBGFREGDESC,pfnGet}718 */719 678 static DECLCALLBACK(int) cpumR3RegHyperGet_drX(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue) 720 679 { … … 751 710 { 752 711 /* Not settable, prevents killing your host. */ 753 NOREF(pvUser); NOREF(pDesc); NOREF(pValue); NOREF(pfMask);754 return VERR_ACCESS_DENIED;755 }756 757 758 /**759 * @interface_method_impl{DBGFREGDESC,pfnGet}760 */761 static DECLCALLBACK(int) cpumR3RegHyperGet_msr(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue)762 {763 NOREF(pvUser);764 765 /* Not availble at present, return all FFs to keep things quiet */766 uint64_t u64Value = UINT64_MAX;767 switch (pDesc->enmType)768 {769 case DBGFREGVALTYPE_U64: pValue->u64 = u64Value; break;770 case DBGFREGVALTYPE_U32: pValue->u32 = (uint32_t)u64Value; break;771 case DBGFREGVALTYPE_U16: pValue->u16 = (uint16_t)u64Value; break;772 default:773 AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);774 }775 return VINF_SUCCESS;776 }777 778 779 /**780 * @interface_method_impl{DBGFREGDESC,pfnGet}781 */782 static DECLCALLBACK(int) cpumR3RegHyperSet_msr(void *pvUser, PCDBGFREGDESC pDesc, PCDBGFREGVAL pValue, PCDBGFREGVAL pfMask)783 {784 /* Not settable, return failure. */785 712 NOREF(pvUser); NOREF(pDesc); NOREF(pValue); NOREF(pfMask); 786 713 return VERR_ACCESS_DENIED; … … 1364 1291 static DBGFREGDESC const g_aCpumRegHyperDescs[] = 1365 1292 { 1366 #define CPU_REG_RW_AS(a_szName, a_RegSuff, a_TypeSuff, a_CpumCtxMemb, a_pfnGet, a_pfnSet, a_paAliases, a_paSubFields) \1367 { a_szName, DBGFREG_##a_RegSuff, DBGFREGVALTYPE_##a_TypeSuff, 0 /*fFlags*/, RT_OFFSETOF(CPUMCPU, Hyper.a_CpumCtxMemb), a_pfnGet, a_pfnSet, a_paAliases, a_paSubFields }1368 #define CPU_REG_RO_AS(a_szName, a_RegSuff, a_TypeSuff, a_CpumCtxMemb, a_pfnGet, a_pfnSet, a_paAliases, a_paSubFields) \1369 { a_szName, DBGFREG_##a_RegSuff, DBGFREGVALTYPE_##a_TypeSuff, DBGFREG_FLAGS_READ_ONLY, RT_OFFSETOF(CPUMCPU, Hyper.a_CpumCtxMemb), a_pfnGet, a_pfnSet, a_paAliases, a_paSubFields }1370 #define CPU_REG_DUMMY(a_szName, a_RegSuff, a_TypeSuff) \1371 { a_szName, DBGFREG_##a_RegSuff, DBGFREGVALTYPE_##a_TypeSuff, DBGFREG_FLAGS_READ_ONLY, 0, cpumR3RegGet_Dummy, cpumR3RegSet_Dummy, NULL, NULL}1372 #define CPU_REG_MSR(a_szName, UName, a_TypeSuff, a_paSubFields) \1373 CPU_REG_EX_AS(a_szName, MSR_##UName, a_TypeSuff, MSR_##UName, cpumR3RegHyperGet_msr, cpumR3RegHyperSet_msr, NULL, a_paSubFields)1374 1375 CPU_REG_REG(RAX, rax),1376 CPU_REG_REG(RCX, rcx),1377 CPU_REG_REG(RDX, rdx),1378 CPU_REG_REG(RBX, rbx),1379 CPU_REG_REG(RSP, rsp),1380 CPU_REG_REG(RBP, rbp),1381 CPU_REG_REG(RSI, rsi),1382 CPU_REG_REG(RDI, rdi),1383 CPU_REG_REG(R8, r8),1384 CPU_REG_REG(R9, r9),1385 CPU_REG_REG(R10, r10),1386 CPU_REG_REG(R11, r11),1387 CPU_REG_REG(R12, r12),1388 CPU_REG_REG(R13, r13),1389 CPU_REG_REG(R14, r14),1390 CPU_REG_REG(R15, r15),1391 CPU_REG_SEG(CS, cs),1392 CPU_REG_SEG(DS, ds),1393 CPU_REG_SEG(ES, es),1394 CPU_REG_SEG(FS, fs),1395 CPU_REG_SEG(GS, gs),1396 CPU_REG_SEG(SS, ss),1397 CPU_REG_REG(RIP, rip),1398 CPU_REG_RW_AS("rflags", RFLAGS, U64, rflags, cpumR3RegGet_Generic, cpumR3RegSet_Generic, g_aCpumRegAliases_rflags, g_aCpumRegFields_rflags ),1399 CPU_REG_DUMMY("fcw", FCW, U16),1400 CPU_REG_DUMMY("fsw", FSW, U16),1401 CPU_REG_DUMMY("ftw", FTW, U16),1402 CPU_REG_DUMMY("fop", FOP, U16),1403 CPU_REG_DUMMY("fpuip", FPUIP, U32),1404 CPU_REG_DUMMY("fpucs", FPUCS, U16),1405 CPU_REG_DUMMY("fpudp", FPUDP, U32),1406 CPU_REG_DUMMY("fpuds", FPUDS, U16),1407 CPU_REG_DUMMY("mxcsr", MXCSR, U32),1408 CPU_REG_DUMMY("mxcsr_mask", MXCSR_MASK, U32),1409 CPU_REG_DUMMY("st0", ST0, R80),1410 CPU_REG_DUMMY("st1", ST1, R80),1411 CPU_REG_DUMMY("st2", ST2, R80),1412 CPU_REG_DUMMY("st3", ST3, R80),1413 CPU_REG_DUMMY("st4", ST4, R80),1414 CPU_REG_DUMMY("st5", ST5, R80),1415 CPU_REG_DUMMY("st6", ST6, R80),1416 CPU_REG_DUMMY("st7", ST7, R80),1417 CPU_REG_DUMMY("mm0", MM0, U64),1418 CPU_REG_DUMMY("mm1", MM1, U64),1419 CPU_REG_DUMMY("mm2", MM2, U64),1420 CPU_REG_DUMMY("mm3", MM3, U64),1421 CPU_REG_DUMMY("mm4", MM4, U64),1422 CPU_REG_DUMMY("mm5", MM5, U64),1423 CPU_REG_DUMMY("mm6", MM6, U64),1424 CPU_REG_DUMMY("mm7", MM7, U64),1425 CPU_REG_DUMMY("xmm0", XMM0, U128),1426 CPU_REG_DUMMY("xmm1", XMM1, U128),1427 CPU_REG_DUMMY("xmm2", XMM2, U128),1428 CPU_REG_DUMMY("xmm3", XMM3, U128),1429 CPU_REG_DUMMY("xmm4", XMM4, U128),1430 CPU_REG_DUMMY("xmm5", XMM5, U128),1431 CPU_REG_DUMMY("xmm6", XMM6, U128),1432 CPU_REG_DUMMY("xmm7", XMM7, U128),1433 CPU_REG_DUMMY("xmm8", XMM8, U128),1434 CPU_REG_DUMMY("xmm9", XMM9, U128),1435 CPU_REG_DUMMY("xmm10", XMM10, U128),1436 CPU_REG_DUMMY("xmm11", XMM11, U128),1437 CPU_REG_DUMMY("xmm12", XMM12, U128),1438 CPU_REG_DUMMY("xmm13", XMM13, U128),1439 CPU_REG_DUMMY("xmm14", XMM14, U128),1440 CPU_REG_DUMMY("xmm15", XMM15, U128),1441 CPU_REG_DUMMY("ymm0", YMM0, U256),1442 CPU_REG_DUMMY("ymm1", YMM1, U256),1443 CPU_REG_DUMMY("ymm2", YMM2, U256),1444 CPU_REG_DUMMY("ymm3", YMM3, U256),1445 CPU_REG_DUMMY("ymm4", YMM4, U256),1446 CPU_REG_DUMMY("ymm5", YMM5, U256),1447 CPU_REG_DUMMY("ymm6", YMM6, U256),1448 CPU_REG_DUMMY("ymm7", YMM7, U256),1449 CPU_REG_DUMMY("ymm8", YMM8, U256),1450 CPU_REG_DUMMY("ymm9", YMM9, U256),1451 CPU_REG_DUMMY("ymm10", YMM10, U256),1452 CPU_REG_DUMMY("ymm11", YMM11, U256),1453 CPU_REG_DUMMY("ymm12", YMM12, U256),1454 CPU_REG_DUMMY("ymm13", YMM13, U256),1455 CPU_REG_DUMMY("ymm14", YMM14, U256),1456 CPU_REG_DUMMY("ymm15", YMM15, U256),1457 CPU_REG_RW_AS("gdtr_base", GDTR_BASE, U64, gdtr.pGdt, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ),1458 CPU_REG_RW_AS("gdtr_lim", GDTR_LIMIT, U16, gdtr.cbGdt, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ),1459 CPU_REG_RW_AS("idtr_base", IDTR_BASE, U64, idtr.pIdt, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ),1460 CPU_REG_RW_AS("idtr_lim", IDTR_LIMIT, U16, idtr.cbIdt, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ),1461 CPU_REG_SEG(LDTR, ldtr),1462 CPU_REG_SEG(TR, tr),1463 CPU_REG_EX_AS("cr0", CR0, U32, 0, cpumR3RegHyperGet_crX, cpumR3RegHyperSet_crX, g_aCpumRegAliases_cr0, g_aCpumRegFields_cr0 ),1464 CPU_REG_EX_AS("cr2", CR2, U64, 2, cpumR3RegHyperGet_crX, cpumR3RegHyperSet_crX, NULL, NULL ),1465 CPU_REG_EX_AS("cr3", CR3, U64, 3, cpumR3RegHyperGet_crX, cpumR3RegHyperSet_crX, NULL, g_aCpumRegFields_cr3 ),1466 CPU_REG_EX_AS("cr4", CR4, U32, 4, cpumR3RegHyperGet_crX, cpumR3RegHyperSet_crX, NULL, g_aCpumRegFields_cr4 ),1467 CPU_REG_EX_AS("cr8", CR8, U32, 8, cpumR3RegHyperGet_crX, cpumR3RegHyperSet_crX, NULL, NULL ),1468 1293 CPU_REG_EX_AS("dr0", DR0, U64, 0, cpumR3RegHyperGet_drX, cpumR3RegHyperSet_drX, NULL, NULL ), 1469 1294 CPU_REG_EX_AS("dr1", DR1, U64, 1, cpumR3RegHyperGet_drX, cpumR3RegHyperSet_drX, NULL, NULL ), … … 1472 1297 CPU_REG_EX_AS("dr6", DR6, U32, 6, cpumR3RegHyperGet_drX, cpumR3RegHyperSet_drX, NULL, g_aCpumRegFields_dr6 ), 1473 1298 CPU_REG_EX_AS("dr7", DR7, U32, 7, cpumR3RegHyperGet_drX, cpumR3RegHyperSet_drX, NULL, g_aCpumRegFields_dr7 ), 1474 CPU_REG_MSR("apic_base", IA32_APICBASE, U32, g_aCpumRegFields_apic_base ),1475 CPU_REG_MSR("pat", IA32_CR_PAT, U64, g_aCpumRegFields_cr_pat ),1476 CPU_REG_MSR("perf_status", IA32_PERF_STATUS, U64, g_aCpumRegFields_perf_status),1477 CPU_REG_MSR("sysenter_cs", IA32_SYSENTER_CS, U16, NULL ),1478 CPU_REG_MSR("sysenter_eip", IA32_SYSENTER_EIP, U32, NULL ),1479 CPU_REG_MSR("sysenter_esp", IA32_SYSENTER_ESP, U32, NULL ),1480 CPU_REG_MSR("tsc", IA32_TSC, U32, NULL ),1481 CPU_REG_MSR("efer", K6_EFER, U32, g_aCpumRegFields_efer ),1482 CPU_REG_MSR("star", K6_STAR, U64, g_aCpumRegFields_star ),1483 CPU_REG_MSR("cstar", K8_CSTAR, U64, g_aCpumRegFields_cstar ),1484 CPU_REG_MSR("msr_fs_base", K8_FS_BASE, U64, NULL ),1485 CPU_REG_MSR("msr_gs_base", K8_GS_BASE, U64, NULL ),1486 CPU_REG_MSR("krnl_gs_base", K8_KERNEL_GS_BASE, U64, NULL ),1487 CPU_REG_MSR("lstar", K8_LSTAR, U64, g_aCpumRegFields_lstar ),1488 CPU_REG_MSR("sf_mask", K8_SF_MASK, U64, NULL ),1489 CPU_REG_MSR("tsc_aux", K8_TSC_AUX, U64, NULL ),1490 CPU_REG_EX_AS("ah", AH, U8, RT_OFFSETOF(CPUMCPU, Hyper.rax) + 1, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ),1491 CPU_REG_EX_AS("ch", CH, U8, RT_OFFSETOF(CPUMCPU, Hyper.rcx) + 1, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ),1492 CPU_REG_EX_AS("dh", DH, U8, RT_OFFSETOF(CPUMCPU, Hyper.rdx) + 1, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ),1493 CPU_REG_EX_AS("bh", BH, U8, RT_OFFSETOF(CPUMCPU, Hyper.rbx) + 1, cpumR3RegGet_Generic, cpumR3RegSet_Generic, NULL, NULL ),1494 CPU_REG_RW_AS("gdtr", GDTR, DTR, gdtr, cpumR3RegGet_gdtr, cpumR3RegSet_gdtr, NULL, NULL ),1495 CPU_REG_RW_AS("idtr", IDTR, DTR, idtr, cpumR3RegGet_idtr, cpumR3RegSet_idtr, NULL, NULL ),1496 1299 DBGFREGDESC_TERMINATOR() 1497 #undef CPU_REG_RW_AS1498 #undef CPU_REG_RO_AS1499 #undef CPU_REG_MSR1500 #undef CPU_REG_ST1501 1300 }; 1502 1301
Note:
See TracChangeset
for help on using the changeset viewer.