Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2946221rdb; Tue, 13 Feb 2024 02:00:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXsQ2mphrlMfsrrwcanfTylNswJ1G7bLpN+2q9F7NbNO6Xgx8MJC3aQ0h6YfMnFjFGACnA1i7kzlc5GoLCFzEqL6nRSJyPxE/ntv1RZbg== X-Google-Smtp-Source: AGHT+IGsIxkyy134D9ZWVtbmbmldOks1qshTLtui1g6X+mwI7GuAOQj5j/Ddsc82wGvx+jYM0M7P X-Received: by 2002:a17:906:b81a:b0:a3c:ce4b:54a5 with SMTP id dv26-20020a170906b81a00b00a3cce4b54a5mr2421583ejb.51.1707818447861; Tue, 13 Feb 2024 02:00:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707818447; cv=pass; d=google.com; s=arc-20160816; b=OhBMjqI+LIPQoUdssDii9lMrRi5oxutm5bhkHg7xswN19yFUVvkajIAwQ3vdPxqDMm +j3E94dLOFJZ0hqtWfbhE06G03wGiaV8appTCkGtxp+OTN5kSuHx/PQOWgbwRF3b0+av /8PMxt7myGMPuEh9HSSpuztZpUs8T1zdkERlz/bnVLX4EoHDq4yXhqrUGdayEK7RfzRk 5FR6dP5f1iDL7URf1chm+gMXe0aidQ3l0NKgLPQQcBraOndXCLQzpb90PvoxVsZGGt/A YImlPEBE5ROHhX8jXQgiSzMCvud4bUSkCzP4/mWE12rxWL8Xyxw/jK0AnbNVaDFAq0OE 0QtQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=rPbTW6UH18y3LLQE1rpdamvhaW8hbKb0iIIf6FdLfuU=; fh=o2DQg2DI4cUSeeeCdSsnxke/iOUpLC5jRlYte4fBlQ0=; b=ajXDslSW3rs/npNP+fL5MAMxmlFRf71eNOC37nZ2ZCcTqHMYBcAU6Uav7+hnR8Zddg pTgxtoZvKSMmTbUtdnQKn3a1kgQH6ABWfpPOXim6gQegcxT6H2Gq36Yv9RavlYJ0y2Sd w3f2m9Xr7sClENvAVUSRpkwfCeFbF8si4mp4G1kxEZkXYK7zSASBLP/2C9L/BX1rO8vl VjEDYl15be8oPvzJDJGNE9zSUYEZEBr/I0kRDDgROq3YXSuyhic++dys7x1AqP3bPeq9 EknPU1eDcvZZxP0gJVcno28SrNLP7kz+yq6BAI1ZUlYPcuuMPqCZGA9/TGgwOXunT4eD MoCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=szljOOS0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63290-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63290-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXKw5KVpyG5mVdmw8E2SSyj/uGuMI8zbUuK+svDR9X7e/eY3/3LOmsxgzwGEwxER+iEgD7m+LDFu21/oZKJnxnAkJVoEOXF6Y4Sgh+EOA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id lt19-20020a170906fa9300b00a37487eb569si1070112ejb.834.2024.02.13.02.00.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:00:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63290-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=szljOOS0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63290-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63290-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8DA851F2B015 for ; Tue, 13 Feb 2024 10:00:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D1842BB09; Tue, 13 Feb 2024 09:58:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="szljOOS0" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A86D42BB01; Tue, 13 Feb 2024 09:58:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707818319; cv=none; b=as3HTdFl/C5+Kku1WksYsb6t7M66PgzNB1zrluky5rdP7EkwhsaHgYLfuGj7CCDAEDQmgkqPR58A88NqbqKITRKA1d8vflfFNQ0Ex46nTU/LiCAFNqyArjAFQtnsNhGBg+o26w1gaeoL48wjGIXODRV/GKk0+Ertq4ucjV5I0hI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707818319; c=relaxed/simple; bh=zRzb7KQv3xRBZo9WYphp8IEg9VdrU4vqON6031OOSn0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=THw1qx+0ACLbCG2ZKKzV1S50hfBDyiRsmV3RBH3/DHV+mmHn/82SngqEmcPyyKZxUdbJp4DrAguYv5Me+r0Zx6QpVFtfumAMi0ZCVw3QE2evhaUIxntIPfQhDFkXcrBROF6JiMWAApktMbT7jWoTJZnpbXtz/R+FyoVmiOFu1qc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=szljOOS0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF023C433C7; Tue, 13 Feb 2024 09:58:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707818319; bh=zRzb7KQv3xRBZo9WYphp8IEg9VdrU4vqON6031OOSn0=; h=From:To:Cc:Subject:Date:From; b=szljOOS0X5reBC/rEedA3Pp3GuGD4SQq7ebT+rhQK6CV0qKApjF0nrIt7hVDh42mv t3NOycP/SJhpr9wfFtjQcbzaMYE51opx1y56z0RLNyt0Z4U7HN0ndRt/FN5x+y2ORN UzHqEE8V0ejjXSLZ7C4JkeGM/4m+1AzEZnTvFAMTZGOe3luBtOeFPBrhyFO4LtnA9a RxrBis7RD+0EFrCTQsVevCGgs2PyqM53/46X+j1X9wlqeq66uhtVEh/MrszBBR+bzW HEuRulOJ3NDV22pnID7xB9KDaeQpVIbTY3KWvIoo82UA94AIKDBR7WjXJ+9AONr8Yf /8wBUR0r4oOQA== From: Arnd Bergmann To: David Woodhouse , Lu Baolu Cc: Arnd Bergmann , Joerg Roedel , Will Deacon , Robin Murphy , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Kevin Tian , Yi Liu , Jason Gunthorpe , Jacob Pan , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] iommu/vt-d: fix constant-out-of-range warning Date: Tue, 13 Feb 2024 10:58:20 +0100 Message-Id: <20240213095832.455245-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann On 32-bit builds, the vt-d driver causes a warning with clang: drivers/iommu/intel/nested.c:112:13: error: result of comparison of constant 18446744073709551615 with expression of type 'unsigned long' is always false [-Werror,-Wtautological-constant-out-of-range-compare] 112 | if (npages == U64_MAX) | ~~~~~~ ^ ~~~~~~~ This can be easily avoided by making the variable a 64-bit type, which matches both the caller and the use anyway. Fixes: f6f3721244a8 ("iommu/vt-d: Add iotlb flush for nested domain") Signed-off-by: Arnd Bergmann --- drivers/iommu/intel/nested.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/intel/nested.c b/drivers/iommu/intel/nested.c index f26c7f1c46cc..77a09c982979 100644 --- a/drivers/iommu/intel/nested.c +++ b/drivers/iommu/intel/nested.c @@ -95,7 +95,7 @@ static void nested_flush_dev_iotlb(struct dmar_domain *domain, u64 addr, } static void intel_nested_flush_cache(struct dmar_domain *domain, u64 addr, - unsigned long npages, bool ih) + u64 npages, bool ih) { struct iommu_domain_info *info; unsigned int mask; -- 2.39.2