Skip to contentSkip to conversation

ARM: mm: Facilitate debugging CONFIG_KUSER_HELPERS disabled

PATCH In review Florian Fainelli 2 participants 3 messages Oct 25, 2018 – Oct 31, 2018 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: mm: Facilitate debugging CONFIG_KUSER_HELPERS disabled

Some software such as perf makes unconditional use of the special [vectors] page which is only provided when CONFIG_KUSER_HELPERS is enabled in the kernel.

Facilitate the debugging of such situations by printing a debug message to the kernel log showing the task name and the faulting address.

---
 arch/arm/mm/fault.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mm/fault.c +6 -0
index f4ea4c62c613..58f69fa07df9 100644
@@ -173,6 +173,12 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
 		show_regs(regs);
 	}
 #endif
+#ifndef CONFIG_KUSER_HELPERS
+	if ((sig == SIGSEGV) && ((addr & PAGE_MASK) == 0xffff0000))
+		printk_ratelimited(KERN_DEBUG
+				   "%s: CONFIG_KUSER_HELPERS disabled at 0x%08lx\n",
+				   tsk->comm, addr);
+#endif
 
 	tsk->thread.address = addr;
 	tsk->thread.error_code = fsr;
Signature · 1 line
2.17.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Florian Fainelli

Some software such as perf makes unconditional use of the special [vectors] page which is only provided when CONFIG_KUSER_HELPERS is enabled in the kernel.

Facilitate the debugging of such situations by printing a debug message to the kernel log showing the task name and the faulting address.

Hi Florian

Nice. I wish we had this a couple of months ago.

Thanks
Andrew

#2 lore raw
Quoted 5 lines · Andrew Lunn
Quoted 4 lines · Florian Fainelli

Some software such as perf makes unconditional use of the special [vectors] page which is only provided when CONFIG_KUSER_HELPERS is enabled in the kernel.

Quoted 8 lines
Quoted 2 lines

Facilitate the debugging of such situations by printing a debug message to the kernel log showing the task name and the faulting address.

Hi Florian

Nice. I wish we had this a couple of months ago.

Thanks Andrew, submitted as 8807/1.

Signature · 1 line
Florian