>>> On 20.11.18 at 15:36, <[email protected]> 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 <[email protected]>
Reviewed-by: Jan Beulich <[email protected]> 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 [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
