* [PATCH] mm/execmem: Make ARCH_WANTS_EXECMEM_LATE depend on EXECMEM
@ 2024-12-09 3:12 Anshuman Khandual
2024-12-09 12:36 ` kernel test robot
0 siblings, 1 reply; 5+ messages in thread
From: Anshuman Khandual @ 2024-12-09 3:12 UTC (permalink / raw)
To: linux-mm
Cc: Anshuman Khandual, Catalin Marinas, Will Deacon, Andrew Morton,
Kees Cook, linux-arm-kernel, linux-kernel
Late initialisation of EXECMEM inherently requires EXEMEM itself, and hence
this dependency should not be left with the subscribing platforms.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Kees Cook <kees@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
This patch applies on v6.13-rc1
arch/Kconfig | 1 +
arch/arm64/Kconfig | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index 6682b2a53e34..17716f32dc44 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -1058,6 +1058,7 @@ config ARCH_WANTS_MODULES_DATA_IN_VMALLOC
config ARCH_WANTS_EXECMEM_LATE
bool
+ depends on EXECMEM
help
For architectures that do not allocate executable memory early on
boot, but rather require its initialization late when there is
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index b5479c8b454c..b146372bc365 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -113,7 +113,7 @@ config ARM64
select ARCH_WANT_FRAME_POINTERS
select ARCH_WANT_HUGE_PMD_SHARE if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36)
select ARCH_WANT_LD_ORPHAN_WARN
- select ARCH_WANTS_EXECMEM_LATE if EXECMEM
+ select ARCH_WANTS_EXECMEM_LATE
select ARCH_WANTS_NO_INSTR
select ARCH_WANTS_THP_SWAP if ARM64_4K_PAGES
select ARCH_HAS_UBSAN
--
2.30.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/execmem: Make ARCH_WANTS_EXECMEM_LATE depend on EXECMEM
2024-12-09 3:12 [PATCH] mm/execmem: Make ARCH_WANTS_EXECMEM_LATE depend on EXECMEM Anshuman Khandual
@ 2024-12-09 12:36 ` kernel test robot
2024-12-09 14:13 ` Anshuman Khandual
0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2024-12-09 12:36 UTC (permalink / raw)
To: Anshuman Khandual, linux-mm
Cc: Paul Gazzillo, Necip Fazil Yildiran, oe-kbuild-all,
Anshuman Khandual, Catalin Marinas, Will Deacon, Andrew Morton,
Linux Memory Management List, Kees Cook, linux-arm-kernel,
linux-kernel
Hi Anshuman,
kernel test robot noticed the following build warnings:
[auto build test WARNING on akpm-mm/mm-everything]
url: https://github.com/intel-lab-lkp/linux/commits/Anshuman-Khandual/mm-execmem-Make-ARCH_WANTS_EXECMEM_LATE-depend-on-EXECMEM/20241209-111533
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20241209031251.515903-1-anshuman.khandual%40arm.com
patch subject: [PATCH] mm/execmem: Make ARCH_WANTS_EXECMEM_LATE depend on EXECMEM
config: arm64-kismet-CONFIG_ARCH_WANTS_EXECMEM_LATE-CONFIG_ARM64-0-0 (https://download.01.org/0day-ci/archive/20241209/202412092048.tTzJ5szH-lkp@intel.com/config)
reproduce: (https://download.01.org/0day-ci/archive/20241209/202412092048.tTzJ5szH-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412092048.tTzJ5szH-lkp@intel.com/
kismet warnings: (new ones prefixed by >>)
>> kismet: WARNING: unmet direct dependencies detected for ARCH_WANTS_EXECMEM_LATE when selected by ARM64
WARNING: unmet direct dependencies detected for ARCH_WANTS_EXECMEM_LATE
Depends on [n]: EXECMEM [=n]
Selected by [y]:
- ARM64 [=y]
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/execmem: Make ARCH_WANTS_EXECMEM_LATE depend on EXECMEM
2024-12-09 12:36 ` kernel test robot
@ 2024-12-09 14:13 ` Anshuman Khandual
2024-12-09 17:09 ` Catalin Marinas
0 siblings, 1 reply; 5+ messages in thread
From: Anshuman Khandual @ 2024-12-09 14:13 UTC (permalink / raw)
To: kernel test robot, linux-mm
Cc: Paul Gazzillo, Necip Fazil Yildiran, oe-kbuild-all,
Catalin Marinas, Will Deacon, Andrew Morton, Kees Cook,
linux-arm-kernel, linux-kernel
On 12/9/24 18:06, kernel test robot wrote:
> Hi Anshuman,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on akpm-mm/mm-everything]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Anshuman-Khandual/mm-execmem-Make-ARCH_WANTS_EXECMEM_LATE-depend-on-EXECMEM/20241209-111533
> base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
> patch link: https://lore.kernel.org/r/20241209031251.515903-1-anshuman.khandual%40arm.com
> patch subject: [PATCH] mm/execmem: Make ARCH_WANTS_EXECMEM_LATE depend on EXECMEM
> config: arm64-kismet-CONFIG_ARCH_WANTS_EXECMEM_LATE-CONFIG_ARM64-0-0 (https://download.01.org/0day-ci/archive/20241209/202412092048.tTzJ5szH-lkp@intel.com/config)
> reproduce: (https://download.01.org/0day-ci/archive/20241209/202412092048.tTzJ5szH-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202412092048.tTzJ5szH-lkp@intel.com/
>
> kismet warnings: (new ones prefixed by >>)
>>> kismet: WARNING: unmet direct dependencies detected for ARCH_WANTS_EXECMEM_LATE when selected by ARM64
> WARNING: unmet direct dependencies detected for ARCH_WANTS_EXECMEM_LATE
> Depends on [n]: EXECMEM [=n]
> Selected by [y]:
> - ARM64 [=y]
Although above mentioned config here has CONFIG_ARCH_WANTS_EXECMEM_LATE=y
and CONFIG_EXECMEM=n (actually absent), could that really happen though ?
Tried making CONFIG_EXECMEM=n (rather deselecting) but that did now allow
setting CONFIG_EXECMEM=n, it always remained set. Reverting this patch i.e
the current behaviour is also the same (CONFIG_EXECMEM always remains set).
select ARCH_WANTS_EXECMEM_LATE if EXECMEM
Above statement seems to be selecting EXECMEM as well but the intent seems
to be a dependency check instead! OR arch selection for a config brings in
all its dependencies as well.
If the selection is always, should this change be like the following ?
config ARCH_WANTS_EXECMEM_LATE
bool
selects EXECMEM
Although a similar config ARCH_WANTS_EXECMEM_ROX is dependent on MMU and
!HIGHMEM at the generic memory level.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/execmem: Make ARCH_WANTS_EXECMEM_LATE depend on EXECMEM
2024-12-09 14:13 ` Anshuman Khandual
@ 2024-12-09 17:09 ` Catalin Marinas
2024-12-10 3:25 ` Anshuman Khandual
0 siblings, 1 reply; 5+ messages in thread
From: Catalin Marinas @ 2024-12-09 17:09 UTC (permalink / raw)
To: Anshuman Khandual
Cc: kernel test robot, linux-mm, Paul Gazzillo, Necip Fazil Yildiran,
oe-kbuild-all, Will Deacon, Andrew Morton, Kees Cook,
linux-arm-kernel, linux-kernel
On Mon, Dec 09, 2024 at 07:43:32PM +0530, Anshuman Khandual wrote:
> On 12/9/24 18:06, kernel test robot wrote:
> > kernel test robot noticed the following build warnings:
> >
> > [auto build test WARNING on akpm-mm/mm-everything]
> >
> > url: https://github.com/intel-lab-lkp/linux/commits/Anshuman-Khandual/mm-execmem-Make-ARCH_WANTS_EXECMEM_LATE-depend-on-EXECMEM/20241209-111533
> > base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
> > patch link: https://lore.kernel.org/r/20241209031251.515903-1-anshuman.khandual%40arm.com
> > patch subject: [PATCH] mm/execmem: Make ARCH_WANTS_EXECMEM_LATE depend on EXECMEM
> > config: arm64-kismet-CONFIG_ARCH_WANTS_EXECMEM_LATE-CONFIG_ARM64-0-0 (https://download.01.org/0day-ci/archive/20241209/202412092048.tTzJ5szH-lkp@intel.com/config)
> > reproduce: (https://download.01.org/0day-ci/archive/20241209/202412092048.tTzJ5szH-lkp@intel.com/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202412092048.tTzJ5szH-lkp@intel.com/
> >
> > kismet warnings: (new ones prefixed by >>)
> >>> kismet: WARNING: unmet direct dependencies detected for ARCH_WANTS_EXECMEM_LATE when selected by ARM64
> > WARNING: unmet direct dependencies detected for ARCH_WANTS_EXECMEM_LATE
> > Depends on [n]: EXECMEM [=n]
> > Selected by [y]:
> > - ARM64 [=y]
>
> Although above mentioned config here has CONFIG_ARCH_WANTS_EXECMEM_LATE=y
> and CONFIG_EXECMEM=n (actually absent), could that really happen though ?
>
> Tried making CONFIG_EXECMEM=n (rather deselecting) but that did now allow
> setting CONFIG_EXECMEM=n, it always remained set. Reverting this patch i.e
> the current behaviour is also the same (CONFIG_EXECMEM always remains set).
>
> select ARCH_WANTS_EXECMEM_LATE if EXECMEM
>
> Above statement seems to be selecting EXECMEM as well but the intent seems
> to be a dependency check instead! OR arch selection for a config brings in
> all its dependencies as well.
>
> If the selection is always, should this change be like the following ?
>
> config ARCH_WANTS_EXECMEM_LATE
> bool
> selects EXECMEM
This is wrong. What ARCH_WANTS_EXECMEM_LATE means is that, _if_ EXECMEM
is enabled, the arch code require its late initialisation. Currently for
arm64 EXECMEM is selected by KPROBES, BPF_JIT and MODULES. So if you
don't have any of these on, you don't need EXECMEM either, no point in
selecting it above just because arm64 wants a specific behaviour (late
initialisation) for EXECMEM.
If you do want a patch for this, I think for arm64 we simply need to
select ARCH_WANTS_EXECMEM_LATE unconditionally. Not much use in having
any dependencies really, it just adds to the clutter. And don't change
the core Kconfig either.
--
Catalin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/execmem: Make ARCH_WANTS_EXECMEM_LATE depend on EXECMEM
2024-12-09 17:09 ` Catalin Marinas
@ 2024-12-10 3:25 ` Anshuman Khandual
0 siblings, 0 replies; 5+ messages in thread
From: Anshuman Khandual @ 2024-12-10 3:25 UTC (permalink / raw)
To: Catalin Marinas
Cc: kernel test robot, linux-mm, Paul Gazzillo, Necip Fazil Yildiran,
oe-kbuild-all, Will Deacon, Andrew Morton, Kees Cook,
linux-arm-kernel, linux-kernel
On 12/9/24 22:39, Catalin Marinas wrote:
> On Mon, Dec 09, 2024 at 07:43:32PM +0530, Anshuman Khandual wrote:
>> On 12/9/24 18:06, kernel test robot wrote:
>>> kernel test robot noticed the following build warnings:
>>>
>>> [auto build test WARNING on akpm-mm/mm-everything]
>>>
>>> url: https://github.com/intel-lab-lkp/linux/commits/Anshuman-Khandual/mm-execmem-Make-ARCH_WANTS_EXECMEM_LATE-depend-on-EXECMEM/20241209-111533
>>> base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
>>> patch link: https://lore.kernel.org/r/20241209031251.515903-1-anshuman.khandual%40arm.com
>>> patch subject: [PATCH] mm/execmem: Make ARCH_WANTS_EXECMEM_LATE depend on EXECMEM
>>> config: arm64-kismet-CONFIG_ARCH_WANTS_EXECMEM_LATE-CONFIG_ARM64-0-0 (https://download.01.org/0day-ci/archive/20241209/202412092048.tTzJ5szH-lkp@intel.com/config)
>>> reproduce: (https://download.01.org/0day-ci/archive/20241209/202412092048.tTzJ5szH-lkp@intel.com/reproduce)
>>>
>>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>>> the same patch/commit), kindly add following tags
>>> | Reported-by: kernel test robot <lkp@intel.com>
>>> | Closes: https://lore.kernel.org/oe-kbuild-all/202412092048.tTzJ5szH-lkp@intel.com/
>>>
>>> kismet warnings: (new ones prefixed by >>)
>>>>> kismet: WARNING: unmet direct dependencies detected for ARCH_WANTS_EXECMEM_LATE when selected by ARM64
>>> WARNING: unmet direct dependencies detected for ARCH_WANTS_EXECMEM_LATE
>>> Depends on [n]: EXECMEM [=n]
>>> Selected by [y]:
>>> - ARM64 [=y]
>>
>> Although above mentioned config here has CONFIG_ARCH_WANTS_EXECMEM_LATE=y
>> and CONFIG_EXECMEM=n (actually absent), could that really happen though ?
>>
>> Tried making CONFIG_EXECMEM=n (rather deselecting) but that did now allow
>> setting CONFIG_EXECMEM=n, it always remained set. Reverting this patch i.e
>> the current behaviour is also the same (CONFIG_EXECMEM always remains set).
>>
>> select ARCH_WANTS_EXECMEM_LATE if EXECMEM
>>
>> Above statement seems to be selecting EXECMEM as well but the intent seems
>> to be a dependency check instead! OR arch selection for a config brings in
>> all its dependencies as well.
>>
>> If the selection is always, should this change be like the following ?
>>
>> config ARCH_WANTS_EXECMEM_LATE
>> bool
>> selects EXECMEM
>
> This is wrong. What ARCH_WANTS_EXECMEM_LATE means is that, _if_ EXECMEM
> is enabled, the arch code require its late initialisation. Currently for
Which implies that even if ARCH_WANTS_EXECMEM_LATE is only applicable when
EXECMEM is enabled, there is no real dependence on the later for platforms
that need a certain init behaviour.
> arm64 EXECMEM is selected by KPROBES, BPF_JIT and MODULES. So if you
EXECMEM gets enabled from the above, not via ARCH_WANTS_EXECMEM_LATE as I
had anticipated earlier.
> don't have any of these on, you don't need EXECMEM either, no point in
> selecting it above just because arm64 wants a specific behaviour (late
> initialisation) for EXECMEM.
Right, specific behaviour preference for a function on a platform should
not necessarily pull in that function itself.
>
> If you do want a patch for this, I think for arm64 we simply need to
> select ARCH_WANTS_EXECMEM_LATE unconditionally. Not much use in having
> any dependencies really, it just adds to the clutter. And don't change
> the core Kconfig either.
Sure, will do.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-12-10 3:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-09 3:12 [PATCH] mm/execmem: Make ARCH_WANTS_EXECMEM_LATE depend on EXECMEM Anshuman Khandual
2024-12-09 12:36 ` kernel test robot
2024-12-09 14:13 ` Anshuman Khandual
2024-12-09 17:09 ` Catalin Marinas
2024-12-10 3:25 ` Anshuman Khandual
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox