From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EFD021770B for ; Mon, 9 Feb 2026 16:38:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770655109; cv=none; b=DsvnY4xejInPzi3FjlTJvDk63kG9hI1GhqiUxU5rgmUjyL21wlALKdcK+qsA4VY+bSnB/VNC7AO2ty+3MRI89v3smb/ewTXEgxye3A7+Q/aocWU/kbx5HnLXJ+iJaGapMJbOLQfAJV7pC81RP4wzX5A39bxspYXap1amYMhJUu8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770655109; c=relaxed/simple; bh=B48DaaCO7+LfyvOi9x6gHsybR+8CdIPj7Qki/6Pp50o=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=lIt0r8/3XfeqXGawWn44JFAkg1pzzx1OJFDQqnAk2C82LjDPftprlFGRCkFW/RJn4OuwMBhH+6jsTvzLgQTakn8i+ojMF9U+ORdmiZ9+JrIRdwgQwdap4ZFlUKjvpvG6RfA+b7HEvC8hjTSuY9Wo8v9ri8iFqRApttvl4tRVrKw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=UH70CD5i; arc=none smtp.client-ip=209.85.216.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="UH70CD5i" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-354bc535546so2770092a91.3 for ; Mon, 09 Feb 2026 08:38:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770655108; x=1771259908; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=rx/VGrvTgLfTgDjWu+ZXokFymSwiySde0F3Aiwt+HCA=; b=UH70CD5iV6opvI53VDp5ROl/OAPU8hmPAUIZL8xBEDR0yskOSmm3UBmyYx7Mrtxol9 tRqW6rdiJH++gi0lzFVq210EbRFy94B0sBDXtW+UyXy7KZBZGlWEZr/hAXhRPEerGIY2 yXitXIDZmENR4S5il9x3FG74+m++yEN+NFF5c2WP+MbRVibjCCOMWLSjv5KQsThnR2OE JV3TUCcySV4/IPivgG1dtvzZ4H7pdDGTesCVB02RG3rI8X7i+gFDUNugYvaLuZ6DmPYb GfsvZtuEZxQmD+q2w17xYqz6agvKRomFB4zPEWEnPn7MJc4pI6fkEBO2zuhBoO9ZVk3p txcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770655108; x=1771259908; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rx/VGrvTgLfTgDjWu+ZXokFymSwiySde0F3Aiwt+HCA=; b=F/bLYoftEGM5Bg+KKpJQg5LpHTqN8rGtTDiQRYZEyHmOKdjBmJY2fYdHSWwcgIO2sY 91ohA0mp2HJkwnhFJla3ECOToiY1Dy65TXCYdA3QLXnTkUyYqlNdUVvthjmNydEfPAuf Y6iv44gquw8T5rXvt5IZcoczAu5qDsxd/XkMeipEv9ZGHgLnQceJhIaQJO2DeuDYQ3h1 NHp8Ez9wweIZsGiB/ghGkKuHnQfv8Eu/OZnUSj/PodMlF8ZiEZYyDF7RWoBs5mfRfner 8p2EUrohT04nittw3gCjU8vk3lSy/fZDMqk4SeyKCIapgJUbWm5+I/UfPz1QSs/SoPWw NF2A== X-Forwarded-Encrypted: i=1; AJvYcCXqUKnAHN5NpCGO75TvttbteFCfr6IYwkZOPp9I7fiAkxW/dMLxZe+tVaBxLp9/vNhAX56+rnn+pUkjvA4=@vger.kernel.org X-Gm-Message-State: AOJu0YyhBrrYMmRZ9HmUz6PocuH1PP0iineiUCliRnc4NhRjyUNq7N5z GZSNOES9Db+tt60bVCB++1iVjmmYX0HVPdIxVAk5Zf496igMoKEf3IFzb9/u42J5/aixVQMDvKx jV7ZWzQ== X-Received: from pjbei15.prod.google.com ([2002:a17:90a:e54f:b0:356:2800:2a52]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4fc6:b0:356:1dad:1b07 with SMTP id 98e67ed59e1d1-3561dad1e0fmr6194504a91.23.1770655108544; Mon, 09 Feb 2026 08:38:28 -0800 (PST) Date: Mon, 9 Feb 2026 08:38:27 -0800 In-Reply-To: <20260209041305.64906-5-zhiquan_li@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260209041305.64906-1-zhiquan_li@163.com> <20260209041305.64906-5-zhiquan_li@163.com> Message-ID: Subject: Re: [PATCH RESEND 4/5] KVM: x86: selftests: Allow the PMU event filter test for Hygon From: Sean Christopherson To: Zhiquan Li Cc: pbonzini@redhat.com, shuah@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" 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 > --- > 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; } /*