lkml.org 
[lkml]   [2018]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 6/8] x86/lib_direct_store.h: Add APIs for direct store instructions
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

\
 
 \ /
  Last update: 2018-06-19 10:49    [W:0.169 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site