Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4334353ybx; Mon, 4 Nov 2019 11:35:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwMPoPGobleRuHni/5Vl39bSJaptunPMVqbjHeX8g2goihCSjPExK7vKeKNV2Sq3MHAYza8 X-Received: by 2002:a17:906:7208:: with SMTP id m8mr25263938ejk.141.1572896133287; Mon, 04 Nov 2019 11:35:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572896133; cv=none; d=google.com; s=arc-20160816; b=G6/j6F+nd1Y0mFPDX6hMeqA3oXglmAdV770AG8SghSnSQg2L8QzMXrFITqqaSJDXyR sdevi3W4V/DkNvBVGxijCfd7D6zfOD3JpYveN/RAGf+ZVLgkquyynwzmX4+5aVGZL/FM IKbkCPk588CCBgsuPdoUAIhYeJtHTjIhPRA93hYS12t/GM4eSG7nCHu/PXSpWMGq4YXH +LtMrG8CtSWLTjoB6WlrUyZabbDjzuvESZW/y659kArYYj/+C9NFVtawhprX5gVvGxNz lVGAn6JMvBZs0kK37lZEbGh5Kw8pauY8dCwmp7As4b5ybKbO+d6gk4yexYjHjqU9yLBQ jX3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:dkim-signature:dkim-signature; bh=nAymidLo9yaowRQCaz4WglT0gPjfILVVkMo0SjQ58v4=; b=WkxDkj97VDv4KLgpCs8afItrFA5ft3qEv0I5Pu1k6C+2JdzYTXLMsN5arUQVbbvxKR KOkJWIlbzXdJHoojwkShGSrxdcafOKKIbSoNreCVEZKT1mrGiZMoEiZzJLPAmiND5Zjd QabxPJ2OLHhEG0sn7KEm7/StNNuH9Q6QeLNalVdtlTb/XGJPBPoHAM7WzOtIFbIFqpph LaeEjNNNphwTkOuKvFcTLbqJNu/D3WdLe7IbJSvQkNelbtLpcqDGTyOmsjWxWZb06bIF XuqAk/2ZXHfAosUmAhmBsnJyF+pnhYjsRqXo/KH2jj/FZAptXa9cl2X7zFgjAoWpdfK5 UzUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=lpaySFHt; dkim=pass header.i=@codeaurora.org header.s=default header.b=Duiop+10; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w52si7623212edd.76.2019.11.04.11.35.10; Mon, 04 Nov 2019 11:35:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=lpaySFHt; dkim=pass header.i=@codeaurora.org header.s=default header.b=Duiop+10; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729563AbfKDTeJ (ORCPT + 99 others); Mon, 4 Nov 2019 14:34:09 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:43880 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728322AbfKDTeJ (ORCPT ); Mon, 4 Nov 2019 14:34:09 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 34F7360F6D; Mon, 4 Nov 2019 19:34:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1572896048; bh=vamSyPnFneWtEfh6IHcJYcXOtMnwFfjQxxj+OCkfymU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lpaySFHthd6UwHbVLaIMwy1dV9eel4wQEgeR1OUxsXRdaSb3h9L4Q0twYg0Zy8iJZ b86hohj2MGpdZYVVm4nGWyZJVGEcqsunWipRByr/QHyt+o0URdu0to04kLwQkSRxYL XHDKJd/6oDD1EjMoF9iSa+ZksRw9nXxL6rV8w8TY= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from codeaurora.org (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: isaacm@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3EBD960DA6; Mon, 4 Nov 2019 19:34:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1572896046; bh=vamSyPnFneWtEfh6IHcJYcXOtMnwFfjQxxj+OCkfymU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Duiop+10dl9a7uFzxcbbqLq46Z+rvAq2Hf6vpbbFBRimQkBG8t331QBq5IYZj8RTI 6hcKhjx+zVGXUAy2DVt0ulZU45h4flw7IH7d1kFS3IeYdoePVyavbVVMMdji7FFdnm BXq/n5MLk4MDgQJAmGmGBNK+KrVLY3jaZtgoQfeI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3EBD960DA6 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=isaacm@codeaurora.org Date: Mon, 4 Nov 2019 11:34:00 -0800 From: "Isaac J. Manjarres" To: Will Deacon Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Robin Murphy Subject: Re: [PATCH 7/7] iommu/arm-smmu: Allow building as a module Message-ID: <20191104193400.GA24983@codeaurora.org> References: <20191030145112.19738-1-will@kernel.org> <20191030145112.19738-8-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191030145112.19738-8-will@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 30, 2019 at 02:51:12PM +0000, Will Deacon wrote: > By conditionally dropping support for the legacy binding and exporting > the newly introduced 'arm_smmu_impl_init()' function we can allow the > ARM SMMU driver to be built as a module. > > Signed-off-by: Will Deacon > --- > drivers/iommu/Kconfig | 14 ++++++++- > drivers/iommu/arm-smmu-impl.c | 6 ++++ > drivers/iommu/arm-smmu.c | 54 +++++++++++++++++++++-------------- > 3 files changed, 51 insertions(+), 23 deletions(-) > > diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig > index 7583d47fc4d5..02703f51e533 100644 > --- a/drivers/iommu/Kconfig > +++ b/drivers/iommu/Kconfig > @@ -350,7 +350,7 @@ config SPAPR_TCE_IOMMU > > # ARM IOMMU support > config ARM_SMMU > - bool "ARM Ltd. System MMU (SMMU) Support" > + tristate "ARM Ltd. System MMU (SMMU) Support" > depends on (ARM64 || ARM) && MMU > select IOMMU_API > select IOMMU_IO_PGTABLE_LPAE > @@ -362,6 +362,18 @@ config ARM_SMMU > Say Y here if your SoC includes an IOMMU device implementing > the ARM SMMU architecture. > > +config ARM_SMMU_LEGACY_DT_BINDINGS > + bool "Support the legacy \"mmu-masters\" devicetree bindings" > + depends on ARM_SMMU=y && OF > + help > + Support for the badly designed and deprecated \"mmu-masters\" > + devicetree bindings. This allows some DMA masters to attach > + to the SMMU but does not provide any support via the DMA API. > + If you're lucky, you might be able to get VFIO up and running. > + > + If you say Y here then you'll make me very sad. Instead, say N > + and move your firmware to the utopian future that was 2016. > + > config ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT > bool "Default to disabling bypass on ARM SMMU v1 and v2" > depends on ARM_SMMU > diff --git a/drivers/iommu/arm-smmu-impl.c b/drivers/iommu/arm-smmu-impl.c > index 5c87a38620c4..2f82d40317d6 100644 > --- a/drivers/iommu/arm-smmu-impl.c > +++ b/drivers/iommu/arm-smmu-impl.c > @@ -5,6 +5,7 @@ > #define pr_fmt(fmt) "arm-smmu: " fmt > > #include > +#include > #include > > #include "arm-smmu.h" > @@ -172,3 +173,8 @@ struct arm_smmu_device *arm_smmu_impl_init(struct arm_smmu_device *smmu) > > return smmu; > } > +EXPORT_SYMBOL_GPL(arm_smmu_impl_init); > + > +MODULE_DESCRIPTION("IOMMU quirks for ARM architected SMMU implementations"); > +MODULE_AUTHOR("Robin Murphy "); > +MODULE_LICENSE("GPL v2"); Hi Will, A minor comment: I was curious about why arm-smmu.c and arm-smmu-impl.c were being compiled as two separate modules, as opposed to combining them into one module? The latter approach seemed more appropriate, given that arm-smmu-impl doesn't offer much as a module on its own. Thoughts? --Isaac