From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82B3C23A3; Tue, 11 Apr 2023 06:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681195684; x=1712731684; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=P4YMBXScVBBglfEFkiGOeQasVcTNDpoblfuqLiEFJNE=; b=ISTridHaKGmCP/skxCTS7NxATQQ74/Uvu2+eHsiQjv/4xUOMFNtFEzmY +/g7oN+z/vxsfU2/KoHrosH/Tvl88DHAhJSdzHt2n0Uwf+xw278uQ18fB XJkOP0JDJ6ZHY0QIyJLdxBUnROBZ+ow+y1R8Xze1vcmO84i0s8aSF+I7I +4bxxVpI6zgbEJocpLCBjNpfKqpg93pZ6sfXINPvpvjyMr1TnG84ga1wM wKd+Kg97nmQvpwt3WEOQ4MPlQvTgo7mNLIYZsUFUPasEIbQikTnN/Yar0 tUAPhAtv+I1hUwV1qA0fECLON8dEpM5YQAgUigIsZJu4TwoTtpqQlJ34l w==; X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="429828721" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="429828721" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2023 23:48:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="721082322" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="721082322" Received: from lkp-server01.sh.intel.com (HELO b613635ddfff) ([10.239.97.150]) by orsmga001.jf.intel.com with ESMTP; 10 Apr 2023 23:47:58 -0700 Received: from kbuild by b613635ddfff with local (Exim 4.96) (envelope-from ) id 1pm7nJ-000W3G-10; Tue, 11 Apr 2023 06:47:57 +0000 Date: Tue, 11 Apr 2023 14:47:02 +0800 From: kernel test robot To: Jing Zhang , KVM , KVMARM , ARMLinux , Marc Zyngier , Oliver Upton Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Will Deacon , Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , Fuad Tabba , Reiji Watanabe , Raghavendra Rao Ananta , Jing Zhang Subject: Re: [PATCH v6 4/6] KVM: arm64: Use per guest ID register for ID_AA64DFR0_EL1.PMUVer Message-ID: <202304111418.tQGXPpze-lkp@intel.com> References: <20230404035344.4043856-5-jingzhangos@google.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230404035344.4043856-5-jingzhangos@google.com> Hi Jing, kernel test robot noticed the following build errors: [auto build test ERROR on 7e364e56293bb98cae1b55fd835f5991c4e96e7d] url: https://github.com/intel-lab-lkp/linux/commits/Jing-Zhang/KVM-arm64-Move-CPU-ID-feature-registers-emulation-into-a-separate-file/20230404-115612 base: 7e364e56293bb98cae1b55fd835f5991c4e96e7d patch link: https://lore.kernel.org/r/20230404035344.4043856-5-jingzhangos%40google.com patch subject: [PATCH v6 4/6] KVM: arm64: Use per guest ID register for ID_AA64DFR0_EL1.PMUVer config: arm64-randconfig-r031-20230410 (https://download.01.org/0day-ci/archive/20230411/202304111418.tQGXPpze-lkp@intel.com/config) compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 2c57868e2e877f73c339796c3374ae660bb77f0d) 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://github.com/intel-lab-lkp/linux/commit/66ece3020c02ab1206bb9478e8cb0172e125bbfc git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Jing-Zhang/KVM-arm64-Move-CPU-ID-feature-registers-emulation-into-a-separate-file/20230404-115612 git checkout 66ece3020c02ab1206bb9478e8cb0172e125bbfc # 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=arm64 olddefconfig 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 where applicable | Reported-by: kernel test robot | Link: https://lore.kernel.org/oe-kbuild-all/202304111418.tQGXPpze-lkp@intel.com/ All errors (new ones prefixed by >>): >> arch/arm64/kvm/id_regs.c:261:31: error: no member named 'config_lock' in 'struct kvm_arch' mutex_lock(&vcpu->kvm->arch.config_lock); ~~~~~~~~~~~~~~~ ^ include/linux/mutex.h:187:44: note: expanded from macro 'mutex_lock' #define mutex_lock(lock) mutex_lock_nested(lock, 0) ^~~~ arch/arm64/kvm/id_regs.c:269:33: error: no member named 'config_lock' in 'struct kvm_arch' mutex_unlock(&vcpu->kvm->arch.config_lock); ~~~~~~~~~~~~~~~ ^ arch/arm64/kvm/id_regs.c:311:31: error: no member named 'config_lock' in 'struct kvm_arch' mutex_lock(&vcpu->kvm->arch.config_lock); ~~~~~~~~~~~~~~~ ^ include/linux/mutex.h:187:44: note: expanded from macro 'mutex_lock' #define mutex_lock(lock) mutex_lock_nested(lock, 0) ^~~~ arch/arm64/kvm/id_regs.c:318:33: error: no member named 'config_lock' in 'struct kvm_arch' mutex_unlock(&vcpu->kvm->arch.config_lock); ~~~~~~~~~~~~~~~ ^ 4 errors generated. vim +261 arch/arm64/kvm/id_regs.c 228 229 static int set_id_aa64dfr0_el1(struct kvm_vcpu *vcpu, 230 const struct sys_reg_desc *rd, 231 u64 val) 232 { 233 u8 pmuver, host_pmuver; 234 bool valid_pmu; 235 236 host_pmuver = kvm_arm_pmu_get_pmuver_limit(); 237 238 /* 239 * Allow AA64DFR0_EL1.PMUver to be set from userspace as long 240 * as it doesn't promise more than what the HW gives us. We 241 * allow an IMPDEF PMU though, only if no PMU is supported 242 * (KVM backward compatibility handling). 243 */ 244 pmuver = FIELD_GET(ARM64_FEATURE_MASK(ID_AA64DFR0_EL1_PMUVer), val); 245 if ((pmuver != ID_AA64DFR0_EL1_PMUVer_IMP_DEF && pmuver > host_pmuver)) 246 return -EINVAL; 247 248 valid_pmu = (pmuver != 0 && pmuver != ID_AA64DFR0_EL1_PMUVer_IMP_DEF); 249 250 /* Make sure view register and PMU support do match */ 251 if (kvm_vcpu_has_pmu(vcpu) != valid_pmu) 252 return -EINVAL; 253 254 /* We can only differ with PMUver, and anything else is an error */ 255 val ^= read_id_reg(vcpu, rd); 256 val &= ~ARM64_FEATURE_MASK(ID_AA64DFR0_EL1_PMUVer); 257 if (val) 258 return -EINVAL; 259 260 if (valid_pmu) { > 261 mutex_lock(&vcpu->kvm->arch.config_lock); 262 IDREG(vcpu->kvm, SYS_ID_AA64DFR0_EL1) &= ~ID_AA64DFR0_EL1_PMUVer_MASK; 263 IDREG(vcpu->kvm, SYS_ID_AA64DFR0_EL1) |= FIELD_PREP(ID_AA64DFR0_EL1_PMUVer_MASK, 264 pmuver); 265 266 IDREG(vcpu->kvm, SYS_ID_DFR0_EL1) &= ~ID_DFR0_EL1_PerfMon_MASK; 267 IDREG(vcpu->kvm, SYS_ID_DFR0_EL1) |= FIELD_PREP(ID_DFR0_EL1_PerfMon_MASK, 268 pmuver_to_perfmon(pmuver)); 269 mutex_unlock(&vcpu->kvm->arch.config_lock); 270 } else { 271 assign_bit(KVM_ARCH_FLAG_VCPU_HAS_IMP_DEF_PMU, &vcpu->kvm->arch.flags, 272 pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF); 273 } 274 275 return 0; 276 } 277 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests