iommu/amd: Update Device Table in increase_address_space()
authorJoerg Roedel <jroedel@suse.de>
Mon, 4 May 2020 12:54:12 +0000 (14:54 +0200)
committerJoerg Roedel <jroedel@suse.de>
Tue, 5 May 2020 12:38:38 +0000 (14:38 +0200)
commit19c6978fba68a2cdedee7d55fb8c3063d47982d9
treedf1fc98fe59e02ed1bdd74d32438f22c7adaa6d4
parentf44a4d7e4f1cdef73c90b1dc749c4d8a7372a8eb
iommu/amd: Update Device Table in increase_address_space()

The Device Table needs to be updated before the new page-table root
can be published in domain->pt_root. Otherwise a concurrent call to
fetch_pte might fetch a PTE which is not reachable through the Device
Table Entry.

Fixes: 92d420ec028d ("iommu/amd: Relax locking in dma_ops path")
Reported-by: Qian Cai <cai@lca.pw>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Tested-by: Qian Cai <cai@lca.pw>
Link: https://lore.kernel.org/r/20200504125413.16798-5-joro@8bytes.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu.c