[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH ats_vtd v5 16/22] intel_iommu: fill the PASID field when creating
From: |
CLEMENT MATHIEU--DRIF |
Subject: |
[PATCH ats_vtd v5 16/22] intel_iommu: fill the PASID field when creating an instance of IOMMUTLBEntry |
Date: |
Tue, 2 Jul 2024 05:52:42 +0000 |
From: Clément Mathieu--Drif <clement.mathieu--drif@eviden.com>
Signed-off-by: Clément Mathieu--Drif <clement.mathieu--drif@eviden.com>
---
hw/i386/intel_iommu.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 2e4f535dd1..f77972130f 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2210,6 +2210,9 @@ static bool vtd_do_iommu_translate(VTDAddressSpace
*vtd_as, PCIBus *bus,
vtd_iommu_lock(s);
+ /* fill the pasid before getting rid2pasid */
+ entry->pasid = pasid;
+
cc_entry = &vtd_as->context_cache_entry;
/* Try to fetch pte form IOTLB, we don't need RID2PASID logic */
@@ -2328,6 +2331,7 @@ out:
entry->translated_addr = vtd_get_pte_addr(pte, s->aw_bits) & page_mask;
entry->addr_mask = ~page_mask;
entry->perm = access_flags;
+ /* pasid already set */
return true;
error:
@@ -2336,6 +2340,7 @@ error:
entry->translated_addr = 0;
entry->addr_mask = 0;
entry->perm = IOMMU_NONE;
+ entry->pasid = PCI_NO_PASID;
return false;
}
@@ -3697,6 +3702,7 @@ static void vtd_piotlb_page_invalidate(IntelIOMMUState
*s, uint16_t domain_id,
event.entry.target_as = &address_space_memory;
event.entry.iova = addr;
event.entry.perm = IOMMU_NONE;
+ event.entry.pasid = pasid;
event.entry.addr_mask = size - 1;
event.entry.translated_addr = 0;
memory_region_notify_iommu(&vtd_as->iommu, 0, event);
@@ -4344,6 +4350,7 @@ static void do_invalidate_device_tlb(VTDAddressSpace
*vtd_dev_as,
event.entry.iova = addr;
event.entry.perm = IOMMU_NONE;
event.entry.translated_addr = 0;
+ event.entry.pasid = vtd_dev_as->pasid;
memory_region_notify_iommu(&vtd_dev_as->iommu, 0, event);
}
@@ -4920,6 +4927,7 @@ static IOMMUTLBEntry
vtd_iommu_translate(IOMMUMemoryRegion *iommu, hwaddr addr,
IOMMUTLBEntry iotlb = {
/* We'll fill in the rest later. */
.target_as = &address_space_memory,
+ .pasid = vtd_as->pasid,
};
bool success;
@@ -4932,6 +4940,7 @@ static IOMMUTLBEntry
vtd_iommu_translate(IOMMUMemoryRegion *iommu, hwaddr addr,
iotlb.translated_addr = addr & VTD_PAGE_MASK_4K;
iotlb.addr_mask = ~VTD_PAGE_MASK_4K;
iotlb.perm = IOMMU_RW;
+ iotlb.pasid = PCI_NO_PASID;
success = true;
}
--
2.45.2
- Re: [PATCH ats_vtd v5 04/22] intel_iommu: do not consider wait_desc as an invalid descriptor, (continued)
[PATCH ats_vtd v5 13/22] intel_iommu: implement the get_address_space_pasid iommu operation, CLEMENT MATHIEU--DRIF, 2024/07/02
[PATCH ats_vtd v5 06/22] pcie: add helper to declare PASID capability for a pcie device, CLEMENT MATHIEU--DRIF, 2024/07/02
[PATCH ats_vtd v5 09/22] pci: cache the bus mastering status in the device, CLEMENT MATHIEU--DRIF, 2024/07/02
[PATCH ats_vtd v5 05/22] memory: add permissions in IOMMUAccessFlags, CLEMENT MATHIEU--DRIF, 2024/07/02
[PATCH ats_vtd v5 15/22] memory: Allow to store the PASID in IOMMUTLBEntry, CLEMENT MATHIEU--DRIF, 2024/07/02
[PATCH ats_vtd v5 16/22] intel_iommu: fill the PASID field when creating an instance of IOMMUTLBEntry,
CLEMENT MATHIEU--DRIF <=
[PATCH ats_vtd v5 14/22] intel_iommu: implement the get_memory_region_pasid iommu operation, CLEMENT MATHIEU--DRIF, 2024/07/02
[PATCH ats_vtd v5 10/22] pci: add IOMMU operations to get address spaces and memory regions with PASID, CLEMENT MATHIEU--DRIF, 2024/07/02
[PATCH ats_vtd v5 12/22] pci: add a pci-level initialization function for iommu notifiers, CLEMENT MATHIEU--DRIF, 2024/07/02
[PATCH ats_vtd v5 11/22] memory: store user data pointer in the IOMMU notifiers, CLEMENT MATHIEU--DRIF, 2024/07/02
[PATCH ats_vtd v5 17/22] atc: generic ATC that can be used by PCIe devices that support SVM, CLEMENT MATHIEU--DRIF, 2024/07/02
[PATCH ats_vtd v5 02/22] intel_iommu: make types match, CLEMENT MATHIEU--DRIF, 2024/07/02
[PATCH ats_vtd v5 20/22] pci: add a pci-level API for ATS, CLEMENT MATHIEU--DRIF, 2024/07/02