From: Sean Christopherson <seanjc@google.com>
To: Zhiquan Li <zhiquan_li@163.com>
Cc: pbonzini@redhat.com, shuah@kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND 4/5] KVM: x86: selftests: Allow the PMU event filter test for Hygon
Date: Mon, 9 Feb 2026 08:38:27 -0800 [thread overview]
Message-ID: <aYoNg4dUNluaQgVJ@google.com> (raw)
In-Reply-To: <20260209041305.64906-5-zhiquan_li@163.com>
On Mon, Feb 09, 2026, Zhiquan Li wrote:
> At present, the PMU event filter test is only available for Intel and
> AMD architecture conditionally, but it is applicable for Hygon
> architecture as well.
>
> Since all known Hygon processors can re-use the test cases, so it isn't
> necessary to create a wrapper like other architectures, using the
> "host_cpu_is_hygon" variable should be enough.
>
> Signed-off-by: Zhiquan Li <zhiquan_li@163.com>
> ---
> tools/testing/selftests/kvm/x86/pmu_event_filter_test.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/x86/pmu_event_filter_test.c b/tools/testing/selftests/kvm/x86/pmu_event_filter_test.c
> index 1c5b7611db24..e6badd9a2a2a 100644
> --- a/tools/testing/selftests/kvm/x86/pmu_event_filter_test.c
> +++ b/tools/testing/selftests/kvm/x86/pmu_event_filter_test.c
> @@ -842,14 +842,14 @@ int main(int argc, char *argv[])
> TEST_REQUIRE(kvm_has_cap(KVM_CAP_PMU_EVENT_FILTER));
> TEST_REQUIRE(kvm_has_cap(KVM_CAP_PMU_EVENT_MASKED_EVENTS));
>
> - TEST_REQUIRE(use_intel_pmu() || use_amd_pmu());
> + TEST_REQUIRE(use_intel_pmu() || use_amd_pmu() || host_cpu_is_hygon);
Manually handling every check is rather silly, just do:
diff --git a/tools/testing/selftests/kvm/x86/pmu_event_filter_test.c b/tools/testing/selftests/kvm/x86/pmu_event_filter_test.c
index 1c5b7611db24..93b61c077991 100644
--- a/tools/testing/selftests/kvm/x86/pmu_event_filter_test.c
+++ b/tools/testing/selftests/kvm/x86/pmu_event_filter_test.c
@@ -361,7 +361,8 @@ static bool use_intel_pmu(void)
*/
static bool use_amd_pmu(void)
{
- return host_cpu_is_amd && kvm_cpu_family() >= 0x17;
+ return (host_cpu_is_amd && kvm_cpu_family() >= 0x17) ||
+ host_cpu_is_hygon;
}
/*
next prev parent reply other threads:[~2026-02-09 16:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-09 4:13 [PATCH RESEND 0/5] KVM: x86: selftests: Add Hygon CPUs support and fix failures Zhiquan Li
2026-02-09 4:13 ` [PATCH RESEND 1/5] KVM: x86: selftests: Add CPU vendor detection for Hygon Zhiquan Li
2026-02-09 4:13 ` [PATCH RESEND 2/5] KVM: x86: selftests: Alter the instruction of hypercall on Hygon Zhiquan Li
2026-02-09 16:37 ` Sean Christopherson
2026-02-10 9:04 ` Zhiquan Li
2026-02-09 4:13 ` [PATCH RESEND 3/5] KVM: x86: selftests: Avoid failures due to reserved memory address regions " Zhiquan Li
2026-02-09 4:13 ` [PATCH RESEND 4/5] KVM: x86: selftests: Allow the PMU event filter test for Hygon Zhiquan Li
2026-02-09 16:38 ` Sean Christopherson [this message]
2026-02-10 9:07 ` Zhiquan Li
2026-02-09 4:13 ` [PATCH RESEND 5/5] KVM: x86: selftests: Fix write MSR_TSC_AUX reserved bits test failure on Hygon Zhiquan Li
2026-02-09 16:41 ` Sean Christopherson
2026-02-10 10:17 ` Zhiquan Li
2026-02-10 20:02 ` Sean Christopherson
2026-02-11 9:24 ` Zhiquan Li
2026-02-11 16:26 ` Sean Christopherson
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=aYoNg4dUNluaQgVJ@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=shuah@kernel.org \
--cc=zhiquan_li@163.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.