From patchwork Sat Aug 9 17:04:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 4703061 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A98059F377 for ; Sat, 9 Aug 2014 17:05:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B45B20154 for ; Sat, 9 Aug 2014 17:05:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A337E20142 for ; Sat, 9 Aug 2014 17:05:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751890AbaHIRFF (ORCPT ); Sat, 9 Aug 2014 13:05:05 -0400 Received: from mail-pd0-f181.google.com ([209.85.192.181]:60462 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751752AbaHIRFC (ORCPT ); Sat, 9 Aug 2014 13:05:02 -0400 Received: by mail-pd0-f181.google.com with SMTP id g10so8603691pdj.12 for ; Sat, 09 Aug 2014 10:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=dli7w5DZY5r/dj01Vd4U+vV18t8NxOPLXHdjSj8qW3E=; b=H31eLIlWQZAD+6owUh5o/syKGsR73g/sE5oI870Sr409EeD/Ea5wlgwuWRis8aTYfw gB9R9LxunbuneHqdzCj5emYK7v3jYTBmD+7SbkxXpx0tShssZEIACnidYB/fbzgWuL5W iTLXNzYwYzo+s3iT5FBpehDksKTv/4FughuvTJkI2jgDmCXaLZO+0PZbkryBK+p0rRoO MFRmrL0s3qKZp6kTSoIO90bhOJ/JIi+T52deTDGZbKyCryvVCKnxCvJPKjfrEuzOuCZp jH5ypp84wq5uFWYRPXimPsjtZu5QejSvoZYuPsRQbRoCGrKCjl4yFG2HTzJr1UO+e5Uo VM9g== X-Received: by 10.70.140.102 with SMTP id rf6mr31455666pdb.4.1407603902229; Sat, 09 Aug 2014 10:05:02 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id u7sm9653139pdj.34.2014.08.09.10.05.00 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 09 Aug 2014 10:05:01 -0700 (PDT) From: Guenter Roeck To: Alex Williamson Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Gavin Shan , Benjamin Herrenschmidt Subject: [PATCH] vfio: Fix build failure seen if vfio is built as module and EEH is enabled Date: Sat, 9 Aug 2014 10:04:47 -0700 Message-Id: <1407603887-1419-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.9.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The following build failure is seen with ppc:allmodconfig. ERROR: ".vfio_spapr_iommu_eeh_ioctl" [drivers/vfio/vfio_iommu_spapr_tce.ko] undefined! ERROR: ".vfio_spapr_pci_eeh_open" [drivers/vfio/pci/vfio-pci.ko] undefined! ERROR: ".vfio_spapr_pci_eeh_release" [drivers/vfio/pci/vfio-pci.ko] undefined! Simply exporting the missing symbols is insufficient, since drivers/vfio can be built as module but drivers/vfio/vfio_spapr_eeh.c depends on EEH which is boolean. The combination of obj-m for drivers/vfio and obj-y for drivers/vfio/vfio_spapr_eeh.o results in the symbols being missed even if exported. Export missing symbols and introduce new tristate configuration option VFIO_EEH depending on both EEH and VFIO to fix the problem. Cc: Gavin Shan Cc: Benjamin Herrenschmidt Signed-off-by: Guenter Roeck --- drivers/vfio/Kconfig | 6 ++++++ drivers/vfio/Makefile | 2 +- drivers/vfio/vfio_spapr_eeh.c | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/Kconfig b/drivers/vfio/Kconfig index af7b204..06adecd 100644 --- a/drivers/vfio/Kconfig +++ b/drivers/vfio/Kconfig @@ -8,12 +8,18 @@ config VFIO_IOMMU_SPAPR_TCE depends on VFIO && SPAPR_TCE_IOMMU default n +config VFIO_EEH + tristate + depends on VFIO && EEH + default n + menuconfig VFIO tristate "VFIO Non-Privileged userspace driver framework" depends on IOMMU_API select VFIO_IOMMU_TYPE1 if X86 select VFIO_IOMMU_SPAPR_TCE if (PPC_POWERNV || PPC_PSERIES) select ANON_INODES + select VFIO_EEH if EEH help VFIO provides a framework for secure userspace device drivers. See Documentation/vfio.txt for more details. diff --git a/drivers/vfio/Makefile b/drivers/vfio/Makefile index 50e30bc..26016cd 100644 --- a/drivers/vfio/Makefile +++ b/drivers/vfio/Makefile @@ -1,5 +1,5 @@ obj-$(CONFIG_VFIO) += vfio.o obj-$(CONFIG_VFIO_IOMMU_TYPE1) += vfio_iommu_type1.o obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) += vfio_iommu_spapr_tce.o -obj-$(CONFIG_EEH) += vfio_spapr_eeh.o +obj-$(CONFIG_VFIO_EEH) += vfio_spapr_eeh.o obj-$(CONFIG_VFIO_PCI) += pci/ diff --git a/drivers/vfio/vfio_spapr_eeh.c b/drivers/vfio/vfio_spapr_eeh.c index f834b4c..e827309 100644 --- a/drivers/vfio/vfio_spapr_eeh.c +++ b/drivers/vfio/vfio_spapr_eeh.c @@ -9,6 +9,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -18,11 +19,13 @@ int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) { return eeh_dev_open(pdev); } +EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open); void vfio_spapr_pci_eeh_release(struct pci_dev *pdev) { eeh_dev_release(pdev); } +EXPORT_SYMBOL(vfio_spapr_pci_eeh_release); long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, unsigned int cmd, unsigned long arg) @@ -85,3 +88,4 @@ long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, return ret; } +EXPORT_SYMBOL(vfio_spapr_iommu_eeh_ioctl);