Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3946152pxb; Mon, 1 Feb 2021 08:34:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyiGrRQAvQY20kakb2VFMIKRC/ErAg1WJ5ZtNlChFsvfVtpvP4B/sw8icV6ACGEeW9PNMRy X-Received: by 2002:aa7:d656:: with SMTP id v22mr6658959edr.349.1612197270853; Mon, 01 Feb 2021 08:34:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612197270; cv=none; d=google.com; s=arc-20160816; b=PNYwuT8jmndO+GwD+BsQ67W6DzbtQ4kg6en20roC3Otb9uLLXPgv/E7mOQ4Vd5MEDy f/cXnJ59OQMRCwugcMIVDgarTPrkRYY/E2jCTmTdbsqeChXgTxN4NEuNC8qL7FZ5YqDL OiTmh9NAtitwGjL7NnDmLOqvKD0+EoO4tyoeGpEKwTBia64ZVV6IK74m76izqOC+Ac1u /tHudLhie49QnvddogPM7prphVjM13cR1DvH0lF0aHqpBQNpHeVs0iqzPM/FBV9V0h4p CRsqK9A8t3zfKHh5gMrj/fOXTs8KL1C4JASIf1pRvSVvJdd0LkhWAfs78A5Utz4PAk0j gReQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=2dRPmnhvotzgAArbVVaHVwd/Yfn7abu3JLVRuSf7Ykg=; b=zVs9yCtQHt7F2t8wPXeoRJISZ1nF+S2z0fQOvptgRLQPpogVK3BRYYp5uDhRzXb+YY w4qGAGx75uuh8XXhB0mob5jH68fpjW8ogXk1HDf8aeZuBtZTkpPQIM7BAFHP7m1HO8tP 6GKDlglU8B/t2UgNZ+DMLH0Lx0bc1fgc3KYmZYOXuEYP4Vz+qDGwtxDcNv47jp6Zpk4d x2DTpHTtOk/jyTcN2ANVuvVQPnY1cceij4N1j++wMAIuxm5K3P6s6kFFBk7YKFgZ95il zHxALLjpbNqvINj5hWlGDIezPPXRz+u6caEoqKpWpuQUykM6pDFs57GjiB62zxJbuMT2 eesw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=kxSW8WVk; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u7si11097725edx.172.2021.02.01.08.34.05; Mon, 01 Feb 2021 08:34:30 -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=@nvidia.com header.s=n1 header.b=kxSW8WVk; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231439AbhBAQai (ORCPT + 99 others); Mon, 1 Feb 2021 11:30:38 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:18360 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231328AbhBAQaJ (ORCPT ); Mon, 1 Feb 2021 11:30:09 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 01 Feb 2021 08:29:14 -0800 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 1 Feb 2021 16:29:14 +0000 Received: from r-nvmx02.mtr.labs.mlnx (172.20.145.6) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Mon, 1 Feb 2021 16:29:09 +0000 From: Max Gurtovoy To: , , , , CC: , , , , , , , , , , , , , , , Max Gurtovoy Subject: [PATCH 8/9] vfio/pci: use x86 naming instead of igd Date: Mon, 1 Feb 2021 16:28:27 +0000 Message-ID: <20210201162828.5938-9-mgurtovoy@nvidia.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20210201162828.5938-1-mgurtovoy@nvidia.com> References: <20210201162828.5938-1-mgurtovoy@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1612196954; bh=2dRPmnhvotzgAArbVVaHVwd/Yfn7abu3JLVRuSf7Ykg=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:Content-Type; b=kxSW8WVkgWdNJY7BlQL/l858Kkqt/Z27DYvgXvyNDTgCH4cfvbHszNA7S/PGmCetM x74O0YddE3zUPYQTaBYEhpT7nhGurrR1kWyrp3IZuaMwLmJjUwT8jKLKCwq87jYLpv KHxgoP1+ZcXyUGlWb+jqZgRE4z55iNo6+SR2jW4iE7ScOun3Gtx3nHtynLifcgzhnP Qgbl5SJE0aCYJ2dzlDF0aDDI9ILdBipxyDhnML8Ppwk/YppD3oyfY7cEcAsKwJ2it2 AlMN4DRMahcN88sj9mpHJCxywxHWf38bxM1jgdGApJRTosh0hoTDBykIUtMyOWHaFI Mles0OYruf4Ww== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch doesn't change any logic but only align to the concept of vfio_pci_core extensions. Extensions that are related to a platform and not to a specific vendor of PCI devices should be part of the core driver. Extensions that are specific for PCI device vendor should go to a dedicated vendor vfio-pci driver. For now, x86 extensions will include only igd. Signed-off-by: Max Gurtovoy --- drivers/vfio/pci/Kconfig | 13 ++++++------- drivers/vfio/pci/Makefile | 2 +- drivers/vfio/pci/vfio_pci_core.c | 2 +- drivers/vfio/pci/vfio_pci_private.h | 2 +- drivers/vfio/pci/{vfio_pci_igd.c =3D> vfio_pci_x86.c} | 0 5 files changed, 9 insertions(+), 10 deletions(-) rename drivers/vfio/pci/{vfio_pci_igd.c =3D> vfio_pci_x86.c} (100%) diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig index 6e6c976b9512..c98f2df01a60 100644 --- a/drivers/vfio/pci/Kconfig +++ b/drivers/vfio/pci/Kconfig @@ -36,17 +36,16 @@ config VFIO_PCI_INTX depends on VFIO_PCI_CORE def_bool y if !S390 =20 -config VFIO_PCI_IGD - bool "VFIO PCI extensions for Intel graphics (GVT-d)" +config VFIO_PCI_X86 + bool "VFIO PCI extensions for Intel X86 platform" depends on VFIO_PCI_CORE && X86 default y help - Support for Intel IGD specific extensions to enable direct - assignment to virtual machines. This includes exposing an IGD - specific firmware table and read-only copies of the host bridge - and LPC bridge config space. + Support for Intel X86 specific extensions for VFIO PCI devices. + This includes exposing an IGD specific firmware table and + read-only copies of the host bridge and LPC bridge config space. =20 - To enable Intel IGD assignment through vfio-pci, say Y. + To enable Intel X86 extensions for vfio-pci-core, say Y. =20 config VFIO_PCI_NVLINK2 def_bool y diff --git a/drivers/vfio/pci/Makefile b/drivers/vfio/pci/Makefile index 90962a495eba..d8ccb70e015a 100644 --- a/drivers/vfio/pci/Makefile +++ b/drivers/vfio/pci/Makefile @@ -5,7 +5,7 @@ obj-$(CONFIG_VFIO_PCI) +=3D vfio-pci.o obj-$(CONFIG_MLX5_VFIO_PCI) +=3D mlx5-vfio-pci.o =20 vfio-pci-core-y :=3D vfio_pci_core.o vfio_pci_intrs.o vfio_pci_rdwr.o vfio= _pci_config.o -vfio-pci-core-$(CONFIG_VFIO_PCI_IGD) +=3D vfio_pci_igd.o +vfio-pci-core-$(CONFIG_VFIO_PCI_X86) +=3D vfio_pci_x86.o vfio-pci-core-$(CONFIG_VFIO_PCI_NVLINK2) +=3D vfio_pci_nvlink2.o vfio-pci-core-$(CONFIG_VFIO_PCI_ZDEV) +=3D vfio_pci_s390.o =20 diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_c= ore.c index c559027def2d..e0e258c37fb5 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -328,7 +328,7 @@ static int vfio_pci_enable(struct vfio_pci_device *vdev= ) =20 if (vfio_pci_is_vga(pdev) && pdev->vendor =3D=3D PCI_VENDOR_ID_INTEL && - IS_ENABLED(CONFIG_VFIO_PCI_IGD)) { + IS_ENABLED(CONFIG_VFIO_PCI_X86)) { ret =3D vfio_pci_igd_init(vdev); if (ret && ret !=3D -ENODEV) { pci_warn(pdev, "Failed to setup Intel IGD regions\n"); diff --git a/drivers/vfio/pci/vfio_pci_private.h b/drivers/vfio/pci/vfio_pc= i_private.h index 7c3c2cd575f8..efc688525784 100644 --- a/drivers/vfio/pci/vfio_pci_private.h +++ b/drivers/vfio/pci/vfio_pci_private.h @@ -165,7 +165,7 @@ extern u16 vfio_pci_memory_lock_and_enable(struct vfio_= pci_device *vdev); extern void vfio_pci_memory_unlock_and_restore(struct vfio_pci_device *vde= v, u16 cmd); =20 -#ifdef CONFIG_VFIO_PCI_IGD +#ifdef CONFIG_VFIO_PCI_X86 extern int vfio_pci_igd_init(struct vfio_pci_device *vdev); #else static inline int vfio_pci_igd_init(struct vfio_pci_device *vdev) diff --git a/drivers/vfio/pci/vfio_pci_igd.c b/drivers/vfio/pci/vfio_pci_x8= 6.c similarity index 100% rename from drivers/vfio/pci/vfio_pci_igd.c rename to drivers/vfio/pci/vfio_pci_x86.c --=20 2.25.4