lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 19 Feb 2019 12:00:06 -0800
From:   kan.liang@...ux.intel.com
To:     peterz@...radead.org, tglx@...utronix.de, acme@...nel.org,
        mingo@...hat.com, x86@...nel.org, linux-kernel@...r.kernel.org
Cc:     len.brown@...el.com, jolsa@...hat.com, namhyung@...nel.org,
        eranian@...gle.com, ak@...ux.intel.com,
        Kan Liang <kan.liang@...ux.intel.com>
Subject: [PATCH 05/10] perf/x86/intel/domain: Add new domain type for die

From: Kan Liang <kan.liang@...ux.intel.com>

Starts from CLX-AP, some uncore and RAPL counters are die scope.

Add a new domain type DIE_DOMAIN for die scope counters.

To distinguish different die among package, unique die id is used as
domain id.

Signed-off-by: Kan Liang <kan.liang@...ux.intel.com>
---
 arch/x86/events/domain.c | 11 +++++++++++
 arch/x86/events/domain.h |  1 +
 2 files changed, 12 insertions(+)

diff --git a/arch/x86/events/domain.c b/arch/x86/events/domain.c
index bd24c5b..1f572a5 100644
--- a/arch/x86/events/domain.c
+++ b/arch/x86/events/domain.c
@@ -17,6 +17,10 @@ int domain_type_init(struct domain_type *type)
 	case CORE_DOMAIN:
 		type->postfix = "core";
 		return 0;
+	case DIE_DOMAIN:
+		type->max_domains = topology_max_packages() * boot_cpu_data.x86_max_dies;
+		type->postfix = "die";
+		return 0;
 	default:
 		return -1;
 	}
@@ -31,6 +35,8 @@ const struct cpumask *get_domain_cpu_mask(int cpu, struct domain_type *type)
 		return topology_die_cpumask(cpu);
 	case CORE_DOMAIN:
 		return topology_sibling_cpumask(cpu);
+	case DIE_DOMAIN:
+		return topology_core_cpumask(cpu);
 	default:
 		return NULL;
 	}
@@ -47,6 +53,9 @@ int get_domain_id(unsigned int cpu, struct domain_type *type)
 	case PACKAGE_DOMAIN:
 		/* Domain id is the same as logical package id */
 		return topology_logical_package_id(cpu);
+	case DIE_DOMAIN:
+		/* Domain id is the same as logical unique die id */
+		return topology_unique_die_id(cpu);
 	default:
 		return -1;
 	}
@@ -63,6 +72,8 @@ int get_domain_id_from_group_id(int id, struct domain_type *type)
 	case PACKAGE_DOMAIN:
 		/* group id is physical pkg id*/
 		return topology_phys_to_logical_pkg(id);
+	case DIE_DOMAIN:
+		return id;
 	default:
 		return -1;
 	}
diff --git a/arch/x86/events/domain.h b/arch/x86/events/domain.h
index c787816..7815aea 100644
--- a/arch/x86/events/domain.h
+++ b/arch/x86/events/domain.h
@@ -9,6 +9,7 @@
 enum domain_types {
 	PACKAGE_DOMAIN = 0,
 	CORE_DOMAIN,
+	DIE_DOMAIN,
 
 	DOMAIN_TYPE_MAX,
 };
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ