tree: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue head: 93472b79715378a2386598d6632c654a2223267b commit: 24688433d2ef9b65af51aa065f649b5f891f6961 [2/3] Merge remote-tracking branch 'kvm/next' into kvm-next-5.20 config: riscv-randconfig-r012-20220729 (https://download.01.org/0day-ci/archive/20220730/202207302002.opeObPd2-lkp@xxxxxxxxx/config) compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 52cd00cabf479aa7eb6dbb063b7ba41ea57bce9e) 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 riscv cross compiling tool for clang build # apt-get install binutils-riscv64-linux-gnu # https://git.kernel.org/pub/scm/virt/kvm/kvm.git/commit/?id=24688433d2ef9b65af51aa065f649b5f891f6961 git remote add kvm https://git.kernel.org/pub/scm/virt/kvm/kvm.git git fetch --no-tags kvm queue git checkout 24688433d2ef9b65af51aa065f649b5f891f6961 # 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=riscv SHELL=/bin/bash arch/riscv/kvm/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <lkp@xxxxxxxxx> All errors (new ones prefixed by >>): >> arch/riscv/kvm/mmu.c:355:61: error: expected '}' .gfp_custom = (in_atomic) ? GFP_ATOMIC | __GFP_ACCOUNT : 0; ^ arch/riscv/kvm/mmu.c:354:39: note: to match this '{' struct kvm_mmu_memory_cache pcache = { ^ >> arch/riscv/kvm/mmu.c:356:3: error: expected expression .gfp_zero = __GFP_ZERO; ^ >> arch/riscv/kvm/mmu.c:359:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] end = (gpa + size + PAGE_SIZE - 1) & PAGE_MASK; ^ int >> arch/riscv/kvm/mmu.c:359:9: error: use of undeclared identifier 'gpa' end = (gpa + size + PAGE_SIZE - 1) & PAGE_MASK; ^ >> arch/riscv/kvm/mmu.c:359:15: error: use of undeclared identifier 'size' end = (gpa + size + PAGE_SIZE - 1) & PAGE_MASK; ^ arch/riscv/kvm/mmu.c:360:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] pfn = __phys_to_pfn(hpa); ^ int >> arch/riscv/kvm/mmu.c:360:22: error: use of undeclared identifier 'hpa' pfn = __phys_to_pfn(hpa); ^ >> arch/riscv/kvm/mmu.c:362:2: error: expected identifier or '(' for (addr = gpa; addr < end; addr += PAGE_SIZE) { ^ arch/riscv/kvm/mmu.c:381:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] out: ^ int >> arch/riscv/kvm/mmu.c:381:4: error: expected ';' after top level declarator out: ^ ; >> arch/riscv/kvm/mmu.c:382:28: error: expected parameter declarator kvm_mmu_free_memory_cache(&pcache); ^ >> arch/riscv/kvm/mmu.c:382:28: error: expected ')' arch/riscv/kvm/mmu.c:382:27: note: to match this '(' kvm_mmu_free_memory_cache(&pcache); ^ arch/riscv/kvm/mmu.c:382:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] kvm_mmu_free_memory_cache(&pcache); ^ int >> arch/riscv/kvm/mmu.c:382:27: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] kvm_mmu_free_memory_cache(&pcache); ^ void >> arch/riscv/kvm/mmu.c:382:2: error: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a previous declaration [-Werror,-Wdeprecated-non-prototype] kvm_mmu_free_memory_cache(&pcache); ^ include/linux/kvm_host.h:1356:6: note: conflicting prototype is here void kvm_mmu_free_memory_cache(struct kvm_mmu_memory_cache *mc); ^ >> arch/riscv/kvm/mmu.c:382:2: error: conflicting types for 'kvm_mmu_free_memory_cache' kvm_mmu_free_memory_cache(&pcache); ^ include/linux/kvm_host.h:1356:6: note: previous declaration is here void kvm_mmu_free_memory_cache(struct kvm_mmu_memory_cache *mc); ^ arch/riscv/kvm/mmu.c:383:2: error: expected identifier or '(' return ret; ^ >> arch/riscv/kvm/mmu.c:384:1: error: extraneous closing brace ('}') } ^ 18 errors generated. vim +355 arch/riscv/kvm/mmu.c 345 346 int kvm_riscv_gstage_ioremap(struct kvm *kvm, gpa_t gpa, 347 phys_addr_t hpa, unsigned long size, 348 bool writable, bool in_atomic) 349 { 350 pte_t pte; 351 int ret = 0; 352 unsigned long pfn; 353 phys_addr_t addr, end; 354 struct kvm_mmu_memory_cache pcache = { > 355 .gfp_custom = (in_atomic) ? GFP_ATOMIC | __GFP_ACCOUNT : 0; > 356 .gfp_zero = __GFP_ZERO; 357 }; 358 > 359 end = (gpa + size + PAGE_SIZE - 1) & PAGE_MASK; > 360 pfn = __phys_to_pfn(hpa); 361 > 362 for (addr = gpa; addr < end; addr += PAGE_SIZE) { 363 pte = pfn_pte(pfn, PAGE_KERNEL_IO); 364 365 if (!writable) 366 pte = pte_wrprotect(pte); 367 368 ret = kvm_mmu_topup_memory_cache(&pcache, gstage_pgd_levels); 369 if (ret) 370 goto out; 371 372 spin_lock(&kvm->mmu_lock); 373 ret = gstage_set_pte(kvm, 0, &pcache, addr, &pte); 374 spin_unlock(&kvm->mmu_lock); 375 if (ret) 376 goto out; 377 378 pfn++; 379 } 380 > 381 out: > 382 kvm_mmu_free_memory_cache(&pcache); 383 return ret; > 384 } 385 -- 0-DAY CI Kernel Test Service https://01.org/lkp