Re: [PATCH] iommu/vt-d: Allocate reserved region for ISA with correct permission

From: Lu Baolu
Date: Sun Dec 15 2019 - 00:39:17 EST


Hi Jerry,

On 12/14/19 9:42 AM, Lu Baolu wrote:
Hi Jerry,

On 12/13/19 1:36 PM, Jerry Snitselaar wrote:
Currently the reserved region for ISA is allocated with no
permissions. If a dma domain is being used, mapping this region will
fail. Set the permissions to DMA_PTE_READ|DMA_PTE_WRITE.

Cc: Joerg Roedel <jroedel@xxxxxxx>
Cc: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
Cc: iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx
Cc: stable@xxxxxxxxxxxxxxx # v5.3+
Fixes: d850c2ee5fe2 ("iommu/vt-d: Expose ISA direct mapping region via iommu_get_resv_regions")
Signed-off-by: Jerry Snitselaar <jsnitsel@xxxxxxxxxx>
---
 drivers/iommu/intel-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 0c8d81f56a30..998529cebcf2 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -5736,7 +5736,7 @@ static void intel_iommu_get_resv_regions(struct device *device,
ÂÂÂÂÂÂÂÂÂ struct pci_dev *pdev = to_pci_dev(device);
ÂÂÂÂÂÂÂÂÂ if ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA) {
-ÂÂÂÂÂÂÂÂÂÂÂ reg = iommu_alloc_resv_region(0, 1UL << 24, 0,
+ÂÂÂÂÂÂÂÂÂÂÂ reg = iommu_alloc_resv_region(0, 1UL << 24, prot,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ IOMMU_RESV_DIRECT);


This also applies to the IOAPIC range. Can you please change them
together?

Please ignore this comment. These two ranges are of different type. Your
fix is enough. Sorry for the confusion.

Best regards,
baolu