Page MenuHomeFreeBSD

est: prevent divide-by-zero in est_msr_info
ClosedPublic

Authored by seuros on Jun 17 2026, 12:44 AM.
Referenced Files
F171426923: D57614.diff
Fri, Sep 11, 2:09 AM
F171350607: D57614.id179900.diff
Thu, Sep 10, 2:57 PM
F171311540: D57614.id179892.diff
Thu, Sep 10, 8:06 AM
Unknown Object (File)
Thu, Sep 10, 2:08 AM
Unknown Object (File)
Wed, Sep 9, 7:26 AM
Unknown Object (File)
Wed, Sep 9, 2:09 AM
Unknown Object (File)
Tue, Sep 8, 9:25 PM
Unknown Object (File)
Tue, Sep 8, 3:50 AM
Subscribers

Details

Summary

When hw.est.msr_info=1 is set, est_msr_info() extracts the bus clock
from MSR_PERF_STATUS upper bits. On secondary CPUs, the MSR may
contain zero in the frequency ratio field, causing a
divide-by-zero panic.

Observed in pre Skylake Intel cpu.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

seuros created this revision.

oh interesting, what did you observe this on?

get rid of the bootverbose change and putit in a different diff, and then i'll approve/land

sys/x86/cpufreq/est.c
1051

you should put this in a different diff. :-)

I can't find where this is documented - all of the SDMs I've looked at so far describe IA32_PERF_STATUS but do not cover the format of the register above bit 31.

This revision is now accepted and ready to land.Jun 17 2026, 2:49 PM
This revision was automatically updated to reflect the committed changes.