]> xenbits.xensource.com Git - xen.git/commit
x86/time: use relative counts in calibration loops
authorJan Beulich <jbeulich@suse.com>
Tue, 25 Jan 2022 12:51:36 +0000 (13:51 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 25 Jan 2022 12:51:36 +0000 (13:51 +0100)
commit6b776749ff7e45c30696235dbb4ecd2b53401cff
tree2563cf5b804b78016b52168cfcb1bdbe2d81ff7a
parent5af939d96a6c7c5a0b4e00f7be3002333959e7e3
x86/time: use relative counts in calibration loops

Looping until reaching/exceeding a certain value is error prone: If the
target value is close enough to the wrapping point, the loop may not
terminate at all. Switch to using delta values, which then allows to
fold the two loops each into just one.

Fixes: 93340297802b ("x86/time: calibrate TSC against platform timer")
Reported-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
master commit: 467191641d2a2fd2e43b3ae7b80399f89d339980
master date: 2022-01-13 14:30:18 +0100
xen/arch/x86/time.c