From nobody Tue Dec 16 04:37:00 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 BADC6C07E9D for ; Mon, 26 Sep 2022 11:43:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238464AbiIZLnV (ORCPT ); Mon, 26 Sep 2022 07:43:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238379AbiIZLmX (ORCPT ); Mon, 26 Sep 2022 07:42:23 -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 8639571BCC; Mon, 26 Sep 2022 03:45:54 -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 E8900B80936; Mon, 26 Sep 2022 10:44:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 459D4C433D6; Mon, 26 Sep 2022 10:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664189091; bh=Q74uf3s621jYqCQHgIEhJcf7RNGBb1f0pLKmEvNefl4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KgRvGvOSVoBfjIvzQHG9CIiM/26Qr+g12BoaEG0Hu/h3mmwINxq39aBwWwIoRI39p eCEt2Pw7piMPKyKhIoDJqU4iPCcMRxltGdNc83tgckeW69N4RcnovWLquF9uvCV8gX +OplgaSiBBk8UnuTrfL4boqV6T/qc3N/uEOCp+RM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Raghunathan Srinivasan , Yi Liu , Jerry Snitselaar , Kevin Tian , Lu Baolu , Joerg Roedel Subject: [PATCH 5.19 039/207] iommu/vt-d: Check correct capability for sagaw determination Date: Mon, 26 Sep 2022 12:10:28 +0200 Message-Id: <20220926100808.370493079@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100806.522017616@linuxfoundation.org> References: <20220926100806.522017616@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: Yi Liu commit 154897807050c1161cb2660e502fc0470d46b986 upstream. Check 5-level paging capability for 57 bits address width instead of checking 1GB large page capability. Fixes: 53fc7ad6edf2 ("iommu/vt-d: Correctly calculate sagaw value of IOMMU") Cc: stable@vger.kernel.org Reported-by: Raghunathan Srinivasan Signed-off-by: Yi Liu Reviewed-by: Jerry Snitselaar Reviewed-by: Kevin Tian Reviewed-by: Raghunathan Srinivasan Link: https://lore.kernel.org/r/20220916071212.2223869-2-yi.l.liu@intel.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/intel/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -419,7 +419,7 @@ static unsigned long __iommu_calculate_s { unsigned long fl_sagaw, sl_sagaw; =20 - fl_sagaw =3D BIT(2) | (cap_fl1gp_support(iommu->cap) ? BIT(3) : 0); + fl_sagaw =3D BIT(2) | (cap_5lp_support(iommu->cap) ? BIT(3) : 0); sl_sagaw =3D cap_sagaw(iommu->cap); =20 /* Second level only. */