Skip to contentSkip to conversation

x86: select ARCH_WANT_FRAME_POINTERS again when UNWINDER_FRAME_POINTER=y

PATCH Applied Masahiro Yamada 3 participants 5 messages Feb 4, 2024 – May 20, 2024 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: select ARCH_WANT_FRAME_POINTERS again when UNWINDER_FRAME_POINTER=y

It took me some time to understand the purpose of the tricky code at the end of arch/x86/Kconfig.debug.

Without it, the following would be shown:

WARNING: unmet direct dependencies detected for FRAME_POINTER

because commit 81d387190039 ("x86/kconfig: Consolidate unwinders into multiple choice selection") removed 'select ARCH_WANT_FRAME_POINTERS'.

The correct and more straightforward approach should have been to move it where 'select FRAME_POINTER' is located.

Several architectures properly handle the conditional selection of ARCH_WANT_FRAME_POINTERS. For example, 'config UNWINDER_FRAME_POINTER' in arch/arm/Kconfig.debug.

---

 arch/x86/Kconfig.debug | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/x86/Kconfig.debug +1 -4
index c5d614d28a75..74777a97e394 100644
@@ -248,6 +248,7 @@ config UNWINDER_ORC
 
 config UNWINDER_FRAME_POINTER
 	bool "Frame pointer unwinder"
+	select ARCH_WANT_FRAME_POINTERS
 	select FRAME_POINTER
 	help
 	  This option enables the frame pointer unwinder for unwinding kernel
@@ -271,7 +272,3 @@ config UNWINDER_GUESS
 	  overhead.
 
 endchoice
-
-config FRAME_POINTER
-	depends on !UNWINDER_ORC && !UNWINDER_GUESS
-	bool
Signature · 1 line
2.40.1
#1 lore raw

Ping?

Quoted 47 lines · Masahiro Yamada

It took me some time to understand the purpose of the tricky code at the end of arch/x86/Kconfig.debug.

Without it, the following would be shown:

WARNING: unmet direct dependencies detected for FRAME_POINTER

because commit 81d387190039 ("x86/kconfig: Consolidate unwinders into multiple choice selection") removed 'select ARCH_WANT_FRAME_POINTERS'.

The correct and more straightforward approach should have been to move it where 'select FRAME_POINTER' is located.

Several architectures properly handle the conditional selection of ARCH_WANT_FRAME_POINTERS. For example, 'config UNWINDER_FRAME_POINTER' in arch/arm/Kconfig.debug.

---

 arch/x86/Kconfig.debug | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/x86/Kconfig.debug +1 -5
index c5d614d28a75..74777a97e394 100644
@@ -248,6 +248,7 @@ config UNWINDER_ORC
 
 config UNWINDER_FRAME_POINTER
        bool "Frame pointer unwinder"
+       select ARCH_WANT_FRAME_POINTERS
        select FRAME_POINTER
        help
          This option enables the frame pointer unwinder for unwinding kernel
@@ -271,7 +272,3 @@ config UNWINDER_GUESS
          overhead.
 
 endchoice
-
-config FRAME_POINTER
-       depends on !UNWINDER_ORC && !UNWINDER_GUESS
-       bool
--

2.40.1

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw

Hi, x86 maintainers

Please check this.

And, please also note the current code is incorrect, and it may get broken with future Kconfig refactoring.

Quoted 44 lines · Masahiro Yamada

Ping?

Quoted 39 lines · Masahiro Yamada

It took me some time to understand the purpose of the tricky code at the end of arch/x86/Kconfig.debug.

Without it, the following would be shown:

WARNING: unmet direct dependencies detected for FRAME_POINTER

because commit 81d387190039 ("x86/kconfig: Consolidate unwinders into multiple choice selection") removed 'select ARCH_WANT_FRAME_POINTERS'.

The correct and more straightforward approach should have been to move it where 'select FRAME_POINTER' is located.

Several architectures properly handle the conditional selection of ARCH_WANT_FRAME_POINTERS. For example, 'config UNWINDER_FRAME_POINTER' in arch/arm/Kconfig.debug.

---

 arch/x86/Kconfig.debug | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/x86/Kconfig.debug +1 -0
index c5d614d28a75..74777a97e394 100644
@@ -248,6 +248,7 @@ config UNWINDER_ORC
 
 config UNWINDER_FRAME_POINTER
        bool "Frame pointer unwinder"
+       select ARCH_WANT_FRAME_POINTERS
        select FRAME_POINTER
        help
          This option enables the frame pointer unwinder for unwinding kernel
@@ -271,7 +272,3 @@ config UNWINDER_GUESS
          overhead.
 
Quoted 13 lines
Quoted 8 lines
arch/x86/Kconfig.debug +0 -5
 endchoice
-
-config FRAME_POINTER
-       depends on !UNWINDER_ORC && !UNWINDER_GUESS
-       bool
--

2.40.1

--
Best Regards
Masahiro Yamada

--
Best Regards
Masahiro Yamada

Acked-by on v1 1/1
#3 lore raw
In reply to Masahiro Yamada
Quoted 10 lines · Masahiro Yamada

It took me some time to understand the purpose of the tricky code at the end of arch/x86/Kconfig.debug.

Without it, the following would be shown:

WARNING: unmet direct dependencies detected for FRAME_POINTER

because commit 81d387190039 ("x86/kconfig: Consolidate unwinders into multiple choice selection") removed 'select ARCH_WANT_FRAME_POINTERS'.

Quoted 8 lines

The correct and more straightforward approach should have been to move it where 'select FRAME_POINTER' is located.

Several architectures properly handle the conditional selection of ARCH_WANT_FRAME_POINTERS. For example, 'config UNWINDER_FRAME_POINTER' in arch/arm/Kconfig.debug.

Looks good, thanks for fixing that!

Fixes 81d387190039 ("x86/kconfig: Consolidate unwinders into multiple choice selection")
Signature · 1 line
Josh
#4 lore raw

[tip: x86/urgent] x86/kconfig: Select ARCH_WANT_FRAME_POINTERS again when UNWINDER_FRAME_POINTER=y

In reply to Masahiro Yamada
The following commit has been merged into the x86/urgent branch of tip:

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     66ee3636eddcc82ab82b539d08b85fb5ac1dff9b
Gitweb:        https://git.kernel.org/tip/66ee3636eddcc82ab82b539d08b85fb5ac1dff9b
Author:        Masahiro Yamada <[email protected]>
AuthorDate:    Sun, 04 Feb 2024 21:20:03 +09:00
Committer:     Borislav Petkov (AMD) <[email protected]>
CommitterDate: Mon, 20 May 2024 11:37:23 +02:00

x86/kconfig: Select ARCH_WANT_FRAME_POINTERS again when UNWINDER_FRAME_POINTER=y

It took me some time to understand the purpose of the tricky code at the end of arch/x86/Kconfig.debug.

Without it, the following would be shown:

WARNING: unmet direct dependencies detected for FRAME_POINTER

because

81d387190039 ("x86/kconfig: Consolidate unwinders into multiple choice selection")

removed 'select ARCH_WANT_FRAME_POINTERS'.

The correct and more straightforward approach should have been to move it where 'select FRAME_POINTER' is located.

Several architectures properly handle the conditional selection of ARCH_WANT_FRAME_POINTERS. For example, 'config UNWINDER_FRAME_POINTER' in arch/arm/Kconfig.debug.

Fixes 81d387190039 ("x86/kconfig: Consolidate unwinders into multiple choice selection")
---
 arch/x86/Kconfig.debug | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/x86/Kconfig.debug +1 -4
index c5d614d..74777a9 100644
@@ -248,6 +248,7 @@ config UNWINDER_ORC
 
 config UNWINDER_FRAME_POINTER
 	bool "Frame pointer unwinder"
+	select ARCH_WANT_FRAME_POINTERS
 	select FRAME_POINTER
 	help
 	  This option enables the frame pointer unwinder for unwinding kernel
@@ -271,7 +272,3 @@ config UNWINDER_GUESS
 	  overhead.
 
 endchoice
-
-config FRAME_POINTER
-	depends on !UNWINDER_ORC && !UNWINDER_GUESS
-	bool