mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 02:42:46 +00:00
apic: prevent divide by zero in CPU frequency init
If a CPU for some reason returns 0 as CPU frequency, we currently panic on the resulting divide by zero when trying to initialize the CPU(s) via APIC. When this happens, we'll fallback to measuring the frequency instead. PR: 269767 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/664
This commit is contained in:
parent
28111ddf9e
commit
499171a98c
@ -953,7 +953,7 @@ lapic_calibrate_initcount_cpuid_vm(void)
|
||||
|
||||
/* Record divided frequency. */
|
||||
count_freq = freq / lapic_timer_divisor;
|
||||
return (true);
|
||||
return (count_freq != 0);
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
|
Loading…
Reference in New Issue
Block a user