Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1548786
| From | Andy Lutomirski <luto@amacapital.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] x86/CPU: Add native CPUID variants returning a single datum |
| Date | 2016-12-31 03:20 +0100 |
| Message-ID | <sUhr3-5cP-1@gated-at.bofh.it> (permalink) |
| References | <sTelz-3km-5@gated-at.bofh.it> <sTkAG-7wR-11@gated-at.bofh.it> <sTkAG-7wR-9@gated-at.bofh.it> <sTqZs-3sy-11@gated-at.bofh.it> <sTFlL-4Oj-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Dec 29, 2016 at 1:30 AM, Borislav Petkov <bp@alien8.de> wrote:
> On Wed, Dec 28, 2016 at 10:11:22AM -0800, Andy Lutomirski wrote:
>> On a very quick read, it looks like none of your new call sites
>> actually use the return value at all. Since you also appear to be
>> consolidating them all, would it make sense to just open-code the
>> single (?) remaining user?
>
> I've got stuff coming up which will use the retval but it is not fully
> cooked yet. And also, we want to have generic helpers so that people do
> not reimplement them left and right.
Okay, but I still think that a variant that says "do cpuid and ignore
the return value" would make sense. Imagine a very clever
implementation of native_cpuid_eax like:
asm ("cpuid" : "=a" (eax) : ...);
return eax;
Now you call it and ignore the return value and the compiler optimizes
it out :) Also, someone reading the code might scratch their head and
wonder why you picked eax and not ebx, ecx, or edx.
--Andy
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] x86: Fix Intel microcode revision detection Junichi Nomura <j-nomura@ce.jp.nec.com> - 2016-12-28 05:50 +0100
[PATCH 1/2] x86/CPU: Add native CPUID variants returning a single datum Borislav Petkov <bp@alien8.de> - 2016-12-28 12:30 +0100
Re: [PATCH 1/2] x86/CPU: Add native CPUID variants returning a single datum Andy Lutomirski <luto@amacapital.net> - 2016-12-28 19:20 +0100
Re: [PATCH 1/2] x86/CPU: Add native CPUID variants returning a single datum Borislav Petkov <bp@alien8.de> - 2016-12-29 10:40 +0100
Re: [PATCH 1/2] x86/CPU: Add native CPUID variants returning a single datum Andy Lutomirski <luto@amacapital.net> - 2016-12-31 03:20 +0100
Re: [PATCH 1/2] x86/CPU: Add native CPUID variants returning a single datum Borislav Petkov <bp@alien8.de> - 2016-12-31 12:20 +0100
[PATCH 2/2] x86/microcode: Use native CPUID to tickle out microcode revision Borislav Petkov <bp@alien8.de> - 2016-12-28 12:30 +0100
[PATCH 3/2] x86/microcode/intel: Add a helper which gives the microcode revision Borislav Petkov <bp@alien8.de> - 2016-12-28 14:00 +0100
Re: [PATCH 3/2] x86/microcode/intel: Add a helper which gives the microcode revision Andy Lutomirski <luto@amacapital.net> - 2016-12-28 19:20 +0100
Re: [PATCH 3/2] x86/microcode/intel: Add a helper which gives the microcode revision Borislav Petkov <bp@alien8.de> - 2016-12-29 10:40 +0100
Re: [PATCH 3/2] x86/microcode/intel: Add a helper which gives the microcode revision Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-12-28 20:30 +0100
Re: [PATCH 3/2] x86/microcode/intel: Add a helper which gives the microcode revision Borislav Petkov <bp@alien8.de> - 2016-12-29 10:40 +0100
Re: [PATCH] x86: Fix Intel microcode revision detection Borislav Petkov <bp@alien8.de> - 2016-12-28 12:30 +0100
csiph-web