[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <691CAE2B-2FDC-44CA-8731-D70C91E94320@zytor.com>
Date: Tue, 10 Jan 2017 08:40:39 -0800
From: hpa@...or.com
To: Borislav Petkov <bp@...e.de>
CC: linux-tip-commits@...r.kernel.org,
tip-bot for Borislav Petkov <tipbot@...or.com>,
mingo@...nel.org, linux-kernel@...r.kernel.org, tglx@...utronix.de
Subject: Re: [tip:x86/urgent] x86/CPU: Add native CPUID variants returning a single datum
On January 10, 2017 1:04:15 AM PST, Borislav Petkov <bp@...e.de> wrote:
>On Mon, Jan 09, 2017 at 04:19:29PM -0800, hpa@...or.com wrote:
>> Any reason to not make these interfaces (leaf, subleaf) from the
>start?
>
>Two, actually:
>
>1. I modelled them after the cpuid_<reg>(op) versions
You are introducing a new API; makes more sense to do it right from the start. The only reason not to have a subleaf for the non-native variants is that they may decay into a function call so there is an extra cost.
>2. I don't think we need the subleaf variant right now.
But at some point we will. Just consider leaf 7.
>But, when we do, we can do that when we cross that bridge and add
>
>native_cpuid_<reg>(leaf, subleaf)
>
>which gets called by the native_cpuid_<reg>(leaf) variants.
C doesn't allow function name overloading ;) (Well, except the C11 type hacks; to the best of my knowledge that doesn't in any way support argument *count* overloading.)
This means that the naming will be awkward at best.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Powered by blists - more mailing lists