From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765340AbdAJQlA convert rfc822-to-8bit (ORCPT ); Tue, 10 Jan 2017 11:41:00 -0500 Received: from terminus.zytor.com ([198.137.202.10]:35070 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764136AbdAJQkz (ORCPT ); Tue, 10 Jan 2017 11:40:55 -0500 Date: Tue, 10 Jan 2017 08:40:39 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <20170110090415.46htye4aczidzvh2@pd.tnic> References: <20170109114147.5082-2-bp@alien8.de> <9724A6CA-1F64-4B4D-BAE4-4116FCE7838D@zytor.com> <20170110090415.46htye4aczidzvh2@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: [tip:x86/urgent] x86/CPU: Add native CPUID variants returning a single datum To: Borislav Petkov CC: linux-tip-commits@vger.kernel.org, tip-bot for Borislav Petkov , mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de From: hpa@zytor.com Message-ID: <691CAE2B-2FDC-44CA-8731-D70C91E94320@zytor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On January 10, 2017 1:04:15 AM PST, Borislav Petkov wrote: >On Mon, Jan 09, 2017 at 04:19:29PM -0800, hpa@zytor.com wrote: >> Any reason to not make these interfaces (leaf, subleaf) from the >start? > >Two, actually: > >1. I modelled them after the cpuid_(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_(leaf, subleaf) > >which gets called by the native_cpuid_(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.