x86/time: avoid reading the platform timer in rendezvous functions
authorJan Beulich <jbeulich@suse.com>
Tue, 4 May 2021 08:49:59 +0000 (10:49 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 4 May 2021 08:49:59 +0000 (10:49 +0200)
commit48bb237fca65e2bcec7dbe7f4b178cf33c5e15f0
treeeb7dd082286374bf8aa7b6a6fa3c299f727ee4ea
parent075926410e997cc564c6b6ac6ddf17bc5459b445
x86/time: avoid reading the platform timer in rendezvous functions

Reading the platform timer isn't cheap, so we'd better avoid it when the
resulting value is of no interest to anyone.

The consumer of master_stime, obtained by
time_calibration_{std,tsc}_rendezvous() and propagated through
this_cpu(cpu_calibration), is local_time_calibration(). With
CONSTANT_TSC the latter function uses an early exit path, which doesn't
explicitly use the field. While this_cpu(cpu_calibration) (including the
master_stime field) gets propagated to this_cpu(cpu_time).stamp on that
path, both structures' fields get consumed only by the !CONSTANT_TSC
logic of the function.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/time.c