From d528a9cb37d4194ee9d60815052a4f3d83ba27a2 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Tue, 14 Jun 2011 16:33:25 +0800 Subject: [PATCH] i386: Don't log cores per CPU and logical CPUs per core --- sys/platform/pc32/i386/identcpu.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/platform/pc32/i386/identcpu.c b/sys/platform/pc32/i386/identcpu.c index 5c72fd5787..98a10b0475 100644 --- a/sys/platform/pc32/i386/identcpu.c +++ b/sys/platform/pc32/i386/identcpu.c @@ -158,8 +158,10 @@ static struct { #endif }; -int cpu_cores; -int cpu_logical; +#ifdef foo +static int cpu_cores; +static int cpu_logical; +#endif #if defined(I586_CPU) && !defined(NO_F00F_HACK) int has_f00f_bug = 0; /* Initialized so that it can be patched. */ @@ -869,13 +871,23 @@ printcpuinfo(void) if ((regs[0] & 0x1f) != 0) cmp = ((regs[0] >> 26) & 0x3f) + 1; } + +#ifdef foo + /* + * XXX For Intel CPUs, this is max number of cores per + * package, not the actual cores per package. + */ cpu_cores = cmp; cpu_logical = htt / cmp; - if (cmp > 1) - kprintf("\n Cores per package: %d", cmp); - if ((htt / cmp) > 1) + + if (cpu_cores > 1) + kprintf("\n Cores per package: %d", cpu_cores); + if (cpu_logical > 1) { kprintf("\n Logical CPUs per core: %d", cpu_logical); + } +#endif + #if 0 /* * If this CPU supports P-state invariant TSC then -- 2.41.0