RE: [PATCH] IA64: fix VT-d dma_mapping_error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
>+int intel_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr)
>+{
>+	return !dma_addr;
>+}

The implementation of inte_dma_mapping_error is incomplete.

Dma_addr is valid only when it belongs to hwdev's domain. This is all about VT-d isolation fundamental.

+int intel_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr)
+{
+        struct pci_dev *pdev = to_pci_dev(hwdev);
+        struct dmar_domain *domain;
+        struct iova *iova;
+
+        domain = find_domain(pdev);
+
+        iova = find_iova(&domain->iovad, IOVA_PFN(dma_addr));
+        if (!iova)
+                return -EINVAL;
+	   return 0;
+}
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Sparc Linux]     [DCCP]     [Linux ARM]     [Yosemite News]     [Linux SCSI]     [Linux x86_64]     [Linux for Ham Radio]

  Powered by Linux