All of lore.kernel.org
 help / color / mirror / Atom feed
* lib/bitfield_kunit.c:60:20: warning: stack frame size (11392) exceeds limit (8192) in function 'test_bitfields_constants'
@ 2021-06-25 19:12 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-06-25 19:12 UTC (permalink / raw)
  To: Vitor Massaru Iha
  Cc: kbuild-all, clang-built-linux, linux-kernel, Shuah Khan, Brendan Higgins

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   44db63d1ad8d71c6932cbe007eb41f31c434d140
commit: d2585f5164c298aaaed14c2c8d313cbe7bd5b253 lib: kunit: add bitfield test conversion to KUnit
date:   9 months ago
config: riscv-randconfig-r023-20210625 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9ca0171a9ffdef5fdb1511d197a3fd72490362de)
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
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d2585f5164c298aaaed14c2c8d313cbe7bd5b253
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout d2585f5164c298aaaed14c2c8d313cbe7bd5b253
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 

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 >>):

   lib/bitfield_kunit.c:136:21: warning: implicit conversion from 'int' to 'u16' (aka 'unsigned short') changes value from 393216 to 0 [-Wconstant-conversion]
           u16_encode_bits(0, 0x60000);
           ~~~~~~~~~~~~~~~    ^~~~~~~
   lib/bitfield_kunit.c:129:20: warning: unused function 'test_bitfields_compile' [-Wunused-function]
   static void __init test_bitfields_compile(struct kunit *context)
                      ^
>> lib/bitfield_kunit.c:60:20: warning: stack frame size (11392) exceeds limit (8192) in function 'test_bitfields_constants' [-Wframe-larger-than]
   static void __init test_bitfields_constants(struct kunit *context)
                      ^
   3 warnings generated.


vim +/test_bitfields_constants +60 lib/bitfield_kunit.c

    10	
    11	#define CHECK_ENC_GET_U(tp, v, field, res) do {				\
    12			{							\
    13				u##tp _res;					\
    14										\
    15				_res = u##tp##_encode_bits(v, field);		\
    16				KUNIT_ASSERT_FALSE_MSG(context, _res != res,	\
    17					       "u" #tp "_encode_bits(" #v ", " #field ") is 0x%llx != " #res "\n",	\
    18					       (u64)_res);			\
    19				KUNIT_ASSERT_FALSE(context,			\
    20					   u##tp##_get_bits(_res, field) != v);	\
    21			}							\
    22		} while (0)
    23	
    24	#define CHECK_ENC_GET_LE(tp, v, field, res) do {			\
    25			{							\
    26				__le##tp _res;					\
    27										\
    28				_res = le##tp##_encode_bits(v, field);		\
    29				KUNIT_ASSERT_FALSE_MSG(context,			\
    30					       _res != cpu_to_le##tp(res),	\
    31					       "le" #tp "_encode_bits(" #v ", " #field ") is 0x%llx != 0x%llx",\
    32					       (u64)le##tp##_to_cpu(_res),	\
    33					       (u64)(res));			\
    34				KUNIT_ASSERT_FALSE(context,			\
    35					   le##tp##_get_bits(_res, field) != v);\
    36			}							\
    37		} while (0)
    38	
    39	#define CHECK_ENC_GET_BE(tp, v, field, res) do {			\
    40			{							\
    41				__be##tp _res;					\
    42										\
    43				_res = be##tp##_encode_bits(v, field);		\
    44				KUNIT_ASSERT_FALSE_MSG(context,			\
    45					       _res != cpu_to_be##tp(res),	\
    46					       "be" #tp "_encode_bits(" #v ", " #field ") is 0x%llx != 0x%llx",	\
    47					       (u64)be##tp##_to_cpu(_res),	\
    48					       (u64)(res));			\
    49				KUNIT_ASSERT_FALSE(context,			\
    50					   be##tp##_get_bits(_res, field) != v);\
    51			}							\
    52		} while (0)
    53	
    54	#define CHECK_ENC_GET(tp, v, field, res) do {				\
    55			CHECK_ENC_GET_U(tp, v, field, res);			\
    56			CHECK_ENC_GET_LE(tp, v, field, res);			\
    57			CHECK_ENC_GET_BE(tp, v, field, res);			\
    58		} while (0)
    59	
  > 60	static void __init test_bitfields_constants(struct kunit *context)
    61	{
    62		/*
    63		 * NOTE
    64		 * This whole function compiles (or at least should, if everything
    65		 * is going according to plan) to nothing after optimisation.
    66		 */
    67	
    68		CHECK_ENC_GET(16,  1, 0x000f, 0x0001);
    69		CHECK_ENC_GET(16,  3, 0x00f0, 0x0030);
    70		CHECK_ENC_GET(16,  5, 0x0f00, 0x0500);
    71		CHECK_ENC_GET(16,  7, 0xf000, 0x7000);
    72		CHECK_ENC_GET(16, 14, 0x000f, 0x000e);
    73		CHECK_ENC_GET(16, 15, 0x00f0, 0x00f0);
    74	
    75		CHECK_ENC_GET_U(8,  1, 0x0f, 0x01);
    76		CHECK_ENC_GET_U(8,  3, 0xf0, 0x30);
    77		CHECK_ENC_GET_U(8, 14, 0x0f, 0x0e);
    78		CHECK_ENC_GET_U(8, 15, 0xf0, 0xf0);
    79	
    80		CHECK_ENC_GET(32,  1, 0x00000f00, 0x00000100);
    81		CHECK_ENC_GET(32,  3, 0x0000f000, 0x00003000);
    82		CHECK_ENC_GET(32,  5, 0x000f0000, 0x00050000);
    83		CHECK_ENC_GET(32,  7, 0x00f00000, 0x00700000);
    84		CHECK_ENC_GET(32, 14, 0x0f000000, 0x0e000000);
    85		CHECK_ENC_GET(32, 15, 0xf0000000, 0xf0000000);
    86	
    87		CHECK_ENC_GET(64,  1, 0x00000f0000000000ull, 0x0000010000000000ull);
    88		CHECK_ENC_GET(64,  3, 0x0000f00000000000ull, 0x0000300000000000ull);
    89		CHECK_ENC_GET(64,  5, 0x000f000000000000ull, 0x0005000000000000ull);
    90		CHECK_ENC_GET(64,  7, 0x00f0000000000000ull, 0x0070000000000000ull);
    91		CHECK_ENC_GET(64, 14, 0x0f00000000000000ull, 0x0e00000000000000ull);
    92		CHECK_ENC_GET(64, 15, 0xf000000000000000ull, 0xf000000000000000ull);
    93	}
    94	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27699 bytes --]

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

* lib/bitfield_kunit.c:60:20: warning: stack frame size (11392) exceeds limit (8192) in function 'test_bitfields_constants'
@ 2021-06-25 19:12 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-06-25 19:12 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   44db63d1ad8d71c6932cbe007eb41f31c434d140
commit: d2585f5164c298aaaed14c2c8d313cbe7bd5b253 lib: kunit: add bitfield test conversion to KUnit
date:   9 months ago
config: riscv-randconfig-r023-20210625 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9ca0171a9ffdef5fdb1511d197a3fd72490362de)
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
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d2585f5164c298aaaed14c2c8d313cbe7bd5b253
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout d2585f5164c298aaaed14c2c8d313cbe7bd5b253
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 

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 >>):

   lib/bitfield_kunit.c:136:21: warning: implicit conversion from 'int' to 'u16' (aka 'unsigned short') changes value from 393216 to 0 [-Wconstant-conversion]
           u16_encode_bits(0, 0x60000);
           ~~~~~~~~~~~~~~~    ^~~~~~~
   lib/bitfield_kunit.c:129:20: warning: unused function 'test_bitfields_compile' [-Wunused-function]
   static void __init test_bitfields_compile(struct kunit *context)
                      ^
>> lib/bitfield_kunit.c:60:20: warning: stack frame size (11392) exceeds limit (8192) in function 'test_bitfields_constants' [-Wframe-larger-than]
   static void __init test_bitfields_constants(struct kunit *context)
                      ^
   3 warnings generated.


vim +/test_bitfields_constants +60 lib/bitfield_kunit.c

    10	
    11	#define CHECK_ENC_GET_U(tp, v, field, res) do {				\
    12			{							\
    13				u##tp _res;					\
    14										\
    15				_res = u##tp##_encode_bits(v, field);		\
    16				KUNIT_ASSERT_FALSE_MSG(context, _res != res,	\
    17					       "u" #tp "_encode_bits(" #v ", " #field ") is 0x%llx != " #res "\n",	\
    18					       (u64)_res);			\
    19				KUNIT_ASSERT_FALSE(context,			\
    20					   u##tp##_get_bits(_res, field) != v);	\
    21			}							\
    22		} while (0)
    23	
    24	#define CHECK_ENC_GET_LE(tp, v, field, res) do {			\
    25			{							\
    26				__le##tp _res;					\
    27										\
    28				_res = le##tp##_encode_bits(v, field);		\
    29				KUNIT_ASSERT_FALSE_MSG(context,			\
    30					       _res != cpu_to_le##tp(res),	\
    31					       "le" #tp "_encode_bits(" #v ", " #field ") is 0x%llx != 0x%llx",\
    32					       (u64)le##tp##_to_cpu(_res),	\
    33					       (u64)(res));			\
    34				KUNIT_ASSERT_FALSE(context,			\
    35					   le##tp##_get_bits(_res, field) != v);\
    36			}							\
    37		} while (0)
    38	
    39	#define CHECK_ENC_GET_BE(tp, v, field, res) do {			\
    40			{							\
    41				__be##tp _res;					\
    42										\
    43				_res = be##tp##_encode_bits(v, field);		\
    44				KUNIT_ASSERT_FALSE_MSG(context,			\
    45					       _res != cpu_to_be##tp(res),	\
    46					       "be" #tp "_encode_bits(" #v ", " #field ") is 0x%llx != 0x%llx",	\
    47					       (u64)be##tp##_to_cpu(_res),	\
    48					       (u64)(res));			\
    49				KUNIT_ASSERT_FALSE(context,			\
    50					   be##tp##_get_bits(_res, field) != v);\
    51			}							\
    52		} while (0)
    53	
    54	#define CHECK_ENC_GET(tp, v, field, res) do {				\
    55			CHECK_ENC_GET_U(tp, v, field, res);			\
    56			CHECK_ENC_GET_LE(tp, v, field, res);			\
    57			CHECK_ENC_GET_BE(tp, v, field, res);			\
    58		} while (0)
    59	
  > 60	static void __init test_bitfields_constants(struct kunit *context)
    61	{
    62		/*
    63		 * NOTE
    64		 * This whole function compiles (or at least should, if everything
    65		 * is going according to plan) to nothing after optimisation.
    66		 */
    67	
    68		CHECK_ENC_GET(16,  1, 0x000f, 0x0001);
    69		CHECK_ENC_GET(16,  3, 0x00f0, 0x0030);
    70		CHECK_ENC_GET(16,  5, 0x0f00, 0x0500);
    71		CHECK_ENC_GET(16,  7, 0xf000, 0x7000);
    72		CHECK_ENC_GET(16, 14, 0x000f, 0x000e);
    73		CHECK_ENC_GET(16, 15, 0x00f0, 0x00f0);
    74	
    75		CHECK_ENC_GET_U(8,  1, 0x0f, 0x01);
    76		CHECK_ENC_GET_U(8,  3, 0xf0, 0x30);
    77		CHECK_ENC_GET_U(8, 14, 0x0f, 0x0e);
    78		CHECK_ENC_GET_U(8, 15, 0xf0, 0xf0);
    79	
    80		CHECK_ENC_GET(32,  1, 0x00000f00, 0x00000100);
    81		CHECK_ENC_GET(32,  3, 0x0000f000, 0x00003000);
    82		CHECK_ENC_GET(32,  5, 0x000f0000, 0x00050000);
    83		CHECK_ENC_GET(32,  7, 0x00f00000, 0x00700000);
    84		CHECK_ENC_GET(32, 14, 0x0f000000, 0x0e000000);
    85		CHECK_ENC_GET(32, 15, 0xf0000000, 0xf0000000);
    86	
    87		CHECK_ENC_GET(64,  1, 0x00000f0000000000ull, 0x0000010000000000ull);
    88		CHECK_ENC_GET(64,  3, 0x0000f00000000000ull, 0x0000300000000000ull);
    89		CHECK_ENC_GET(64,  5, 0x000f000000000000ull, 0x0005000000000000ull);
    90		CHECK_ENC_GET(64,  7, 0x00f0000000000000ull, 0x0070000000000000ull);
    91		CHECK_ENC_GET(64, 14, 0x0f00000000000000ull, 0x0e00000000000000ull);
    92		CHECK_ENC_GET(64, 15, 0xf000000000000000ull, 0xf000000000000000ull);
    93	}
    94	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 27699 bytes --]

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

end of thread, other threads:[~2021-06-25 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 19:12 lib/bitfield_kunit.c:60:20: warning: stack frame size (11392) exceeds limit (8192) in function 'test_bitfields_constants' kernel test robot
2021-06-25 19:12 ` kernel test robot

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.