Skip to contentSkip to conversation

iommu/amd: use full 64-bit value in build_completion_wait()

PATCH In review John Sperbeck 2 participants 2 messages Aug 1, 2022 – Sep 7, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/amd: use full 64-bit value in build_completion_wait()

We started using a 64 bit completion value. Unfortunately, we only stored the low 32-bits, so a very large completion value would never be matched in iommu_completion_wait().

Fixes c69d89aff393 ("iommu/amd: Use 4K page for completion wait write-back semaphore")
---
 drivers/iommu/amd/iommu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/amd/iommu.c +2 -1
index 840831d5d2ad..a0924144bac8 100644
@@ -874,7 +874,8 @@ static void build_completion_wait(struct iommu_cmd *cmd,
 	memset(cmd, 0, sizeof(*cmd));
 	cmd->data[0] = lower_32_bits(paddr) | CMD_COMPL_WAIT_STORE_MASK;
 	cmd->data[1] = upper_32_bits(paddr);
-	cmd->data[2] = data;
+	cmd->data[2] = lower_32_bits(data);
+	cmd->data[3] = upper_32_bits(data);
 	CMD_SET_TYPE(cmd, CMD_COMPL_WAIT);
 }
 
Signature · 1 line
2.37.1.455.g008518b4e5-goog
maintainer
#1 lore raw
Quoted 9 lines · John Sperbeck

We started using a 64 bit completion value. Unfortunately, we only stored the low 32-bits, so a very large completion value would never be matched in iommu_completion_wait().

Fixes c69d89aff393 ("iommu/amd: Use 4K page for completion wait write-back semaphore")
---
 drivers/iommu/amd/iommu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied for 6.0, thanks.