All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Nathan Chancellor <nathan@kernel.org>
Cc: linux-crypto@vger.kernel.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH] riscv: crypto - Use SYM_FUNC_START for functions only called directly
Date: Fri, 25 Apr 2025 10:48:44 +0800	[thread overview]
Message-ID: <aAr4DFlbPiNKpBmp@gondor.apana.org.au> (raw)
In-Reply-To: <20250424-riscv-crypto-fix-cfi-build-v1-1-2d7516737379@kernel.org>

On Thu, Apr 24, 2025 at 05:23:22PM -0700, Nathan Chancellor wrote:
> After some recent changes to the RISC-V crypto code that turned some
> indirect function calls into direct ones, builds with CONFIG_CFI_CLANG
> fail with:
> 
>   ld.lld: error: undefined symbol: __kcfi_typeid_sm3_transform_zvksh_zvkb
>   >>> referenced by arch/riscv/crypto/sm3-riscv64-zvksh-zvkb.o:(.text+0x2) in archive vmlinux.a
> 
>   ld.lld: error: undefined symbol: __kcfi_typeid_sha512_transform_zvknhb_zvkb
>   >>> referenced by arch/riscv/crypto/sha512-riscv64-zvknhb-zvkb.o:(.text+0x2) in archive vmlinux.a
> 
>   ld.lld: error: undefined symbol: __kcfi_typeid_sha256_transform_zvknha_or_zvknhb_zvkb
>   >>> referenced by arch/riscv/crypto/sha256-riscv64-zvknha_or_zvknhb-zvkb.o:(.text+0x2) in archive vmlinux.a
> 
> As these functions are no longer indirectly called (i.e., have their
> address taken), the compiler will not emit __kcfi_typeid symbols for
> them but SYM_TYPED_FUNC_START expects these to exist at link time.
> 
> Switch the definitions of these functions to use SYM_FUNC_START, as they
> no longer need kCFI type information since they are only called
> directly.
> 
> Fixes: 1523eaed0ac5 ("crypto: riscv/sm3 - Use API partial block handling")
> Fixes: 561aab1104d8 ("crypto: riscv/sha512 - Use API partial block handling")
> Fixes: e6c5597badf2 ("crypto: riscv/sha256 - Use API partial block handling")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  arch/riscv/crypto/sha256-riscv64-zvknha_or_zvknhb-zvkb.S | 4 ++--
>  arch/riscv/crypto/sha512-riscv64-zvknhb-zvkb.S           | 4 ++--
>  arch/riscv/crypto/sm3-riscv64-zvksh-zvkb.S               | 4 ++--
>  3 files changed, 6 insertions(+), 6 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

WARNING: multiple messages have this Message-ID (diff)
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Nathan Chancellor <nathan@kernel.org>
Cc: linux-crypto@vger.kernel.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH] riscv: crypto - Use SYM_FUNC_START for functions only called directly
Date: Fri, 25 Apr 2025 10:48:44 +0800	[thread overview]
Message-ID: <aAr4DFlbPiNKpBmp@gondor.apana.org.au> (raw)
In-Reply-To: <20250424-riscv-crypto-fix-cfi-build-v1-1-2d7516737379@kernel.org>

On Thu, Apr 24, 2025 at 05:23:22PM -0700, Nathan Chancellor wrote:
> After some recent changes to the RISC-V crypto code that turned some
> indirect function calls into direct ones, builds with CONFIG_CFI_CLANG
> fail with:
> 
>   ld.lld: error: undefined symbol: __kcfi_typeid_sm3_transform_zvksh_zvkb
>   >>> referenced by arch/riscv/crypto/sm3-riscv64-zvksh-zvkb.o:(.text+0x2) in archive vmlinux.a
> 
>   ld.lld: error: undefined symbol: __kcfi_typeid_sha512_transform_zvknhb_zvkb
>   >>> referenced by arch/riscv/crypto/sha512-riscv64-zvknhb-zvkb.o:(.text+0x2) in archive vmlinux.a
> 
>   ld.lld: error: undefined symbol: __kcfi_typeid_sha256_transform_zvknha_or_zvknhb_zvkb
>   >>> referenced by arch/riscv/crypto/sha256-riscv64-zvknha_or_zvknhb-zvkb.o:(.text+0x2) in archive vmlinux.a
> 
> As these functions are no longer indirectly called (i.e., have their
> address taken), the compiler will not emit __kcfi_typeid symbols for
> them but SYM_TYPED_FUNC_START expects these to exist at link time.
> 
> Switch the definitions of these functions to use SYM_FUNC_START, as they
> no longer need kCFI type information since they are only called
> directly.
> 
> Fixes: 1523eaed0ac5 ("crypto: riscv/sm3 - Use API partial block handling")
> Fixes: 561aab1104d8 ("crypto: riscv/sha512 - Use API partial block handling")
> Fixes: e6c5597badf2 ("crypto: riscv/sha256 - Use API partial block handling")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  arch/riscv/crypto/sha256-riscv64-zvknha_or_zvknhb-zvkb.S | 4 ++--
>  arch/riscv/crypto/sha512-riscv64-zvknhb-zvkb.S           | 4 ++--
>  arch/riscv/crypto/sm3-riscv64-zvksh-zvkb.S               | 4 ++--
>  3 files changed, 6 insertions(+), 6 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2025-04-25  2:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25  0:23 [PATCH] riscv: crypto - Use SYM_FUNC_START for functions only called directly Nathan Chancellor
2025-04-25  0:23 ` Nathan Chancellor
2025-04-25  2:48 ` Herbert Xu [this message]
2025-04-25  2:48   ` Herbert 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=aAr4DFlbPiNKpBmp@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.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.