From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 4/5] x86/time: gtsc_to_gtime() is HVM-only
Date: Wed, 14 Jan 2026 10:52:07 +0100 [thread overview]
Message-ID: <aWdnR9YGrYSzj2fH@Mac.lan> (raw)
In-Reply-To: <aWdlSkpL-jR66Maa@Mac.lan>
On Wed, Jan 14, 2026 at 10:43:38AM +0100, Roger Pau Monné wrote:
> 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 <jbeulich@suse.com>
> >
> > --- 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.
I see now this might not be appropriate, gtsc_to_gtime() is the pair
to gtime_to_gtsc(), which is used in other places. It looks like
gtsc_to_gtime() could also gain users in order parts of the code, and
hence making static to vlapic might not be the best approach.
I'm not overly happy with adding more ifdefary to time.c, and the
asymmetry this creates with PV guest not having a gtsc_to_gtime(), but
it's otherwise dead code, so:
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Thanks, Roger.
next prev parent reply other threads:[~2026-01-14 9:53 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-06 13:57 [PATCH 0/5] x86: assorted time handling adjustments Jan Beulich
2026-01-06 13:58 ` [PATCH 1/5] x86/time: deal with negative deltas in get_s_time_fixed() Jan Beulich
2026-01-06 20:10 ` Антон Марков
2026-01-07 8:02 ` Jan Beulich
2026-01-09 16:11 ` Anton Markov
2026-01-12 10:31 ` Anton Markov
2026-01-12 11:45 ` Jan Beulich
2026-01-12 12:49 ` Anton Markov
2026-01-12 14:13 ` Jan Beulich
2026-01-12 14:51 ` Anton Markov
2026-01-12 16:08 ` Jan Beulich
2026-01-12 16:41 ` Anton Markov
2026-01-13 11:21 ` Jan Beulich
2026-01-13 12:35 ` Anton Markov
2026-01-14 17:49 ` Roger Pau Monné
2026-01-15 8:00 ` Jan Beulich
2026-01-15 8:24 ` Roger Pau Monné
2026-01-15 8:49 ` Anton Markov
2026-01-15 10:38 ` Jan Beulich
2026-01-15 11:48 ` Roger Pau Monné
2026-01-15 12:04 ` Jan Beulich
2026-01-20 8:50 ` Jan Beulich
2026-01-20 9:28 ` Jan Beulich
2026-01-06 13:58 ` [PATCH 2/5] x86/time: scale_delta() can be static Jan Beulich
2026-01-13 18:40 ` Roger Pau Monné
2026-01-06 13:58 ` [PATCH 3/5] x86/HVM: drop at_tsc parameter from ->set_tsc_offset() hook Jan Beulich
2026-01-14 9:40 ` Roger Pau Monné
2026-01-06 13:59 ` [PATCH 4/5] x86/time: gtsc_to_gtime() is HVM-only Jan Beulich
2026-01-14 9:43 ` Roger Pau Monné
2026-01-14 9:52 ` Roger Pau Monné [this message]
2026-01-06 14:00 ` [PATCH 5/5] x86/time: pv_soft_rdtsc() is PV-only Jan Beulich
2026-01-14 9:46 ` Roger Pau Monné
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aWdnR9YGrYSzj2fH@Mac.lan \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.