* Re: [PATCH v5 3/7] Change the symbols order when --ffunction-sections is enabled [not found] <20241023224409.201771-4-xur@google.com> @ 2024-10-25 6:47 ` kernel test robot 2024-10-25 18:14 ` Rong Xu 0 siblings, 1 reply; 4+ messages in thread From: kernel test robot @ 2024-10-25 6:47 UTC (permalink / raw) To: Rong Xu, Alice Ryhl, Andrew Morton, Arnd Bergmann, Bill Wendling, Borislav Petkov, Breno Leitao, Brian Gerst, Dave Hansen, David Li, Han Shen, Heiko Carstens, H. Peter Anvin, Ingo Molnar, Jann Horn, Jonathan Corbet, Josh Poimboeuf, Juergen Gross, Justin Stitt, Kees Cook, Masahiro Yamada, Mike Rapoport (IBM), Nathan Chancellor, Nick Desaulniers, Nicolas Schier, Paul E. McKenney, Peter Zijlstra, Sami Tolvanen, Thomas Gleixner Cc: oe-kbuild-all, Linux Memory Management List Hi Rong, kernel test robot noticed the following build errors: [auto build test ERROR on eb952c47d154ba2aac794b99c66c3c45eb4cc4ec] url: https://github.com/intel-lab-lkp/linux/commits/Rong-Xu/Add-AutoFDO-support-for-Clang-build/20241024-064725 base: eb952c47d154ba2aac794b99c66c3c45eb4cc4ec patch link: https://lore.kernel.org/r/20241023224409.201771-4-xur%40google.com patch subject: [PATCH v5 3/7] Change the symbols order when --ffunction-sections is enabled config: sparc-sparc64_defconfig (https://download.01.org/0day-ci/archive/20241025/202410251411.eRNArTOZ-lkp@intel.com/config) compiler: sparc64-linux-gcc (GCC) 13.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241025/202410251411.eRNArTOZ-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202410251411.eRNArTOZ-lkp@intel.com/ All errors (new ones prefixed by >>): >> sparc64-linux-ld: Error: sparc64 early assembler too large -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v5 3/7] Change the symbols order when --ffunction-sections is enabled 2024-10-25 6:47 ` [PATCH v5 3/7] Change the symbols order when --ffunction-sections is enabled kernel test robot @ 2024-10-25 18:14 ` Rong Xu 2024-10-26 0:27 ` Rong Xu 0 siblings, 1 reply; 4+ messages in thread From: Rong Xu @ 2024-10-25 18:14 UTC (permalink / raw) To: kernel test robot, Masahiro Yamada Cc: Alice Ryhl, Andrew Morton, Arnd Bergmann, Bill Wendling, Borislav Petkov, Breno Leitao, Brian Gerst, Dave Hansen, David Li, Han Shen, Heiko Carstens, H. Peter Anvin, Ingo Molnar, Jann Horn, Jonathan Corbet, Josh Poimboeuf, Juergen Gross, Justin Stitt, Kees Cook, Mike Rapoport (IBM), Nathan Chancellor, Nick Desaulniers, Nicolas Schier, Paul E. McKenney, Peter Zijlstra, Sami Tolvanen, Thomas Gleixner, oe-kbuild-all, Linux Memory Management List I can reproduce the build error. The reason for the error is because in CONFIG_SPARC64, the symbol swapper_tsb needs to have a fixed address of 0x0000000000408000. In arch/sparc/kernel/vmlinux.lds.S 37 #ifdef CONFIG_SPARC64 38 ASSERT((swapper_tsb == 0x0000000000408000), "Error: sparc64 early assembler too large") 39 #endif This symbol resides in the .text section. The patch relocates "cold" functions (tagged by .text.unlikely) to precede other symbols within the .text section. This pushes swapper_tsb to a higher memory address, and we have the assertion. However, this sparc code appears incompatible with the original linker script. The original script prioritized .text.hot symbols, placing them before others in the .text section. Currently, no functions are marked as "hot" in the source code. If a function were marked with __attribute__((hot)), the build would also fail. I don't know a good solution other than adding a branch to the include/asm-generic/vmlinux.lds.h. @Masahiro Yamada: I'd appreciate any further suggestions you might have. Best regards, -Rong On Thu, Oct 24, 2024 at 11:47 PM kernel test robot <lkp@intel.com> wrote: > > Hi Rong, > > kernel test robot noticed the following build errors: > > [auto build test ERROR on eb952c47d154ba2aac794b99c66c3c45eb4cc4ec] > > url: https://github.com/intel-lab-lkp/linux/commits/Rong-Xu/Add-AutoFDO-support-for-Clang-build/20241024-064725 > base: eb952c47d154ba2aac794b99c66c3c45eb4cc4ec > patch link: https://lore.kernel.org/r/20241023224409.201771-4-xur%40google.com > patch subject: [PATCH v5 3/7] Change the symbols order when --ffunction-sections is enabled > config: sparc-sparc64_defconfig (https://download.01.org/0day-ci/archive/20241025/202410251411.eRNArTOZ-lkp@intel.com/config) > compiler: sparc64-linux-gcc (GCC) 13.3.0 > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241025/202410251411.eRNArTOZ-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot <lkp@intel.com> > | Closes: https://lore.kernel.org/oe-kbuild-all/202410251411.eRNArTOZ-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > >> sparc64-linux-ld: Error: sparc64 early assembler too large > > -- > 0-DAY CI Kernel Test Service > https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v5 3/7] Change the symbols order when --ffunction-sections is enabled 2024-10-25 18:14 ` Rong Xu @ 2024-10-26 0:27 ` Rong Xu 2024-10-26 5:17 ` Rong Xu 0 siblings, 1 reply; 4+ messages in thread From: Rong Xu @ 2024-10-26 0:27 UTC (permalink / raw) To: kernel test robot, Masahiro Yamada Cc: Alice Ryhl, Andrew Morton, Arnd Bergmann, Bill Wendling, Borislav Petkov, Breno Leitao, Brian Gerst, Dave Hansen, David Li, Han Shen, Heiko Carstens, H. Peter Anvin, Ingo Molnar, Jann Horn, Jonathan Corbet, Josh Poimboeuf, Juergen Gross, Justin Stitt, Kees Cook, Mike Rapoport (IBM), Nathan Chancellor, Nick Desaulniers, Nicolas Schier, Paul E. McKenney, Peter Zijlstra, Sami Tolvanen, Thomas Gleixner, oe-kbuild-all, Linux Memory Management List OK. Here is a simple fix to the issue. diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S index d317a843f7ea9..f1b86eb303404 100644 --- a/arch/sparc/kernel/vmlinux.lds.S +++ b/arch/sparc/kernel/vmlinux.lds.S @@ -48,6 +48,11 @@ SECTIONS { _text = .; HEAD_TEXT + ALIGN_FUNCTION(); +#ifdef CONFIG_SPARC64 + /* Match text section symbols in head_64.S first */ + *head_64.o(.text) +#endif TEXT_TEXT SCHED_TEXT LOCK_TEXT If this is OK, I'll send the updated patch. -Rong On Fri, Oct 25, 2024 at 11:14 AM Rong Xu <xur@google.com> wrote: > > I can reproduce the build error. > > The reason for the error is because in CONFIG_SPARC64, the symbol > swapper_tsb needs to have a fixed address of 0x0000000000408000. > > In arch/sparc/kernel/vmlinux.lds.S > 37 #ifdef CONFIG_SPARC64 > 38 ASSERT((swapper_tsb == 0x0000000000408000), "Error: sparc64 early > assembler too large") > 39 #endif > > This symbol resides in the .text section. The patch relocates "cold" > functions (tagged by .text.unlikely) to precede other symbols within > the .text section. This pushes swapper_tsb to a higher memory address, > and we have the assertion. > > However, this sparc code appears incompatible with the original linker > script. The original script prioritized .text.hot symbols, placing > them before others in the .text section. Currently, no functions are > marked as "hot" in the source code. If a function were marked with > __attribute__((hot)), the build would also fail. > > I don't know a good solution other than adding a branch to the > include/asm-generic/vmlinux.lds.h. > > @Masahiro Yamada: I'd appreciate any further suggestions you might have. > > Best regards, > > -Rong > > On Thu, Oct 24, 2024 at 11:47 PM kernel test robot <lkp@intel.com> wrote: > > > > Hi Rong, > > > > kernel test robot noticed the following build errors: > > > > [auto build test ERROR on eb952c47d154ba2aac794b99c66c3c45eb4cc4ec] > > > > url: https://github.com/intel-lab-lkp/linux/commits/Rong-Xu/Add-AutoFDO-support-for-Clang-build/20241024-064725 > > base: eb952c47d154ba2aac794b99c66c3c45eb4cc4ec > > patch link: https://lore.kernel.org/r/20241023224409.201771-4-xur%40google.com > > patch subject: [PATCH v5 3/7] Change the symbols order when --ffunction-sections is enabled > > config: sparc-sparc64_defconfig (https://download.01.org/0day-ci/archive/20241025/202410251411.eRNArTOZ-lkp@intel.com/config) > > compiler: sparc64-linux-gcc (GCC) 13.3.0 > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241025/202410251411.eRNArTOZ-lkp@intel.com/reproduce) > > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > > the same patch/commit), kindly add following tags > > | Reported-by: kernel test robot <lkp@intel.com> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202410251411.eRNArTOZ-lkp@intel.com/ > > > > All errors (new ones prefixed by >>): > > > > >> sparc64-linux-ld: Error: sparc64 early assembler too large > > > > -- > > 0-DAY CI Kernel Test Service > > https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v5 3/7] Change the symbols order when --ffunction-sections is enabled 2024-10-26 0:27 ` Rong Xu @ 2024-10-26 5:17 ` Rong Xu 0 siblings, 0 replies; 4+ messages in thread From: Rong Xu @ 2024-10-26 5:17 UTC (permalink / raw) To: kernel test robot, Masahiro Yamada Cc: Alice Ryhl, Andrew Morton, Arnd Bergmann, Bill Wendling, Borislav Petkov, Breno Leitao, Brian Gerst, Dave Hansen, David Li, Han Shen, Heiko Carstens, H. Peter Anvin, Ingo Molnar, Jann Horn, Jonathan Corbet, Josh Poimboeuf, Juergen Gross, Justin Stitt, Kees Cook, Mike Rapoport (IBM), Nathan Chancellor, Nick Desaulniers, Nicolas Schier, Paul E. McKenney, Peter Zijlstra, Sami Tolvanen, Thomas Gleixner, oe-kbuild-all, Linux Memory Management List The fix is now included in v6 of the patch series for review. On Fri, Oct 25, 2024 at 5:27 PM Rong Xu <xur@google.com> wrote: > > OK. Here is a simple fix to the issue. > > diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S > index d317a843f7ea9..f1b86eb303404 100644 > --- a/arch/sparc/kernel/vmlinux.lds.S > +++ b/arch/sparc/kernel/vmlinux.lds.S > @@ -48,6 +48,11 @@ SECTIONS > { > _text = .; > HEAD_TEXT > + ALIGN_FUNCTION(); > +#ifdef CONFIG_SPARC64 > + /* Match text section symbols in head_64.S first */ > + *head_64.o(.text) > +#endif > TEXT_TEXT > SCHED_TEXT > LOCK_TEXT > > If this is OK, I'll send the updated patch. > > -Rong > > On Fri, Oct 25, 2024 at 11:14 AM Rong Xu <xur@google.com> wrote: > > > > I can reproduce the build error. > > > > The reason for the error is because in CONFIG_SPARC64, the symbol > > swapper_tsb needs to have a fixed address of 0x0000000000408000. > > > > In arch/sparc/kernel/vmlinux.lds.S > > 37 #ifdef CONFIG_SPARC64 > > 38 ASSERT((swapper_tsb == 0x0000000000408000), "Error: sparc64 early > > assembler too large") > > 39 #endif > > > > This symbol resides in the .text section. The patch relocates "cold" > > functions (tagged by .text.unlikely) to precede other symbols within > > the .text section. This pushes swapper_tsb to a higher memory address, > > and we have the assertion. > > > > However, this sparc code appears incompatible with the original linker > > script. The original script prioritized .text.hot symbols, placing > > them before others in the .text section. Currently, no functions are > > marked as "hot" in the source code. If a function were marked with > > __attribute__((hot)), the build would also fail. > > > > I don't know a good solution other than adding a branch to the > > include/asm-generic/vmlinux.lds.h. > > > > @Masahiro Yamada: I'd appreciate any further suggestions you might have. > > > > Best regards, > > > > -Rong > > > > On Thu, Oct 24, 2024 at 11:47 PM kernel test robot <lkp@intel.com> wrote: > > > > > > Hi Rong, > > > > > > kernel test robot noticed the following build errors: > > > > > > [auto build test ERROR on eb952c47d154ba2aac794b99c66c3c45eb4cc4ec] > > > > > > url: https://github.com/intel-lab-lkp/linux/commits/Rong-Xu/Add-AutoFDO-support-for-Clang-build/20241024-064725 > > > base: eb952c47d154ba2aac794b99c66c3c45eb4cc4ec > > > patch link: https://lore.kernel.org/r/20241023224409.201771-4-xur%40google.com > > > patch subject: [PATCH v5 3/7] Change the symbols order when --ffunction-sections is enabled > > > config: sparc-sparc64_defconfig (https://download.01.org/0day-ci/archive/20241025/202410251411.eRNArTOZ-lkp@intel.com/config) > > > compiler: sparc64-linux-gcc (GCC) 13.3.0 > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241025/202410251411.eRNArTOZ-lkp@intel.com/reproduce) > > > > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > > > the same patch/commit), kindly add following tags > > > | Reported-by: kernel test robot <lkp@intel.com> > > > | Closes: https://lore.kernel.org/oe-kbuild-all/202410251411.eRNArTOZ-lkp@intel.com/ > > > > > > All errors (new ones prefixed by >>): > > > > > > >> sparc64-linux-ld: Error: sparc64 early assembler too large > > > > > > -- > > > 0-DAY CI Kernel Test Service > > > https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-26 5:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20241023224409.201771-4-xur@google.com>
2024-10-25 6:47 ` [PATCH v5 3/7] Change the symbols order when --ffunction-sections is enabled kernel test robot
2024-10-25 18:14 ` Rong Xu
2024-10-26 0:27 ` Rong Xu
2024-10-26 5:17 ` Rong Xu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox