From nobody Sun Sep 14 22:49:45 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2A25C6FA82 for ; Tue, 13 Sep 2022 14:45:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230401AbiIMOpW (ORCPT ); Tue, 13 Sep 2022 10:45:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232051AbiIMOm7 (ORCPT ); Tue, 13 Sep 2022 10:42:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 881F26E88B; Tue, 13 Sep 2022 07:22:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7F679B80F1A; Tue, 13 Sep 2022 14:20:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF58AC433C1; Tue, 13 Sep 2022 14:20:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078853; bh=QxTU32UgUc4bDHoxqPIsENUxvy6OgdxzOwguF1x6ojw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SE/Eu9XKAbanIIiez0FPYOHKcuZc3g4bdr27CFJtZWa6h/phhjlbN7mZ4SUde+zd5 Qc7bZ32ZE23rFWbWMQgU5euzWWYkmvHvCT2lgAj558PgKBJ6w0UCDzb9ByGxV58KOI tpbdXuiZzU6nzxksbpacW3bl5Oe5LdfKPKelDG48= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Sperbeck , Joerg Roedel , Sasha Levin Subject: [PATCH 5.15 108/121] iommu/amd: use full 64-bit value in build_completion_wait() Date: Tue, 13 Sep 2022 16:04:59 +0200 Message-Id: <20220913140401.984422152@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140357.323297659@linuxfoundation.org> References: <20220913140357.323297659@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: John Sperbeck [ 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 Link: https://lore.kernel.org/r/20220801192229.3358786-1-jsperbeck@google.c= om Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- 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 e23e70af718f1..7154fb551ddc9 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -852,7 +852,8 @@ static void build_completion_wait(struct iommu_cmd *cmd, memset(cmd, 0, sizeof(*cmd)); cmd->data[0] =3D lower_32_bits(paddr) | CMD_COMPL_WAIT_STORE_MASK; cmd->data[1] =3D upper_32_bits(paddr); - cmd->data[2] =3D data; + cmd->data[2] =3D lower_32_bits(data); + cmd->data[3] =3D upper_32_bits(data); CMD_SET_TYPE(cmd, CMD_COMPL_WAIT); } =20 --=20 2.35.1