Module Name: src Committed By: mlelstv Date: Sun Jan 28 16:15:41 UTC 2018
Modified Files: src/sys/arch/x86/x86: cpu_topology.c Log Message: CPUID tells the ApicIdCoreIdSize in bits. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/x86/cpu_topology.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/x86/cpu_topology.c diff -u src/sys/arch/x86/x86/cpu_topology.c:1.11 src/sys/arch/x86/x86/cpu_topology.c:1.12 --- src/sys/arch/x86/x86/cpu_topology.c:1.11 Sun Jan 28 15:00:42 2018 +++ src/sys/arch/x86/x86/cpu_topology.c Sun Jan 28 16:15:41 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu_topology.c,v 1.11 2018/01/28 15:00:42 mlelstv Exp $ */ +/* $NetBSD: cpu_topology.c,v 1.12 2018/01/28 16:15:41 mlelstv Exp $ */ /*- * Copyright (c) 2009 Mindaugas Rasiukevicius <rmind at NetBSD org>, @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cpu_topology.c,v 1.11 2018/01/28 15:00:42 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu_topology.c,v 1.12 2018/01/28 16:15:41 mlelstv Exp $"); #include <sys/param.h> #include <sys/bitops.h> @@ -108,6 +108,7 @@ x86_cpu_topology(struct cpu_info *ci) core_max = lp_max; break; } + /* Number of Cores (NC) per package (ecx[7:0]). */ x86_cpuid(0x80000008, descs); core_max = (descs[2] & 0xff) + 1; @@ -116,9 +117,9 @@ x86_cpu_topology(struct cpu_info *ci) if (n != 0) { /* * Extended Method. - * core_bits = 2 ^ n (power of two) + * core_max = 2 ^ n (power of two) */ - core_bits = 1 << n; + core_bits = n; } break; default: