Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932313AbcLTJaw (ORCPT ); Tue, 20 Dec 2016 04:30:52 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:55883 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751125AbcLTJas (ORCPT ); Tue, 20 Dec 2016 04:30:48 -0500 Date: Tue, 20 Dec 2016 10:27:36 +0100 (CET) From: Thomas Gleixner To: "H. Peter Anvin" cc: brgerst@gmail.com, luto@kernel.org, bp@alien8.de, linux-kernel@vger.kernel.org, mingo@kernel.org, linux-tip-commits@vger.kernel.org Subject: Re: [tip:x86/urgent] x86/cpu: Probe CPUID leaf 6 even when cpuid_level == 6 In-Reply-To: Message-ID: References: <6ea30c0e9daec21e488b54761881a6dfcf3e04d0.1481825597.git.luto@kernel.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 867 Lines: 21 On Mon, 19 Dec 2016, H. Peter Anvin wrote: > P.S. I would love to (a) move the CPUID bits into a structure instead of > passing all those crazy pointers around, and (b) stop passing struct > cpuinfo * around when we only use it for the current processor anyway (a > lot of these functions are in fact completely invalid if we don't); we > could define this_cpu_info as (*this_cpu_ptr(&cpu_info)) -- basically > what I have above -- or directly use percpu functions to access these > variables. The whole cpu identify code wants to be rewritten completely. It's full of conditionals and places which read the same cpuid leaf over and over. The whole thing is just insane. The proper solution is to have a single function which reads all available leafs into a data structure and then do all the conditional computations and decisions based on that. Thanks, tglx