On Tue, Jan 06, 2026 at 02:59:43PM +0100, Jan Beulich wrote: > Omit the function when HVM=n. With that the !HVM logic can also go away; > leave an assertion. > > Signed-off-by: Jan Beulich <[email protected]> > > --- a/xen/arch/x86/time.c > +++ b/xen/arch/x86/time.c > @@ -2840,14 +2840,13 @@ uint64_t gtime_to_gtsc(const struct doma > return scale_delta(time, &d->arch.ns_to_vtsc); > } > > +#ifdef CONFIG_HVM > uint64_t gtsc_to_gtime(const struct domain *d, uint64_t tsc) > { > - u64 time = scale_delta(tsc, &d->arch.vtsc_to_ns); > - > - if ( !is_hvm_domain(d) ) > - time += d->arch.vtsc_offset; > - return time; > + ASSERT(is_hvm_domain(d)); > + return scale_delta(tsc, &d->arch.vtsc_to_ns); > } > +#endif /* CONFIG_HVM */
Seeing this is solely used by the vlapic code, did you consider keeping scale_delta() non-static, and then moving gtsc_to_gtime() into vlapic.c? It would result in less ifdefery overall. Thanks, Roger.
