Re: [PATCH 1/2] LoongArch: Add pad structure members for explicit alignment

From: kernel test robot
Date: Tue Apr 18 2023 - 13:29:07 EST


Hi Qing,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.3-rc7 next-20230417]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Qing-Zhang/LoongArch-Adjust-the-user_regset_copyin-parameter-to-the-correct-offset/20230418-171556
patch link: https://lore.kernel.org/r/20230418091348.9239-1-zhangqing%40loongson.cn
patch subject: [PATCH 1/2] LoongArch: Add pad structure members for explicit alignment
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20230419/202304190108.aA4uyDQZ-lkp@xxxxxxxxx/config)
compiler: loongarch64-linux-gcc (GCC) 12.1.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://github.com/intel-lab-lkp/linux/commit/dace28025b7b1f35b35042ddac8bdb1e412c2d7f
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Qing-Zhang/LoongArch-Adjust-the-user_regset_copyin-parameter-to-the-correct-offset/20230418-171556
git checkout dace28025b7b1f35b35042ddac8bdb1e412c2d7f
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=loongarch olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=loongarch SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Link: https://lore.kernel.org/oe-kbuild-all/202304190108.aA4uyDQZ-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

arch/loongarch/kernel/ptrace.c: In function 'hw_break_set':
>> arch/loongarch/kernel/ptrace.c:626:60: error: 'PTRACE_HBP_PAD_SZ' undeclared (first use in this function); did you mean 'PTRACE_HBP_MASK_SZ'?
626 | offset, offset + PTRACE_HBP_PAD_SZ);
| ^~~~~~~~~~~~~~~~~
| PTRACE_HBP_MASK_SZ
arch/loongarch/kernel/ptrace.c:626:60: note: each undeclared identifier is reported only once for each function it appears in


vim +626 arch/loongarch/kernel/ptrace.c

571
572 static int hw_break_set(struct task_struct *target,
573 const struct user_regset *regset,
574 unsigned int pos, unsigned int count,
575 const void *kbuf, const void __user *ubuf)
576 {
577 u32 ctrl;
578 u64 addr, mask;
579 int ret, idx = 0, offset, limit;
580 unsigned int note_type = regset->core_note_type;
581
582 /* Resource info and pad */
583 offset = offsetof(struct user_watch_state, dbg_regs);
584 user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, offset);
585
586 /* (address, ctrl) registers */
587 limit = regset->n * regset->size;
588 while (count && offset < limit) {
589 if (count < PTRACE_HBP_ADDR_SZ)
590 return -EINVAL;
591
592 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &addr,
593 offset, offset + PTRACE_HBP_ADDR_SZ);
594 if (ret)
595 return ret;
596
597 ret = ptrace_hbp_set_addr(note_type, target, idx, addr);
598 if (ret)
599 return ret;
600 offset += PTRACE_HBP_ADDR_SZ;
601
602 if (!count)
603 break;
604
605 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &mask,
606 offset, offset + PTRACE_HBP_ADDR_SZ);
607 if (ret)
608 return ret;
609
610 ret = ptrace_hbp_set_mask(note_type, target, idx, mask);
611 if (ret)
612 return ret;
613 offset += PTRACE_HBP_MASK_SZ;
614
615 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &mask,
616 offset, offset + PTRACE_HBP_MASK_SZ);
617 if (ret)
618 return ret;
619
620 ret = ptrace_hbp_set_ctrl(note_type, target, idx, ctrl);
621 if (ret)
622 return ret;
623 offset += PTRACE_HBP_CTRL_SZ;
624
625 user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
> 626 offset, offset + PTRACE_HBP_PAD_SZ);
627 offset += PTRACE_HBP_PAD_SZ;
628 idx++;
629 }
630
631 return 0;
632 }
633

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