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


Groups > linux.kernel > #1548801

Re: [PATCH 1/2] x86/CPU: Add native CPUID variants returning a single datum

From Borislav Petkov <bp@alien8.de>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] x86/CPU: Add native CPUID variants returning a single datum
Date 2016-12-31 12:20 +0100
Message-ID <sUpRE-2d9-7@gated-at.bofh.it> (permalink)
References (1 earlier) <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> <sUhr3-5cP-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Dec 30, 2016 at 06:13:24PM -0800, Andy Lutomirski wrote:
> Now you call it and ignore the return value and the compiler optimizes
> it out :)

Does it, really?

It is an inlined asm volatile. I checked all call sites and the CPUID
call is there. gcc 6 simply issues the CPUID and then later code
overwrites rAX. I.e., it looks ok to me.

Or what example scenario do you have in mind?

> Also, someone reading the code might scratch their head and
> wonder why you picked eax and not ebx, ecx, or edx.

We have comments for her/him :-)

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

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


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