Hi Vitor,
First bad commit (maybe != root cause):
tree:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f40ddce88593482919761f74910f42f4b84c004b
commit: d2585f5164c298aaaed14c2c8d313cbe7bd5b253 lib: kunit: add bitfield test conversion
to KUnit
date: 4 months ago
config: mips-randconfig-r016-20210216 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0
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
#
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
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=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
lib/bitfield_kunit.c: In function 'test_bitfields_compile':
lib/bitfield_kunit.c:136:21: warning: unsigned conversion from 'int' to
'u16' {aka 'short unsigned int'} changes value from '393216' to
'0' [-Woverflow]
136 | u16_encode_bits(0, 0x60000);
| ^~~~~~~
At top level:
lib/bitfield_kunit.c:129:20: warning: 'test_bitfields_compile' defined but not
used [-Wunused-function]
129 | static void __init test_bitfields_compile(struct kunit *context)
| ^~~~~~~~~~~~~~~~~~~~~~
lib/bitfield_kunit.c: In function 'test_bitfields_constants':
> lib/bitfield_kunit.c:93:1: warning: the frame size of 4200 bytes
is larger than 2048 bytes [-Wframe-larger-than=]
93 | }
| ^
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SSB_EMBEDDED
Depends on SSB && SSB_DRIVER_MIPS && SSB_PCICORE_HOSTMODE
Selected by
- BCM47XX_SSB && BCM47XX
vim +93 lib/bitfield_kunit.c
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 10
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 11 #define
CHECK_ENC_GET_U(tp, v, field, res) do { \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 12 { \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 13 u##tp
_res; \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 14 \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 15 _res =
u##tp##_encode_bits(v, field); \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 16
KUNIT_ASSERT_FALSE_MSG(context, _res != res, \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 17
"u" #tp "_encode_bits(" #v ", " #field ") is 0x%llx !=
" #res "\n", \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 18
(u64)_res); \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 19
KUNIT_ASSERT_FALSE(context, \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 20
u##tp##_get_bits(_res, field) != v); \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 21 } \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 22 } while (0)
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 23
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 24 #define
CHECK_ENC_GET_LE(tp, v, field, res) do { \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 25 { \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 26 __le##tp
_res; \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 27 \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 28 _res =
le##tp##_encode_bits(v, field); \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 29
KUNIT_ASSERT_FALSE_MSG(context, \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 30 _res !=
cpu_to_le##tp(res), \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 31
"le" #tp "_encode_bits(" #v ", " #field ") is 0x%llx !=
0x%llx",\
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 32
(u64)le##tp##_to_cpu(_res), \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 33
(u64)(res)); \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 34
KUNIT_ASSERT_FALSE(context, \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 35
le##tp##_get_bits(_res, field) != v);\
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 36 } \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 37 } while (0)
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 38
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 39 #define
CHECK_ENC_GET_BE(tp, v, field, res) do { \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 40 { \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 41 __be##tp
_res; \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 42 \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 43 _res =
be##tp##_encode_bits(v, field); \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 44
KUNIT_ASSERT_FALSE_MSG(context, \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 45 _res !=
cpu_to_be##tp(res), \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 46
"be" #tp "_encode_bits(" #v ", " #field ") is 0x%llx !=
0x%llx", \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 47
(u64)be##tp##_to_cpu(_res), \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 48
(u64)(res)); \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 49
KUNIT_ASSERT_FALSE(context, \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 50
be##tp##_get_bits(_res, field) != v);\
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 51 } \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 52 } while (0)
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 53
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 54 #define
CHECK_ENC_GET(tp, v, field, res) do { \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 55
CHECK_ENC_GET_U(tp, v, field, res); \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 56
CHECK_ENC_GET_LE(tp, v, field, res); \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 57
CHECK_ENC_GET_BE(tp, v, field, res); \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 58 } while (0)
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 59
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 60 static void __init
test_bitfields_constants(struct kunit *context)
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 61 {
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 62 /*
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 63 * NOTE
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 64 * This whole
function compiles (or at least should, if everything
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 65 * is going
according to plan) to nothing after optimisation.
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 66 */
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 67
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 68 CHECK_ENC_GET(16,
1, 0x000f, 0x0001);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 69 CHECK_ENC_GET(16,
3, 0x00f0, 0x0030);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 70 CHECK_ENC_GET(16,
5, 0x0f00, 0x0500);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 71 CHECK_ENC_GET(16,
7, 0xf000, 0x7000);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 72 CHECK_ENC_GET(16,
14, 0x000f, 0x000e);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 73 CHECK_ENC_GET(16,
15, 0x00f0, 0x00f0);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 74
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 75 CHECK_ENC_GET_U(8,
1, 0x0f, 0x01);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 76 CHECK_ENC_GET_U(8,
3, 0xf0, 0x30);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 77 CHECK_ENC_GET_U(8,
14, 0x0f, 0x0e);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 78 CHECK_ENC_GET_U(8,
15, 0xf0, 0xf0);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 79
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 80 CHECK_ENC_GET(32,
1, 0x00000f00, 0x00000100);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 81 CHECK_ENC_GET(32,
3, 0x0000f000, 0x00003000);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 82 CHECK_ENC_GET(32,
5, 0x000f0000, 0x00050000);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 83 CHECK_ENC_GET(32,
7, 0x00f00000, 0x00700000);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 84 CHECK_ENC_GET(32,
14, 0x0f000000, 0x0e000000);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 85 CHECK_ENC_GET(32,
15, 0xf0000000, 0xf0000000);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 86
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 87 CHECK_ENC_GET(64,
1, 0x00000f0000000000ull, 0x0000010000000000ull);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 88 CHECK_ENC_GET(64,
3, 0x0000f00000000000ull, 0x0000300000000000ull);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 89 CHECK_ENC_GET(64,
5, 0x000f000000000000ull, 0x0005000000000000ull);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 90 CHECK_ENC_GET(64,
7, 0x00f0000000000000ull, 0x0070000000000000ull);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 91 CHECK_ENC_GET(64,
14, 0x0f00000000000000ull, 0x0e00000000000000ull);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 92 CHECK_ENC_GET(64,
15, 0xf000000000000000ull, 0xf000000000000000ull);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 @93 }
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 94
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 95 #define CHECK(tp,
mask) do { \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 96 u64 v; \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 97 \
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 98 for (v = 0; v
< 1 << hweight32(mask); v++) \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 99
KUNIT_ASSERT_FALSE(context, \
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 100
tp##_encode_bits(v, mask) != v << __ffs64(mask));\
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 101 } while (0)
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 102
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 103 static void __init
test_bitfields_variables(struct kunit *context)
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 104 {
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 105 CHECK(u8, 0x0f);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 106 CHECK(u8, 0xf0);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 107 CHECK(u8, 0x38);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 108
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 109 CHECK(u16,
0x0038);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 110 CHECK(u16,
0x0380);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 111 CHECK(u16,
0x3800);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 112 CHECK(u16,
0x8000);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 113
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 114 CHECK(u32,
0x80000000);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 115 CHECK(u32,
0x7f000000);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 116 CHECK(u32,
0x07e00000);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 117 CHECK(u32,
0x00018000);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 118
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 119 CHECK(u64,
0x8000000000000000ull);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 120 CHECK(u64,
0x7f00000000000000ull);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 121 CHECK(u64,
0x0001800000000000ull);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 122 CHECK(u64,
0x0000000080000000ull);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 123 CHECK(u64,
0x000000007f000000ull);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 124 CHECK(u64,
0x0000000018000000ull);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 125 CHECK(u64,
0x0000001f8000000ull);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 126 }
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 127
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 128
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 129 static void __init
test_bitfields_compile(struct kunit *context)
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 130 {
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 131 /* these should
fail compilation */
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 132 CHECK_ENC_GET(16,
16, 0x0f00, 0x1000);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 133 u32_encode_bits(7,
0x06000000);
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 134
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 135 /* this should at
least give a warning */
0e2dc70e3d0d50 lib/test_bitfield.c Johannes Berg 2018-06-20 @136 u16_encode_bits(0,
0x60000);
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 137 }
d2585f5164c298 lib/bitfield_kunit.c Vitor Massaru Iha 2020-07-29 138
:::::: The code at line 93 was first introduced by commit
:::::: 0e2dc70e3d0d503b0cc9c5f74db3eb6db52c9e22 bitfield: add tests
:::::: TO: Johannes Berg <johannes(a)sipsolutions.net>
:::::: CC: Kalle Valo <kvalo(a)codeaurora.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org