* [atishp04:kvm_pmu_snapshot_v1 32/32] arch/riscv/kvm/vcpu_pmu.c:204:6: warning: unused variable 'enabled'
@ 2023-12-05 9:50 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-12-05 9:50 UTC (permalink / raw)
To: Atish Patra; +Cc: llvm, oe-kbuild-all, Atish Patra
tree: https://github.com/atishp04/linux kvm_pmu_snapshot_v1
head: 7536565387bf2f507db4c5407ad0a27413b349db
commit: 7536565387bf2f507db4c5407ad0a27413b349db [32/32] RISC-V: KVM: Support 64 bit firmware counters on RV32
config: riscv-rv32_defconfig (https://download.01.org/0day-ci/archive/20231205/202312051709.nVYMNAeq-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231205/202312051709.nVYMNAeq-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312051709.nVYMNAeq-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> arch/riscv/kvm/vcpu_pmu.c:204:6: warning: unused variable 'enabled' [-Wunused-variable]
204 | u64 enabled, running;
| ^
>> arch/riscv/kvm/vcpu_pmu.c:204:15: warning: unused variable 'running' [-Wunused-variable]
204 | u64 enabled, running;
| ^
arch/riscv/kvm/vcpu_pmu.c:383:28: warning: result of comparison of constant 18446744073709551615 with expression of type 'unsigned long' is always true [-Wtautological-constant-out-of-range-compare]
383 | if (kvpmu->snapshot_addr != INVALID_GPA)
| ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
arch/riscv/kvm/vcpu_pmu.c:387:25: warning: implicit conversion from 'gpa_t' (aka 'unsigned long long') to 'unsigned long' changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion]
387 | kvpmu->snapshot_addr = INVALID_GPA;
| ~ ^~~~~~~~~~~
include/linux/kvm_types.h:43:22: note: expanded from macro 'INVALID_GPA'
43 | #define INVALID_GPA (~(gpa_t)0)
| ^~~~~~~~~
arch/riscv/kvm/vcpu_pmu.c:440:26: warning: implicit conversion from 'gpa_t' (aka 'unsigned long long') to 'unsigned long' changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion]
440 | kvpmu->snapshot_addr = INVALID_GPA;
| ~ ^~~~~~~~~~~
include/linux/kvm_types.h:43:22: note: expanded from macro 'INVALID_GPA'
43 | #define INVALID_GPA (~(gpa_t)0)
| ^~~~~~~~~
arch/riscv/kvm/vcpu_pmu.c:485:41: warning: result of comparison of constant 18446744073709551615 with expression of type 'unsigned long' is always false [-Wtautological-constant-out-of-range-compare]
485 | (bSnapshot && kvpmu->snapshot_addr == INVALID_GPA)) {
| ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
arch/riscv/kvm/vcpu_pmu.c:556:42: warning: result of comparison of constant 18446744073709551615 with expression of type 'unsigned long' is always false [-Wtautological-constant-out-of-range-compare]
556 | (bSnapshot && (kvpmu->snapshot_addr == INVALID_GPA))) {
| ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
arch/riscv/kvm/vcpu_pmu.c:771:25: warning: implicit conversion from 'gpa_t' (aka 'unsigned long long') to 'unsigned long' changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion]
771 | kvpmu->snapshot_addr = INVALID_GPA;
| ~ ^~~~~~~~~~~
include/linux/kvm_types.h:43:22: note: expanded from macro 'INVALID_GPA'
43 | #define INVALID_GPA (~(gpa_t)0)
| ^~~~~~~~~
8 warnings generated.
vim +/enabled +204 arch/riscv/kvm/vcpu_pmu.c
185
186 static int pmu_get_pmc_index(struct kvm_pmu *pmu, unsigned long eidx,
187 unsigned long cbase, unsigned long cmask)
188 {
189 int ret;
190
191 /* Fixed counters need to be have fixed mapping as they have different width */
192 ret = kvm_pmu_get_fixed_pmc_index(eidx);
193 if (ret >= 0)
194 return ret;
195
196 return kvm_pmu_get_programmable_pmc_index(pmu, eidx, cbase, cmask);
197 }
198 #if defined(CONFIG_32BIT)
199 static int pmu_fw_ctr_read_hi(struct kvm_vcpu *vcpu, unsigned long cidx,
200 unsigned long *out_val)
201 {
202 struct kvm_pmu *kvpmu = vcpu_to_pmu(vcpu);
203 struct kvm_pmc *pmc;
> 204 u64 enabled, running;
205 int fevent_code;
206
207 pmc = &kvpmu->pmc[cidx];
208
209 if (pmc->cinfo.type != SBI_PMU_CTR_TYPE_FW)
210 return -EINVAL;
211
212 fevent_code = get_event_code(pmc->event_idx);
213 pmc->counter_val = kvpmu->fw_event[fevent_code].value;
214
215 *out_val = pmc->counter_val >> 32;
216
217 return 0;
218 }
219 #endif
220
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-05 9:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-05 9:50 [atishp04:kvm_pmu_snapshot_v1 32/32] arch/riscv/kvm/vcpu_pmu.c:204:6: warning: unused variable 'enabled' kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox