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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 18 Dec 2020 12:38:36 +0000
From:   Robin Murphy <robin.murphy@....com>
To:     "Isaac J. Manjarres" <isaacm@...eaurora.org>,
        iommu@...ts.linux-foundation.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc:     will@...nel.org, joro@...tes.org, pdaly@...eaurora.org,
        pratikp@...eaurora.org, kernel-team@...roid.com
Subject: Re: [PATCH 1/3] iommu/io-pgtable-arm: Prepare for modularization

On 2020-12-18 08:38, Isaac J. Manjarres wrote:
> The io-pgtable-arm and io-pgtable-arm-v7s source files will
> be compiled as separate modules, along with the io-pgtable
> source. Export the symbols for the io-pgtable init function
> structures for the io-pgtable module to use.

In my current build tree, the io-pgtable glue itself is a whopping 379 
bytes of code and data - is there really any benefit to all the 
additional overhead of making that modular? Given the number of 
different users (including AMD now), I think at this point we should 
start considering this as part of the IOMMU core, and just tweak the 
interface such that formats can register their own init_fns dynamically 
instead of the static array that's always horrible.

Robin.

> Signed-off-by: Isaac J. Manjarres <isaacm@...eaurora.org>
> ---
>   drivers/iommu/io-pgtable-arm-v7s.c | 4 ++++
>   drivers/iommu/io-pgtable-arm.c     | 8 ++++++++
>   2 files changed, 12 insertions(+)
> 
> diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c
> index 1d92ac9..f062c1c 100644
> --- a/drivers/iommu/io-pgtable-arm-v7s.c
> +++ b/drivers/iommu/io-pgtable-arm-v7s.c
> @@ -28,6 +28,7 @@
>   #include <linux/iommu.h>
>   #include <linux/kernel.h>
>   #include <linux/kmemleak.h>
> +#include <linux/module.h>
>   #include <linux/sizes.h>
>   #include <linux/slab.h>
>   #include <linux/spinlock.h>
> @@ -839,6 +840,7 @@ struct io_pgtable_init_fns io_pgtable_arm_v7s_init_fns = {
>   	.alloc	= arm_v7s_alloc_pgtable,
>   	.free	= arm_v7s_free_pgtable,
>   };
> +EXPORT_SYMBOL_GPL(io_pgtable_arm_v7s_init_fns);
>   
>   #ifdef CONFIG_IOMMU_IO_PGTABLE_ARMV7S_SELFTEST
>   
> @@ -984,3 +986,5 @@ static int __init arm_v7s_do_selftests(void)
>   }
>   subsys_initcall(arm_v7s_do_selftests);
>   #endif
> +
> +MODULE_LICENSE("GPL v2");
> diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
> index 87def58..2623d57 100644
> --- a/drivers/iommu/io-pgtable-arm.c
> +++ b/drivers/iommu/io-pgtable-arm.c
> @@ -13,6 +13,7 @@
>   #include <linux/bitops.h>
>   #include <linux/io-pgtable.h>
>   #include <linux/kernel.h>
> +#include <linux/module.h>
>   #include <linux/sizes.h>
>   #include <linux/slab.h>
>   #include <linux/types.h>
> @@ -1047,26 +1048,31 @@ struct io_pgtable_init_fns io_pgtable_arm_64_lpae_s1_init_fns = {
>   	.alloc	= arm_64_lpae_alloc_pgtable_s1,
>   	.free	= arm_lpae_free_pgtable,
>   };
> +EXPORT_SYMBOL_GPL(io_pgtable_arm_64_lpae_s1_init_fns);
>   
>   struct io_pgtable_init_fns io_pgtable_arm_64_lpae_s2_init_fns = {
>   	.alloc	= arm_64_lpae_alloc_pgtable_s2,
>   	.free	= arm_lpae_free_pgtable,
>   };
> +EXPORT_SYMBOL_GPL(io_pgtable_arm_64_lpae_s2_init_fns);
>   
>   struct io_pgtable_init_fns io_pgtable_arm_32_lpae_s1_init_fns = {
>   	.alloc	= arm_32_lpae_alloc_pgtable_s1,
>   	.free	= arm_lpae_free_pgtable,
>   };
> +EXPORT_SYMBOL_GPL(io_pgtable_arm_32_lpae_s1_init_fns);
>   
>   struct io_pgtable_init_fns io_pgtable_arm_32_lpae_s2_init_fns = {
>   	.alloc	= arm_32_lpae_alloc_pgtable_s2,
>   	.free	= arm_lpae_free_pgtable,
>   };
> +EXPORT_SYMBOL_GPL(io_pgtable_arm_32_lpae_s2_init_fns);
>   
>   struct io_pgtable_init_fns io_pgtable_arm_mali_lpae_init_fns = {
>   	.alloc	= arm_mali_lpae_alloc_pgtable,
>   	.free	= arm_lpae_free_pgtable,
>   };
> +EXPORT_SYMBOL_GPL(io_pgtable_arm_mali_lpae_init_fns);
>   
>   #ifdef CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST
>   
> @@ -1252,3 +1258,5 @@ static int __init arm_lpae_do_selftests(void)
>   }
>   subsys_initcall(arm_lpae_do_selftests);
>   #endif
> +
> +MODULE_LICENSE("GPL v2");
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ