- Timestamp:
- Jun 12, 2020 6:49:01 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r84677 r84808 4126 4126 4127 4127 /* Check permissions bits of the root page table. */ 4128 uint8_t const f PtePerm = (pDte->au64[0] >> IOMMU_IO_PERM_SHIFT) & IOMMU_IO_PERM_MASK;4129 if ((fAccess & f PtePerm) == fAccess)4128 uint8_t const fRootPtePerm = (pDte->au64[0] >> IOMMU_IO_PERM_SHIFT) & IOMMU_IO_PERM_MASK; 4129 if ((fAccess & fRootPtePerm) == fAccess) 4130 4130 { /* likely */ } 4131 4131 else 4132 4132 { 4133 Log((IOMMU_LOG_PFX ": Permission denied (fAccess=%#x f PtePerm=%#x) -> IOPF", fAccess, fPtePerm));4133 Log((IOMMU_LOG_PFX ": Permission denied (fAccess=%#x fRootPtePerm=%#x) -> IOPF", fAccess, fRootPtePerm)); 4134 4134 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 4135 4135 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, true /* fPresent */, false /* fRsvdNotZero */, … … 4189 4189 else 4190 4190 { 4191 Log((IOMMU_LOG_PFX ": Page table entry not present -> IOPF" , fAccess, fPtePerm));4191 Log((IOMMU_LOG_PFX ": Page table entry not present -> IOPF")); 4192 4192 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 4193 4193 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, false /* fPresent */, false /* fRsvdNotZero */, … … 4514 4514 /* Ensure the IRTE offset is within the specified table size. */ 4515 4515 Assert(pDte->n.u4IntrTableLength < 12); 4516 if (offIrte + sizeof(IRTE_T) <= (1 << pDte->n.u4IntrTableLength) << IOMMU_IRTE_SIZE_SHIFT)4516 if (offIrte + sizeof(IRTE_T) <= (1U << pDte->n.u4IntrTableLength) << IOMMU_IRTE_SIZE_SHIFT) 4517 4517 { /* likely */ } 4518 4518 else … … 4879 4879 } 4880 4880 4881 /* If command completion interrupt is requested, raise an interrupt. */ 4881 IOMMU_LOCK(pDevIns); 4882 4883 /* Indicate that this command has completed. */ 4884 ASMAtomicOrU64(&pThis->Status.u64, IOMMU_STATUS_COMPLETION_WAIT_INTR); 4885 4886 /* If the command requests an interrupt and completion wait interrupts are enabled, raise it. */ 4882 4887 if (pCmdComWait->n.u1Interrupt) 4883 4888 { 4884 IOMMU_LOCK(pDevIns);4885 4889 IOMMU_CTRL_T const Ctrl = iommuAmdGetCtrl(pThis); 4886 4890 if (Ctrl.n.u1CompWaitIntrEn) 4887 { 4888 /* Indicate that this command completed. */ 4889 ASMAtomicOrU64(&pThis->Status.u64, IOMMU_STATUS_COMPLETION_WAIT_INTR); 4890 4891 /* Check and signal an interrupt if software wants to receive one when this command completes. */ 4892 IOMMU_CTRL_T const Ctrl = iommuAmdGetCtrl(pThis); 4893 if (Ctrl.n.u1CompWaitIntrEn) 4894 iommuAmdRaiseMsiInterrupt(pDevIns); 4895 } 4896 IOMMU_UNLOCK(pDevIns); 4891 iommuAmdRaiseMsiInterrupt(pDevIns); 4897 4892 } 4893 4894 IOMMU_UNLOCK(pDevIns); 4898 4895 return VINF_SUCCESS; 4899 4896 } … … 6069 6066 pThis->ExtFeat.n.u1HwErrorSup = 1; 6070 6067 pThis->ExtFeat.n.u1PerfCounterSup = 0; 6071 pThis->ExtFeat.n.u2HostAddrTranslateSize = IOMMU_MAX_HOST_PT_LEVEL; 6068 AssertCompile((IOMMU_MAX_HOST_PT_LEVEL & 0x3) < 3); 6069 pThis->ExtFeat.n.u2HostAddrTranslateSize = (IOMMU_MAX_HOST_PT_LEVEL & 0x3); 6072 6070 pThis->ExtFeat.n.u2GstAddrTranslateSize = 0; /* Requires GstTranslateSup. */ 6073 6071 pThis->ExtFeat.n.u2GstCr3RootTblLevel = 0; /* Requires GstTranslateSup. */
Note:
See TracChangeset
for help on using the changeset viewer.