]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Set translation valid bit only when IO page tables are in use
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Wed, 13 Jul 2022 22:56:49 +0000 (17:56 -0500)
committerJoerg Roedel <jroedel@suse.de>
Fri, 15 Jul 2022 08:41:04 +0000 (10:41 +0200)
commit54c4e127f06c4391112c5ceb732fd12c7bd84d0f
tree1f0fd665ecac566421a0b98b5d2bd3db27c22c4c
parentad377ef0c13a14d8ef6d0891a9a674742bc8262d
iommu/amd: Set translation valid bit only when IO page tables are in use

On AMD system with SNP enabled, IOMMU hardware checks the host translation
valid (TV) and guest translation valid (GV) bits in the device table entry
(DTE) before accessing the corresponded page tables.

However, current IOMMU driver sets the TV bit for all devices regardless
of whether the host page table is in use. This results in
ILLEGAL_DEV_TABLE_ENTRY event for devices, which do not the host page
table root pointer set up.

Thefore, when SNP is enabled, only set TV bit when DMA remapping is not
used, which is when domain ID in the AMD IOMMU device table entry (DTE)
is zero.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Link: https://lore.kernel.org/r/20220713225651.20758-8-suravee.suthikulpanit@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/init.c
drivers/iommu/amd/iommu.c