mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: Jinyang He <hejinyang@loongson.cn>,
	Nathan Chancellor <nathan@kernel.org>,
	 Peter Zijlstra <peterz@infradead.org>,
	WANG Xuerui <kernel@xen0n.name>,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	 Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	 Youling Tang <tangyouling@kylinos.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>,
	 Heng Qi <hengqi@linux.alibaba.com>, Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH] loongarch: Only select HAVE_OBJTOOL and allow ORC unwinder if the inline assembler supports R_LARCH_{32,64}_PCREL
Date: Sat, 15 Jun 2024 16:53:39 +0800	[thread overview]
Message-ID: <a97cd0f2e2cac10253d6b5cdd0ace3db3b220535.camel@xry111.site> (raw)
In-Reply-To: <CAAhV-H5Wz=U4kbX+tXt1qoCr6RaEDkzZXV7B=tgU_8o+X-NtVQ@mail.gmail.com>

On Sat, 2024-06-15 at 16:45 +0800, Huacai Chen wrote:
> Hi, Ruoyao and Jinyang,
> 
> On Fri, Jun 7, 2024 at 4:29 PM Xi Ruoyao <xry111@xry111.site> wrote:
> > 
> > On Fri, 2024-06-07 at 15:14 +0800, Jinyang He wrote:
> > > >      Note: on RISC-V and LoongArch, the stack slot for the previous frame
> > > >      pointer is stored at fp[-2] instead of fp[0]. See [Consider
> > > >      standardising which stack slot fp points
> > > >      to](https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/18)
> > > >      for the RISC-V discussion.
> > > 
> > > In most cases the $fp is saved at cfa-16. But for va args, something
> > > becomes different at LoongArch (I do not know the case of riscv), the
> > > $fp isn't saved at cfa-16. (e.g. printk?)
> > 
> > Oops indeed.  Even with a very simple case:
> > 
> > int sum(int a, int b) {
> >         return a + b;
> > }
> > 
> > with -fno-omit-frame-pointer we get:
> > 
> > sum:
> >         addi.d  $r3,$r3,-16
> >         st.d    $r22,$r3,8
> >         addi.d  $r22,$r3,16
> >         ld.d    $r22,$r3,8
> >         add.w   $r4,$r4,$r5
> >         addi.d  $r3,$r3,16
> >         jr      $r1
> > 
> > So for leaf functions (where we don't save $ra) $fp is saved at cfa-8.
> > 
> > > I feel that the update_cfi_state should be arch specific. I believe
> > > that some logic can be reused, but each arch may have its own logic.
> > 
> > I agree it now.
> What is the conclusion about the clang part now? And for the original
> -mno-thin-add-sub problem, do you have some way to fix it in the root?
> I think we needn't rush, there are some weeks before 6.10 released.

To me for now we should just make OBJTOOL and ORC depend on BROKEN and
backport to stable...

Even if we can fix both the -mno-thin-add-sub problem and the frame
pointer problem in these weeks, they'll be some nontrivial large change
and improper to backport.  Thus we have to admit objtool doesn't really
work for old releases and mark it broken.


-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

  reply	other threads:[~2024-06-15  9:05 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
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 [this message]
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=a97cd0f2e2cac10253d6b5cdd0ace3db3b220535.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=cailulu@loongson.cn \
    --cc=chenhuacai@kernel.org \
    --cc=hejinyang@loongson.cn \
    --cc=hengqi@linux.alibaba.com \
    --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=peterz@infradead.org \
    --cc=tangyouling@kylinos.cn \
    --cc=tj@kernel.org \
    --cc=wanglei@loongson.cn \
    --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®