[systemd-devel] Antw: Re: Antw: Re: Antw: Re: rdrand generated with march=winchip-c6 in systemd-241

Matthew Garrett mjg59 at google.com
Tue May 14 08:01:26 UTC 2019

> The point I was trying to make was: "CPUID" and the model-specific registers
> (thus the name) depend very much on the CPU being used. While the kernel makes
> grat efforts to get things right, I wondered whether it's the best idea whether
> to repeat that effort in an application program.

Compiler intrinsics are supposed to provide correct results
independent of the OS that they're running on. It's not unreasonable
for code to expect them to behave correctly. In this case it seems
that an assumption that gcc made that's true for most CPUs isn't true
for a specific (20 years old) CPU - that's a bug in gcc, and it's
reasonable to ask for it to be fixed. There's a separate question of
whether depending on the kernel for this information rather than using
the compiler was the best solution, but it's pretty justified for
applications to presume that the compiler works the way that the
compiler is documented as behaving.

More information about the systemd-devel mailing list