lkml.org 
[lkml]   [2017]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [Xen-devel] [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave
From
Date
On 18/04/17 12:02, Andrew Cooper wrote:
> On 18/04/17 07:31, Juergen Gross wrote:
>> @@ -281,22 +274,24 @@ static bool __init xen_check_mwait(void)
>> return false;
>> #endif
>> }
>> -static void __init xen_init_cpuid_mask(void)
>> +
>> +static bool __init xen_check_xsave(void)
>> {
>> - unsigned int ax, bx, cx, dx;
>> - unsigned int xsave_mask;
>> + unsigned int err, eax, edx;
>>
>> - ax = 1;
>> - cx = 0;
>> - cpuid(1, &ax, &bx, &cx, &dx);
>> + /* Test OSXSAVE capability via xgetbv instruction. */
>
> The code is fine, but this comment isn't going to be any help to people
> reading this code in 6 months time.
>
> How about this:
>
> "Xen 4.0 and older accidentally leaked the host XSAVE flag into guest
> view, despite not being able to support guests using the functionality.
> Probe for the actual availability of XSAVE by seeing whether xgetbv
> executes successfully or raises #UD."

I'll update the comment.

> Everything else is fine, so Reviewed-by: Andrew Cooper
> <andrew.cooper3@citrix.com>

Thanks,

Juergen

\
 
 \ /
  Last update: 2017-04-18 13:57    [W:0.111 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site