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

Re: [Xen-devel] [PATCH v3 3/4] x86/hvm: Add HVM-specific hypervisor CPUID leaf



>>> On 13.03.14 at 19:08, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> wrote:
> +void hvm_hypervisor_cpuid_leaf(uint32_t idx, uint32_t sub_idx,
> +                               uint32_t *eax, uint32_t *ebx,
> +                               uint32_t *ecx, uint32_t *edx)
> +{
> +    if ( idx != 4 )
> +        return;

What's the point of this check? Why is "idx" being passed in here in
the first place? With you making use of "sub_idx", there's absolutely
no reason to expect the need for another leaf to ever get funneled
into here.

> +
> +    *eax = *ebx = *ecx = *edx = 0;
> +    if ( !hvm_funcs.hypervisor_cpuid_leaf )
> +            return;
> +
> +    hvm_funcs.hypervisor_cpuid_leaf(idx, sub_idx, eax, ebx, ecx, edx);
> +
> +    return;

Please invert the condition and drop both return-s, at once fixing
the wrong indentation above.

Jan


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


 


Rackspace

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