public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add support for pebs fmt6(Lunar Lake)
@ 2024-12-26  8:52 Yiwei Yang
  0 siblings, 0 replies; 3+ messages in thread
From: Yiwei Yang @ 2024-12-26  8:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-perf-users, hpa, bp, tglx, kan.liang, adrian.hunter,
	irogers, jolsa, alexander.shishkin, mark.rutland, namhyung, acme,
	mingo, peterz, Yiwei Yang

Signed-off-by: Yiwei Yang <victoryang00@ucsc.edu>
---
 arch/x86/events/intel/ds.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
index 1a4b326ca..0c001844d 100644
--- a/arch/x86/events/intel/ds.c
+++ b/arch/x86/events/intel/ds.c
@@ -2516,7 +2516,8 @@ void __init intel_ds_init(void)
 			x86_pmu.drain_pebs = intel_pmu_drain_pebs_nhm;
 			x86_pmu.large_pebs_flags |= PERF_SAMPLE_TIME;
 			break;
-
+			
+		case 6:
 		case 5:
 			x86_pmu.pebs_ept = 1;
 			fallthrough;
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] Add support for pebs fmt6(Lunar Lake)
@ 2024-12-26  8:56 Yiwei Yang
  2025-01-02 18:51 ` Liang, Kan
  0 siblings, 1 reply; 3+ messages in thread
From: Yiwei Yang @ 2024-12-26  8:56 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-perf-users, hpa, bp, tglx, kan.liang, adrian.hunter,
	irogers, jolsa, alexander.shishkin, mark.rutland, namhyung, acme,
	mingo, peterz, Yiwei Yang

Signed-off-by: Yiwei Yang <victoryang00@ucsc.edu>

Lunar lake's pebs is not kernel ready. in dmesg I found

victoryang00@victoryang00-ASUS-Zenbook-S-14-UX5406SA-UX5406SA:~$ sudo dmesg|grep PMU
[sudo] password for victoryang00: 
[    0.107418] Performance Events: XSAVE Architectural LBR, no PEBS fmt6+,  AnyThread deprecated, Lunarlake Hybrid events, 32-deep LBR, full-width counters, Intel PMU driver.
[    0.107418] core: cpu_core PMU driver: 
[    0.107418] NMI watchdog: Enabled. Permanently consumes one hw-PMU counter.
[    0.007380] core: cpu_atom PMU driver: 
[    2.802582] RAPL PMU: API unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
[    2.802585] RAPL PMU: hw unit of domain pp0-core 2^-14 Joules
[    2.802586] RAPL PMU: hw unit of domain package 2^-14 Joules
[    2.802587] RAPL PMU: hw unit of domain dram 2^-14 Joules
[    2.802587] RAPL PMU: hw unit of domain pp1-gpu 2^-14 Joules

But lunar lake has the pebs extension in lscpu

    Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge m
                          ca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 s
                          s ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc 
                          art arch_perfmon pebs bts rep_good nopl xtopology nons
                          top_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq 
                          dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma c
                          x16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt t
                          sc_deadline_timer aes xsave avx f16c rdrand lahf_lm ab
                          m 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp i
                          brs_enhanced tpr_shadow flexpriority ept vpid ept_ad f
                          sgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rd
                          t_a rdseed adx smap clflushopt clwb intel_pt sha_ni xs
                          aveopt xsavec xgetbv1 xsaves split_lock_detect avx_vnn
                          i lam wbnoinvd dtherm ida arat pln pts hwp hwp_notify 
                          hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku o
                          spke waitpkg gfni vaes vpclmulqdq rdpid bus_lock_detec
                          t movdiri movdir64b fsrm md_clear serialize pconfig ar
                          ch_lbr ibt flush_l1d arch_capabilities


But I found implementation [1] and [2].

The code in the kernel seems not updated [3].

[1] https://github.com/search?q=repo%3Atorvalds%2Flinux%20MSR_IA32_PMC_V6_FX0_CTR&type=code 
[2] https://lwn.net/ml/all/20240625182256.291914-9-kan.liang@linux.intel.com/
[3] https://elixir.bootlin.com/linux/v6.13-rc3/source/arch/x86/events/intel/ds.c#L2480


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add support for pebs fmt6(Lunar Lake)
  2024-12-26  8:56 [PATCH] Add support for pebs fmt6(Lunar Lake) Yiwei Yang
@ 2025-01-02 18:51 ` Liang, Kan
  0 siblings, 0 replies; 3+ messages in thread
From: Liang, Kan @ 2025-01-02 18:51 UTC (permalink / raw)
  To: Yiwei Yang, linux-kernel
  Cc: linux-perf-users, hpa, bp, tglx, adrian.hunter, irogers, jolsa,
	alexander.shishkin, mark.rutland, namhyung, acme, mingo, peterz,
	Yiwei Yang



On 2024-12-26 3:56 a.m., Yiwei Yang wrote:
> Signed-off-by: Yiwei Yang <victoryang00@ucsc.edu>
> 
> Lunar lake's pebs is not kernel ready. in dmesg I found
> 
> victoryang00@victoryang00-ASUS-Zenbook-S-14-UX5406SA-UX5406SA:~$ sudo dmesg|grep PMU
> [sudo] password for victoryang00: 
> [    0.107418] Performance Events: XSAVE Architectural LBR, no PEBS fmt6+,  AnyThread deprecated, Lunarlake Hybrid events, 32-deep LBR, full-width counters, Intel PMU driver.
> [    0.107418] core: cpu_core PMU driver: 
> [    0.107418] NMI watchdog: Enabled. Permanently consumes one hw-PMU counter.
> [    0.007380] core: cpu_atom PMU driver: 
> [    2.802582] RAPL PMU: API unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> [    2.802585] RAPL PMU: hw unit of domain pp0-core 2^-14 Joules
> [    2.802586] RAPL PMU: hw unit of domain package 2^-14 Joules
> [    2.802587] RAPL PMU: hw unit of domain dram 2^-14 Joules
> [    2.802587] RAPL PMU: hw unit of domain pp1-gpu 2^-14 Joules
> 
> But lunar lake has the pebs extension in lscpu
> 
>     Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge m
>                           ca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 s
>                           s ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc 
>                           art arch_perfmon pebs bts rep_good nopl xtopology nons
>                           top_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq 
>                           dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma c
>                           x16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt t
>                           sc_deadline_timer aes xsave avx f16c rdrand lahf_lm ab
>                           m 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp i
>                           brs_enhanced tpr_shadow flexpriority ept vpid ept_ad f
>                           sgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rd
>                           t_a rdseed adx smap clflushopt clwb intel_pt sha_ni xs
>                           aveopt xsavec xgetbv1 xsaves split_lock_detect avx_vnn
>                           i lam wbnoinvd dtherm ida arat pln pts hwp hwp_notify 
>                           hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku o
>                           spke waitpkg gfni vaes vpclmulqdq rdpid bus_lock_detec
>                           t movdiri movdir64b fsrm md_clear serialize pconfig ar
>                           ch_lbr ibt flush_l1d arch_capabilities
> 
> 
> But I found implementation [1] and [2].
> 
> The code in the kernel seems not updated [3].
> 
> [1] https://github.com/search?q=repo%3Atorvalds%2Flinux%20MSR_IA32_PMC_V6_FX0_CTR&type=code 
> [2] https://lwn.net/ml/all/20240625182256.291914-9-kan.liang@linux.intel.com/
> [3] https://elixir.bootlin.com/linux/v6.13-rc3/source/arch/x86/events/intel/ds.c#L2480
> 

Thanks for the report. The fix has been merged into the tip branch.
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=b8c3a2502a205321fe66c356f4b70cabd8e1a5fc

Thanks,
Kan


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-02 18:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-26  8:56 [PATCH] Add support for pebs fmt6(Lunar Lake) Yiwei Yang
2025-01-02 18:51 ` Liang, Kan
  -- strict thread matches above, loose matches on Subject: below --
2024-12-26  8:52 Yiwei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox