HPET instability when running with qemu
When running the desktop build, compiled under ubuntu linux, with qemu 7.2.0 installed with brew, under MacOS 12.2, intel CPU, I get random crashes like these:
It appears that period_fs
here is becoming zero.
When adding this debug print:
// Calculate divisor
if period_fs == 0 {
let capability2 = unsafe { hpet.base_address.read_u64(hpet::CAPABILITY_OFFSET) };
println!(
"hpet={:?} capability={:?} capability2={:?}",
hpet, capability, capability2
);
}
I managed to get this output:
capability=10164 capability2=42949675116306945
By the way: 42949675116306945 translates to 0x9896808086A201.
0x9896808086A201 >> 32 is 0x989680. In decimal, this is 10000000, the clock period.
The contents of hpet struct is the same in good & bad boots.