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:	Tue,  3 Mar 2015 23:18:13 +0800
From:	Daniel J Blueman <daniel@...ascale.com>
To:	Ingo Molnar <mingo@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>
Cc:	x86@...nel.org, linux-kernel@...r.kernel.org,
	Steffen Persvold <sp@...ascale.com>,
	Daniel J Blueman <daniel@...ascale.com>
Subject: [PATCH RESEND] x86: Fix sibling map with NumaChip

On NumaChip systems, the physical processor ID assignment wasn't accounting
for the number of nodes in AMD multi-module processors, giving an incorrect
sibling map:

$ cd /sys/devices/system/cpu/cpu29/topology
$ grep . *
core_id:5
core_siblings:00000000,ff000000
core_siblings_list:24-31
physical_package_id:3
thread_siblings:00000000,30000000
thread_siblings_list:28-29

After fixing:

core_id:5
core_siblings:00000000,ffff0000
core_siblings_list:16-31
physical_package_id:1
thread_siblings:00000000,30000000
thread_siblings_list:28-29

Candidate for stable.

Signed-off-by: Daniel J Blueman <daniel@...ascale.com>
---
 arch/x86/kernel/apic/apic_numachip.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c
index 19f893f..a59768b 100644
--- a/arch/x86/kernel/apic/apic_numachip.c
+++ b/arch/x86/kernel/apic/apic_numachip.c
@@ -180,11 +180,15 @@ static int __init numachip_probe(void)
 
 static void fixup_cpu_id(struct cpuinfo_x86 *c, int node)
 {
-
-	if (c->phys_proc_id != node) {
-		c->phys_proc_id = node;
-		per_cpu(cpu_llc_id, smp_processor_id()) = node;
-	}
+	u64 val;
+	u32 nodes;
+
+	per_cpu(cpu_llc_id, smp_processor_id()) = node;
+
+	/* Account for nodes per socket in multi-core-module processors */
+	rdmsrl(MSR_FAM10H_NODE_ID, val);
+	nodes = ((val >> 3) & 7) + 1;
+	c->phys_proc_id = node / nodes;
 }
 
 static int parse_oemn(struct acpi_table_header *table)
-- 
2.1.0

--
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