AutoFDO: Remove the architecture specific config
PATCH 1/2 AutoFDO: Remove the architecture specific config
The CONFIG_AUTOFDO_CLANG option currently depends on ARCH_SUPPORTS_AUTOFDO_CLANG, but this dependency seems unnecessary.
Remove ARCH_SUPPORTS_AUTOFDO_CLANG and allow users to control AutoFDO builds solely through CONFIG_AUTOFDO_CLANG. This simplifies the kconfig and avoids potential confusion.
--- arch/Kconfig | 4 ---- arch/x86/Kconfig | 1 - 2 files changed, 5 deletions(-)
arch/Kconfig +0 -4
@@ -812,12 +812,8 @@ config LTO_CLANG_THIN If unsure, say Y. endchoice -config ARCH_SUPPORTS_AUTOFDO_CLANG - bool - config AUTOFDO_CLANG bool "Enable Clang's AutoFDO build (EXPERIMENTAL)" - depends on ARCH_SUPPORTS_AUTOFDO_CLANG depends on CC_IS_CLANG && CLANG_VERSION >= 170000 help This option enables Clang’s AutoFDO build. When
arch/x86/Kconfig +0 -1
@@ -128,7 +128,6 @@ config X86 select ARCH_SUPPORTS_LTO_CLANG select ARCH_SUPPORTS_LTO_CLANG_THIN select ARCH_SUPPORTS_RT - select ARCH_SUPPORTS_AUTOFDO_CLANG select ARCH_SUPPORTS_PROPELLER_CLANG if X86_64 select ARCH_USE_BUILTIN_BSWAP select ARCH_USE_CMPXCHG_LOCKREF if X86_CMPXCHG64
base-commit: f92f4749861b06fed908d336b4dee1326003291b
Signature · 1 line
2.47.0.338.g60cca15819-goog
PATCH 2/2 Propeller: Remove the architecture specific config
The CONFIG_PROPELLER_CLANG option currently depends on ARCH_SUPPORTS_PROPELLER_CLANG, but this dependency seems unnecessary.
Remove ARCH_SUPPORTS_PROPELLER_CLANG and allow users to control Propeller builds solely through CONFIG_PROPELLER_CLANG. This simplifies the kconfig and avoids potential confusion.
--- arch/Kconfig | 4 ---- arch/x86/Kconfig | 1 - 2 files changed, 5 deletions(-)
arch/Kconfig +0 -4
@@ -828,12 +828,8 @@ config AUTOFDO_CLANG If unsure, say N. -config ARCH_SUPPORTS_PROPELLER_CLANG - bool - config PROPELLER_CLANG bool "Enable Clang's Propeller build" - depends on ARCH_SUPPORTS_PROPELLER_CLANG depends on CC_IS_CLANG && CLANG_VERSION >= 190000 help This option enables Clang’s Propeller build. When the Propeller
arch/x86/Kconfig +0 -1
@@ -128,7 +128,6 @@ config X86 select ARCH_SUPPORTS_LTO_CLANG select ARCH_SUPPORTS_LTO_CLANG_THIN select ARCH_SUPPORTS_RT - select ARCH_SUPPORTS_PROPELLER_CLANG if X86_64 select ARCH_USE_BUILTIN_BSWAP select ARCH_USE_CMPXCHG_LOCKREF if X86_CMPXCHG64 select ARCH_USE_MEMTEST
Signature · 1 line
2.47.0.338.g60cca15819-goog
Re: [PATCH 2/2] Propeller: Remove the architecture specific config
Hi Rong,
Quoted 9 lines · Rong Xu
The
CONFIG_PROPELLER_CLANGoption currently depends onARCH_SUPPORTS_PROPELLER_CLANG, but this dependency seems unnecessary.Remove
ARCH_SUPPORTS_PROPELLER_CLANGand allow users to control Propeller builds solely throughCONFIG_PROPELLER_CLANG. This simplifies the kconfig and avoids potential confusion.Signed-off-by Rong Xu <[email protected]>Suggested-by Will Deacon <[email protected]>
In commit d5dc95836147 ("kbuild: Add Propeller configuration for kernel build"), you added .llvm_bb_addr_map to arch/x86/kernel/vmlinux.lds.S. Was this to address a orphan section warning from the linker? Is that same change needed in the linker scripts of the other architectures that clang supports building in the kernel?
Cheers,
Nathan
Quoted 37 lines
--- arch/Kconfig | 4 ---- arch/x86/Kconfig | 1 - 2 files changed, 5 deletions(-)arch/Kconfig +0
-4@@ -828,12 +828,8 @@ config AUTOFDO_CLANG If unsure, say N. -config ARCH_SUPPORTS_PROPELLER_CLANG - bool - config PROPELLER_CLANG bool "Enable Clang's Propeller build" - depends on ARCH_SUPPORTS_PROPELLER_CLANG depends on CC_IS_CLANG && CLANG_VERSION >= 190000 help This option enables Clang’s Propeller build. When the Propellerarch/x86/Kconfig +0
-1@@ -128,7 +128,6 @@ config X86 select ARCH_SUPPORTS_LTO_CLANG select ARCH_SUPPORTS_LTO_CLANG_THIN select ARCH_SUPPORTS_RT - select ARCH_SUPPORTS_PROPELLER_CLANG if X86_64 select ARCH_USE_BUILTIN_BSWAP select ARCH_USE_CMPXCHG_LOCKREF if X86_CMPXCHG64 select ARCH_USE_MEMTESTSignature · 1 line
2.47.0.338.g60cca15819-goog
Re: [PATCH 2/2] Propeller: Remove the architecture specific config
(o
Quoted 11 lines · Nathan Chancellor
Hi Rong,
Quoted 7 lines · Rong Xu
The
CONFIG_PROPELLER_CLANGoption currently depends onARCH_SUPPORTS_PROPELLER_CLANG, but this dependency seems unnecessary.Remove
ARCH_SUPPORTS_PROPELLER_CLANGand allow users to control Propeller builds solely throughCONFIG_PROPELLER_CLANG. This simplifies the kconfig and avoids potential confusion.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Rong Xu <[email protected]>Suggested-by Will Deacon <[email protected]>In commit
d5dc95836147("kbuild: Add Propeller configuration for kernel build"), you added .llvm_bb_addr_map toarch/x86/kernel/vmlinux.lds.S. Was this to address a orphan section warning from the linker? Is that same change needed in the linker scripts of the other architectures that clang supports building in the kernel?
The .llvm_bb_addr_map section is created when compiling with the -fbasic-block-address-map flag (or the older -fbasic-block-sections=labels option), with LLVM. We need the change in the linker script to group the sections together and emit in the final vmlinux.
This applies to all architectures, as LLVM can generate these sections for any architecture when the corresponding option is used.
The statement that AutoFDO and Propeller are only supported on certain platforms really refers to the availability of *native* profile generation:
the native profile generation is only available on these platforms.
Hope this helps,
-Rong
Quoted 40 lines
Cheers,
NathanQuoted 37 lines
--- arch/Kconfig | 4 ---- arch/x86/Kconfig | 1 - 2 files changed, 5 deletions(-)arch/Kconfig +0
-4@@ -828,12 +828,8 @@ config AUTOFDO_CLANG If unsure, say N. -config ARCH_SUPPORTS_PROPELLER_CLANG - bool - config PROPELLER_CLANG bool "Enable Clang's Propeller build" - depends on ARCH_SUPPORTS_PROPELLER_CLANG depends on CC_IS_CLANG && CLANG_VERSION >= 190000 help This option enables Clang’s Propeller build. When the Propellerarch/x86/Kconfig +0
-2@@ -128,7 +128,6 @@ config X86 select ARCH_SUPPORTS_LTO_CLANG select ARCH_SUPPORTS_LTO_CLANG_THIN select ARCH_SUPPORTS_RT - select ARCH_SUPPORTS_PROPELLER_CLANG if X86_64 select ARCH_USE_BUILTIN_BSWAP select ARCH_USE_CMPXCHG_LOCKREF if X86_CMPXCHG64 select ARCH_USE_MEMTEST --2.47.0.338.g60cca15819-goog
Yabin Cui
Tested-byRe: [PATCH 2/2] Propeller: Remove the architecture specific config
Quoted 80 lines · Rong Xu
(o
Quoted 11 lines · Nathan Chancellor
Hi Rong,
Quoted 7 lines · Rong Xu
The
CONFIG_PROPELLER_CLANGoption currently depends onARCH_SUPPORTS_PROPELLER_CLANG, but this dependency seems unnecessary.Remove
ARCH_SUPPORTS_PROPELLER_CLANGand allow users to control Propeller builds solely throughCONFIG_PROPELLER_CLANG. This simplifies the kconfig and avoids potential confusion.Quoted 8 lines
Quoted 2 lines
Signed-off-by Rong Xu <[email protected]>Suggested-by Will Deacon <[email protected]>In commit
d5dc95836147("kbuild: Add Propeller configuration for kernel build"), you added .llvm_bb_addr_map toarch/x86/kernel/vmlinux.lds.S. Was this to address a orphan section warning from the linker? Is that same change needed in the linker scripts of the other architectures that clang supports building in the kernel?The .llvm_bb_addr_map section is created when compiling with the -fbasic-block-address-map flag (or the older -fbasic-block-sections=labels option), with LLVM. We need the change in the linker script to group the sections together and emit in the final vmlinux.
This applies to all architectures, as LLVM can generate these sections for any architecture when the corresponding option is used.
The statement that AutoFDO and Propeller are only supported on certain platforms really refers to the availability of *native* profile generation:
the native profile generation is only available on these platforms.Hope this helps,
-Rong
Quoted 40 lines
Cheers,
NathanQuoted 37 lines
--- arch/Kconfig | 4 ---- arch/x86/Kconfig | 1 - 2 files changed, 5 deletions(-)arch/Kconfig +0
-4@@ -828,12 +828,8 @@ config AUTOFDO_CLANG If unsure, say N. -config ARCH_SUPPORTS_PROPELLER_CLANG - bool - config PROPELLER_CLANG bool "Enable Clang's Propeller build" - depends on ARCH_SUPPORTS_PROPELLER_CLANG depends on CC_IS_CLANG && CLANG_VERSION >= 190000 help This option enables Clang’s Propeller build. When the Propellerarch/x86/Kconfig +0
-2@@ -128,7 +128,6 @@ config X86 select ARCH_SUPPORTS_LTO_CLANG select ARCH_SUPPORTS_LTO_CLANG_THIN select ARCH_SUPPORTS_RT - select ARCH_SUPPORTS_PROPELLER_CLANG if X86_64 select ARCH_USE_BUILTIN_BSWAP select ARCH_USE_CMPXCHG_LOCKREF if X86_CMPXCHG64 select ARCH_USE_MEMTEST --2.47.0.338.g60cca15819-goog
Re: [PATCH 2/2] Propeller: Remove the architecture specific config
In reply to Rong XuQuoted 8 lines · Rong Xu
The
CONFIG_PROPELLER_CLANGoption currently depends onARCH_SUPPORTS_PROPELLER_CLANG, but this dependency seems unnecessary.Remove
ARCH_SUPPORTS_PROPELLER_CLANGand allow users to control Propeller builds solely throughCONFIG_PROPELLER_CLANG. This simplifies the kconfig and avoids potential confusion.Signed-off-by Rong Xu <[email protected]>
With Nathan's question answered, this looks good to me:
Signature · 1 line
Kees Cook
Quoted 7 lines · Rong Xu
The
CONFIG_AUTOFDO_CLANGoption currently depends onARCH_SUPPORTS_AUTOFDO_CLANG, but this dependency seems unnecessary.Remove
ARCH_SUPPORTS_AUTOFDO_CLANGand allow users to control AutoFDO builds solely throughCONFIG_AUTOFDO_CLANG. This simplifies the kconfig and avoids potential confusion.
Quoted 6 lines
Signed-off-by Rong Xu <[email protected]>Suggested-by Will Deacon <[email protected]>--- arch/Kconfig | 4 ---- arch/x86/Kconfig | 1 - 2 files changed, 5 deletions(-)
However, you've dropped the previous hunk you had to Documentation/dev-tools/autofdo.rst which had some text about using ETM to collect fdo data on arm64. It seems like that might still be useful to have?
Will
Thanks for the Acked-by.
Regarding the ETM documentation change, I haven't forgotten it. I think it's best for Yabin to submit another patch (or revision of his previous patch), as he has done all the ETM side work.
Best regards,
-Rong
Quoted 24 lines · Will Deacon
Quoted 7 lines · Rong Xu
The
CONFIG_AUTOFDO_CLANGoption currently depends onARCH_SUPPORTS_AUTOFDO_CLANG, but this dependency seems unnecessary.Remove
ARCH_SUPPORTS_AUTOFDO_CLANGand allow users to control AutoFDO builds solely throughCONFIG_AUTOFDO_CLANG. This simplifies the kconfig and avoids potential confusion.Quoted 6 lines
Signed-off-by Rong Xu <[email protected]>Suggested-by Will Deacon <[email protected]>--- arch/Kconfig | 4 ---- arch/x86/Kconfig | 1 - 2 files changed, 5 deletions(-)Acked-by Will Deacon <[email protected]>However, you've dropped the previous hunk you had to
Documentation/dev-tools/autofdo.rstwhich had some text about using ETM to collect fdo data on arm64. It seems like that might still be useful to have?Will
Yabin Cui
Tested-byHi Rong,
Thanks for the patch! Sorry for the delay in testing it. I will upload another patch to document steps for using ETM.
Thanks,
Yabin
Quoted 36 lines · Rong Xu
Thanks for the Acked-by.
Regarding the ETM documentation change, I haven't forgotten it. I think it's best for Yabin to submit another patch (or revision of his previous patch), as he has done all the ETM side work.
Best regards,
-Rong
Quoted 24 lines · Will Deacon
Quoted 7 lines · Rong Xu
The
CONFIG_AUTOFDO_CLANGoption currently depends onARCH_SUPPORTS_AUTOFDO_CLANG, but this dependency seems unnecessary.Remove
ARCH_SUPPORTS_AUTOFDO_CLANGand allow users to control AutoFDO builds solely throughCONFIG_AUTOFDO_CLANG. This simplifies the kconfig and avoids potential confusion.Quoted 6 lines
Signed-off-by Rong Xu <[email protected]>Suggested-by Will Deacon <[email protected]>--- arch/Kconfig | 4 ---- arch/x86/Kconfig | 1 - 2 files changed, 5 deletions(-)Acked-by Will Deacon <[email protected]>However, you've dropped the previous hunk you had to
Documentation/dev-tools/autofdo.rstwhich had some text about using ETM to collect fdo data on arm64. It seems like that might still be useful to have?Will
Quoted 8 lines · Rong Xu
The
CONFIG_AUTOFDO_CLANGoption currently depends onARCH_SUPPORTS_AUTOFDO_CLANG, but this dependency seems unnecessary.Remove
ARCH_SUPPORTS_AUTOFDO_CLANGand allow users to control AutoFDO builds solely throughCONFIG_AUTOFDO_CLANG. This simplifies the kconfig and avoids potential confusion.Signed-off-by Rong Xu <[email protected]>
Looks right to me!
Signature · 1 line
Kees Cook