Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1555699

Re: [tip:x86/urgent] x86/CPU: Add native CPUID variants returning a single datum

From hpa@zytor.com
Newsgroups linux.kernel
Subject Re: [tip:x86/urgent] x86/CPU: Add native CPUID variants returning a single datum
Date 2017-01-10 17:50 +0100
Message-ID <sY7Mt-3II-33@gated-at.bofh.it> (permalink)
References <sXGCD-3EW-21@gated-at.bofh.it> <sXQsi-1ot-29@gated-at.bofh.it> <sXSu5-2ym-13@gated-at.bofh.it> <sY0L0-7Ue-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On January 10, 2017 1:04:15 AM PST, Borislav Petkov <bp@suse.de> 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_<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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] x86/microcode: More urgent fixes Borislav Petkov <bp@alien8.de> - 2017-01-09 12:50 +0100
  [PATCH 1/5] x86/CPU: Add native CPUID variants returning a single datum Borislav Petkov <bp@alien8.de> - 2017-01-09 12:50 +0100
    [tip:x86/urgent] x86/CPU: Add native CPUID variants returning a  single datum tip-bot for Borislav Petkov <tipbot@zytor.com> - 2017-01-09 23:20 +0100
      Re: [tip:x86/urgent] x86/CPU: Add native CPUID variants returning a single datum hpa@zytor.com - 2017-01-10 01:30 +0100
        Re: [tip:x86/urgent] x86/CPU: Add native CPUID variants returning a  single datum Borislav Petkov <bp@suse.de> - 2017-01-10 10:20 +0100
          Re: [tip:x86/urgent] x86/CPU: Add native CPUID variants returning a single datum hpa@zytor.com - 2017-01-10 17:50 +0100
            Re: [tip:x86/urgent] x86/CPU: Add native CPUID variants returning a  single datum Borislav Petkov <bp@suse.de> - 2017-01-10 18:10 +0100

csiph-web