iommu/amd: Modify set_dte_entry() to use 256-bit DTE helpers
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Mon, 18 Nov 2024 05:49:33 +0000 (05:49 +0000)
committerJoerg Roedel <jroedel@suse.de>
Wed, 18 Dec 2024 08:37:40 +0000 (09:37 +0100)
commitfd5dff9de4be29b8ebec63b7e916915d4c984027
treed20bdb8d3bddfd00a4fed4f85ec0ceed426f36ce
parent8b3f78733814b180089a400743b6f19d118aec62
iommu/amd: Modify set_dte_entry() to use 256-bit DTE helpers

Also, the set_dte_entry() is used to program several DTE fields (e.g.
stage1 table, stage2 table, domain id, and etc.), which is difficult
to keep track with current implementation.

Therefore, separate logic for clearing DTE (i.e. make_clear_dte) and
another function for setting up the GCR3 Table Root Pointer, GIOV, GV,
GLX, and GuestPagingMode into another function set_dte_gcr3_table().

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Link: https://lore.kernel.org/r/20241118054937.5203-6-suravee.suthikulpanit@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/amd_iommu.h
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/init.c
drivers/iommu/amd/iommu.c