summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Sperbeck <jsperbeck@google.com>2022-08-01 22:22:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-15 12:32:06 +0300
commit5e17967c7ea2c6b167d370a759b16cab54583ac1 (patch)
treeec4357c4465eb31670bfe01156f665ac12fca3ae
parent1a2742552372585e3c865ce6837624f320985ef6 (diff)
downloadlinux-5e17967c7ea2c6b167d370a759b16cab54583ac1.tar.xz
iommu/amd: use full 64-bit value in build_completion_wait()
[ Upstream commit 94a568ce32038d8ff9257004bb4632e60eb43a49 ] 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") Signed-off-by: John Sperbeck <jsperbeck@google.com> Link: https://lore.kernel.org/r/20220801192229.3358786-1-jsperbeck@google.com Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/iommu/amd/iommu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 200cf5da5e0a..f216a86d9c81 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -923,7 +923,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);
}