Changeset 85995 in vbox for trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
- Timestamp:
- Sep 2, 2020 11:15:07 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r85988 r85995 3132 3132 3133 3133 LogFlowFunc(("pThis=%p pszArgs=%s\n", pThis, pszArgs)); 3134 bool const fVerbose = !strncmp(pszArgs, RT_STR_TUPLE("verbose")) ? true : false; 3134 bool fVerbose; 3135 if ( pszArgs 3136 && !strncmp(pszArgs, RT_STR_TUPLE("verbose"))) 3137 fVerbose = true; 3138 else 3139 fVerbose = false; 3135 3140 3136 3141 pHlp->pfnPrintf(pHlp, "AMD-IOMMU:\n"); … … 3139 3144 { 3140 3145 DEV_TAB_BAR_T const DevTabBar = pThis->aDevTabBaseAddrs[i]; 3141 pHlp->pfnPrintf(pHlp, " Device Table BAR [%u]= %#RX64\n", i, DevTabBar.u64);3146 pHlp->pfnPrintf(pHlp, " Device Table BAR %u = %#RX64\n", i, DevTabBar.u64); 3142 3147 if (fVerbose) 3143 3148 { … … 3153 3158 uint32_t const cEntries = iommuAmdGetBufMaxEntries(uEncodedLen); 3154 3159 uint32_t const cbBuffer = iommuAmdGetTotalBufLength(uEncodedLen); 3155 pHlp->pfnPrintf(pHlp, " Command buffer BAR = %#RX64\n", CmdBufBar.u64);3160 pHlp->pfnPrintf(pHlp, " Command Buffer BAR = %#RX64\n", CmdBufBar.u64); 3156 3161 if (fVerbose) 3157 3162 { … … 3167 3172 uint32_t const cEntries = iommuAmdGetBufMaxEntries(uEncodedLen); 3168 3173 uint32_t const cbBuffer = iommuAmdGetTotalBufLength(uEncodedLen); 3169 pHlp->pfnPrintf(pHlp, " Event log BAR = %#RX64\n", EvtLogBar.u64);3174 pHlp->pfnPrintf(pHlp, " Event Log BAR = %#RX64\n", EvtLogBar.u64); 3170 3175 if (fVerbose) 3171 3176 { … … 3244 3249 IOMMU_EXT_FEAT_T ExtFeat = pThis->ExtFeat; 3245 3250 pHlp->pfnPrintf(pHlp, " Extended Feature Register = %#RX64\n", ExtFeat.u64); 3246 pHlp->pfnPrintf(pHlp, " Prefetch support = %RTbool\n", ExtFeat.n.u1PrefetchSup);3247 3251 if (fVerbose) 3248 3252 { 3253 pHlp->pfnPrintf(pHlp, " Prefetch support = %RTbool\n", ExtFeat.n.u1PrefetchSup); 3249 3254 pHlp->pfnPrintf(pHlp, " PPR support = %RTbool\n", ExtFeat.n.u1PprSup); 3250 3255 pHlp->pfnPrintf(pHlp, " x2APIC support = %RTbool\n", ExtFeat.n.u1X2ApicSup); … … 3308 3313 } 3309 3314 /* Hardware Event (Lo) Register. */ 3310 pHlp->pfnPrintf(pHlp, " Hardware Event (Lo) 3315 pHlp->pfnPrintf(pHlp, " Hardware Event (Lo) = %#RX64\n", pThis->HwEvtLo); 3311 3316 /* Hardware Event Status. */ 3312 3317 { … … 3393 3398 { 3394 3399 DEV_SPECIFIC_STATUS_T const DevSpecificStatus = pThis->DevSpecificStatus; 3395 pHlp->pfnPrintf(pHlp, " Device-specific Control= %#RX64\n", DevSpecificStatus.u64);3400 pHlp->pfnPrintf(pHlp, " Device-specific Status = %#RX64\n", DevSpecificStatus.u64); 3396 3401 if (fVerbose) 3397 3402 { … … 3544 3549 } 3545 3550 /* Reserved Register. */ 3546 pHlp->pfnPrintf(pHlp, " Reserved Register 3551 pHlp->pfnPrintf(pHlp, " Reserved Register = %#RX64\n", pThis->RsvdReg); 3547 3552 /* Command Buffer Head Pointer Register. */ 3548 3553 { 3549 3554 CMD_BUF_HEAD_PTR_T const CmdBufHeadPtr = pThis->CmdBufHeadPtr; 3550 pHlp->pfnPrintf(pHlp, " Command Buffer Head Pointer = %#RX64 \n", CmdBufHeadPtr.u64);3551 pHlp->pfnPrintf(pHlp, " Pointer = %#x\n",CmdBufHeadPtr.n.off);3555 pHlp->pfnPrintf(pHlp, " Command Buffer Head Pointer = %#RX64 (off: %#x)\n", CmdBufHeadPtr.u64, 3556 CmdBufHeadPtr.n.off); 3552 3557 } 3553 3558 /* Command Buffer Tail Pointer Register. */ 3554 3559 { 3555 3560 CMD_BUF_HEAD_PTR_T const CmdBufTailPtr = pThis->CmdBufTailPtr; 3556 pHlp->pfnPrintf(pHlp, " Command Buffer Tail Pointer = %#RX64 \n", CmdBufTailPtr.u64);3557 pHlp->pfnPrintf(pHlp, " Pointer = %#x\n",CmdBufTailPtr.n.off);3561 pHlp->pfnPrintf(pHlp, " Command Buffer Tail Pointer = %#RX64 (off: %#x)\n", CmdBufTailPtr.u64, 3562 CmdBufTailPtr.n.off); 3558 3563 } 3559 3564 /* Event Log Head Pointer Register. */ 3560 3565 { 3561 3566 EVT_LOG_HEAD_PTR_T const EvtLogHeadPtr = pThis->EvtLogHeadPtr; 3562 pHlp->pfnPrintf(pHlp, " Event Log Head Pointer = %#RX64 \n", EvtLogHeadPtr.u64);3563 pHlp->pfnPrintf(pHlp, " Pointer = %#x\n",EvtLogHeadPtr.n.off);3567 pHlp->pfnPrintf(pHlp, " Event Log Head Pointer = %#RX64 (off: %#x)\n", EvtLogHeadPtr.u64, 3568 EvtLogHeadPtr.n.off); 3564 3569 } 3565 3570 /* Event Log Tail Pointer Register. */ 3566 3571 { 3567 3572 EVT_LOG_TAIL_PTR_T const EvtLogTailPtr = pThis->EvtLogTailPtr; 3568 pHlp->pfnPrintf(pHlp, " Event Log Head Pointer = %#RX64 \n", EvtLogTailPtr.u64);3569 pHlp->pfnPrintf(pHlp, " Pointer = %#x\n",EvtLogTailPtr.n.off);3573 pHlp->pfnPrintf(pHlp, " Event Log Head Pointer = %#RX64 (off: %#x)\n", EvtLogTailPtr.u64, 3574 EvtLogTailPtr.n.off); 3570 3575 } 3571 3576 /* Status Register. */ … … 3596 3601 { 3597 3602 PPR_LOG_HEAD_PTR_T const PprLogHeadPtr = pThis->PprLogHeadPtr; 3598 pHlp->pfnPrintf(pHlp, " PPR Log Head Pointer = %#RX64 \n", PprLogHeadPtr.u64);3599 pHlp->pfnPrintf(pHlp, " Pointer = %#x\n",PprLogHeadPtr.n.off);3603 pHlp->pfnPrintf(pHlp, " PPR Log Head Pointer = %#RX64 (off: %#x)\n", PprLogHeadPtr.u64, 3604 PprLogHeadPtr.n.off); 3600 3605 } 3601 3606 /* PPR Log Tail Pointer. */ 3602 3607 { 3603 3608 PPR_LOG_TAIL_PTR_T const PprLogTailPtr = pThis->PprLogTailPtr; 3604 pHlp->pfnPrintf(pHlp, " PPR Log Tail Pointer = %#RX64 \n", PprLogTailPtr.u64);3605 pHlp->pfnPrintf(pHlp, " Pointer = %#x\n",PprLogTailPtr.n.off);3609 pHlp->pfnPrintf(pHlp, " PPR Log Tail Pointer = %#RX64 (off: %#x)\n", PprLogTailPtr.u64, 3610 PprLogTailPtr.n.off); 3606 3611 } 3607 3612 /* Guest Virtual-APIC Log Head Pointer. */ 3608 3613 { 3609 3614 GALOG_HEAD_PTR_T const GALogHeadPtr = pThis->GALogHeadPtr; 3610 pHlp->pfnPrintf(pHlp, " Guest Virtual-APIC Log Head Pointer = %#RX64 \n", GALogHeadPtr.u64);3611 pHlp->pfnPrintf(pHlp, " Pointer = %#x\n",GALogHeadPtr.n.u12GALogPtr);3615 pHlp->pfnPrintf(pHlp, " Guest Virtual-APIC Log Head Pointer = %#RX64 (off: %#x)\n", GALogHeadPtr.u64, 3616 GALogHeadPtr.n.u12GALogPtr); 3612 3617 } 3613 3618 /* Guest Virtual-APIC Log Tail Pointer. */ 3614 3619 { 3615 3620 GALOG_HEAD_PTR_T const GALogTailPtr = pThis->GALogTailPtr; 3616 pHlp->pfnPrintf(pHlp, " Guest Virtual-APIC Log Tail Pointer = %#RX64 \n", GALogTailPtr.u64);3617 pHlp->pfnPrintf(pHlp, " Pointer = %#x\n",GALogTailPtr.n.u12GALogPtr);3621 pHlp->pfnPrintf(pHlp, " Guest Virtual-APIC Log Tail Pointer = %#RX64 (off: %#x)\n", GALogTailPtr.u64, 3622 GALogTailPtr.n.u12GALogPtr); 3618 3623 } 3619 3624 /* PPR Log B Head Pointer. */ 3620 3625 { 3621 3626 PPR_LOG_B_HEAD_PTR_T const PprLogBHeadPtr = pThis->PprLogBHeadPtr; 3622 pHlp->pfnPrintf(pHlp, " PPR Log B Head Pointer = %#RX64 \n", PprLogBHeadPtr.u64);3623 pHlp->pfnPrintf(pHlp, " Pointer = %#x\n",PprLogBHeadPtr.n.off);3627 pHlp->pfnPrintf(pHlp, " PPR Log B Head Pointer = %#RX64 (off: %#x)\n", PprLogBHeadPtr.u64, 3628 PprLogBHeadPtr.n.off); 3624 3629 } 3625 3630 /* PPR Log B Tail Pointer. */ 3626 3631 { 3627 3632 PPR_LOG_B_TAIL_PTR_T const PprLogBTailPtr = pThis->PprLogBTailPtr; 3628 pHlp->pfnPrintf(pHlp, " PPR Log B Tail Pointer = %#RX64 \n", PprLogBTailPtr.u64);3629 pHlp->pfnPrintf(pHlp, " Pointer = %#x\n",PprLogBTailPtr.n.off);3633 pHlp->pfnPrintf(pHlp, " PPR Log B Tail Pointer = %#RX64 (off: %#x)\n", PprLogBTailPtr.u64, 3634 PprLogBTailPtr.n.off); 3630 3635 } 3631 3636 /* Event Log B Head Pointer. */ 3632 3637 { 3633 3638 EVT_LOG_B_HEAD_PTR_T const EvtLogBHeadPtr = pThis->EvtLogBHeadPtr; 3634 pHlp->pfnPrintf(pHlp, " Event Log B Head Pointer = %#RX64 \n", EvtLogBHeadPtr.u64);3635 pHlp->pfnPrintf(pHlp, " Pointer = %#x\n",EvtLogBHeadPtr.n.off);3639 pHlp->pfnPrintf(pHlp, " Event Log B Head Pointer = %#RX64 (off: %#x)\n", EvtLogBHeadPtr.u64, 3640 EvtLogBHeadPtr.n.off); 3636 3641 } 3637 3642 /* Event Log B Tail Pointer. */ 3638 3643 { 3639 3644 EVT_LOG_B_TAIL_PTR_T const EvtLogBTailPtr = pThis->EvtLogBTailPtr; 3640 pHlp->pfnPrintf(pHlp, " Event Log B Tail Pointer = %#RX64 \n", EvtLogBTailPtr.u64);3641 pHlp->pfnPrintf(pHlp, " Pointer = %#x\n",EvtLogBTailPtr.n.off);3645 pHlp->pfnPrintf(pHlp, " Event Log B Tail Pointer = %#RX64 (off: %#x)\n", EvtLogBTailPtr.u64, 3646 EvtLogBTailPtr.n.off); 3642 3647 } 3643 3648 /* PPR Log Auto Response Register. */ … … 3860 3865 PDMPciDevSetVendorId(pPciDev, IOMMU_PCI_VENDOR_ID); /* AMD */ 3861 3866 PDMPciDevSetDeviceId(pPciDev, IOMMU_PCI_DEVICE_ID); /* VirtualBox IOMMU device */ 3862 PDMPciDevSetCommand(pPciDev, VBOX_PCI_COMMAND_MASTER); /* Enable bus master (as we write to main memory) .*/3863 PDMPciDevSetStatus(pPciDev, VBOX_PCI_STATUS_CAP_LIST); /* Status - CapList supported */3867 PDMPciDevSetCommand(pPciDev, VBOX_PCI_COMMAND_MASTER); /* Enable bus master (as we write to main memory) */ 3868 PDMPciDevSetStatus(pPciDev, VBOX_PCI_STATUS_CAP_LIST); /* Capability list supported */ 3864 3869 PDMPciDevSetRevisionId(pPciDev, IOMMU_PCI_REVISION_ID); /* VirtualBox specific device implementation revision */ 3865 3870 PDMPciDevSetClassBase(pPciDev, VBOX_PCI_CLASS_SYSTEM); /* System Base Peripheral */ 3866 3871 PDMPciDevSetClassSub(pPciDev, VBOX_PCI_SUB_SYSTEM_IOMMU); /* IOMMU */ 3867 PDMPciDevSetClassProg(pPciDev, 0x0 0);/* IOMMU Programming interface */3868 PDMPciDevSetHeaderType(pPciDev, 0x0 0); /* Single function, type 0.*/3872 PDMPciDevSetClassProg(pPciDev, 0x0); /* IOMMU Programming interface */ 3873 PDMPciDevSetHeaderType(pPciDev, 0x0); /* Single function, type 0 */ 3869 3874 PDMPciDevSetSubSystemId(pPciDev, IOMMU_PCI_DEVICE_ID); /* AMD */ 3870 3875 PDMPciDevSetSubSystemVendorId(pPciDev, IOMMU_PCI_VENDOR_ID); /* VirtualBox IOMMU device */ 3871 PDMPciDevSetCapabilityList(pPciDev, IOMMU_PCI_OFF_CAP_HDR); /* Offset into capability registers .*/3872 PDMPciDevSetInterruptPin(pPciDev, 0x 01);/* INTA#. */3873 PDMPciDevSetInterruptLine(pPciDev, 0x0 0); /* For software compatibility; no effect on hardware.*/3876 PDMPciDevSetCapabilityList(pPciDev, IOMMU_PCI_OFF_CAP_HDR); /* Offset into capability registers */ 3877 PDMPciDevSetInterruptPin(pPciDev, 0x1); /* INTA#. */ 3878 PDMPciDevSetInterruptLine(pPciDev, 0x0); /* For software compatibility; no effect on hardware */ 3874 3879 3875 3880 /* Capability Header. */ … … 3886 3891 | RT_BF_MAKE(IOMMU_BF_CAPHDR_CAP_EXT, 0x1)); /* RO - Misc. Information Register support */ 3887 3892 3888 /* Base Address Low Register. */ 3889 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_BASE_ADDR_REG_LO, 0x0); /* RW - Base address (Lo) and enable bit. */ 3890 3891 /* Base Address High Register. */ 3893 /* Base Address Register. */ 3894 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_BASE_ADDR_REG_LO, 0x0); /* RW - Base address (Lo) and enable bit */ 3892 3895 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_BASE_ADDR_REG_HI, 0x0); /* RW - Base address (Hi) */ 3893 3896 3894 3897 /* IOMMU Range Register. */ 3895 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_RANGE_REG, 0x0); /* RW - Range register (implemented as RO by us) .*/3898 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_RANGE_REG, 0x0); /* RW - Range register (implemented as RO by us) */ 3896 3899 3897 3900 /* Misc. Information Register. */ … … 3918 3921 #if 0 3919 3922 /* MSI Address Lo. */ 3920 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_ADDR_LO, 0); /* RW - MSI message address (Lo) .*/3923 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_ADDR_LO, 0); /* RW - MSI message address (Lo) */ 3921 3924 /* MSI Address Hi. */ 3922 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_ADDR_HI, 0); /* RW - MSI message address (Hi) .*/3925 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_ADDR_HI, 0); /* RW - MSI message address (Hi) */ 3923 3926 /* MSI Data. */ 3924 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_DATA, 0); /* RW - MSI data .*/3927 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_DATA, 0); /* RW - MSI data */ 3925 3928 #endif 3926 3929 … … 4013 4016 AssertCompile((IOMMU_MAX_HOST_PT_LEVEL & 0x3) < 3); 4014 4017 pThis->ExtFeat.n.u2HostAddrTranslateSize = (IOMMU_MAX_HOST_PT_LEVEL & 0x3); 4015 pThis->ExtFeat.n.u2GstAddrTranslateSize = 0; /* Requires GstTranslateSup .*/4016 pThis->ExtFeat.n.u2GstCr3RootTblLevel = 0; /* Requires GstTranslateSup .*/4018 pThis->ExtFeat.n.u2GstAddrTranslateSize = 0; /* Requires GstTranslateSup */ 4019 pThis->ExtFeat.n.u2GstCr3RootTblLevel = 0; /* Requires GstTranslateSup */ 4017 4020 pThis->ExtFeat.n.u2SmiFilterSup = 0; 4018 4021 pThis->ExtFeat.n.u3SmiFilterCount = 0; … … 4020 4023 pThis->ExtFeat.n.u2DualPprLogSup = 0; 4021 4024 pThis->ExtFeat.n.u2DualEvtLogSup = 0; 4022 pThis->ExtFeat.n.u5MaxPasidSup = 0; /* Requires GstTranslateSup .*/4025 pThis->ExtFeat.n.u5MaxPasidSup = 0; /* Requires GstTranslateSup */ 4023 4026 pThis->ExtFeat.n.u1UserSupervisorSup = 0; 4024 4027 AssertCompile(IOMMU_MAX_DEV_TAB_SEGMENTS <= 3);
Note:
See TracChangeset
for help on using the changeset viewer.