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:Wei Huang <wei@redhat.com> Message-Id: <1504901592-10357-1-git-send-email-wei@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
Loading
Please register or sign in to comment