]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/vPMU: fix undefined shift in intel_pmu_refresh()
authorRadim Krčmář <rkrcmar@redhat.com>
Thu, 18 May 2017 17:37:31 +0000 (19:37 +0200)
committerRadim Krčmář <rkrcmar@redhat.com>
Fri, 19 May 2017 17:59:27 +0000 (19:59 +0200)
commitf4ef29aefa8ec990c390a9cdac7d2e962cc3a744
tree992122c8f5b91773bbc18d45d15184e2e43b7a9d
parent7a8b25d82510d3d3ce66d9f5b0841e489f62f6a9
KVM: x86/vPMU: fix undefined shift in intel_pmu_refresh()

Static analysis noticed that pmu->nr_arch_gp_counters can be 32
(INTEL_PMC_MAX_GENERIC) and therefore cannot be used to shift 'int'.

I didn't add BUILD_BUG_ON for it as we have a better checker.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 2dd01dcc98f6 ("KVM: x86/vPMU: Define kvm_pmu_ops to support vPMU function dispatch")
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/pmu_intel.c