Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6818475rwn; Tue, 13 Sep 2022 09:22:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR6PvQyto/Yc1KflCYMhbBWun2htqpBwYKocubxTKNwOcaohmeXG2iH6LmVvMNT9AnAzUDFH X-Received: by 2002:a05:6402:1211:b0:44e:b250:633d with SMTP id c17-20020a056402121100b0044eb250633dmr26571479edw.2.1663086158379; Tue, 13 Sep 2022 09:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663086158; cv=none; d=google.com; s=arc-20160816; b=H6KjFYGdQE59yRJOrRYOByo/AZLSEGtxxvV5uBhuSnT61/qnWkvSTWXVjlnwIJRUng TWAXSg/NRWzBr2KgKB70Ub+CITewOIMlgxy2iJ63YSlFCKZZRxmOUxnT3v8eC98I2rtY 947vgBw5cAm/VPgnyPqEdqwcznWPx1MKP+Ca+nueOdMS/Y8BFV348bkhnAgSUu+cP+Ar nD4a5G1as2H3X3/Hw4pbdM0Dhq3Kb6Cg4RuVNiITwH4bChyV6Bdfz1iMjwUKqwHUa7eL P71USnvmTl+UMFWJ5QSBrDIdXFEYGBBMKYSB7iZPZux5qS/R/K22zR0qngdq10AStroT EGdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vmzDrNtBZi842flneK87JTs0hYOduykk5TbzZnicN0I=; b=PWENZGrNSPFiN+5zdHiHj5wmzi7ml5WzWcfPr5P9Z2LneP/es/XCIVKZov8dqmkCFL oNwK9BDA93PLpSmqfcA02mgN/GY5pPcYHbr9VFNXmr9d9B5w7BGF4/YPlKe3OieZscWS h7eiATawuRhq2FFxudYWPh26XRdg0NjqYA+bwsCJHz0vNIN+km2BVrwMh9CXpVMOxwqy ZsVPtiOQEwG/ffJ3yyoy1/59fptpg2oC6F6BYaLM+JkCitv+HmLQzZfeEHSBHrDFXgu/ j0VWzkkR5dcKH8WuWNPw8tcO3k+3qQI16elpuAMjdquta7ChANjPwoCIdHSM4lMFgQaz xLQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="SE/Eu9XK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s27-20020a170906061b00b0073d7f493935si7908693ejb.755.2022.09.13.09.22.12; Tue, 13 Sep 2022 09:22:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="SE/Eu9XK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231484AbiIMOpS (ORCPT + 99 others); Tue, 13 Sep 2022 10:45:18 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.com 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] = 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.35.1