public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mingwei Zhang <mizhang@google.com>
To: Colton Lewis <coltonlewis@google.com>
Cc: kvm@vger.kernel.org, Jinrong Liang <ljr.kernel@gmail.com>,
	Jim Mattson <jmattson@google.com>,
	Aaron Lewis <aaronlewis@google.com>,
	Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/6] KVM: x86: selftests: Fix typos in macro variable use
Date: Wed, 21 Aug 2024 18:21:11 +0000	[thread overview]
Message-ID: <ZsYwF5QJ8gqto8Mm@google.com> (raw)
In-Reply-To: <20240813164244.751597-2-coltonlewis@google.com>

On Tue, Aug 13, 2024, Colton Lewis wrote:
> Without the leading underscore, these variables are referencing a
> variable in the calling scope. It only worked before by accident
> because all calling scopes had a variable with the right name.
> 
> Signed-off-by: Colton Lewis <coltonlewis@google.com>

This might need a fixes tag, right?
Fixes: cd34fd8c758e ("KVM: selftests: Test PMC virtualization with forced emulation")

no need to cc stable tree though, since this is very minor.

Reviewed-by: Mingwei Zhang <mizhang@google.com>
> ---
>  tools/testing/selftests/kvm/x86_64/pmu_counters_test.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/testing/selftests/kvm/x86_64/pmu_counters_test.c b/tools/testing/selftests/kvm/x86_64/pmu_counters_test.c
> index 698cb36989db..0e305e43a93b 100644
> --- a/tools/testing/selftests/kvm/x86_64/pmu_counters_test.c
> +++ b/tools/testing/selftests/kvm/x86_64/pmu_counters_test.c
> @@ -174,7 +174,7 @@ do {										\
>  
>  #define GUEST_TEST_EVENT(_idx, _event, _pmc, _pmc_msr, _ctrl_msr, _value, FEP)	\
>  do {										\
> -	wrmsr(pmc_msr, 0);							\
> +	wrmsr(_pmc_msr, 0);							\
>  										\
>  	if (this_cpu_has(X86_FEATURE_CLFLUSHOPT))				\
>  		GUEST_MEASURE_EVENT(_ctrl_msr, _value, "clflushopt .", FEP);	\
> @@ -331,9 +331,9 @@ __GUEST_ASSERT(expect_gp ? vector == GP_VECTOR : !vector,			\
>  	       expect_gp ? "#GP" : "no fault", msr, vector)			\
>  
>  #define GUEST_ASSERT_PMC_VALUE(insn, msr, val, expected)			\
> -	__GUEST_ASSERT(val == expected_val,					\
> +	__GUEST_ASSERT(val == expected,					\
>  		       "Expected " #insn "(0x%x) to yield 0x%lx, got 0x%lx",	\
> -		       msr, expected_val, val);
> +		       msr, expected, val);
>  
>  static void guest_test_rdpmc(uint32_t rdpmc_idx, bool expect_success,
>  			     uint64_t expected_val)
> -- 
> 2.46.0.76.ge559c4bf1a-goog
> 

  reply	other threads:[~2024-08-21 18:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 16:42 [PATCH 0/6] Extend pmu_counters_test to AMD CPUs Colton Lewis
2024-08-13 16:42 ` [PATCH 1/6] KVM: x86: selftests: Fix typos in macro variable use Colton Lewis
2024-08-21 18:21   ` Mingwei Zhang [this message]
2024-08-28 21:24     ` Colton Lewis
2024-08-13 16:42 ` [PATCH 2/6] KVM: x86: selftests: Define AMD PMU CPUID leaves Colton Lewis
2024-08-26 22:27   ` Mingwei Zhang
2024-08-28 22:24     ` Colton Lewis
2024-08-29 20:25       ` Sean Christopherson
2024-08-13 16:42 ` [PATCH 3/6] KVM: x86: selftests: Set up AMD VM in pmu_counters_test Colton Lewis
2024-08-26 22:43   ` Mingwei Zhang
2024-08-28 22:39     ` Colton Lewis
2024-08-28 23:18       ` Mingwei Zhang
2024-08-29 20:45         ` Sean Christopherson
2024-09-02 18:37           ` Colton Lewis
2024-08-13 16:42 ` [PATCH 4/6] KVM: x86: selftests: Test read/write core counters Colton Lewis
2024-08-13 16:42 ` [PATCH 5/6] KVM: x86: selftests: Test core events Colton Lewis
2024-08-13 16:42 ` [PATCH 6/6] KVM: x86: selftests: Test PerfMonV2 Colton Lewis
2024-08-13 17:36 ` [PATCH 0/6] Extend pmu_counters_test to AMD CPUs Sean Christopherson
2024-08-13 20:09   ` Colton Lewis
2024-08-14  1:03     ` Sean Christopherson
2024-08-14 16:58       ` Colton Lewis
  -- strict thread matches above, loose matches on Subject: below --
2024-08-02 18:22 [PATCH 0/7] " Colton Lewis
2024-08-02 18:22 ` [PATCH 1/6] KVM: x86: selftests: Fix typos in macro variable use Colton Lewis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZsYwF5QJ8gqto8Mm@google.com \
    --to=mizhang@google.com \
    --cc=aaronlewis@google.com \
    --cc=coltonlewis@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=ljr.kernel@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox