[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZN6nkkZ7D/baOp+f@google.com>
Date: Thu, 17 Aug 2023 16:04:50 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Jinrong Liang <ljr.kernel@...il.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, Like Xu <likexu@...cent.com>,
David Matlack <dmatlack@...gle.com>,
Aaron Lewis <aaronlewis@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jinrong Liang <cloudliang@...cent.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 06/11] KVM: selftests: Test consistency of CPUID with
num of fixed counters
On Mon, Aug 14, 2023, Jinrong Liang wrote:
> @@ -239,6 +272,14 @@ static void intel_test_counters_num(void)
> if (!perf_caps[i])
> test_oob_gp_counter(0, 2, perf_caps[i], 0);
> }
> +
> + for (ecx = 0;
> + ecx <= kvm_cpu_property(X86_PROPERTY_PMU_FIXED_COUNTERS_BITMASK) + 1;
This is the perfect time to use a local variable:
for (ecx = 0; ecx <= fixed_counters_bitmask; ecx++)
> + ecx++) {
> + intel_test_oob_fixed_ctr(0, ecx, GP_VECTOR);
> + intel_test_oob_fixed_ctr(nr_fixed_counters, ecx, GP_VECTOR);
> + intel_test_oob_fixed_ctr(nr_fixed_counters + 1, ecx, GP_VECTOR);
> + }
> }
>
> int main(int argc, char *argv[])
> --
> 2.39.3
>
Powered by blists - more mailing lists