diff options
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/intel-iommu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 64d8942d6d14..e2d2cb3119b3 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -3877,7 +3877,7 @@ static void vm_domain_remove_all_dev_info(struct dmar_domain *domain) | |||
3877 | } | 3877 | } |
3878 | 3878 | ||
3879 | /* domain id for virtual machine, it won't be set in context */ | 3879 | /* domain id for virtual machine, it won't be set in context */ |
3880 | static unsigned long vm_domid; | 3880 | static atomic_t vm_domid = ATOMIC_INIT(0); |
3881 | 3881 | ||
3882 | static struct dmar_domain *iommu_alloc_vm_domain(void) | 3882 | static struct dmar_domain *iommu_alloc_vm_domain(void) |
3883 | { | 3883 | { |
@@ -3887,7 +3887,7 @@ static struct dmar_domain *iommu_alloc_vm_domain(void) | |||
3887 | if (!domain) | 3887 | if (!domain) |
3888 | return NULL; | 3888 | return NULL; |
3889 | 3889 | ||
3890 | domain->id = vm_domid++; | 3890 | domain->id = atomic_inc_return(&vm_domid); |
3891 | domain->nid = -1; | 3891 | domain->nid = -1; |
3892 | memset(domain->iommu_bmp, 0, sizeof(domain->iommu_bmp)); | 3892 | memset(domain->iommu_bmp, 0, sizeof(domain->iommu_bmp)); |
3893 | domain->flags = DOMAIN_FLAG_VIRTUAL_MACHINE; | 3893 | domain->flags = DOMAIN_FLAG_VIRTUAL_MACHINE; |