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

Re: [Xen-devel] [PATCH 1/4] x86/hyperv: misc cleanup



On 12.02.2020 17:09, Wei Liu wrote:
> --- a/xen/arch/x86/guest/hyperv/private.h
> +++ b/xen/arch/x86/guest/hyperv/private.h
> @@ -26,6 +26,6 @@
>  
>  DECLARE_PER_CPU(void *, hv_input_page);
>  DECLARE_PER_CPU(void *, hv_vp_assist);
> -DECLARE_PER_CPU(unsigned int, hv_vp_index);
> +DECLARE_PER_CPU(uint32_t, hv_vp_index);

You've got a co-maintainer ack, i.e. so be it, but FTR this is
against what CodingStyle says, afaict: "Fixed width types should
only be used when a fixed width quantity is meant (which for
example may be a value read from or to be written to a register)."
If you handed the address (perhaps indirectly, e.g. by converting
to a physical one first) of this variable to Hyper-V, then things
would be different. But

    this_cpu(hv_vp_index) = vp_index_msr;

would, if unsigned int was wider than 32 bits, not cause any
issues. And this is the only place the variable currently gets
accessed, and I expect future uses will just be reads of it (as
can be seen later in the series).

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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