BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jens Remus" <jremus@linux.ibm.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH v11 3/6] x86/asm: Use CFI_* macros in SYM_FUNC_* macros so they can be added to VDSO
Date: Fri, 22 May 2026 11:58:44 +0000	[thread overview]
Message-ID: <20260522115844.9BEEB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260522110427.2816637-4-jremus@linux.ibm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The `__CFI_TYPE` macro in `arch/x86/include/asm/linkage.h` creates unbalanced CFI directives because it uses `SYM_START` but closes with `SYM_FUNC_END`.
--

commit 2769cdf2ca16b1b56aace01ab1acf0951b91be1f
Author: Josh Poimboeuf <jpoimboe@kernel.org>

x86/asm: Use CFI_* macros in SYM_FUNC_* macros so they can be added to VDSO

This commit adds CFI_STARTPROC and CFI_ENDPROC annotations to the SYM_FUNC_*
macros. This allows VDSO asm functions to avoid adding them manually, while
leaving the macros empty for the kernel proper.

> diff --git a/arch/x86/include/asm/linkage.h b/arch/x86/include/asm/linkage.h
> index a7294656ad908..c2ca8117376fb 100644
> --- a/arch/x86/include/asm/linkage.h
> +++ b/arch/x86/include/asm/linkage.h
> @@ -112,34 +116,51 @@
>  # define SYM_FUNC_ALIAS_MEMFUNC	SYM_FUNC_ALIAS
>  #endif
>  
> +#define __SYM_FUNC_START				\
> +	CFI_STARTPROC ASM_NL
> +
> +#define __SYM_FUNC_END					\
> +	CFI_ENDPROC ASM_NL

[ ... ]

> +#define SYM_FUNC_END(name)				\
> +	__SYM_FUNC_END					\
> +	SYM_END(name, SYM_T_FUNC)

[Severity: Low]
Does this change to SYM_FUNC_END() create unbalanced CFI directives when
used with __CFI_TYPE()?

The __CFI_TYPE() macro is defined earlier in this file to expand to a
block that starts with SYM_START() and ends with SYM_FUNC_END():

#define __CFI_TYPE(name)                                        \
        SYM_START(__cfi_##name, SYM_L_LOCAL, SYM_A_NONE)        \
        ...                                                     \
        SYM_FUNC_END(__cfi_##name)

Because SYM_START() does not emit CFI_STARTPROC (unlike SYM_FUNC_START()),
code expanding __CFI_TYPE() will now emit a CFI_ENDPROC directive without
a corresponding CFI_STARTPROC.

While this might not break the build today since CFI_ENDPROC evaluates to an
empty nocfi macro outside VDSO and __CFI_TYPE() is not used in VDSO code,
will this cause issues if KCFI or typed symbols are ever used in VDSO builds?

Should __CFI_TYPE() pair SYM_START() with SYM_END() instead?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260522110427.2816637-1-jremus@linux.ibm.com?part=3

  reply	other threads:[~2026-05-22 11:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22 11:04 [PATCH v11 0/6] x86/vdso: VDSO updates and fixes for sframes Jens Remus
2026-05-22 11:04 ` [PATCH v11 1/6] x86/vdso: Fix DWARF generation for getrandom() Jens Remus
2026-05-22 11:04 ` [PATCH v11 2/6] x86/asm: Avoid emitting DWARF CFI for non-VDSO Jens Remus
2026-05-22 11:04 ` [PATCH v11 3/6] x86/asm: Use CFI_* macros in SYM_FUNC_* macros so they can be added to VDSO Jens Remus
2026-05-22 11:58   ` sashiko-bot [this message]
2026-06-11 15:58     ` Jens Remus
2026-05-22 11:04 ` [PATCH v11 4/6] x86/vdso: Use SYM_FUNC_{START,END} in __kernel_vsyscall() Jens Remus
2026-05-22 11:04 ` [PATCH v11 5/6] x86/vdso: Use CFI macros in __vdso_sgx_enter_enclave() Jens Remus
2026-05-22 11:04 ` [PATCH v11 6/6] x86/vdso: Enable sframe generation in VDSO Jens Remus

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=20260522115844.9BEEB1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=jremus@linux.ibm.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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