lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191104193400.GA24983@codeaurora.org>
Date:   Mon, 4 Nov 2019 11:34:00 -0800
From:   "Isaac J. Manjarres" <isaacm@...eaurora.org>
To:     Will Deacon <will@...nel.org>
Cc:     iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Robin Murphy <robin.murphy@....com>
Subject: Re: [PATCH 7/7] iommu/arm-smmu: Allow building as a module

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 <will@...nel.org>
> ---
>  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 <linux/bitfield.h>
> +#include <linux/module.h>
>  #include <linux/of.h>
>  
>  #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 <robin.murphy@....com>");
> +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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ