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:	Mon, 21 Mar 2016 02:54:14 -0700
From:	tip-bot for Huang Rui <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	alexander.shishkin@...ux.intel.com, suravee.suthikulpanit@....com,
	dvlasenk@...hat.com, rric@...nel.org, vincent.weaver@...ne.edu,
	peterz@...radead.org, bp@...e.de, eranian@...gle.com,
	ray.huang@....com, dsahern@...il.com, bp@...en8.de,
	herrmann.der.user@...glemail.com, namhyung@...nel.org,
	luto@...nel.org, linux-kernel@...r.kernel.org,
	fengguang.wu@...el.com, john.stultz@...aro.org, hecmargi@....es,
	mingo@...nel.org, aaron.lu@...el.com, linux@...ck-us.net,
	brgerst@...il.com, jolsa@...hat.com, luto@...capital.net,
	hpa@...or.com, jacob.w.shin@...il.com, fweisbec@...il.com,
	tglx@...utronix.de, acme@...hat.com, torvalds@...ux-foundation.org,
	Aravind.Gopalakrishnan@....com
Subject: [tip:perf/urgent] perf/x86/amd: Move nodes_per_socket into
 bsp_init_amd()

Commit-ID:  8dfeae0d73bf803be1a533e147b3b0ea69375596
Gitweb:     http://git.kernel.org/tip/8dfeae0d73bf803be1a533e147b3b0ea69375596
Author:     Huang Rui <ray.huang@....com>
AuthorDate: Thu, 14 Jan 2016 10:50:04 +0800
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 21 Mar 2016 09:08:22 +0100

perf/x86/amd: Move nodes_per_socket into bsp_init_amd()

nodes_per_socket is static and it needn't be initialized many
times during every CPU core init. So move its initialization into
bsp_init_amd().

Signed-off-by: Huang Rui <ray.huang@....com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Cc: Aaron Lu <aaron.lu@...el.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Andreas Herrmann <herrmann.der.user@...glemail.com>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: Fengguang Wu <fengguang.wu@...el.com>
Cc: Frédéric Weisbecker <fweisbec@...il.com>
Cc: Guenter Roeck <linux@...ck-us.net>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Hector Marco-Gisbert <hecmargi@....es>
Cc: Jacob Shin <jacob.w.shin@...il.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Robert Richter <rric@...nel.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Vince Weaver <vincent.weaver@...ne.edu>
Cc: spg_linux_kernel@....com
Link: http://lkml.kernel.org/r/1452739808-11871-2-git-send-email-ray.huang@amd.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 arch/x86/kernel/cpu/amd.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index b39338c..d4b06e8 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -306,7 +306,6 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
 		u32 eax, ebx, ecx, edx;
 
 		cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
-		nodes_per_socket = ((ecx >> 8) & 7) + 1;
 		node_id = ecx & 7;
 
 		/* get compute unit information */
@@ -317,7 +316,6 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
 		u64 value;
 
 		rdmsrl(MSR_FAM10H_NODE_ID, value);
-		nodes_per_socket = ((value >> 3) & 7) + 1;
 		node_id = value & 7;
 	} else
 		return;
@@ -519,6 +517,18 @@ static void bsp_init_amd(struct cpuinfo_x86 *c)
 
 	if (cpu_has(c, X86_FEATURE_MWAITX))
 		use_mwaitx_delay();
+
+	if (boot_cpu_has(X86_FEATURE_TOPOEXT)) {
+		u32 ecx;
+
+		ecx = cpuid_ecx(0x8000001e);
+		nodes_per_socket = ((ecx >> 8) & 7) + 1;
+	} else if (boot_cpu_has(X86_FEATURE_NODEID_MSR)) {
+		u64 value;
+
+		rdmsrl(MSR_FAM10H_NODE_ID, value);
+		nodes_per_socket = ((value >> 3) & 7) + 1;
+	}
 }
 
 static void early_init_amd(struct cpuinfo_x86 *c)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ