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-next>] [day] [month] [year] [list]
Date:	Thu, 12 Aug 2010 14:28:49 -0700
From:	Venkatesh Pallipadi <venki@...gle.com>
To:	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andreas Herrmann <andreas.herrmann3@....com>
Cc:	linux-kernel@...r.kernel.org,
	Venkatesh Pallipadi <venki@...gle.com>
Subject: [PATCH] x86: Wrong /proc/cpuinfo core id on AMD fam_f model_9

Commit 4a376ec3a2599c02207cd4cbd5dbf73783548463 changes cpuinfo cpu_core_id
from an unique id in a physical package to core id within a node. And it
does not change phys_proc_id or booted_cores to reflect this new topology.

This breaks the user view of topology in /proc/cpuinfo.

With commit 4a376ec /proc/cpuinfo output (for one package) looks something like
processor: 0..11
physical id: 0..0
core id: 0..5 0..5
siblings: 12
cpu cores: 12

That is, there are processors with same "physical id" and same "core id" (which
are not SMT siblings). As I understand, if /proc/cpuinfo says there are 12
"cpu cores" per package, there should be 12 unique core ids in that package.
And same "physical id" and "core id" is supposed to indicate SMT siblings.

The change below reverts the cpu_core_id part of that commit and
/proc/cpuinfo has
processor: 0..11
physical id: 0..0
core id: 0..11
siblings: 12
cpu cores: 12


Also, if the intention of the original change was to export two node info,
then changing just the core id is not enough. User has no way to determine
which of these 6 cores out of 12 belong to same node by looking at
/proc/cpuinfo output. Both "physical id" and "cpu cores" has to change
to reflect that or one more node id needs to be added (I didn't say that :))

Signed-off-by: Venkatesh Pallipadi <venki@...gle.com>
---
 arch/x86/kernel/cpu/amd.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index e485825..80d3d80 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -281,9 +281,6 @@ static void __cpuinit amd_fixup_dcm(struct cpuinfo_x86 *c)
 
 	/* store NodeID, use llc_shared_map to store sibling info */
 	per_cpu(cpu_llc_id, cpu) = value & 7;
-
-	/* fixup core id to be in range from 0 to (cores_per_node - 1) */
-	c->cpu_core_id = c->cpu_core_id % cores_per_node;
 }
 #endif
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ