[arm-platforms:kvm-arm64/pmu-bl 4/5] arch/arm64/kvm/pmu-emul.c:895:24: error: use of undeclared identifier 'kvm'

kernel test robot lkp at intel.com
Mon Jan 3 10:39:22 PST 2022


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git kvm-arm64/pmu-bl
head:   877a6850e9bc0d29fa60dbedf345300c0f3396e4
commit: 0071239cd4ab9fc0b5cb9b911b36adee31598f3f [4/5] KVM: arm64: Add KVM_ARM_VCPU_PMU_V3_SET_PMU attribute
config: arm64-randconfig-r013-20220103 (https://download.01.org/0day-ci/archive/20220104/202201040228.xRreWFaE-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 104a827ea6de0cbe0f5faef4407552ede31d165c)
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 arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?id=0071239cd4ab9fc0b5cb9b911b36adee31598f3f
        git remote add arm-platforms https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git
        git fetch --no-tags arm-platforms kvm-arm64/pmu-bl
        git checkout 0071239cd4ab9fc0b5cb9b911b36adee31598f3f
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/kvm/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All errors (new ones prefixed by >>):

>> arch/arm64/kvm/pmu-emul.c:895:24: error: use of undeclared identifier 'kvm'
           if (irqchip_in_kernel(kvm)) {
                                 ^
   arch/arm64/kvm/pmu-emul.c:903:25: error: use of undeclared identifier 'kvm'
                   if (!vgic_initialized(kvm))
                                         ^
>> arch/arm64/kvm/pmu-emul.c:906:8: error: no member named 'pmu' in 'struct kvm_arch'
                   if (!kvm_arm_pmu_irq_initialized(vcpu->kvm))
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kvm/arm_pmu.h:45:51: note: expanded from macro 'kvm_arm_pmu_irq_initialized'
   #define kvm_arm_pmu_irq_initialized(v)  ((v)->arch.pmu.irq_num >= VGIC_NR_SGIS)
                                            ~~~~~~~~~ ^
   3 errors generated.


vim +/kvm +895 arch/arm64/kvm/pmu-emul.c

   892	
   893	static int kvm_arm_pmu_v3_init(struct kvm_vcpu *vcpu)
   894	{
 > 895		if (irqchip_in_kernel(kvm)) {
   896			int ret;
   897	
   898			/*
   899			 * If using the PMU with an in-kernel virtual GIC
   900			 * implementation, we require the GIC to be already
   901			 * initialized when initializing the PMU.
   902			 */
   903			if (!vgic_initialized(kvm))
   904				return -ENODEV;
   905	
 > 906			if (!kvm_arm_pmu_irq_initialized(vcpu->kvm))
   907				return -ENXIO;
   908	
   909			ret = kvm_vgic_set_owner(vcpu, vcpu->arch.pmu.irq_num,
   910						 &vcpu->arch.pmu);
   911			if (ret)
   912				return ret;
   913		}
   914	
   915		init_irq_work(&vcpu->arch.pmu.overflow_work,
   916			      kvm_pmu_perf_overflow_notify_vcpu);
   917	
   918		atomic_set(&vcpu->arch.pmu.created, 1);
   919	
   920		return 0;
   921	}
   922	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org



More information about the linux-arm-kernel mailing list