On 17/12/2022 5:42 pm, Neowutran wrote:
> diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
> index b01acd390d..7c77ec8902 100644
> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -2585,7 +2585,7 @@ int tsc_set_info(struct domain *d,
>      case TSC_MODE_ALWAYS_EMULATE:
>          d->arch.vtsc_offset = get_s_time() - elapsed_nsec;
>          d->arch.tsc_khz = gtsc_khz ?: cpu_khz;
> -        set_time_scale(&d->arch.vtsc_to_ns, d->arch.tsc_khz * 1000);
> +        set_time_scale(&d->arch.vtsc_to_ns, (u64)d->arch.tsc_khz * 1000);

Ah - I see you tracked down your bug in the end.  One minor thing, we
prefer to use (uint64_t) rather than (u64).

As Elliot said, you need to submit a v2 with a Signed-off-by for the DCO
before the patch can be accepted.

A more succinct commit message would also be great - it wants to
describe what the bug is, and what the fix is.  For this, the key term
is "overflow before widen" (or variation thereof) which is a common
class of bug in C.

Thanks,

~Andrew

Reply via email to