From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751589AbcBVSyJ (ORCPT ); Mon, 22 Feb 2016 13:54:09 -0500 Received: from mga04.intel.com ([192.55.52.120]:50428 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751145AbcBVSyH (ORCPT ); Mon, 22 Feb 2016 13:54:07 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,485,1449561600"; d="scan'208";a="921427908" From: Andi Kleen To: Thomas Gleixner Cc: LKML , Peter Zijlstra , x86@kernel.org, Borislav Petkov , Stephane Eranian , Harish Chegondi , Kan Liang , Andi Kleen , Jacob Pan Subject: Re: [patch V2 11/28] x86/topology: Create logical package id References: <20160222110337.198341739@linutronix.de> <20160222110441.100696947@linutronix.de> Date: Mon, 22 Feb 2016 10:54:01 -0800 In-Reply-To: <20160222110441.100696947@linutronix.de> (Thomas Gleixner's message of "Mon, 22 Feb 2016 11:06:50 -0000") Message-ID: <87h9h0pody.fsf@tassilo.jf.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thomas Gleixner writes: > + > + if (c->cpuid_level >= 0x00000001) { > + u32 eax, ebx, ecx, edx; > + > + cpuid(0x00000001, &eax, &ebx, &ecx, &edx); Use cpuid_edx() > + /* > + * If HTT (EDX[28]) is set EBX[16:23] contain the number of > + * apicids which are reserved per package. Store the resulting > + * shift value for the package management code. > + */ > + if (edx & (1U << 28)) > + c->x86_coreid_bits = get_count_order((ebx >> 16) & 0xff); > + } > +++ b/arch/x86/kernel/cpu/proc.c > @@ -12,6 +12,7 @@ static void show_cpuinfo_core(struct seq > { > #ifdef CONFIG_SMP > seq_printf(m, "physical id\t: %d\n", c->phys_proc_id); > + seq_printf(m, "logical id\t: %d\n", c->logical_proc_id); I'm not sure it makes sense to export this. What good would it be for the user? If it was it would need to be documented somewhere. But I would just drop it and keep it kernel internal. FWIW every time something is added to this file it usually breaks some (dumb) programs. > + /* > + * Today neither Intel nor AMD support heterogenous systems. That > + * might change in the future.... > + */ > + ncpus = boot_cpu_data.x86_max_cores * smp_num_siblings; > + __max_logical_packages = DIV_ROUND_UP(nr_cpu_ids, ncpus); FWIW Hypervisors can do nearly everything today. I assume your code handles it. Let's hope that the Hypervisors always set up the correct CPUID now for their sibling configuration. If they don't with this change some CPUs would be suddenly lost. Would it be worth to have a kernel option where the maximum can be overriden in case this happens? -Andi -- ak@linux.intel.com -- Speaking for myself only