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

Re: [Xen-devel] [PATCH v2 01/25] x86/cpuid: Introduce guest_cpuid() and struct cpuid_leaf



>>> On 09.01.17 at 12:03, <andrew.cooper3@xxxxxxxxxx> wrote:
> @@ -215,6 +218,39 @@ const uint32_t * __init lookup_deep_deps(uint32_t 
> feature)
>      return NULL;
>  }
>  
> +void guest_cpuid(const struct vcpu *v, uint32_t leaf,
> +                 uint32_t subleaf, struct cpuid_leaf *res)
> +{
> +    const struct vcpu *curr = current;
> +    const struct domain *d = v->domain;
> +
> +    *res = EMPTY_LEAF;
> +
> +    /* {hvm,pv}_cpuid() have this expectation. */
> +    ASSERT(v == curr);

You don't appear to use curr other than here, so I'd prefer if you
eliminated the local variable.

> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2361,8 +2361,9 @@ static void vmx_fpu_dirty_intercept(void)
>  
>  static int vmx_do_cpuid(struct cpu_user_regs *regs)
>  {
> -    unsigned int eax, ebx, ecx, edx;
> -    unsigned int leaf, subleaf;
> +    struct vcpu *curr = current;
> +    unsigned int leaf = regs->_eax, subleaf = regs->_ecx;

According to "Consistently use uint32_t" I'd have expected this to
now be uint32_t too.

In any event
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®.