Linux IOMMU Development
 help / color / mirror / Atom feed
* [PATCH] iommu/amd: use full 64-bit value in build_completion_wait()
@ 2022-08-01 19:22 John Sperbeck
  2022-09-07  8:40 ` Joerg Roedel
  0 siblings, 1 reply; 2+ messages in thread
From: John Sperbeck @ 2022-08-01 19:22 UTC (permalink / raw)
  To: Joerg Roedel, Suravee Suthikulpanit; +Cc: Logan Odell, iommu, 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")
Signed-off-by: John Sperbeck <jsperbeck@google.com>
---
 drivers/iommu/amd/iommu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 840831d5d2ad..a0924144bac8 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -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);
 }
 
-- 
2.37.1.455.g008518b4e5-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iommu/amd: use full 64-bit value in build_completion_wait()
  2022-08-01 19:22 [PATCH] iommu/amd: use full 64-bit value in build_completion_wait() John Sperbeck
@ 2022-09-07  8:40 ` Joerg Roedel
  0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2022-09-07  8:40 UTC (permalink / raw)
  To: John Sperbeck; +Cc: Suravee Suthikulpanit, Logan Odell, iommu

On Mon, Aug 01, 2022 at 07:22:29PM +0000, John Sperbeck wrote:
> 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>
> ---
>  drivers/iommu/amd/iommu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied for 6.0, thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-07  8:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-01 19:22 [PATCH] iommu/amd: use full 64-bit value in build_completion_wait() John Sperbeck
2022-09-07  8:40 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox