Re: [PATCH v6 29/30] LoongArch: KVM: Enable kvm config and add the makefile

From: kernel test robot
Date: Thu Apr 13 2023 - 03:33:03 EST


Hi Tianrui,

kernel test robot noticed the following build errors:

[auto build test ERROR on kvm/queue]
[also build test ERROR on linus/master v6.3-rc6 next-20230412]
[cannot apply to kvm/linux-next]
[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/Tianrui-Zhao/LoongArch-KVM-Add-kvm-related-header-files/20230412-163935
base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
patch link: https://lore.kernel.org/r/20230412083023.1693910-30-zhaotianrui%40loongson.cn
patch subject: [PATCH v6 29/30] LoongArch: KVM: Enable kvm config and add the makefile
config: loongarch-randconfig-c033-20230413 (https://download.01.org/0day-ci/archive/20230413/202304131526.iXfLaVZc-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/19c2472bf2612603ce4671e06fb185516a99e040
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Tianrui-Zhao/LoongArch-KVM-Add-kvm-related-header-files/20230412-163935
git checkout 19c2472bf2612603ce4671e06fb185516a99e040
# 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 arch/loongarch/kvm/

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/202304131526.iXfLaVZc-lkp@xxxxxxxxx/

All error/warnings (new ones prefixed by >>):

In file included from arch/loongarch/include/asm/cpu-info.h:11,
from arch/loongarch/include/asm/processor.h:13,
from arch/loongarch/include/asm/thread_info.h:15,
from include/linux/thread_info.h:60,
from include/asm-generic/preempt.h:5,
from ./arch/loongarch/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/percpu.h:6,
from include/linux/context_tracking_state.h:5,
from include/linux/hardirq.h:5,
from include/linux/kvm_host.h:7,
from arch/loongarch/kvm/vcpu.c:6:
In function 'gcsr_read',
inlined from 'kvm_save_hw_gcsr' at arch/loongarch/include/asm/kvm_csr.h:24:19:
>> arch/loongarch/include/asm/loongarch.h:244:9: warning: 'asm' operand 1 probably does not match constraints
244 | asm volatile (
| ^~~
>> arch/loongarch/include/asm/loongarch.h:244:9: error: impossible constraint in 'asm'
In function 'gcsr_write',
inlined from 'kvm_restore_hw_gcsr' at arch/loongarch/include/asm/kvm_csr.h:29:2:
arch/loongarch/include/asm/loongarch.h:261:9: warning: 'asm' operand 1 probably does not match constraints
261 | asm volatile (
| ^~~


vim +/asm +244 arch/loongarch/include/asm/loongarch.h

f2ac457a61389b Huacai Chen 2022-05-31 238
2c87b678639d25 Tianrui Zhao 2023-04-12 239 /* GCSR */
2c87b678639d25 Tianrui Zhao 2023-04-12 240 static inline u64 gcsr_read(u32 reg)
2c87b678639d25 Tianrui Zhao 2023-04-12 241 {
2c87b678639d25 Tianrui Zhao 2023-04-12 242 u64 val = 0;
2c87b678639d25 Tianrui Zhao 2023-04-12 243 /* Instructions will be available in binutils later */
2c87b678639d25 Tianrui Zhao 2023-04-12 @244 asm volatile (
2c87b678639d25 Tianrui Zhao 2023-04-12 245 "parse_r __reg, %[val]\n\t"
2c87b678639d25 Tianrui Zhao 2023-04-12 246 /*
2c87b678639d25 Tianrui Zhao 2023-04-12 247 * read val from guest csr register %[reg]
2c87b678639d25 Tianrui Zhao 2023-04-12 248 * gcsrrd %[val], %[reg]
2c87b678639d25 Tianrui Zhao 2023-04-12 249 */
2c87b678639d25 Tianrui Zhao 2023-04-12 250 ".word 0x5 << 24 | %[reg] << 10 | 0 << 5 | __reg\n\t"
2c87b678639d25 Tianrui Zhao 2023-04-12 251 : [val] "+r" (val)
2c87b678639d25 Tianrui Zhao 2023-04-12 252 : [reg] "i" (reg)
2c87b678639d25 Tianrui Zhao 2023-04-12 253 : "memory");
2c87b678639d25 Tianrui Zhao 2023-04-12 254
2c87b678639d25 Tianrui Zhao 2023-04-12 255 return val;
2c87b678639d25 Tianrui Zhao 2023-04-12 256 }
2c87b678639d25 Tianrui Zhao 2023-04-12 257

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