linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rong Xu <xur@google.com>
To: kernel test robot <lkp@intel.com>,
	Masahiro Yamada <masahiroy@kernel.org>
Cc: Alice Ryhl <aliceryhl@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Arnd Bergmann <arnd@arndb.de>, Bill Wendling <morbo@google.com>,
	Borislav Petkov <bp@alien8.de>,  Breno Leitao <leitao@debian.org>,
	Brian Gerst <brgerst@gmail.com>,
	 Dave Hansen <dave.hansen@linux.intel.com>,
	David Li <davidxl@google.com>,  Han Shen <shenhan@google.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	"H. Peter Anvin" <hpa@zytor.com>,  Ingo Molnar <mingo@redhat.com>,
	Jann Horn <jannh@google.com>, Jonathan Corbet <corbet@lwn.net>,
	 Josh Poimboeuf <jpoimboe@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	 Justin Stitt <justinstitt@google.com>,
	Kees Cook <kees@kernel.org>,
	 "Mike Rapoport (IBM)" <rppt@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	 Nick Desaulniers <ndesaulniers@google.com>,
	Nicolas Schier <nicolas@fjasle.eu>,
	 "Paul E. McKenney" <paulmck@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	 Sami Tolvanen <samitolvanen@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	 oe-kbuild-all@lists.linux.dev,
	 Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH v5 3/7] Change the symbols order when --ffunction-sections is enabled
Date: Fri, 25 Oct 2024 17:27:04 -0700	[thread overview]
Message-ID: <CAF1bQ=SLkmVaQ_J8FnM145Y3-65-7DuAwd-OPF1iOhtMtHg0WQ@mail.gmail.com> (raw)
In-Reply-To: <CAF1bQ=RmUbPGro2c+0mukG7PjP4OMgZEqjmfRnOudt_N12vzvA@mail.gmail.com>

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


  reply	other threads:[~2024-10-26  0:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20241023224409.201771-4-xur@google.com>
2024-10-25  6:47 ` kernel test robot
2024-10-25 18:14   ` Rong Xu
2024-10-26  0:27     ` Rong Xu [this message]
2024-10-26  5:17       ` Rong Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAF1bQ=SLkmVaQ_J8FnM145Y3-65-7DuAwd-OPF1iOhtMtHg0WQ@mail.gmail.com' \
    --to=xur@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=aliceryhl@google.com \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=davidxl@google.com \
    --cc=hca@linux.ibm.com \
    --cc=hpa@zytor.com \
    --cc=jannh@google.com \
    --cc=jgross@suse.com \
    --cc=jpoimboe@kernel.org \
    --cc=justinstitt@google.com \
    --cc=kees@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=masahiroy@kernel.org \
    --cc=mingo@redhat.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rppt@kernel.org \
    --cc=samitolvanen@google.com \
    --cc=shenhan@google.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox