All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/kconfig: hide unwinder menu for KMEMCHECK
@ 2017-09-11 19:59 Arnd Bergmann
  2017-09-11 23:42 ` Josh Poimboeuf
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-09-11 19:59 UTC (permalink / raw)
  To: Josh Poimboeuf, Ingo Molnar
  Cc: Arnd Bergmann, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Kees Cook, linux-kernel

When KMEMCHECK is enabled, we always build with frame pointers,
which is incompatible with ORC_UNWINDER and GUESS_UNWINDER, as
Kconfig points out:

warning: (FAULT_INJECTION_STACKTRACE_FILTER && LATENCYTOP && KMEMCHECK && LOCKDEP && FRAME_POINTER_UNWINDER) selects FRAME_POINTER which has unmet direct dependencies (DEBUG_KERNEL && (CRIS || M68K || FRV || UML || SUPERH || BLACKFIN || MN10300 || METAG) || ARCH_WANT_FRAME_POINTERS || !ORC_UNWINDER && !GUESS_UNWINDER)

This works around it by making those two unwinders depend on
!KMEMCHECK. The other three options that enable frame pointers
(FAULT_INJECTION_STACKTRACE_FILTER, LATENCYTOP and LOCKDEP) only
do that on some architectures but not on x86.

It's possible that KMEMCHECK doesn't actually require frame pointers
but only requires some unwinder. If that is the case, we should drop
the 'select FRAME_POINTER' there. KMEMCHECK is currenly used only
on x86.

Fixes: 81d387190039 ("x86/kconfig: Consolidate unwinders into multiple choice selection")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/Kconfig.debug | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index 71a48a30fc84..79f0f563d525 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -381,7 +381,7 @@ config FRAME_POINTER_UNWINDER
 
 config ORC_UNWINDER
 	bool "ORC unwinder"
-	depends on X86_64
+	depends on X86_64 && !KMEMCHECK
 	select STACK_VALIDATION
 	---help---
 	  This option enables the ORC (Oops Rewind Capability) unwinder for
@@ -397,7 +397,7 @@ config ORC_UNWINDER
 
 config GUESS_UNWINDER
 	bool "Guess unwinder"
-	depends on EXPERT
+	depends on EXPERT && !KMEMCHECK
 	---help---
 	  This option enables the "guess" unwinder for unwinding kernel stack
 	  traces.  It scans the stack and reports every kernel text address it
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/kconfig: hide unwinder menu for KMEMCHECK
  2017-09-11 19:59 [PATCH] x86/kconfig: hide unwinder menu for KMEMCHECK Arnd Bergmann
@ 2017-09-11 23:42 ` Josh Poimboeuf
  0 siblings, 0 replies; 2+ messages in thread
From: Josh Poimboeuf @ 2017-09-11 23:42 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Ingo Molnar, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Kees Cook, linux-kernel

On Mon, Sep 11, 2017 at 09:59:36PM +0200, Arnd Bergmann wrote:
> When KMEMCHECK is enabled, we always build with frame pointers,
> which is incompatible with ORC_UNWINDER and GUESS_UNWINDER, as
> Kconfig points out:
> 
> warning: (FAULT_INJECTION_STACKTRACE_FILTER && LATENCYTOP && KMEMCHECK && LOCKDEP && FRAME_POINTER_UNWINDER) selects FRAME_POINTER which has unmet direct dependencies (DEBUG_KERNEL && (CRIS || M68K || FRV || UML || SUPERH || BLACKFIN || MN10300 || METAG) || ARCH_WANT_FRAME_POINTERS || !ORC_UNWINDER && !GUESS_UNWINDER)
> 
> This works around it by making those two unwinders depend on
> !KMEMCHECK. The other three options that enable frame pointers
> (FAULT_INJECTION_STACKTRACE_FILTER, LATENCYTOP and LOCKDEP) only
> do that on some architectures but not on x86.
> 
> It's possible that KMEMCHECK doesn't actually require frame pointers
> but only requires some unwinder. If that is the case, we should drop
> the 'select FRAME_POINTER' there. KMEMCHECK is currenly used only
> on x86.

KMEMCHECK should work with *any* of the unwinders because it uses the
unwinder-agnostic save_stack_trace() interface.  So removing the 'select
FRAME_POINTER' sounds like the right fix.

-- 
Josh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-11 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-11 19:59 [PATCH] x86/kconfig: hide unwinder menu for KMEMCHECK Arnd Bergmann
2017-09-11 23:42 ` Josh Poimboeuf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.