Bug #13301
closedbhyve PIT not periodic for square wave mode
100%
Description
While testing an experimental bootrom under bhyve, I found unexpected behavior in the PIT emulation: The square wave mode, which should be periodic, like the rate generation mode, was behaving as a one-shot timer.
It needs to be updated to both run in the expected periodic fashion and have the count-down semantics described by the specification. (The square-wave counter proceeds at a doubled tick rate, keeping the value even.)
Related issues
Updated by Patrick Mooney almost 3 years ago
- Related to Bug #13362: bhyve PIT should count square wave properly added
Updated by Patrick Mooney almost 3 years ago
Prior to this change, a stock OVMF bootrom (running under an experimental userspace) would attempt to use the PIT in square wave mode to drive its event loop. Without the periodic behavior, it would fire once, and the ROM shell would never react to user input, since all other interrupts were masked/disabled. With the fix in place, the shell in the ROM is now responsive.
Updated by Patrick Mooney almost 3 years ago
Considering this behavior has been present in bhyve since it was ported to illumos, it's highly probable that other guest workloads never make use of a the periodic square-wave mode on the PIT, otherwise they too would have been broken. Nevertheless, I spun through the typical cohort of guests to smoke-test booting and running with the change. Those tests were successful on both Intel and AMD machines.
Updated by Electric Monk almost 3 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
git commit 93d78aba5b32996fc2ae893a6237a0d3972f86b2
commit 93d78aba5b32996fc2ae893a6237a0d3972f86b2 Author: Patrick Mooney <pmooney@pfmooney.com> Date: 2020-12-17T15:52:54.000Z 13301 bhyve PIT not periodic for square wave mode Reviewed by: Jason King <jason.king@joyent.com> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Robert Mustacchi <rm@fingolfin.org>