[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 21/25] x86/cpuid: Move all leaf 7 handling into guest_cpuid()



>>> On 09.01.17 at 12:03, <andrew.cooper3@xxxxxxxxxx> wrote:
> @@ -396,12 +403,47 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
>      case 0x80000000 ... 0x80000000 + CPUID_GUEST_NR_EXTD - 1:
>          if ( leaf > p->extd.max_leaf )
>              return;
> -        break;
> +        goto legacy;
>  
>      default:
>          return;
>      }
>  
> +    /*
> +     * Skip dynamic adjustments if we are in the wrong context.
> +     *
> +     * All dynamic adjustments depends on current register state, which will
> +     * be stale if the vcpu is running elsewhere.  It is simpler, quicker, 
> and
> +     * more reliable for the caller to nothing (consistently) than to hand

Missing "do"?

> +     * back stale data which it can't use safely.
> +     */
> +    if ( v != curr )
> +        return;
> +
> +    /*
> +     * Second pass:
> +     * - Dynamic adjustments
> +     */
> +    switch ( leaf )
> +    {
> +    case 0x7:
> +        switch ( subleaf )
> +        {
> +        case 0:
> +            /* OSPKE clear in policy.  Fast-forward CR4 back in. */
> +            if ( (is_pv_vcpu(v)

is_pv_domain(d)?

With these taken care of if indeed applicable,
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.