HomeFreeBSD

clockcalib: Fix an overflow bug

Description

clockcalib: Fix an overflow bug

tc_counter_mask is an unsigned int and in the TSC timecounter is equal
to UINT_MAX, so the addition tc->tc_counter_mask + 1 can overflow to 0,
resulting in a hang during boot.

Fixes: c2705ceaeb09 ("x86: Speed up clock calibration")
Reviewed by: cperciva
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33956

Details

Provenance
markjAuthored on Jan 20 2022, 1:23 PM
Reviewer
cperciva
Differential Revision
D33956: clockcalib: Fix an overflow bug
Parents
rGe0282802a6ec: remove debug code for cpu usage
Branches
Unknown
Tags
Unknown