Changeset 86339 in vbox
- Timestamp:
- Sep 30, 2020 7:22:13 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r86319 r86339 38 38 *********************************************************************************************************************************/ 39 39 /** Release log prefix string. */ 40 #define IOMMU_LOG_PFX " IOMMU-AMD"40 #define IOMMU_LOG_PFX "AMD-IOMMU" 41 41 /** The current saved state version. */ 42 42 #define IOMMU_SAVED_STATE_VERSION 1 … … 2741 2741 if ((fAccess & fDtePerm) != fAccess) 2742 2742 { 2743 LogFunc(("Access denied for IOVA (%#RX64). fAccess=%#x fDtePerm=%#x\n", uIova, fAccess, fDtePerm));2743 LogFunc(("Access denied for IOVA %#RX64. uDevId=%#x fAccess=%#x fDtePerm=%#x\n", uIova, uDevId, fAccess, fDtePerm)); 2744 2744 return VERR_IOMMU_ADDR_ACCESS_DENIED; 2745 2745 } … … 2758 2758 * raising an ILLEGAL_DEV_TABLE_ENTRY event or an IO_PAGE_FAULT event here. 2759 2759 * I'm just going with I/O page fault. */ 2760 LogFunc(("Invalid root page table level %#x -> IOPF\n", uMaxLevel));2760 LogFunc(("Invalid root page table level %#x (uDevId=%#x) -> IOPF\n", uMaxLevel, uDevId)); 2761 2761 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2762 2762 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, true /* fPresent */, false /* fRsvdNotZero */, … … 2831 2831 else 2832 2832 { 2833 LogFunc(("Page table entry not present -> IOPF\n"));2833 LogFunc(("Page table entry not present (uDevId=%#x) -> IOPF\n", uDevId)); 2834 2834 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2835 2835 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, false /* fPresent */, false /* fRsvdNotZero */, … … 2845 2845 else 2846 2846 { 2847 LogFunc(("Page table entry permission denied (fAccess=%#x fPtePerm=%#x) -> IOPF\n", fAccess, fPtePerm));2847 LogFunc(("Page table entry access denied (uDevId=%#x fAccess=%#x fPtePerm=%#x) -> IOPF\n", uDevId, fAccess, fPtePerm)); 2848 2848 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2849 2849 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, true /* fPresent */, false /* fRsvdNotZero */, … … 4669 4669 * Resets read-write portion of the IOMMU state. 4670 4670 * 4671 * State datanot initialized here is expected to be initialized during4671 * NOTE! State not initialized here is expected to be initialized during 4672 4672 * device construction and remain read-only through the lifetime of the VM. 4673 4673 */ … … 4833 4833 /* NOTE! Fields (e.g, EFR) must match what we expose in the ACPI tables. */ 4834 4834 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_CAP_HDR, 4835 RT_BF_MAKE(IOMMU_BF_CAPHDR_CAP_ID, 0xf) /* RO - Secure Device capability block */4836 | RT_BF_MAKE(IOMMU_BF_CAPHDR_CAP_PTR, IOMMU_PCI_OFF_MSI_CAP_HDR) /* RO - Offset to next capability*/4837 | RT_BF_MAKE(IOMMU_BF_CAPHDR_CAP_TYPE, 0x3) /* RO - IOMMU capability block */4838 | RT_BF_MAKE(IOMMU_BF_CAPHDR_CAP_REV, 0x1) /* RO - IOMMU interface revision */4839 | RT_BF_MAKE(IOMMU_BF_CAPHDR_IOTLB_SUP, 0x0) /* RO - Remote IOTLB support */4840 | RT_BF_MAKE(IOMMU_BF_CAPHDR_HT_TUNNEL, 0x0) /* RO - HyperTransport Tunnel support */4841 | RT_BF_MAKE(IOMMU_BF_CAPHDR_NP_CACHE, 0x0) /* RO - Cache NP page table entries */4842 | RT_BF_MAKE(IOMMU_BF_CAPHDR_EFR_SUP, 0x1) /* RO - Extended Feature Register support */4843 | RT_BF_MAKE(IOMMU_BF_CAPHDR_CAP_EXT, 0x1)); /* RO - Misc. Information Register support */4835 RT_BF_MAKE(IOMMU_BF_CAPHDR_CAP_ID, 0xf) /* RO - Secure Device capability block */ 4836 | RT_BF_MAKE(IOMMU_BF_CAPHDR_CAP_PTR, IOMMU_PCI_OFF_MSI_CAP_HDR) /* RO - Next capability offset */ 4837 | RT_BF_MAKE(IOMMU_BF_CAPHDR_CAP_TYPE, 0x3) /* RO - IOMMU capability block */ 4838 | RT_BF_MAKE(IOMMU_BF_CAPHDR_CAP_REV, 0x1) /* RO - IOMMU interface revision */ 4839 | RT_BF_MAKE(IOMMU_BF_CAPHDR_IOTLB_SUP, 0x0) /* RO - Remote IOTLB support */ 4840 | RT_BF_MAKE(IOMMU_BF_CAPHDR_HT_TUNNEL, 0x0) /* RO - HyperTransport Tunnel support */ 4841 | RT_BF_MAKE(IOMMU_BF_CAPHDR_NP_CACHE, 0x0) /* RO - Cache NP page table entries */ 4842 | RT_BF_MAKE(IOMMU_BF_CAPHDR_EFR_SUP, 0x1) /* RO - Extended Feature Register support */ 4843 | RT_BF_MAKE(IOMMU_BF_CAPHDR_CAP_EXT, 0x1)); /* RO - Misc. Information Register support */ 4844 4844 4845 4845 /* Base Address Register. */ … … 4990 4990 * NOTE! Fields here must match their corresponding field in the ACPI tables. 4991 4991 */ 4992 /** @todo Don't remove the =0 assignment for now. It's just there so it's easier 4993 * for me to see existing features that we might want to implement. Do it 4994 * later. */ 4992 /* Don't remove the commented lines below as it lets us see all features at a glance. */ 4995 4993 pThis->ExtFeat.u64 = 0; 4996 pThis->ExtFeat.n.u1PrefetchSup = 0;4997 pThis->ExtFeat.n.u1PprSup = 0;4998 pThis->ExtFeat.n.u1X2ApicSup = 0;4999 pThis->ExtFeat.n.u1NoExecuteSup = 0;5000 pThis->ExtFeat.n.u1GstTranslateSup = 0;5001 pThis->ExtFeat.n.u1InvAllSup = 1;5002 pThis->ExtFeat.n.u1GstVirtApicSup = 0;5003 pThis->ExtFeat.n.u1HwErrorSup = 1;5004 pThis->ExtFeat.n.u1PerfCounterSup = 0;4994 //pThis->ExtFeat.n.u1PrefetchSup = 0; 4995 //pThis->ExtFeat.n.u1PprSup = 0; 4996 //pThis->ExtFeat.n.u1X2ApicSup = 0; 4997 //pThis->ExtFeat.n.u1NoExecuteSup = 0; 4998 //pThis->ExtFeat.n.u1GstTranslateSup = 0; 4999 pThis->ExtFeat.n.u1InvAllSup = 1; 5000 //pThis->ExtFeat.n.u1GstVirtApicSup = 0; 5001 pThis->ExtFeat.n.u1HwErrorSup = 1; 5002 //pThis->ExtFeat.n.u1PerfCounterSup = 0; 5005 5003 AssertCompile((IOMMU_MAX_HOST_PT_LEVEL & 0x3) < 3); 5006 5004 pThis->ExtFeat.n.u2HostAddrTranslateSize = (IOMMU_MAX_HOST_PT_LEVEL & 0x3); 5007 pThis->ExtFeat.n.u2GstAddrTranslateSize = 0; /* Requires GstTranslateSup */5008 pThis->ExtFeat.n.u2GstCr3RootTblLevel = 0; /* Requires GstTranslateSup */5009 pThis->ExtFeat.n.u2SmiFilterSup = 0;5010 pThis->ExtFeat.n.u3SmiFilterCount = 0;5011 pThis->ExtFeat.n.u3GstVirtApicModeSup = 0; /* Requires GstVirtApicSup */5012 pThis->ExtFeat.n.u2DualPprLogSup = 0;5013 pThis->ExtFeat.n.u2DualEvtLogSup = 0;5014 pThis->ExtFeat.n.u5MaxPasidSup = 0; /* Requires GstTranslateSup */5015 pThis->ExtFeat.n.u1UserSupervisorSup = 0;5005 //pThis->ExtFeat.n.u2GstAddrTranslateSize = 0; /* Requires GstTranslateSup */ 5006 //pThis->ExtFeat.n.u2GstCr3RootTblLevel = 0; /* Requires GstTranslateSup */ 5007 //pThis->ExtFeat.n.u2SmiFilterSup = 0; 5008 //pThis->ExtFeat.n.u3SmiFilterCount = 0; 5009 //pThis->ExtFeat.n.u3GstVirtApicModeSup = 0; /* Requires GstVirtApicSup */ 5010 //pThis->ExtFeat.n.u2DualPprLogSup = 0; 5011 //pThis->ExtFeat.n.u2DualEvtLogSup = 0; 5012 //pThis->ExtFeat.n.u5MaxPasidSup = 0; /* Requires GstTranslateSup */ 5013 //pThis->ExtFeat.n.u1UserSupervisorSup = 0; 5016 5014 AssertCompile(IOMMU_MAX_DEV_TAB_SEGMENTS <= 3); 5017 pThis->ExtFeat.n.u2DevTabSegSup = IOMMU_MAX_DEV_TAB_SEGMENTS;5018 pThis->ExtFeat.n.u1PprLogOverflowWarn = 0;5019 pThis->ExtFeat.n.u1PprAutoRespSup = 0;5020 pThis->ExtFeat.n.u2MarcSup = 0;5021 pThis->ExtFeat.n.u1BlockStopMarkSup = 0;5022 pThis->ExtFeat.n.u1PerfOptSup = 0;5023 pThis->ExtFeat.n.u1MsiCapMmioSup = 1;5024 pThis->ExtFeat.n.u1GstIoSup = 0;5025 pThis->ExtFeat.n.u1HostAccessSup = 0;5026 pThis->ExtFeat.n.u1EnhancedPprSup = 0;5027 pThis->ExtFeat.n.u1AttrForwardSup = 0;5028 pThis->ExtFeat.n.u1HostDirtySup = 0;5029 pThis->ExtFeat.n.u1InvIoTlbTypeSup = 0;5030 pThis->ExtFeat.n.u1GstUpdateDisSup = 0;5031 pThis->ExtFeat.n.u1ForcePhysDstSup = 0;5015 pThis->ExtFeat.n.u2DevTabSegSup = IOMMU_MAX_DEV_TAB_SEGMENTS; 5016 //pThis->ExtFeat.n.u1PprLogOverflowWarn = 0; 5017 //pThis->ExtFeat.n.u1PprAutoRespSup = 0; 5018 //pThis->ExtFeat.n.u2MarcSup = 0; 5019 //pThis->ExtFeat.n.u1BlockStopMarkSup = 0; 5020 //pThis->ExtFeat.n.u1PerfOptSup = 0; 5021 pThis->ExtFeat.n.u1MsiCapMmioSup = 1; 5022 //pThis->ExtFeat.n.u1GstIoSup = 0; 5023 //pThis->ExtFeat.n.u1HostAccessSup = 0; 5024 //pThis->ExtFeat.n.u1EnhancedPprSup = 0; 5025 //pThis->ExtFeat.n.u1AttrForwardSup = 0; 5026 //pThis->ExtFeat.n.u1HostDirtySup = 0; 5027 //pThis->ExtFeat.n.u1InvIoTlbTypeSup = 0; 5028 //pThis->ExtFeat.n.u1GstUpdateDisSup = 0; 5029 //pThis->ExtFeat.n.u1ForcePhysDstSup = 0; 5032 5030 5033 5031 pThis->RsvdReg = 0; … … 5053 5051 iommuAmdR3Reset(pDevIns); 5054 5052 5053 LogRel(("%s: DSFX=%u.%u DSCX=%u.%u DSSX=%u.%u ExtFeat=%#RX64\n", IOMMU_LOG_PFX, 5054 pThis->DevSpecificFeat.n.u4RevMajor, pThis->DevSpecificFeat.n.u4RevMinor, 5055 pThis->DevSpecificCtrl.n.u4RevMajor, pThis->DevSpecificCtrl.n.u4RevMinor, 5056 pThis->DevSpecificStatus.n.u4RevMajor, pThis->DevSpecificStatus.n.u4RevMinor, 5057 pThis->ExtFeat.u64)); 5055 5058 return VINF_SUCCESS; 5056 5059 }
Note:
See TracChangeset
for help on using the changeset viewer.