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

Re: [Xen-devel] [PATCH v2 1/5] x86/time: Alter tsc_set_info() to return an error value



>>> On 20.11.18 at 15:36, <andrew.cooper3@xxxxxxxxxx> wrote:
> Currently, tsc_set_info() performs no parameter checking, and an invalid
> tsc_mode goes largely unnoticed.  Fix it to reject invalid tsc_modes with
> -EINVAL, and update the callers to check the return value.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
with one suggestion:

> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -599,8 +599,8 @@ int arch_domain_create(struct domain *d,
>      else
>          ASSERT_UNREACHABLE(); /* Not HVM and not PV? */
>  
> -    /* initialize default tsc behavior in case tools don't */
> -    tsc_set_info(d, TSC_MODE_DEFAULT, 0UL, 0, 0);
> +    if ( (rc = tsc_set_info(d, TSC_MODE_DEFAULT, 0UL, 0, 0)) != 0 )
> +        goto fail;

I think this should gain ASSERT_UNREACHABLE(). According to
patch context the "goto fail;" might even be omitted.

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®.