path: root/drivers/iommu/amd_iommu_types.h
diff options
authorLinus Torvalds <>2019-09-29 10:00:14 -0700
committerLinus Torvalds <>2019-09-29 10:00:14 -0700
commit4d2af08ed08ce87c4fd2379fa857153631ee8537 (patch)
tree6e2c3891290440fb902145fa7a11837f7d17f694 /drivers/iommu/amd_iommu_types.h
parent02dc96ef6c25f990452c114c59d75c368a1f4c8f (diff)
parent2a78f9962565e53b78363eaf516eb052009e8020 (diff)
Merge tag 'iommu-fixes-5.4-rc1' of git://
Pull iommu fixes from Joerg Roedel: "A couple of fixes for the AMD IOMMU driver have piled up: - Some fixes for the reworked IO page-table which caused memory leaks or did not allow to downgrade mappings under some conditions. - Locking fixes to fix a couple of possible races around accessing 'struct protection_domain'. The races got introduced when the dma-ops path became lock-less in the fast-path" * tag 'iommu-fixes-5.4-rc1' of git:// iommu/amd: Lock code paths traversing protection_domain->dev_list iommu/amd: Lock dev_data in attach/detach code paths iommu/amd: Check for busy devices earlier in attach_device() iommu/amd: Take domain->lock for complete attach/detach path iommu/amd: Remove amd_iommu_devtable_lock iommu/amd: Remove domain->updated iommu/amd: Wait for completion of IOTLB flush in attach_device iommu/amd: Unmap all L7 PTEs when downgrading page-sizes iommu/amd: Introduce first_pte_l7() helper iommu/amd: Fix downgrading default page-sizes in alloc_pte() iommu/amd: Fix pages leak in free_pagetable()
Diffstat (limited to 'drivers/iommu/amd_iommu_types.h')
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
index 9ac229e92b07..c9c1612d52e0 100644
--- a/drivers/iommu/amd_iommu_types.h
+++ b/drivers/iommu/amd_iommu_types.h
@@ -475,7 +475,6 @@ struct protection_domain {
int glx; /* Number of levels for GCR3 table */
u64 *gcr3_tbl; /* Guest CR3 table */
unsigned long flags; /* flags to find out type of domain */
- bool updated; /* complete domain flush required */
unsigned dev_cnt; /* devices assigned to this domain */
unsigned dev_iommu[MAX_IOMMUS]; /* per-IOMMU reference count */
@@ -634,6 +633,9 @@ struct devid_map {
* This struct contains device specific data for the IOMMU
struct iommu_dev_data {
+ /*Protect against attach/detach races */
+ spinlock_t lock;
struct list_head list; /* For domain->dev_list */
struct llist_node dev_data_list; /* For global dev_data_list */
struct protection_domain *domain; /* Domain the device is bound to */