]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Unmap all L7 PTEs when downgrading page-sizes
authorAndrei Dulea <adulea@amazon.de>
Fri, 13 Sep 2019 14:42:31 +0000 (16:42 +0200)
committerJoerg Roedel <jroedel@suse.de>
Tue, 24 Sep 2019 09:15:51 +0000 (11:15 +0200)
commit0f441cf2d1a0ff83a934073867e9d1da7611b5e1
tree8c59410d75bdad5ca8ff1bbf2e4f85dfb9f0cd72
parentd720ed79bfff12ca149374c753cc84402e881f78
iommu/amd: Unmap all L7 PTEs when downgrading page-sizes

When replacing a large mapping created with page-mode 7 (i.e.
non-default page size), tear down the entire series of replicated PTEs.
Besides providing access to the old mapping, another thing that might go
wrong with this issue is on the fetch_pte() code path that can return a
PDE entry of the newly re-mapped range.

While at it, make sure that we flush the TLB in case alloc_pte() fails
and returns NULL at a lower level.

Fixes: ab8a4925a149 ("iommu/amd: Allow downgrading page-sizes in alloc_pte()")
Signed-off-by: Andrei Dulea <adulea@amazon.de>
drivers/iommu/amd_iommu.c