On Fri, 15 Jun 2018, Fenghua Yu wrote:
> +static inline bool movdiri_supported(void)
> +{
> +     int eax, ebx, ecx, edx;
> +     bool ret;
> +
> +     /*
> +      * If movdiri has been enumerated before, return cached movdiri
> +      * support info.
> +      */
> +     if (_movdiri_enumerated)
> +             return _movdiri_supported;
> +
> +     /* Otherwise, enumerate movdiri from CPUID. */
> +     asm volatile("mov $7, %%eax\t\n"
> +                  "mov $0, %%ecx\t\n"
> +                  "cpuid\t\n"
> +                  : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx));

Why on earth do we need yet another machinery to figure out whether
something is enumerated in CPUID? We have feature bits and the whole set of
functions around it, including those which are run time patched.

Aside of that adding static booleans to every compilation unit which
includes that header file is just broken.

Thanks,

        tglx

Reply via email to