Re: [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-24 Thread Juergen Gross
On 21/04/17 16:51, Boris Ostrovsky wrote: > On 04/21/2017 10:45 AM, Andrew Cooper wrote: >> On 21/04/17 15:38, Juergen Gross wrote: >>> On 21/04/17 16:24, Boris Ostrovsky wrote: > +static bool __init xen_check_xsave(void) > { > - unsigned int ax, bx, cx, dx; > - unsigned int

Re: [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-24 Thread Juergen Gross
On 21/04/17 16:51, Boris Ostrovsky wrote: > On 04/21/2017 10:45 AM, Andrew Cooper wrote: >> On 21/04/17 15:38, Juergen Gross wrote: >>> On 21/04/17 16:24, Boris Ostrovsky wrote: > +static bool __init xen_check_xsave(void) > { > - unsigned int ax, bx, cx, dx; > - unsigned int

Re: [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-21 Thread Boris Ostrovsky
On 04/21/2017 10:45 AM, Andrew Cooper wrote: > On 21/04/17 15:38, Juergen Gross wrote: >> On 21/04/17 16:24, Boris Ostrovsky wrote: +static bool __init xen_check_xsave(void) { - unsigned int ax, bx, cx, dx; - unsigned int xsave_mask; + unsigned int err, eax, edx;

Re: [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-21 Thread Boris Ostrovsky
On 04/21/2017 10:45 AM, Andrew Cooper wrote: > On 21/04/17 15:38, Juergen Gross wrote: >> On 21/04/17 16:24, Boris Ostrovsky wrote: +static bool __init xen_check_xsave(void) { - unsigned int ax, bx, cx, dx; - unsigned int xsave_mask; + unsigned int err, eax, edx;

Re: [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-21 Thread Andrew Cooper
On 21/04/17 15:38, Juergen Gross wrote: > On 21/04/17 16:24, Boris Ostrovsky wrote: >>> +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,

Re: [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-21 Thread Andrew Cooper
On 21/04/17 15:38, Juergen Gross wrote: > On 21/04/17 16:24, Boris Ostrovsky wrote: >>> +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,

Re: [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-21 Thread Juergen Gross
On 21/04/17 16:24, Boris Ostrovsky wrote: > >> +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, , , , ); >> +/* Test OSXSAVE

Re: [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-21 Thread Juergen Gross
On 21/04/17 16:24, Boris Ostrovsky wrote: > >> +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, , , , ); >> +/* Test OSXSAVE

Re: [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-21 Thread Boris Ostrovsky
> +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, , , , ); > + /* Test OSXSAVE capability via xgetbv instruction. */ > + asm

Re: [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-21 Thread Boris Ostrovsky
> +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, , , , ); > + /* Test OSXSAVE capability via xgetbv instruction. */ > + asm

Re: [Xen-devel] [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-18 Thread Juergen Gross
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) >> { >> -

Re: [Xen-devel] [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-18 Thread Juergen Gross
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) >> { >> -

Re: [Xen-devel] [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-18 Thread Andrew Cooper
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

Re: [Xen-devel] [PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-18 Thread Andrew Cooper
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

[PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-18 Thread Juergen Gross
When running as pv domain xen_cpuid() is being used instead of native_cpuid(). In xen_cpuid() the xsave feature availability is indicated by special casing the related cpuid leaf. Instead of delivering fake cpuid values set or clear the cpu capability bits for xsave instead. Signed-off-by:

[PATCH v3 09/11] x86/xen: use capabilities instead of fake cpuid values for xsave

2017-04-18 Thread Juergen Gross
When running as pv domain xen_cpuid() is being used instead of native_cpuid(). In xen_cpuid() the xsave feature availability is indicated by special casing the related cpuid leaf. Instead of delivering fake cpuid values set or clear the cpu capability bits for xsave instead. Signed-off-by: