Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9080746pxu; Mon, 28 Dec 2020 06:10:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIvXF0ElI87d5ImEyKkCxrwzz6ZD6sS04KcscU8R6fmYqZcmsl6aLL0tHOza6K+/MtgI85 X-Received: by 2002:aa7:c3cd:: with SMTP id l13mr41964875edr.97.1609164635464; Mon, 28 Dec 2020 06:10:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164635; cv=none; d=google.com; s=arc-20160816; b=zlpgqw1pKMJOZoGQFMHGjOFXM1STcsC49Q8uXbmRW0SRisZE9PEPhxVjn1Ni4qtR7w Fux4RpubdCKegf1Mdkpf6yf5rlyw5lz9sucykQz3PgkShB5c/U3UkXeDg8PjueTXkcSd UYW1R3SU9NWSK6mjKKgSkMeF1ZIxGN/H7uBPEBrVD9VfQCI3jPPfbytkw0/UK9PGKi9T ZfZDf90MsE62vXNSop/i2IB4ICNMC5o5L37UBobr/O3pD6saBnDfMGCICOZtsiebmwuC oqDEUozTnCc0ZkGV6O/vXYfm3vYHFEUxcFcGfXzj43hj7rfDl/s0PRMTkPmxhDvFvhz2 wRtA== 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=OFulTmhM02J0yvLt36gUHMd5iaOf8UvA5RQhJGJMGMw=; b=swae1M4o7unKyvQcGw5Hal38UpeoC8P39Frqps+YcK2L7bmwhlRQdgu3YfQrhpN5bL eKFZ/VZHRBRhS7nPpMPBvc/lvcIOZSM9xEzKd7F+BhcgLdejs/V8JpW6+Cg+A9XOHqzZ y7PxzigqBspFKXPTy9aJCCukzBBVGbj1bnuLz/1Dzkcbm4SXhook2mKl3q0qozcaKG7c GJ8Jqn0/gdh82aZo3W8rsZLsv3iP4oEwGY+L5BoB6J/0USgxMx6X19452V2sCJuzyMnZ cpKcKDeqi5fWI/+37Hnl4tI6Xxer6idwN3+dc9A5uRg5aoMRkyzJ2GwBgO45AonW9Bxc AKuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="DJlwwE/j"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si18470253ejp.753.2020.12.28.06.10.10; Mon, 28 Dec 2020 06:10:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="DJlwwE/j"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2438539AbgL1OHt (ORCPT + 99 others); Mon, 28 Dec 2020 09:07:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:42274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438530AbgL1OHr (ORCPT ); Mon, 28 Dec 2020 09:07:47 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 99B67206D4; Mon, 28 Dec 2020 14:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164427; bh=ILd5HK2o1fyL/VtjzVg7wVZsVWz5aoSSOlNatR8ogV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DJlwwE/jJElcJp9tqrGsR5D31Ny/2xR7E1/Bb0KdFTIyrI0EOQuVQ7HkB8cdN50x0 eOAc0+Uwauesx1iA9/hbCiBMvhtbT9Nytluyf8GaAEej6gO3gvKTfS38eOw+c52q/M nnVu6vCvI/LU56wndlSPu8H7kGRebzihnprmw87Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lukas Bulwahn , Lu Baolu , Will Deacon , Sasha Levin Subject: [PATCH 5.10 146/717] iommu/vt-d: include conditionally on CONFIG_INTEL_IOMMU_SVM Date: Mon, 28 Dec 2020 13:42:24 +0100 Message-Id: <20201228125027.957807088@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lukas Bulwahn [ Upstream commit 68dd9d89eaf56dfab8d46bf25610aa4650247617 ] Commit 6ee1b77ba3ac ("iommu/vt-d: Add svm/sva invalidate function") introduced intel_iommu_sva_invalidate() when CONFIG_INTEL_IOMMU_SVM. This function uses the dedicated static variable inv_type_granu_table and functions to_vtd_granularity() and to_vtd_size(). These parts are unused when !CONFIG_INTEL_IOMMU_SVM, and hence, make CC=clang W=1 warns with an -Wunused-function warning. Include these parts conditionally on CONFIG_INTEL_IOMMU_SVM. Fixes: 6ee1b77ba3ac ("iommu/vt-d: Add svm/sva invalidate function") Signed-off-by: Lukas Bulwahn Acked-by: Lu Baolu Link: https://lore.kernel.org/r/20201115205951.20698-1-lukas.bulwahn@gmail.com Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- drivers/iommu/intel/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index a49afa11673cc..c9da9e93f545c 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -5387,6 +5387,7 @@ static void intel_iommu_aux_detach_device(struct iommu_domain *domain, aux_domain_remove_dev(to_dmar_domain(domain), dev); } +#ifdef CONFIG_INTEL_IOMMU_SVM /* * 2D array for converting and sanitizing IOMMU generic TLB granularity to * VT-d granularity. Invalidation is typically included in the unmap operation @@ -5433,7 +5434,6 @@ static inline u64 to_vtd_size(u64 granu_size, u64 nr_granules) return order_base_2(nr_pages); } -#ifdef CONFIG_INTEL_IOMMU_SVM static int intel_iommu_sva_invalidate(struct iommu_domain *domain, struct device *dev, struct iommu_cache_invalidate_info *inv_info) -- 2.27.0