Commit 74a5843c authored by Liao Xuan's avatar Liao Xuan
Browse files

perf/x86/uncore: Add L3 PMU support for Hygon family 18h model 7h

hygon inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9VW6G


CVE: NA

---------------------------

From model 6h, Hygon processors can use the same L3 PMU slicemask
and threadmask.

Signed-off-by: default avatarLiao Xuan <liaoxuan@hygon.cn>
parent ec401fb6
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -250,7 +250,8 @@ amd_f17h_uncore_is_visible(struct kobject *kobj, struct attribute *attr, int i)
static umode_t
hygon_f18h_m6h_uncore_is_visible(struct kobject *kobj, struct attribute *attr, int i)
{
	return boot_cpu_data.x86 == 0x18 && boot_cpu_data.x86_model == 0x6 ?
	return boot_cpu_data.x86 == 0x18 &&
	       boot_cpu_data.x86_model >= 0x6 && boot_cpu_data.x86_model <= 0xf	?
	       attr->mode : 0;
}

@@ -774,7 +775,7 @@ static int amd_uncore_l3_event_init(struct perf_event *event)
		       ((config & AMD64_L3_THREAD_MASK) ? : AMD64_L3_THREAD_MASK);
	else if (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON &&
		 boot_cpu_data.x86 == 0x18) {
		if (boot_cpu_data.x86_model == 0x6)
		if (boot_cpu_data.x86_model >= 0x6 && boot_cpu_data.x86_model <= 0xf)
			return ((config & HYGON_L3_SLICE_MASK) ? : HYGON_L3_SLICE_MASK) |
			       ((config & HYGON_L3_THREAD_MASK) ? : HYGON_L3_THREAD_MASK);
		else
@@ -878,7 +879,7 @@ int amd_uncore_l3_ctx_init(struct amd_uncore *uncore, unsigned int cpu)
	    boot_cpu_data.x86 == 0x18) {
		*l3_attr++ = &format_attr_event8.attr;
		*l3_attr++ = &format_attr_umask8.attr;
		if (boot_cpu_data.x86_model == 0x6) {
		if (boot_cpu_data.x86_model >= 0x6 && boot_cpu_data.x86_model <= 0xf) {
			*l3_attr++ = &format_attr_threadmask32.attr;
			pmu->pmu.attr_update = hygon_uncore_l3_attr_update;
		} else {