>>> On 16.01.17 at 12:40, <andrew.coop...@citrix.com> wrote:
> @@ -1007,10 +864,13 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
>              break;
>  
>          case XSTATE_CPUID:
> -            if ( subleaf > ARRAY_SIZE(p->xstate.raw) )
> +            if ( !p->basic.xsave || subleaf >= ARRAY_SIZE(p->xstate.raw) )
>                  return;
>  
> -            /* Fallthrough. */
> +            BUG_ON(subleaf >= ARRAY_SIZE(p->xstate.raw));

Kind of pointless considering the if() right above? With this removed
(or the reason for it clarified)
Reviewed-by: Jan Beulich <jbeul...@suse.com>

> @@ -1067,6 +927,31 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
>              break;
>          }
>          break;
> +
> +    case XSTATE_CPUID:
> +        switch ( subleaf )
> +        {
> +        case 1:
> +            if ( p->xstate.xsaves )
> +            {
> +                /*
> +                 * TODO: Figure out what to do for XSS state.  VT-x manages
> +                 * host vs guest MSR_XSS automatically, so as soon as we 
> start
> +                 * supporting any XSS states, the wrong XSS will be in
> +                 * context.
> +                 */
> +                BUILD_BUG_ON(XSTATE_XSAVES_ONLY != 0);

Yeah, I guess we won't have many options other than switching
XSS around for the CPUID invocation.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to