lkml.org 
[lkml]   [2022]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 1/1] selftests/x86/xstate: Add xstate test cases for XSAVE feature
On 2022-03-24 at 03:06:50 -0700, Chang S. Bae wrote:
> On 3/16/2022 5:40 AM, Pengfei Xu wrote:
> >
> > +static inline void check_cpuid_xsave_availability(void)
> > +{
> > + uint32_t eax, ebx, ecx, edx;
> > +
> > + /*
> > + * CPUID.1:ECX.XSAVE[bit 26] enumerates general
> > + * support for the XSAVE feature set, including
> > + * XGETBV.
> > + */
> > + __cpuid_count(1, 0, eax, ebx, ecx, edx);
> > + if (!(ecx & CPUID_LEAF1_ECX_XSAVE_MASK))
> > + fatal_error("cpuid: no CPU xsave support");
> > + if (!(ecx & CPUID_LEAF1_ECX_OSXSAVE_MASK))
> > + fatal_error("cpuid: no OS xsave support");
>
> We need to skip the test when XSAVE is not available. See the point here:
> https://lore.kernel.org/lkml/8735j8aa9g.ffs@tglx/
>
Yes, it's better, will skip and exit if CPU doesn't support XSAVE or OS
XSAVE.
Thanks for suggestion!

BR.
-- Pengfei

> Thanks,
> Chang
>
>

\
 
 \ /
  Last update: 2022-03-24 12:39    [W:0.127 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site