From: Heng Qi <hengqi@linux.alibaba.com>
To: Xi Ruoyao <xry111@xry111.site>
Cc: Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Youling Tang <tangyouling@kylinos.cn>,
Jinyang He <hejinyang@loongson.cn>,
loongarch@lists.linux.dev, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, mengqinggang@loongson.cn,
cailulu@loongson.cn, wanglei@loongson.cn, luweining@loongson.cn,
Yujie Liu <yujie.liu@intel.com>, Tejun Heo <tj@kernel.org>,
Xi Ruoyao <xry111@xry111.site>,
Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>,
Tiezhu Yang <yangtiezhu@loongson.cn>
Subject: Re: [PATCH] loongarch: Only select HAVE_OBJTOOL and allow ORC unwinder if the inline assembler supports R_LARCH_{32,64}_PCREL
Date: Wed, 5 Jun 2024 10:04:18 +0800 [thread overview]
Message-ID: <1717553058.033336-2-hengqi@linux.alibaba.com> (raw)
In-Reply-To: <20240604150741.30252-1-xry111@xry111.site>
On Tue, 4 Jun 2024 23:07:41 +0800, Xi Ruoyao <xry111@xry111.site> wrote:
> GAS <= 2.41 does not support generating R_LARCH_{32,64}_PCREL for
> "label - ." and it generates R_LARCH_{ADD,SUB}{32,64} pairs instead.
> objtool cannot handle R_LARCH_{ADD,SUB}{32,64} pair in __jump_table
> (static key implementation) and etc. so it will produce some warnings.
> This is causing the kernel CI systems to complain everywhere.
>
> For GAS we can check if -mthin-add-sub option is available to know if
> R_LARCH_{32,64}_PCREL are supported.
>
> For Clang, we require Clang >= 18 and Clang >= 17 already supports
> R_LARCH_{32,64}_PCREL, so we can always assume Clang is fine for
> objtool.
>
> Note that __jump_table is not generated by the compiler so
> -fno-jump-table is completely irrelevant for this issue.
>
Hi Xi Ruoyao,
I want to know does this patch fix the following warning:
https://lore.kernel.org/all/202406040645.6z95FW1f-lkp@intel.com/ ?
Thanks.
> Fixes: cb8a2ef0848c ("LoongArch: Add ORC stack unwinder support")
> Closes: https://lore.kernel.org/loongarch/Zl5m1ZlVmGKitAof@yujie-X299/
> Closes: https://lore.kernel.org/loongarch/ZlY1gDDPi_mNrwJ1@slm.duckdns.org/
> Closes: https://lore.kernel.org/loongarch/1717478006.038663-1-hengqi@linux.alibaba.com/
> Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=816029e06768
> Link: https://github.com/llvm/llvm-project/commit/42cb3c6346fc
> Signed-off-by: Xi Ruoyao <xry111@xry111.site>
> ---
> arch/loongarch/Kconfig | 5 ++++-
> arch/loongarch/Kconfig.debug | 1 +
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
> index e38139c576ee..e461a6c59f15 100644
> --- a/arch/loongarch/Kconfig
> +++ b/arch/loongarch/Kconfig
> @@ -143,7 +143,7 @@ config LOONGARCH
> select HAVE_LIVEPATCH
> select HAVE_MOD_ARCH_SPECIFIC
> select HAVE_NMI
> - select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS
> + select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS && AS_HAS_THIN_ADD_SUB
> select HAVE_PCI
> select HAVE_PERF_EVENTS
> select HAVE_PERF_REGS
> @@ -273,6 +273,9 @@ config AS_HAS_LBT_EXTENSION
> config AS_HAS_LVZ_EXTENSION
> def_bool $(as-instr,hvcl 0)
>
> +config AS_HAS_THIN_ADD_SUB
> + def_bool $(cc-option,-Wa$(comma)-mthin-add-sub) || CC_IS_CLANG
> +
> menu "Kernel type and options"
>
> source "kernel/Kconfig.hz"
> diff --git a/arch/loongarch/Kconfig.debug b/arch/loongarch/Kconfig.debug
> index 98d60630c3d4..8b2ce5b5d43e 100644
> --- a/arch/loongarch/Kconfig.debug
> +++ b/arch/loongarch/Kconfig.debug
> @@ -28,6 +28,7 @@ config UNWINDER_PROLOGUE
>
> config UNWINDER_ORC
> bool "ORC unwinder"
> + depends on HAVE_OBJTOOL
> select OBJTOOL
> help
> This option enables the ORC (Oops Rewind Capability) unwinder for
> --
> 2.45.2
>
next prev parent reply other threads:[~2024-06-05 2:06 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 15:07 Xi Ruoyao
2024-06-05 1:52 ` Huacai Chen
2024-06-05 4:38 ` Xi Ruoyao
2024-06-05 5:21 ` Huacai Chen
2024-06-05 5:25 ` Xi Ruoyao
2024-06-05 2:04 ` Heng Qi [this message]
2024-06-05 5:43 ` Nathan Chancellor
2024-06-05 5:54 ` Xi Ruoyao
2024-06-05 6:25 ` Nathan Chancellor
2024-06-05 10:57 ` Xi Ruoyao
2024-06-05 13:18 ` Xi Ruoyao
2024-06-05 15:13 ` Xi Ruoyao
2024-06-05 15:47 ` Jinyang He
2024-06-05 19:05 ` Xi Ruoyao
2024-06-06 2:10 ` Jinyang He
2024-06-07 5:42 ` Xi Ruoyao
2024-06-07 7:14 ` Jinyang He
2024-06-07 8:29 ` Xi Ruoyao
2024-06-15 8:45 ` Huacai Chen
2024-06-15 8:53 ` Xi Ruoyao
2024-06-15 9:33 ` Huacai Chen
2024-06-15 10:22 ` Xi Ruoyao
2024-06-17 13:11 ` Huacai Chen
2024-06-17 13:38 ` Xi Ruoyao
2024-06-17 13:47 ` Huacai Chen
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=1717553058.033336-2-hengqi@linux.alibaba.com \
--to=hengqi@linux.alibaba.com \
--cc=cailulu@loongson.cn \
--cc=chenhuacai@kernel.org \
--cc=hejinyang@loongson.cn \
--cc=justinstitt@google.com \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=loongarch@lists.linux.dev \
--cc=luweining@loongson.cn \
--cc=mengqinggang@loongson.cn \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=tangyouling@kylinos.cn \
--cc=tj@kernel.org \
--cc=wanglei@loongson.cn \
--cc=xry111@xry111.site \
--cc=yangtiezhu@loongson.cn \
--cc=yujie.liu@intel.com \
/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
all inboxes | Powered by JetHome®