]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Enforce 4k mapping for certain IOMMU data structures
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Thu, 5 Nov 2020 14:58:32 +0000 (14:58 +0000)
committerWill Deacon <will@kernel.org>
Mon, 23 Nov 2020 12:52:04 +0000 (12:52 +0000)
commit6f7afd94d79d5be6500f9d225ca2949a69b21438
treeb0e3ab5e5730bbde6358dc42f37f418cfeb8de5e
parent2d3aa92d810d4388804c16522f960a4464de341f
iommu/amd: Enforce 4k mapping for certain IOMMU data structures

AMD IOMMU requires 4k-aligned pages for the event log, the PPR log,
and the completion wait write-back regions. However, when allocating
the pages, they could be part of large mapping (e.g. 2M) page.
This causes #PF due to the SNP RMP hardware enforces the check based
on the page level for these data structures.

So, fix by calling set_memory_4k() on the allocated pages.

Fixes: cb8ae7aef532 ("iommu/amd: Use 4K page for completion wait write-back semaphore")
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Link: https://lore.kernel.org/r/20201105145832.3065-1-suravee.suthikulpanit@amd.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/amd/init.c