Skip to content
Commit 4ac45293 authored by Wei Huang's avatar Wei Huang Committed by Paolo Bonzini
Browse files

x86/pmu: change the num_counters to reflect the real gp counters



Currently pmu.c sets num_counters to MIN(num_gp_counters, num_gp_events).
This is to prevent the out-of-bound access to gp_events[] array in
check_counters_many(). However it also means that check_counters_many()
can NOT stress all gp counters if num_gp_counters > num_gp_events. This
small patch changes the value of num_counters back to num_gp_counters and
prevents the out-of-bound problem by using the mod function in the array
access.

Signed-off-by: default avatarWei Huang <wei@redhat.com>
Message-Id: <1504901592-10357-1-git-send-email-wei@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent af928b22
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment