From af9a7ae09549e482598e9312719ee1df16f5c898 Mon Sep 17 00:00:00 2001 From: Liao Xuan Date: Tue, 27 Jan 2026 16:51:57 +0800 Subject: [PATCH] perf/x86/uncore: Add DF PMU support for Hygon family 18h model 18h Adjust the DF PMU event and umask for Hygon family 18h model 18h processor. Hygon-SIG: perf/x86/uncore: Add DF PMU support for Hygon family 18h model 18h Signed-off-by: Liao Xuan Signed-off-by: yuntong --- arch/x86/events/amd/uncore.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c index 2d7840ea0743..7804fade31c2 100644 --- a/arch/x86/events/amd/uncore.c +++ b/arch/x86/events/amd/uncore.c @@ -242,10 +242,8 @@ static int amd_uncore_event_init(struct perf_event *event) if (boot_cpu_data.x86_model == 0x4 || boot_cpu_data.x86_model == 0x5) event_mask = HYGON_F18H_M4H_RAW_EVENT_MASK_NB; - if (boot_cpu_data.x86_model == 0x6 || - boot_cpu_data.x86_model == 0x7 || - boot_cpu_data.x86_model == 0x8 || - boot_cpu_data.x86_model == 0x10) + if (boot_cpu_data.x86_model >= 0x6 && + boot_cpu_data.x86_model <= 0x18) event_mask = HYGON_F18H_M6H_RAW_EVENT_MASK_NB; } if (pmu_version >= 2 && is_nb_event(event)) @@ -742,10 +740,8 @@ static int __init amd_uncore_init(void) if (boot_cpu_data.x86_model == 0x4 || boot_cpu_data.x86_model == 0x5) *df_attr++ = &format_attr_umask10f18h.attr; - else if (boot_cpu_data.x86_model == 0x6 || - boot_cpu_data.x86_model == 0x7 || - boot_cpu_data.x86_model == 0x8 || - boot_cpu_data.x86_model == 0x10) + else if (boot_cpu_data.x86_model >= 0x6 && + boot_cpu_data.x86_model <= 0x18) *df_attr++ = &format_attr_umask12f18h.attr; } -- Gitee