diff mbox series

[v15,03/11] riscv/Kconfig: make direct map manipulation options depend on MMU

Message ID 20210120180612.1058-4-rppt@kernel.org (mailing list archive)
State New, archived
Headers show
Series mm: introduce memfd_secret system call to create "secret" memory areas | expand

Commit Message

Mike Rapoport Jan. 20, 2021, 6:06 p.m. UTC
From: Mike Rapoport <rppt@linux.ibm.com>

ARCH_HAS_SET_DIRECT_MAP and ARCH_HAS_SET_MEMORY configuration options have
no meaning when CONFIG_MMU is disabled and there is no point to enable them
for the nommu case.

Add an explicit dependency on MMU for these options.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Reported-by: kernel test robot <lkp@intel.com>
---
 arch/riscv/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Palmer Dabbelt Jan. 23, 2021, 4:12 a.m. UTC | #1
On Wed, 20 Jan 2021 10:06:04 PST (-0800), rppt@kernel.org wrote:
> From: Mike Rapoport <rppt@linux.ibm.com>
>
> ARCH_HAS_SET_DIRECT_MAP and ARCH_HAS_SET_MEMORY configuration options have
> no meaning when CONFIG_MMU is disabled and there is no point to enable them
> for the nommu case.
>
> Add an explicit dependency on MMU for these options.
>
> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
> Reported-by: kernel test robot <lkp@intel.com>
> ---
>  arch/riscv/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index d82303dcc6b6..d35ce19ab1fa 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -25,8 +25,8 @@ config RISCV
>  	select ARCH_HAS_KCOV
>  	select ARCH_HAS_MMIOWB
>  	select ARCH_HAS_PTE_SPECIAL
> -	select ARCH_HAS_SET_DIRECT_MAP
> -	select ARCH_HAS_SET_MEMORY
> +	select ARCH_HAS_SET_DIRECT_MAP if MMU
> +	select ARCH_HAS_SET_MEMORY if MMU
>  	select ARCH_HAS_STRICT_KERNEL_RWX if MMU
>  	select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
>  	select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT

Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>

LMK if you want this to go in via the RISC-V tree, otherwise I'm going to
assume it's going in along with the rest of these.  FWIW I see these in other
architectures without the MMU guard.

Thanks!
Mike Rapoport Jan. 23, 2021, 11 a.m. UTC | #2
On Fri, Jan 22, 2021 at 08:12:30PM -0800, Palmer Dabbelt wrote:
> On Wed, 20 Jan 2021 10:06:04 PST (-0800), rppt@kernel.org wrote:
> > From: Mike Rapoport <rppt@linux.ibm.com>
> > 
> > ARCH_HAS_SET_DIRECT_MAP and ARCH_HAS_SET_MEMORY configuration options have
> > no meaning when CONFIG_MMU is disabled and there is no point to enable them
> > for the nommu case.
> > 
> > Add an explicit dependency on MMU for these options.
> > 
> > Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
> > Reported-by: kernel test robot <lkp@intel.com>
> > ---
> >  arch/riscv/Kconfig | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> > index d82303dcc6b6..d35ce19ab1fa 100644
> > --- a/arch/riscv/Kconfig
> > +++ b/arch/riscv/Kconfig
> > @@ -25,8 +25,8 @@ config RISCV
> >  	select ARCH_HAS_KCOV
> >  	select ARCH_HAS_MMIOWB
> >  	select ARCH_HAS_PTE_SPECIAL
> > -	select ARCH_HAS_SET_DIRECT_MAP
> > -	select ARCH_HAS_SET_MEMORY
> > +	select ARCH_HAS_SET_DIRECT_MAP if MMU
> > +	select ARCH_HAS_SET_MEMORY if MMU
> >  	select ARCH_HAS_STRICT_KERNEL_RWX if MMU
> >  	select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
> >  	select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
> 
> Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
> 
> LMK if you want this to go in via the RISC-V tree, otherwise I'm going to
> assume it's going in along with the rest of these.  FWIW I see these in other
> architectures without the MMU guard.

Except arm, they all always have MMU=y and arm selects only
ARCH_HAS_SET_MEMORY and has empty stubs for those when MMU=n.

Indeed I might have been over zealous adding ARCH_HAS_SET_MEMORY dependency
on MMU, as riscv also has these stubs, but I thought that making this
explicit is a nice thing.
 
> Thanks!
Palmer Dabbelt Jan. 27, 2021, 5:46 a.m. UTC | #3
On Sat, 23 Jan 2021 03:00:41 PST (-0800), rppt@kernel.org wrote:
> On Fri, Jan 22, 2021 at 08:12:30PM -0800, Palmer Dabbelt wrote:
>> On Wed, 20 Jan 2021 10:06:04 PST (-0800), rppt@kernel.org wrote:
>> > From: Mike Rapoport <rppt@linux.ibm.com>
>> >
>> > ARCH_HAS_SET_DIRECT_MAP and ARCH_HAS_SET_MEMORY configuration options have
>> > no meaning when CONFIG_MMU is disabled and there is no point to enable them
>> > for the nommu case.
>> >
>> > Add an explicit dependency on MMU for these options.
>> >
>> > Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
>> > Reported-by: kernel test robot <lkp@intel.com>
>> > ---
>> >  arch/riscv/Kconfig | 4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
>> > index d82303dcc6b6..d35ce19ab1fa 100644
>> > --- a/arch/riscv/Kconfig
>> > +++ b/arch/riscv/Kconfig
>> > @@ -25,8 +25,8 @@ config RISCV
>> >  	select ARCH_HAS_KCOV
>> >  	select ARCH_HAS_MMIOWB
>> >  	select ARCH_HAS_PTE_SPECIAL
>> > -	select ARCH_HAS_SET_DIRECT_MAP
>> > -	select ARCH_HAS_SET_MEMORY
>> > +	select ARCH_HAS_SET_DIRECT_MAP if MMU
>> > +	select ARCH_HAS_SET_MEMORY if MMU
>> >  	select ARCH_HAS_STRICT_KERNEL_RWX if MMU
>> >  	select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
>> >  	select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
>>
>> Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
>> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
>>
>> LMK if you want this to go in via the RISC-V tree, otherwise I'm going to
>> assume it's going in along with the rest of these.  FWIW I see these in other
>> architectures without the MMU guard.
>
> Except arm, they all always have MMU=y and arm selects only
> ARCH_HAS_SET_MEMORY and has empty stubs for those when MMU=n.

OK, maybe I just checked ARM, then.  I was just making sure.

> Indeed I might have been over zealous adding ARCH_HAS_SET_MEMORY dependency
> on MMU, as riscv also has these stubs, but I thought that making this
> explicit is a nice thing.

It seems reasonable to me.

Thanks!
diff mbox series

Patch

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index d82303dcc6b6..d35ce19ab1fa 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -25,8 +25,8 @@  config RISCV
 	select ARCH_HAS_KCOV
 	select ARCH_HAS_MMIOWB
 	select ARCH_HAS_PTE_SPECIAL
-	select ARCH_HAS_SET_DIRECT_MAP
-	select ARCH_HAS_SET_MEMORY
+	select ARCH_HAS_SET_DIRECT_MAP if MMU
+	select ARCH_HAS_SET_MEMORY if MMU
 	select ARCH_HAS_STRICT_KERNEL_RWX if MMU
 	select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
 	select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT