All of lore.kernel.org
 help / color / mirror / Atom feed
* [hyperv:hyperv-next-staging 2/9] include/linux/compiler_types.h:572:45: error: call to '__compiletime_assert_494' declared with attribute error: BUILD_BUG_ON failed: HV_HVCALL_ARG_PAGES == 1
@ 2025-08-13 21:28 kernel test robot
  2025-08-14 18:18 ` Michael Kelley
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2025-08-13 21:28 UTC (permalink / raw)
  To: Michael Kelley; +Cc: oe-kbuild-all, Wei Liu, Nuno Das Neves, Easwar Hariharan

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git hyperv-next-staging
head:   ee8b3b85ffbc4dc06a598a12185537dae67714ab
commit: ffe1588178d5bb71c58361cb84cc3f4342f82100 [2/9] x86/hyperv: Use hv_setup_*() to set up hypercall arguments -- part 1
config: i386-randconfig-014-20250813 (https://download.01.org/0day-ci/archive/20250814/202508140537.LHGYEm9W-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250814/202508140537.LHGYEm9W-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/202508140537.LHGYEm9W-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from <command-line>:
   include/asm-generic/mshyperv.h: In function 'hv_setup_inout_array.constprop':
>> include/linux/compiler_types.h:572:45: error: call to '__compiletime_assert_494' declared with attribute error: BUILD_BUG_ON failed: HV_HVCALL_ARG_PAGES == 1
     572 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |                                             ^
   include/linux/compiler_types.h:553:25: note: in definition of macro '__compiletime_assert'
     553 |                         prefix ## suffix();                             \
         |                         ^~~~~~
   include/linux/compiler_types.h:572:9: note: in expansion of macro '_compiletime_assert'
     572 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
      39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
         |                                     ^~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
      50 |         BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
         |         ^~~~~~~~~~~~~~~~
   include/asm-generic/mshyperv.h:239:25: note: in expansion of macro 'BUILD_BUG_ON'
     239 |                         BUILD_BUG_ON(HV_HVCALL_ARG_PAGES == 1);
         |                         ^~~~~~~~~~~~


vim +/__compiletime_assert_494 +572 include/linux/compiler_types.h

eb5c2d4b45e3d2 Will Deacon 2020-07-21  558  
eb5c2d4b45e3d2 Will Deacon 2020-07-21  559  #define _compiletime_assert(condition, msg, prefix, suffix) \
eb5c2d4b45e3d2 Will Deacon 2020-07-21  560  	__compiletime_assert(condition, msg, prefix, suffix)
eb5c2d4b45e3d2 Will Deacon 2020-07-21  561  
eb5c2d4b45e3d2 Will Deacon 2020-07-21  562  /**
eb5c2d4b45e3d2 Will Deacon 2020-07-21  563   * compiletime_assert - break build and emit msg if condition is false
eb5c2d4b45e3d2 Will Deacon 2020-07-21  564   * @condition: a compile-time constant condition to check
eb5c2d4b45e3d2 Will Deacon 2020-07-21  565   * @msg:       a message to emit if condition is false
eb5c2d4b45e3d2 Will Deacon 2020-07-21  566   *
eb5c2d4b45e3d2 Will Deacon 2020-07-21  567   * In tradition of POSIX assert, this macro will break the build if the
eb5c2d4b45e3d2 Will Deacon 2020-07-21  568   * supplied condition is *false*, emitting the supplied error message if the
eb5c2d4b45e3d2 Will Deacon 2020-07-21  569   * compiler has support to do so.
eb5c2d4b45e3d2 Will Deacon 2020-07-21  570   */
eb5c2d4b45e3d2 Will Deacon 2020-07-21  571  #define compiletime_assert(condition, msg) \
eb5c2d4b45e3d2 Will Deacon 2020-07-21 @572  	_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
eb5c2d4b45e3d2 Will Deacon 2020-07-21  573  

:::::: The code at line 572 was first introduced by commit
:::::: eb5c2d4b45e3d2d5d052ea6b8f1463976b1020d5 compiler.h: Move compiletime_assert() macros into compiler_types.h

:::::: TO: Will Deacon <will@kernel.org>
:::::: CC: Will Deacon <will@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [hyperv:hyperv-next-staging 2/9] include/linux/compiler_types.h:572:45: error: call to '__compiletime_assert_494' declared with attribute error: BUILD_BUG_ON failed: HV_HVCALL_ARG_PAGES == 1
  2025-08-13 21:28 [hyperv:hyperv-next-staging 2/9] include/linux/compiler_types.h:572:45: error: call to '__compiletime_assert_494' declared with attribute error: BUILD_BUG_ON failed: HV_HVCALL_ARG_PAGES == 1 kernel test robot
@ 2025-08-14 18:18 ` Michael Kelley
  2025-08-14 18:20   ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kelley @ 2025-08-14 18:18 UTC (permalink / raw)
  To: Wei Liu; +Cc: oe-kbuild-all@lists.linux.dev, Nuno Das Neves, Easwar Hariharan

From: kernel test robot <lkp@intel.com> Sent: Wednesday, August 13, 2025 2:28 PM
> 
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git hyperv-next-staging
> head:   ee8b3b85ffbc4dc06a598a12185537dae67714ab
> commit: ffe1588178d5bb71c58361cb84cc3f4342f82100 [2/9] x86/hyperv: Use
> hv_setup_*() to set up hypercall arguments -- part 1
> config: i386-randconfig-014-20250813 (https://download.01.org/0day-ci/archive/20250814/202508140537.LHGYEm9W-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250814/202508140537.LHGYEm9W-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/202508140537.LHGYEm9W-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from <command-line>:
>    include/asm-generic/mshyperv.h: In function 'hv_setup_inout_array.constprop':
> >> include/linux/compiler_types.h:572:45: error: call to '__compiletime_assert_494' declared with attribute error: BUILD_BUG_ON failed: HV_HVCALL_ARG_PAGES == 1
>      572 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>          |                                             ^
>    include/linux/compiler_types.h:553:25: note: in definition of macro '__compiletime_assert'
>      553 |                         prefix ## suffix();                             \
>          |                         ^~~~~~
>    include/linux/compiler_types.h:572:9: note: in expansion of macro '_compiletime_assert'
>      572 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>          |         ^~~~~~~~~~~~~~~~~~~
>    include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
>       39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
>          |                                     ^~~~~~~~~~~~~~~~~~
>    include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
>       50 |         BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
>          |         ^~~~~~~~~~~~~~~~
>    include/asm-generic/mshyperv.h:239:25: note: in expansion of macro 'BUILD_BUG_ON'
>      239 |                         BUILD_BUG_ON(HV_HVCALL_ARG_PAGES == 1);
>          |                         ^~~~~~~~~~~~
> 

Wei --

This error is due to the compiler *not* inlining hv_setup_inout_array() in
include/asm-generic/mshyperv.h, which makes sense because when the function
is inline, the clause with BUILD_BUG_ON() gets dropped. The function is tagged
as "inline", but of course that doesn't guarantee inlining. The problematic config is
for a 32-bit build, and perhaps the compiler is short on registers and decides not to
inline. The problem is occurring when building arch/x86/hyperv/irqdomain.c, though
that's not indicated in the problem report.

All that said, if I change the "inline" tag to "__always_inline" the problem goes away.
Is that a fixup you can make to directly to the linux-hyperv tree? Or should I spin
a new version of the patch?

Michael

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [hyperv:hyperv-next-staging 2/9] include/linux/compiler_types.h:572:45: error: call to '__compiletime_assert_494' declared with attribute error: BUILD_BUG_ON failed: HV_HVCALL_ARG_PAGES == 1
  2025-08-14 18:18 ` Michael Kelley
@ 2025-08-14 18:20   ` Wei Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Liu @ 2025-08-14 18:20 UTC (permalink / raw)
  To: Michael Kelley
  Cc: Wei Liu, oe-kbuild-all@lists.linux.dev, Nuno Das Neves,
	Easwar Hariharan

On Thu, Aug 14, 2025 at 06:18:25PM +0000, Michael Kelley wrote:
> From: kernel test robot <lkp@intel.com> Sent: Wednesday, August 13, 2025 2:28 PM
> > 
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git hyperv-next-staging
> > head:   ee8b3b85ffbc4dc06a598a12185537dae67714ab
> > commit: ffe1588178d5bb71c58361cb84cc3f4342f82100 [2/9] x86/hyperv: Use
> > hv_setup_*() to set up hypercall arguments -- part 1
> > config: i386-randconfig-014-20250813 (https://download.01.org/0day-ci/archive/20250814/202508140537.LHGYEm9W-lkp@intel.com/config)
> > compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250814/202508140537.LHGYEm9W-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/202508140537.LHGYEm9W-lkp@intel.com/
> > 
> > All errors (new ones prefixed by >>):
> > 
> >    In file included from <command-line>:
> >    include/asm-generic/mshyperv.h: In function 'hv_setup_inout_array.constprop':
> > >> include/linux/compiler_types.h:572:45: error: call to '__compiletime_assert_494' declared with attribute error: BUILD_BUG_ON failed: HV_HVCALL_ARG_PAGES == 1
> >      572 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
> >          |                                             ^
> >    include/linux/compiler_types.h:553:25: note: in definition of macro '__compiletime_assert'
> >      553 |                         prefix ## suffix();                             \
> >          |                         ^~~~~~
> >    include/linux/compiler_types.h:572:9: note: in expansion of macro '_compiletime_assert'
> >      572 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
> >          |         ^~~~~~~~~~~~~~~~~~~
> >    include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
> >       39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
> >          |                                     ^~~~~~~~~~~~~~~~~~
> >    include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
> >       50 |         BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
> >          |         ^~~~~~~~~~~~~~~~
> >    include/asm-generic/mshyperv.h:239:25: note: in expansion of macro 'BUILD_BUG_ON'
> >      239 |                         BUILD_BUG_ON(HV_HVCALL_ARG_PAGES == 1);
> >          |                         ^~~~~~~~~~~~
> > 
> 
> Wei --
> 
> This error is due to the compiler *not* inlining hv_setup_inout_array() in
> include/asm-generic/mshyperv.h, which makes sense because when the function
> is inline, the clause with BUILD_BUG_ON() gets dropped. The function is tagged
> as "inline", but of course that doesn't guarantee inlining. The problematic config is
> for a 32-bit build, and perhaps the compiler is short on registers and decides not to
> inline. The problem is occurring when building arch/x86/hyperv/irqdomain.c, though
> that's not indicated in the problem report.
> 
> All that said, if I change the "inline" tag to "__always_inline" the problem goes away.
> Is that a fixup you can make to directly to the linux-hyperv tree? Or should I spin
> a new version of the patch?

I can make the change directly. Thanks for looking into this.

Wei

> 
> Michael

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-14 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13 21:28 [hyperv:hyperv-next-staging 2/9] include/linux/compiler_types.h:572:45: error: call to '__compiletime_assert_494' declared with attribute error: BUILD_BUG_ON failed: HV_HVCALL_ARG_PAGES == 1 kernel test robot
2025-08-14 18:18 ` Michael Kelley
2025-08-14 18:20   ` Wei Liu

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.