From: "Chen, Zide" <zide.chen@intel.com>
To: Dapeng Mi <dapeng1.mi@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Andi Kleen <ak@linux.intel.com>,
Eranian Stephane <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Dapeng Mi <dapeng1.mi@intel.com>,
Falcon Thomas <thomas.falcon@intel.com>,
Xudong Hao <xudong.hao@intel.com>,
Kan Liang <kan.liang@linux.intel.com>
Subject: Re: [Patch v2] perf/x86/msr: Make SMI and PPERF on by default
Date: Fri, 27 Mar 2026 10:05:38 -0700 [thread overview]
Message-ID: <b65adc63-edf2-4927-8913-a431290d673d@intel.com> (raw)
In-Reply-To: <20260327052844.818218-1-dapeng1.mi@linux.intel.com>
On 3/26/2026 10:28 PM, Dapeng Mi wrote:
> From: Kan Liang <kan.liang@linux.intel.com>
>
> The MSRs, SMI_COUNT and PPERF, are model-specific MSRs. A very long
> CPU ID list is maintained to indicate the supported platforms. With more
> and more platforms being introduced, new CPU IDs have to be kept adding.
> Also, the old kernel has to be updated to apply the new CPU ID.
>
> The MSRs have been introduced for a long time. There is no plan to
> change them in the near future. Furthermore, the current code utilizes
> rdmsr_safe() to check the availability of MSRs before using it.
>
> Make them on by default. It should be good enough to only rely on the
> rdmsr_safe() to check their availability for both existing and future
> platforms.
>
> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
> Co-developed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
> Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
> ---
Reviewed-by: Zide Chen <zide.chen@intel.com>
>
> V2: Removed stale #include <asm/cpu_device_id.h>.
>
> V1: https://lore.kernel.org/lkml/20240910192626.768146-1-kan.liang@linux.intel.com/
>
> arch/x86/events/msr.c | 82 ++-----------------------------------------
> 1 file changed, 3 insertions(+), 79 deletions(-)
>
> diff --git a/arch/x86/events/msr.c b/arch/x86/events/msr.c
> index 8052596b8503..76d6418c5055 100644
> --- a/arch/x86/events/msr.c
> +++ b/arch/x86/events/msr.c
> @@ -2,7 +2,6 @@
> #include <linux/perf_event.h>
> #include <linux/sysfs.h>
> #include <linux/nospec.h>
> -#include <asm/cpu_device_id.h>
> #include <asm/msr.h>
>
> #include "probe.h"
> @@ -41,86 +40,11 @@ static bool test_therm_status(int idx, void *data)
>
> static bool test_intel(int idx, void *data)
> {
> - if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL ||
> - boot_cpu_data.x86 != 6)
> + if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
> return false;
>
> - switch (boot_cpu_data.x86_vfm) {
> - case INTEL_NEHALEM:
> - case INTEL_NEHALEM_G:
> - case INTEL_NEHALEM_EP:
> - case INTEL_NEHALEM_EX:
> -
> - case INTEL_WESTMERE:
> - case INTEL_WESTMERE_EP:
> - case INTEL_WESTMERE_EX:
> -
> - case INTEL_SANDYBRIDGE:
> - case INTEL_SANDYBRIDGE_X:
> -
> - case INTEL_IVYBRIDGE:
> - case INTEL_IVYBRIDGE_X:
> -
> - case INTEL_HASWELL:
> - case INTEL_HASWELL_X:
> - case INTEL_HASWELL_L:
> - case INTEL_HASWELL_G:
> -
> - case INTEL_BROADWELL:
> - case INTEL_BROADWELL_D:
> - case INTEL_BROADWELL_G:
> - case INTEL_BROADWELL_X:
> - case INTEL_SAPPHIRERAPIDS_X:
> - case INTEL_EMERALDRAPIDS_X:
> - case INTEL_GRANITERAPIDS_X:
> - case INTEL_GRANITERAPIDS_D:
> -
> - case INTEL_ATOM_SILVERMONT:
> - case INTEL_ATOM_SILVERMONT_D:
> - case INTEL_ATOM_AIRMONT:
> - case INTEL_ATOM_AIRMONT_NP:
> -
> - case INTEL_ATOM_GOLDMONT:
> - case INTEL_ATOM_GOLDMONT_D:
> - case INTEL_ATOM_GOLDMONT_PLUS:
> - case INTEL_ATOM_TREMONT_D:
> - case INTEL_ATOM_TREMONT:
> - case INTEL_ATOM_TREMONT_L:
> -
> - case INTEL_XEON_PHI_KNL:
> - case INTEL_XEON_PHI_KNM:
> - if (idx == PERF_MSR_SMI)
> - return true;
> - break;
> -
> - case INTEL_SKYLAKE_L:
> - case INTEL_SKYLAKE:
> - case INTEL_SKYLAKE_X:
> - case INTEL_KABYLAKE_L:
> - case INTEL_KABYLAKE:
> - case INTEL_COMETLAKE_L:
> - case INTEL_COMETLAKE:
> - case INTEL_ICELAKE_L:
> - case INTEL_ICELAKE:
> - case INTEL_ICELAKE_X:
> - case INTEL_ICELAKE_D:
> - case INTEL_TIGERLAKE_L:
> - case INTEL_TIGERLAKE:
> - case INTEL_ROCKETLAKE:
> - case INTEL_ALDERLAKE:
> - case INTEL_ALDERLAKE_L:
> - case INTEL_ATOM_GRACEMONT:
> - case INTEL_RAPTORLAKE:
> - case INTEL_RAPTORLAKE_P:
> - case INTEL_RAPTORLAKE_S:
> - case INTEL_METEORLAKE:
> - case INTEL_METEORLAKE_L:
> - if (idx == PERF_MSR_SMI || idx == PERF_MSR_PPERF)
> - return true;
> - break;
> - }
> -
> - return false;
> + /* Rely on perf_msr_probe() to check the availability */
> + return true;
> }
>
> PMU_EVENT_ATTR_STRING(tsc, attr_tsc, "event=0x00" );
>
> base-commit: 6ee26b7a224b27aa7e8e1ee8a845a31664d2e97c
prev parent reply other threads:[~2026-03-27 17:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-27 5:28 [Patch v2] perf/x86/msr: Make SMI and PPERF on by default Dapeng Mi
2026-03-27 17:05 ` Chen, Zide [this message]
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=b65adc63-edf2-4927-8913-a431290d673d@intel.com \
--to=zide.chen@intel.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dapeng1.mi@intel.com \
--cc=dapeng1.mi@linux.intel.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=thomas.falcon@intel.com \
--cc=xudong.hao@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox