* [linux-next:master 6153/10326] drivers/block/pktcdvd.c:1315:13: warning: stack frame size (2496) exceeds limit (2048) in 'pkt_handle_packets'
@ 2023-06-16 0:43 kernel test robot
2023-06-16 14:07 ` Andy Shevchenko
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-06-16 0:43 UTC (permalink / raw)
To: Andy Shevchenko
Cc: llvm, oe-kbuild-all, Linux Memory Management List, Jens Axboe,
Greg Kroah-Hartman
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 925294c9aa184801cc0a451b69a18dd0fe7d847d
commit: 3a41db531e5124adaa3a9ab9ca0c724aee85b10c [6153/10326] pktcdvd: Get rid of custom printing macros
config: riscv-buildonly-randconfig-r001-20230615 (https://download.01.org/0day-ci/archive/20230616/202306160811.nV1bMsK4-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
mkdir -p ~/bin
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/next/linux-next.git/commit/?id=3a41db531e5124adaa3a9ab9ca0c724aee85b10c
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 3a41db531e5124adaa3a9ab9ca0c724aee85b10c
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=riscv olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/ mm//
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/202306160811.nV1bMsK4-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/block/pktcdvd.c:1364:12: warning: stack frame size (3648) exceeds limit (2048) in 'kcdrwd' [-Wframe-larger-than]
static int kcdrwd(void *foobar)
^
>> drivers/block/pktcdvd.c:1315:13: warning: stack frame size (2496) exceeds limit (2048) in 'pkt_handle_packets' [-Wframe-larger-than]
static void pkt_handle_packets(struct pktcdvd_device *pd)
^
2 warnings generated.
vim +/pkt_handle_packets +1315 drivers/block/pktcdvd.c
4b83e99ee7092d Jens Axboe 2023-01-04 1314
4b83e99ee7092d Jens Axboe 2023-01-04 @1315 static void pkt_handle_packets(struct pktcdvd_device *pd)
4b83e99ee7092d Jens Axboe 2023-01-04 1316 {
3a41db531e5124 Andy Shevchenko 2023-03-10 1317 struct device *ddev = disk_to_dev(pd->disk);
4b83e99ee7092d Jens Axboe 2023-01-04 1318 struct packet_data *pkt, *next;
4b83e99ee7092d Jens Axboe 2023-01-04 1319
4b83e99ee7092d Jens Axboe 2023-01-04 1320 /*
4b83e99ee7092d Jens Axboe 2023-01-04 1321 * Run state machine for active packets
4b83e99ee7092d Jens Axboe 2023-01-04 1322 */
4b83e99ee7092d Jens Axboe 2023-01-04 1323 list_for_each_entry(pkt, &pd->cdrw.pkt_active_list, list) {
4b83e99ee7092d Jens Axboe 2023-01-04 1324 if (atomic_read(&pkt->run_sm) > 0) {
4b83e99ee7092d Jens Axboe 2023-01-04 1325 atomic_set(&pkt->run_sm, 0);
4b83e99ee7092d Jens Axboe 2023-01-04 1326 pkt_run_state_machine(pd, pkt);
4b83e99ee7092d Jens Axboe 2023-01-04 1327 }
4b83e99ee7092d Jens Axboe 2023-01-04 1328 }
4b83e99ee7092d Jens Axboe 2023-01-04 1329
4b83e99ee7092d Jens Axboe 2023-01-04 1330 /*
4b83e99ee7092d Jens Axboe 2023-01-04 1331 * Move no longer active packets to the free list
4b83e99ee7092d Jens Axboe 2023-01-04 1332 */
4b83e99ee7092d Jens Axboe 2023-01-04 1333 spin_lock(&pd->cdrw.active_list_lock);
4b83e99ee7092d Jens Axboe 2023-01-04 1334 list_for_each_entry_safe(pkt, next, &pd->cdrw.pkt_active_list, list) {
4b83e99ee7092d Jens Axboe 2023-01-04 1335 if (pkt->state == PACKET_FINISHED_STATE) {
4b83e99ee7092d Jens Axboe 2023-01-04 1336 list_del(&pkt->list);
4b83e99ee7092d Jens Axboe 2023-01-04 1337 pkt_put_packet_data(pd, pkt);
3a41db531e5124 Andy Shevchenko 2023-03-10 1338 pkt_set_state(ddev, pkt, PACKET_IDLE_STATE);
4b83e99ee7092d Jens Axboe 2023-01-04 1339 atomic_set(&pd->scan_queue, 1);
4b83e99ee7092d Jens Axboe 2023-01-04 1340 }
4b83e99ee7092d Jens Axboe 2023-01-04 1341 }
4b83e99ee7092d Jens Axboe 2023-01-04 1342 spin_unlock(&pd->cdrw.active_list_lock);
4b83e99ee7092d Jens Axboe 2023-01-04 1343 }
4b83e99ee7092d Jens Axboe 2023-01-04 1344
:::::: The code at line 1315 was first introduced by commit
:::::: 4b83e99ee7092df37a5cf292fde976ebc475ea63 Revert "pktcdvd: remove driver."
:::::: TO: Jens Axboe <axboe@kernel.dk>
:::::: CC: Jens Axboe <axboe@kernel.dk>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [linux-next:master 6153/10326] drivers/block/pktcdvd.c:1315:13: warning: stack frame size (2496) exceeds limit (2048) in 'pkt_handle_packets'
2023-06-16 0:43 [linux-next:master 6153/10326] drivers/block/pktcdvd.c:1315:13: warning: stack frame size (2496) exceeds limit (2048) in 'pkt_handle_packets' kernel test robot
@ 2023-06-16 14:07 ` Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2023-06-16 14:07 UTC (permalink / raw)
To: kernel test robot
Cc: llvm, oe-kbuild-all, Linux Memory Management List, Jens Axboe,
Greg Kroah-Hartman
On Fri, Jun 16, 2023 at 08:43:56AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: 925294c9aa184801cc0a451b69a18dd0fe7d847d
> commit: 3a41db531e5124adaa3a9ab9ca0c724aee85b10c [6153/10326] pktcdvd: Get rid of custom printing macros
> config: riscv-buildonly-randconfig-r001-20230615 (https://download.01.org/0day-ci/archive/20230616/202306160811.nV1bMsK4-lkp@intel.com/config)
> compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
> reproduce (this is a W=1 build):
> mkdir -p ~/bin
> 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/next/linux-next.git/commit/?id=3a41db531e5124adaa3a9ab9ca0c724aee85b10c
> git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> git fetch --no-tags linux-next master
> git checkout 3a41db531e5124adaa3a9ab9ca0c724aee85b10c
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=riscv olddefconfig
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/ mm//
>
> 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/202306160811.nV1bMsK4-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> drivers/block/pktcdvd.c:1364:12: warning: stack frame size (3648) exceeds limit (2048) in 'kcdrwd' [-Wframe-larger-than]
> static int kcdrwd(void *foobar)
> ^
> >> drivers/block/pktcdvd.c:1315:13: warning: stack frame size (2496) exceeds limit (2048) in 'pkt_handle_packets' [-Wframe-larger-than]
> static void pkt_handle_packets(struct pktcdvd_device *pd)
> ^
> 2 warnings generated.
Ha, the added line
> 4b83e99ee7092d Jens Axboe 2023-01-04 @1315 static void pkt_handle_packets(struct pktcdvd_device *pd)
> 4b83e99ee7092d Jens Axboe 2023-01-04 1316 {
> 3a41db531e5124 Andy Shevchenko 2023-03-10 1317 struct device *ddev = disk_to_dev(pd->disk);
is a simple macro
#define disk_to_dev(disk) \
(&((disk)->part0->bd_device))
and looking into implementation it might be that clang mistakenly allocates
stack based on bd_device size. And since it's a randconfig, quite likely
something like GCOV, KASAN, etc. is involved.
Also note, that
struct block_device {
...
/*
* keep this out-of-line as it's both big and not needed in the fast
* path
*/
struct device bd_device;
} __randomize_layout;
> 4b83e99ee7092d Jens Axboe 2023-01-04 1318 struct packet_data *pkt, *next;
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-16 14:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-16 0:43 [linux-next:master 6153/10326] drivers/block/pktcdvd.c:1315:13: warning: stack frame size (2496) exceeds limit (2048) in 'pkt_handle_packets' kernel test robot
2023-06-16 14:07 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox