Skip to contentSkip to conversation

ARM: make CONFIG_DEBUG_WX depend on MMU

PATCH In review Arnd Bergmann 2 participants 2 messages Feb 20, 2018 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: make CONFIG_DEBUG_WX depend on MMU

Without CONFIG_MMU, this results in a build failure:

./arch/arm/include/asm/memory.h:92:23: error: initializer element is not constant
#define VECTORS_BASE vectors_base
arch/arm/mm/dump.c:32:4: note: in expansion of macro 'VECTORS_BASE'
{ VECTORS_BASE, "Vectors" },

arch/arm/mm/dump.c:71:11: error: 'L_PTE_USER' undeclared here (not in a function); did you mean 'VTIME_USER'?
.mask = L_PTE_USER,

           ^~~~~~~~~~

Obviously the feature only makes sense with an MMU, so let's add the dependency here.

Fixes a8e53c151fe7 ("ARM: 8737/1: mm: dump: add checking for writable and executable")
---
 arch/arm/Kconfig.debug | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Kconfig.debug +1 -0
index 7b3d9c5c73bb..6db106b5b9e9 100644
@@ -22,6 +22,7 @@ config ARM_PTDUMP_DEBUGFS
 
 config DEBUG_WX
 	bool "Warn on W+X mappings at boot"
+	depends on MMU
 	select ARM_PTDUMP_CORE
 	---help---
 		Generate a warning if any W+X mappings are found at boot.
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Arnd Bergmann

Without CONFIG_MMU, this results in a build failure:

./arch/arm/include/asm/memory.h:92:23: error: initializer element is not constant
#define VECTORS_BASE vectors_base
arch/arm/mm/dump.c:32:4: note: in expansion of macro 'VECTORS_BASE'
{ VECTORS_BASE, "Vectors" },

Quoted 7 lines

arch/arm/mm/dump.c:71:11: error: 'L_PTE_USER' undeclared here (not in a function); did you mean 'VTIME_USER'?

    .mask = L_PTE_USER,
            ^~~~~~~~~~

Obviously the feature only makes sense with an MMU, so let's add the dependency here.

Quoted 19 lines
Fixes a8e53c151fe7 ("ARM: 8737/1: mm: dump: add checking for writable and executable")
---
  arch/arm/Kconfig.debug | 1 +
  1 file changed, 1 insertion(+)
arch/arm/Kconfig.debug +1 -0
index 7b3d9c5c73bb..6db106b5b9e9 100644
@@ -22,6 +22,7 @@ config ARM_PTDUMP_DEBUGFS
 
  config DEBUG_WX
  	bool "Warn on W+X mappings at boot"
+	depends on MMU
  	select ARM_PTDUMP_CORE
  	---help---
  		Generate a warning if any W+X mappings are found at boot.