lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202212180502.CJhnCXoe-lkp@intel.com>
Date:   Sun, 18 Dec 2022 06:00:41 +0800
From:   kernel test robot <lkp@...el.com>
To:     Tzung-Bi Shih <tzungbi@...nel.org>
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        linux-kernel@...r.kernel.org, Guenter Roeck <groeck@...omium.org>
Subject: drivers/platform/chrome/cros_ec_proto_test.c:2530:13: warning: stack
 frame size (1040) exceeds limit (1024) in
 'cros_ec_proto_test_get_sensor_count_legacy'

Hi Tzung-Bi,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f9ff5644bcc04221bae56f922122f2b7f5d24d62
commit: 33f0fdba6066b504ee0b5f1480b1f93b06050df6 platform/chrome: cros_ec_proto: add Kunit tests for get_sensor_count
date:   5 months ago
config: powerpc-allyesconfig
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 98b13979fb05f3ed288a900deb843e7b27589e58)
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 powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=33f0fdba6066b504ee0b5f1480b1f93b06050df6
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 33f0fdba6066b504ee0b5f1480b1f93b06050df6
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=powerpc olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/net/ethernet/mellanox/mlx5/core/steering/ drivers/platform/chrome/ drivers/staging/media/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> drivers/platform/chrome/cros_ec_proto_test.c:2530:13: warning: stack frame size (1040) exceeds limit (1024) in 'cros_ec_proto_test_get_sensor_count_legacy' [-Wframe-larger-than]
   static void cros_ec_proto_test_get_sensor_count_legacy(struct kunit *test)
               ^
   140/1040 (13.46%) spills, 900/1040 (86.54%) variables
   1 warning generated.


vim +/cros_ec_proto_test_get_sensor_count_legacy +2530 drivers/platform/chrome/cros_ec_proto_test.c

  2529	
> 2530	static void cros_ec_proto_test_get_sensor_count_legacy(struct kunit *test)
  2531	{
  2532		struct cros_ec_proto_test_priv *priv = test->priv;
  2533		struct cros_ec_device *ec_dev = &priv->ec_dev;
  2534		struct ec_xfer_mock *mock;
  2535		int ret, i;
  2536		struct cros_ec_dev ec;
  2537		struct {
  2538			u8 readmem_data;
  2539			int expected_result;
  2540		} test_data[] = {
  2541			{ 0, 0 },
  2542			{ EC_MEMMAP_ACC_STATUS_PRESENCE_BIT, 2 },
  2543		};
  2544	
  2545		ec_dev->max_request = 0xff;
  2546		ec_dev->max_response = 0xee;
  2547		ec_dev->cmd_readmem = cros_kunit_readmem_mock;
  2548		ec.ec_dev = ec_dev;
  2549		ec.dev = ec_dev->dev;
  2550		ec.cmd_offset = 0;
  2551	
  2552		for (i = 0; i < ARRAY_SIZE(test_data); ++i) {
  2553			/* For EC_CMD_MOTION_SENSE_CMD. */
  2554			{
  2555				mock = cros_kunit_ec_xfer_mock_addx(test, -EPROTO, EC_RES_SUCCESS, 0);
  2556				KUNIT_ASSERT_PTR_NE(test, mock, NULL);
  2557			}
  2558	
  2559			/* For readmem. */
  2560			{
  2561				cros_kunit_readmem_mock_data = kunit_kzalloc(test, 1, GFP_KERNEL);
  2562				KUNIT_ASSERT_PTR_NE(test, cros_kunit_readmem_mock_data, NULL);
  2563				cros_kunit_readmem_mock_data[0] = test_data[i].readmem_data;
  2564	
  2565				cros_kunit_ec_xfer_mock_default_ret = 1;
  2566			}
  2567	
  2568			ret = cros_ec_get_sensor_count(&ec);
  2569			KUNIT_EXPECT_EQ(test, ret, test_data[i].expected_result);
  2570	
  2571			/* For EC_CMD_MOTION_SENSE_CMD. */
  2572			{
  2573				struct ec_params_motion_sense *data;
  2574	
  2575				mock = cros_kunit_ec_xfer_mock_next();
  2576				KUNIT_EXPECT_PTR_NE(test, mock, NULL);
  2577	
  2578				KUNIT_EXPECT_EQ(test, mock->msg.version, 1);
  2579				KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_MOTION_SENSE_CMD);
  2580				KUNIT_EXPECT_EQ(test, mock->msg.insize,
  2581						sizeof(struct ec_response_motion_sense));
  2582				KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(*data));
  2583	
  2584				data = (struct ec_params_motion_sense *)mock->i_data;
  2585				KUNIT_EXPECT_EQ(test, data->cmd, MOTIONSENSE_CMD_DUMP);
  2586			}
  2587	
  2588			/* For readmem. */
  2589			{
  2590				KUNIT_EXPECT_EQ(test, cros_kunit_readmem_mock_offset, EC_MEMMAP_ACC_STATUS);
  2591			}
  2592		}
  2593	}
  2594	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (320934 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ