linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Huacai Chen <chenhuacai@kernel.org>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>,
	Philip Li <philip.li@intel.com>,
	 kernel test robot <lkp@intel.com>,
	Guenter Roeck <linux@roeck-us.net>,
	oe-kbuild-all@lists.linux.dev,
	 Andrew Morton <akpm@linux-foundation.org>,
	 Linux Memory Management List <linux-mm@kvack.org>,
	Alessandro Carminati <acarmina@redhat.com>,
	 Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org,  loongarch@lists.linux.dev
Subject: Re: [linux-next:master 12681/13861] drivers/i2c/i2c-core-base.o: warning: objtool: __i2c_transfer+0x120: stack state mismatch: reg1[24]=-1+0 reg2[24]=-2-24
Date: Thu, 3 Apr 2025 17:40:26 +0800	[thread overview]
Message-ID: <CAAhV-H5iwFS15GU-_aPJSK8FzkxL-=eDJa+TW48QW1PC6RQxrQ@mail.gmail.com> (raw)
In-Reply-To: <348cdb14-f8cf-1e7b-44b2-79dc4dda4e35@loongson.cn>

On Thu, Apr 3, 2025 at 5:36 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> On 04/02/2025 03:45 AM, Josh Poimboeuf wrote:
> > On Tue, Apr 01, 2025 at 12:38:37PM +0800, Philip Li wrote:
> >> On Tue, Apr 01, 2025 at 10:44:57AM +0800, kernel test robot wrote:
> >>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> >>> head:   405e2241def89c88f008dcb899eb5b6d4be8b43c
> >>> commit: 9016dad4dca4bbe61c48ffd5a273cad980caa0d1 [12681/13861] loongarch: add support for suppressing warning backtraces
> >>> config: loongarch-randconfig-001-20250401 (https://download.01.org/0day-ci/archive/20250401/202504011011.jyZ6NtXx-lkp@intel.com/config)
> >>> compiler: loongarch64-linux-gcc (GCC) 14.2.0
> >>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250401/202504011011.jyZ6NtXx-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/202504011011.jyZ6NtXx-lkp@intel.com/
> >>>
> >>> All warnings (new ones prefixed by >>):
> >>>
> >>>>> drivers/i2c/i2c-core-base.o: warning: objtool: __i2c_transfer+0x120: stack state mismatch: reg1[24]=-1+0 reg2[24]=-2-24
> >
> > Tiezhu, this looks like a loongarch GCC bug with asm goto, or am I
> > confused?  See analysis below.
>
> This is related with GCC optimization "-fshrink-wrap" which is default y
> on LoongArch, use "-fno-shrink-wrap" can avoid such issues, like this:
>
> ---8<---
>
> diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
> index 0304eabbe606..2d5529322357 100644
> --- a/arch/loongarch/Makefile
> +++ b/arch/loongarch/Makefile
> @@ -106,6 +106,7 @@ KBUILD_CFLAGS                       +=
> -mannotate-tablejump
>   else
>   KBUILD_CFLAGS                  += -fno-jump-tables # keep
> compatibility with older compilers
>   endif
> +KBUILD_CFLAGS                  += -fno-shrink-wrap
>   endif
>
>   KBUILD_RUSTFLAGS               +=
> --target=loongarch64-unknown-none-softfloat -Ccode-model=small
>
> If you are OK with this change, I will send a formal patch after the
> merge window.
Is this the same problem solved by the commit below?

https://web.git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=objtool/urgent&id=7c977393b8277ed319e92e4b598b26598c9d30c0

Huacai

>
> Thanks,
> Tiezhu
>
>


  reply	other threads:[~2025-04-03  9:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01  2:44 kernel test robot
2025-04-01  4:38 ` Philip Li
2025-04-01 19:45   ` Josh Poimboeuf
2025-04-03  9:35     ` Tiezhu Yang
2025-04-03  9:40       ` Huacai Chen [this message]
2025-04-03 14:37       ` Josh Poimboeuf
2025-04-07 10:52         ` Tiezhu Yang
2025-04-08  1:23           ` Josh Poimboeuf
2025-04-08  2:45             ` Tiezhu Yang
2025-04-08  6:29               ` Josh Poimboeuf
2025-04-08  9:32                 ` Tiezhu Yang

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='CAAhV-H5iwFS15GU-_aPJSK8FzkxL-=eDJa+TW48QW1PC6RQxrQ@mail.gmail.com' \
    --to=chenhuacai@kernel.org \
    --cc=acarmina@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@roeck-us.net \
    --cc=lkp@intel.com \
    --cc=loongarch@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=peterz@infradead.org \
    --cc=philip.li@intel.com \
    --cc=yangtiezhu@loongson.cn \
    /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