iommu/amd: Use 4K page for completion wait write-back semaphore
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Wed, 23 Sep 2020 12:13:45 +0000 (12:13 +0000)
committerJoerg Roedel <jroedel@suse.de>
Thu, 24 Sep 2020 10:46:40 +0000 (12:46 +0200)
commitc69d89aff393a212b9635c95990173b48d8bd74d
treeced76feea84d5b77c86ba4267b1b48f069dea2e4
parent06ce8a62ce81f47542043d93b64a4be106e98106
iommu/amd: Use 4K page for completion wait write-back semaphore

IOMMU SNP support requires the completion wait write-back semaphore to be
implemented using a 4K-aligned page, where the page address is to be
programmed into the newly introduced MMIO base/range registers.

This new scheme uses a per-iommu atomic variable to store the current
semaphore value, which is incremented for every completion wait command.

Since this new scheme is also compatible with non-SNP mode,
generalize the driver to use 4K page for completion-wait semaphore in
both modes.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Link: https://lore.kernel.org/r/20200923121347.25365-2-suravee.suthikulpanit@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/init.c
drivers/iommu/amd/iommu.c