diff mbox series

riscv: disable ARCH_HAS_STRICT_KERNEL_RWX for nommu builds

Message ID 20200422165537.26883-1-laanwj@gmail.com (mailing list archive)
State New, archived
Headers show
Series riscv: disable ARCH_HAS_STRICT_KERNEL_RWX for nommu builds | expand

Commit Message

Wladimir J. van der Laan April 22, 2020, 4:55 p.m. UTC
From: "Wladimir J. van der Laan" <laanwj@protonmail.com>

For non-MMU systems, which tend to be low-memory SoCs such as the K210,
it's expensive to align sections to 2MB. Besides that, the security
guarantees cannot be made anyway.
---
 arch/riscv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Atish Patra April 22, 2020, 4:58 p.m. UTC | #1
On Wed, Apr 22, 2020 at 9:56 AM Wladimir J. van der Laan
<laanwj@gmail.com> wrote:
>
> From: "Wladimir J. van der Laan" <laanwj@protonmail.com>
>
> For non-MMU systems, which tend to be low-memory SoCs such as the K210,
> it's expensive to align sections to 2MB. Besides that, the security
> guarantees cannot be made anyway.
> ---
>  arch/riscv/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 62f7bfeb709eb1cdabaccce261320dd0191b3c48..74f82cf4f7816b99fc54155fd40dcf4d40cbf956 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -60,7 +60,7 @@ config RISCV
>         select ARCH_HAS_GIGANTIC_PAGE
>         select ARCH_HAS_SET_DIRECT_MAP
>         select ARCH_HAS_SET_MEMORY
> -       select ARCH_HAS_STRICT_KERNEL_RWX
> +       select ARCH_HAS_STRICT_KERNEL_RWX if MMU
>         select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
>         select SPARSEMEM_STATIC if 32BIT
>         select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
> --
> 2.17.1
>
>

This fix is already available in the mailing list from Damien.
https://patchwork.kernel.org/patch/11485305/
Palmer Dabbelt April 24, 2020, 6:46 p.m. UTC | #2
On Wed, 22 Apr 2020 09:55:37 PDT (-0700), laanwj@gmail.com wrote:
> From: "Wladimir J. van der Laan" <laanwj@protonmail.com>
>
> For non-MMU systems, which tend to be low-memory SoCs such as the K210,
> it's expensive to align sections to 2MB. Besides that, the security
> guarantees cannot be made anyway.
> ---
>  arch/riscv/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 62f7bfeb709eb1cdabaccce261320dd0191b3c48..74f82cf4f7816b99fc54155fd40dcf4d40cbf956 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -60,7 +60,7 @@ config RISCV
>  	select ARCH_HAS_GIGANTIC_PAGE
>  	select ARCH_HAS_SET_DIRECT_MAP
>  	select ARCH_HAS_SET_MEMORY
> -	select ARCH_HAS_STRICT_KERNEL_RWX
> +	select ARCH_HAS_STRICT_KERNEL_RWX if MMU
>  	select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
>  	select SPARSEMEM_STATIC if 32BIT
>  	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU

I took Damien's version because it was posted first.  It had missed my inbox,
so thanks for pointing this out.
diff mbox series

Patch

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 62f7bfeb709eb1cdabaccce261320dd0191b3c48..74f82cf4f7816b99fc54155fd40dcf4d40cbf956 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -60,7 +60,7 @@  config RISCV
 	select ARCH_HAS_GIGANTIC_PAGE
 	select ARCH_HAS_SET_DIRECT_MAP
 	select ARCH_HAS_SET_MEMORY
-	select ARCH_HAS_STRICT_KERNEL_RWX
+	select ARCH_HAS_STRICT_KERNEL_RWX if MMU
 	select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
 	select SPARSEMEM_STATIC if 32BIT
 	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU