All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [linux-next:master 3857/7963] arch/x86/crypto/sm4-aesni-avx-asm_64.o: warning: objtool: sm4_aesni_avx_crypt8()+0x8: sibling call from callable instruction with modified stack frame
Date: Mon, 20 Sep 2021 13:02:07 +0200	[thread overview]
Message-ID: <CAK8P3a3qhfxUC-7y-_q35-tNrs2L93htjuVzSukqZO0hDhOAuw@mail.gmail.com> (raw)
In-Reply-To: <202108160330.T1EbbpCi-lkp@intel.com>

On Sun, Aug 15, 2021 at 9:41 PM kernel test robot <lkp@intel.com> wrote:
>
> CC: Linux Memory Management List <linux-mm@kvack.org>
> TO: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
> CC: Herbert Xu <herbert@gondor.apana.org.au>
>
> Hi Tianjia,
>
> First bad commit (maybe != root cause):
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   4b358aabb93a2c654cd1dcab1a25a589f6e2b153
> commit: a7ee22ee1445c7fdb00ab80116bb9710ca86a860 [3857/7963] crypto: x86/sm4 - add AES-NI/AVX/x86_64 implementation
> config: x86_64-randconfig-r024-20210816 (attached as .config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 7776b19eed44906e9973bfb240b6279d6feaab41)
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a7ee22ee1445c7fdb00ab80116bb9710ca86a860
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout a7ee22ee1445c7fdb00ab80116bb9710ca86a860
>         # save the attached .config to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> >> arch/x86/crypto/sm4-aesni-avx-asm_64.o: warning: objtool: sm4_aesni_avx_crypt8()+0x8: sibling call from callable instruction with modified stack frame

I see the same thing in my randconfig builds using gcc. This is an
assembler file,
my interpretation is that objtool has found an actual code bug:

.macro FRAME_BEGIN
        push %_ASM_BP
        _ASM_MOV %_ASM_SP, %_ASM_BP
.endm
.macro FRAME_END
        pop %_ASM_BP
.endm

SYM_FUNC_START(sm4_aesni_avx_crypt8)
        /* input:
         *      %rdi: round key array, CTX
         *      %rsi: dst (1..8 blocks)
         *      %rdx: src (1..8 blocks)
         *      %rcx: num blocks (1..8)
         */
        FRAME_BEGIN

        cmpq $5, %rcx;
        jb sm4_aesni_avx_crypt4;
        ....

SYM_FUNC_START(sm4_aesni_avx_crypt4)
        /* input:
         *      %rdi: round key array, CTX
         *      %rsi: dst (1..4 blocks)
         *      %rdx: src (1..4 blocks)
         *      %rcx: num blocks (1..4)
         */
        FRAME_BEGIN
        ...
        FRAME_END
        ret;
SYM_FUNC_END(sm4_aesni_avx_crypt4)


sm4_aesni_avx_crypt8() starts a frame and conditionally branches to
sm4_aesni_avx_crypt4(), which starts another frame and returns from
that without cleaning up the parent frame.

        Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@kernel.org>
To: kbuild-all@lists.01.org
Subject: Re: [linux-next:master 3857/7963] arch/x86/crypto/sm4-aesni-avx-asm_64.o: warning: objtool: sm4_aesni_avx_crypt8()+0x8: sibling call from callable instruction with modified stack frame
Date: Mon, 20 Sep 2021 13:02:07 +0200	[thread overview]
Message-ID: <CAK8P3a3qhfxUC-7y-_q35-tNrs2L93htjuVzSukqZO0hDhOAuw@mail.gmail.com> (raw)
In-Reply-To: <202108160330.T1EbbpCi-lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2968 bytes --]

On Sun, Aug 15, 2021 at 9:41 PM kernel test robot <lkp@intel.com> wrote:
>
> CC: Linux Memory Management List <linux-mm@kvack.org>
> TO: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
> CC: Herbert Xu <herbert@gondor.apana.org.au>
>
> Hi Tianjia,
>
> First bad commit (maybe != root cause):
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   4b358aabb93a2c654cd1dcab1a25a589f6e2b153
> commit: a7ee22ee1445c7fdb00ab80116bb9710ca86a860 [3857/7963] crypto: x86/sm4 - add AES-NI/AVX/x86_64 implementation
> config: x86_64-randconfig-r024-20210816 (attached as .config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 7776b19eed44906e9973bfb240b6279d6feaab41)
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a7ee22ee1445c7fdb00ab80116bb9710ca86a860
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout a7ee22ee1445c7fdb00ab80116bb9710ca86a860
>         # save the attached .config to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> >> arch/x86/crypto/sm4-aesni-avx-asm_64.o: warning: objtool: sm4_aesni_avx_crypt8()+0x8: sibling call from callable instruction with modified stack frame

I see the same thing in my randconfig builds using gcc. This is an
assembler file,
my interpretation is that objtool has found an actual code bug:

.macro FRAME_BEGIN
        push %_ASM_BP
        _ASM_MOV %_ASM_SP, %_ASM_BP
.endm
.macro FRAME_END
        pop %_ASM_BP
.endm

SYM_FUNC_START(sm4_aesni_avx_crypt8)
        /* input:
         *      %rdi: round key array, CTX
         *      %rsi: dst (1..8 blocks)
         *      %rdx: src (1..8 blocks)
         *      %rcx: num blocks (1..8)
         */
        FRAME_BEGIN

        cmpq $5, %rcx;
        jb sm4_aesni_avx_crypt4;
        ....

SYM_FUNC_START(sm4_aesni_avx_crypt4)
        /* input:
         *      %rdi: round key array, CTX
         *      %rsi: dst (1..4 blocks)
         *      %rdx: src (1..4 blocks)
         *      %rcx: num blocks (1..4)
         */
        FRAME_BEGIN
        ...
        FRAME_END
        ret;
SYM_FUNC_END(sm4_aesni_avx_crypt4)


sm4_aesni_avx_crypt8() starts a frame and conditionally branches to
sm4_aesni_avx_crypt4(), which starts another frame and returns from
that without cleaning up the parent frame.

        Arnd

  reply	other threads:[~2021-09-20 11:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-15 19:41 [linux-next:master 3857/7963] arch/x86/crypto/sm4-aesni-avx-asm_64.o: warning: objtool: sm4_aesni_avx_crypt8()+0x8: sibling call from callable instruction with modified stack frame kernel test robot
2021-09-20 11:02 ` Arnd Bergmann [this message]
2021-09-20 11:02   ` Arnd Bergmann
2021-09-20 17:56   ` Josh Poimboeuf
2021-09-20 17:56     ` Josh Poimboeuf
2021-09-21  0:56     ` Herbert Xu
2021-09-21  0:56       ` Herbert Xu
2021-09-21  6:56     ` Peter Zijlstra
2021-09-21  6:56       ` Peter Zijlstra
2021-09-22  2:28     ` Tianjia Zhang
2021-09-22  2:28       ` Tianjia Zhang

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=CAK8P3a3qhfxUC-7y-_q35-tNrs2L93htjuVzSukqZO0hDhOAuw@mail.gmail.com \
    --to=arnd@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=jpoimboe@redhat.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=peterz@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.