Re: [linux-next:master 8173/8441] include/linux/list.h:53:13: warning: '__preserve_most__' calling convention is not supported for this target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 9, 2023 at 4:15 AM Marco Elver <elver@xxxxxxxxxx> wrote:
>
> On Wed, Aug 09, 2023 at 06:27PM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > head:   21ef7b1e17d039053edaeaf41142423810572741
> > commit: fee8feb67f0b2954eb7a2a259122e43a15cf3a52 [8173/8441] list_debug: introduce CONFIG_DEBUG_LIST_MINIMAL
> > config: hexagon-randconfig-r041-20230808 (https://download.01.org/0day-ci/archive/20230809/202308091820.0dPY7D6f-lkp@xxxxxxxxx/config)
> > compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
> > reproduce: (https://download.01.org/0day-ci/archive/20230809/202308091820.0dPY7D6f-lkp@xxxxxxxxx/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@xxxxxxxxx>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202308091820.0dPY7D6f-lkp@xxxxxxxxx/
> >
> > All warnings (new ones prefixed by >>):
> >
> >    In file included from arch/hexagon/kernel/asm-offsets.c:12:
> >    In file included from include/linux/compat.h:14:
> >    In file included from include/linux/sem.h:5:
> >    In file included from include/uapi/linux/sem.h:5:
> >    In file included from include/linux/ipc.h:5:
> >    In file included from include/linux/spinlock.h:56:
> >    In file included from include/linux/preempt.h:12:
> > >> include/linux/list.h:53:13: warning: '__preserve_most__' calling convention is not supported for this target [-Wignored-attributes]
> >    extern bool __list_valid_slowpath __list_add_valid_or_report(struct list_head *new,
> >                ^
> >    include/linux/list.h:44:39: note: expanded from macro '__list_valid_slowpath'
> >    # define __list_valid_slowpath __cold __preserve_most
> >                                          ^
> >    include/linux/compiler_types.h:132:49: note: expanded from macro '__preserve_most'
> >    # define __preserve_most notrace __attribute__((__preserve_most__))
>
> To silence this warning, we can just guard it based on known-supported architectures:

As a band-aid, sure.
Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
Long term, perhaps we can fix in clang what __has_attribute evaluates
to for this attribute depending on the target.  Filed:
https://github.com/ClangBuiltLinux/linux/issues/1908
^ Consider adding a comment linking to that in the sources.

>
> diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
> index c88488715a39..c523c6683789 100644
> --- a/include/linux/compiler_types.h
> +++ b/include/linux/compiler_types.h
> @@ -128,7 +128,7 @@ static inline void __chk_io_ptr(const volatile void __iomem *ptr) { }
>   *
>   * clang: https://clang.llvm.org/docs/AttributeReference.html#preserve-most
>   */
> -#if __has_attribute(__preserve_most__)
> +#if __has_attribute(__preserve_most__) && (defined(CONFIG_X86_64) || defined(CONFIG_ARM64))
>  # define __preserve_most notrace __attribute__((__preserve_most__))
>  #else
>  # define __preserve_most
>


-- 
Thanks,
~Nick Desaulniers





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux