[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aYoNg4dUNluaQgVJ@google.com>
Date: Mon, 9 Feb 2026 08:38:27 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Zhiquan Li <zhiquan_li@....com>
Cc: pbonzini@...hat.com, shuah@...nel.org, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND 4/5] KVM: x86: selftests: Allow the PMU event
filter test for Hygon
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@....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;
}
/*
Powered by blists - more mailing lists