Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2378971lqp; Sun, 24 Mar 2024 16:46:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVRMK0ZBZoIOe5pu2oVAw1gUHJPFL/U3xtKkhYZ3kc1DVGhXOj9B7MadxvjOqqL4h1lzhCqKrJC5ZOQWHa0quCLWz25prQMHXQmrO9i3g== X-Google-Smtp-Source: AGHT+IFODmEGRiyLukPShllV737eUtFFVz6XTlsa4cTuWBT1CCoOaKF3+uWrF3H7VSgcf5vZAsAs X-Received: by 2002:a17:90b:246:b0:29b:96ab:28ea with SMTP id fz6-20020a17090b024600b0029b96ab28eamr3868691pjb.5.1711323993910; Sun, 24 Mar 2024 16:46:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711323993; cv=pass; d=google.com; s=arc-20160816; b=KeO8sX+tSnF/SFC3XUPnvfyFwitXNzBpa/ICStweNTzFdZiXsLcDIga8WTJ20LEUxY vQDh/AYtyJyDobItrdT4iaobzyILDJaNEmg7KRidZ2oT+WF7wIXOLK/bXzWFlqrAZ0gw LSnCPhsyZKQMMXL9wRJqN408wX2f6ZophbGhJnwngZ4pkFCU1vEKVhY3FbTylWyTa1be VjaT26z7qofeNMdsKDW61Evt6ZI6fs6zgHm98YW9CUA2WRXo5FXxYmDqXSVNn+/P9v8t H/B50i5o2lRZUYL4fV0AX7D2ESpFPEdz6Z4Llho8xUiRU52Fyu5QQYTueEZn+wOr58D+ INwg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=G/r1/jLaUhV+2Yp3gBqmboyXx3WdPZNvNbAinCpWxh8=; fh=b1xw9pgHPRgYwguiD36lU2V+axUXuIima0TYNBKT2x4=; b=FYZmR0QiIxeiqTLSxgIi12MlYNPrh3faIAOJDpvGrxyf/BLKEiscIIxV1bJS2ObgJ8 856lMc9GetFdcrYKb3fZ1SuYvRKE9LFFxaredds2iRiUFnfFMxaPW1mj/fSE7LgplW+y 6rG5klRTKegeCKie108NslMg2NKWkBSYSebFYWsAbXJv73OhzETvKnH7oJIHN52VFLm2 UHByM6RlhNTJoZ4HciZH5NzZXovZtGo9E5TgwGNPWNX1sFRTmRiV7HfVNTkmNQNUQxdn w3ZqK+GNKGlqA9UeCwDtre7UamWlRBsDBhYzNhqG883UGZ+RdYvtiQwSsyXXdmtlxm1m Y/dg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WuyHl2oQ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113215-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h17-20020a17090aa89100b0029c6fc14248si10306956pjq.155.2024.03.24.16.46.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:46:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WuyHl2oQ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113215-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9637928D306 for ; Sun, 24 Mar 2024 23:46:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6340613C822; Sun, 24 Mar 2024 22:40:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WuyHl2oQ" 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 7098317EB82; Sun, 24 Mar 2024 22:40:16 +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=1711320016; cv=none; b=Qm3rkXIlvR3vxi/A5xptE5haJosCLHykg5iNGiZatosWxZiQYZKOCssLD1tnk6tUeYz18blEm82nDv1J+dpIp23bMkcn9lk31S2I0dehHwA1ExS9IshOjXdP3BmOcPjyQg0KeO/SRCXkmSWEAAptfcb8iYoiZ3kMPOyYfdP424w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320016; c=relaxed/simple; bh=b7ejtDltFIu6hTTp3AUM0Hnm/ru5scpjy7t1uf24Ek4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HLAqpkya/KXeTzO5vhRns/4wyQ6c2kA3gv6MKwYJrPFxLbaDA4Fj7uL/+eYFnmzbfnyIphI/RHzb2deAbLirfCfxAZpoUryW6ImlBzZg+kvQfFsqbstEnqahvmxoWI9/pkEbJsk/h+tIXoA4O2gGAXZ9O3G8+D02nE5cpPew6g4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WuyHl2oQ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B66DC43399; Sun, 24 Mar 2024 22:40:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320016; bh=b7ejtDltFIu6hTTp3AUM0Hnm/ru5scpjy7t1uf24Ek4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WuyHl2oQZ8pqKcRhXCmHAs+zDXEpq9sf5gHn0go/c8TflszLeltD1pwprJ3+EAC04 r7lrjJ2R50Mudgs+ReQbKxjquRXkwdofncx8gB1brFAoz0n0MBQYdsQTOyA3xXj/NM S/pmbBuAZmYuRaRblQ+YD56OFh7p4eNyixFjyFMEdMPwB7f5AdiQ51qrJXZsuu+t1Z wTkXLmiRFidvS/lAzvpxp5pQVFeqCQqu+9ubWnNdG0lcRHNL0HXYvKoxa/3zZJyB2k g63NbpmZZMePD0P/P5D7zHsSeLcStdnyfAKjl9/BvlJHX6xA+zz7Tn33erEpFeu4fk yrePC+Pvv3BWw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Bert Karwatzki , Lu Baolu , Joerg Roedel , Sasha Levin Subject: [PATCH 6.8 324/715] iommu: Fix compilation without CONFIG_IOMMU_INTEL Date: Sun, 24 Mar 2024 18:28:23 -0400 Message-ID: <20240324223455.1342824-325-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Bert Karwatzki [ Upstream commit 70bad345e622c23bb530016925c936ab04a646ac ] When the kernel is comiled with CONFIG_IRQ_REMAP=y but without CONFIG_IOMMU_INTEL compilation fails since commit def054b01a8678 with an undefined reference to device_rbtree_find(). This patch makes sure that intel specific code is only compiled with CONFIG_IOMMU_INTEL=y. Signed-off-by: Bert Karwatzki Fixes: 80a9b50c0b9e ("iommu/vt-d: Improve ITE fault handling if target device isn't present") Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/20240307194419.15801-1-spasswolf@web.de Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/Kconfig | 2 +- drivers/iommu/intel/Makefile | 2 ++ drivers/iommu/irq_remapping.c | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 9a29d742617e3..9dbb55e745bd9 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -196,7 +196,7 @@ source "drivers/iommu/iommufd/Kconfig" config IRQ_REMAP bool "Support for Interrupt Remapping" depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI - select DMAR_TABLE + select DMAR_TABLE if INTEL_IOMMU help Supports Interrupt remapping for IO-APIC and MSI devices. To use x2apic mode in the CPU's which support x2APIC enhancements or diff --git a/drivers/iommu/intel/Makefile b/drivers/iommu/intel/Makefile index 5dabf081a7793..5402b699a1229 100644 --- a/drivers/iommu/intel/Makefile +++ b/drivers/iommu/intel/Makefile @@ -5,5 +5,7 @@ obj-$(CONFIG_DMAR_TABLE) += trace.o cap_audit.o obj-$(CONFIG_DMAR_PERF) += perf.o obj-$(CONFIG_INTEL_IOMMU_DEBUGFS) += debugfs.o obj-$(CONFIG_INTEL_IOMMU_SVM) += svm.o +ifdef CONFIG_INTEL_IOMMU obj-$(CONFIG_IRQ_REMAP) += irq_remapping.o +endif obj-$(CONFIG_INTEL_IOMMU_PERF_EVENTS) += perfmon.o diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index 83314b9d8f38b..ee59647c20501 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c @@ -99,7 +99,8 @@ int __init irq_remapping_prepare(void) if (disable_irq_remap) return -ENOSYS; - if (intel_irq_remap_ops.prepare() == 0) + if (IS_ENABLED(CONFIG_INTEL_IOMMU) && + intel_irq_remap_ops.prepare() == 0) remap_ops = &intel_irq_remap_ops; else if (IS_ENABLED(CONFIG_AMD_IOMMU) && amd_iommu_irq_ops.prepare() == 0) -- 2.43.0