aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHayzam Sherif <hayzam@gmail.com>2026-09-21 16:34:37 +0000
committerMark Johnston <markj@FreeBSD.org>2026-09-21 16:36:11 +0000
commitfc44154841fc2ebb1530a10cad719edb58559a88 (patch)
tree5bc8b76cc1d5d9d5d2b97011924d546870ea0db4
parentce5b70657f94d2051566664d3ea7167d104803b0 (diff)
vmm: Re-arm the PIT callout for square wave mode
The 8254's square wave mode (mode 3) is periodic, with the same interrupt rate as the rate generator mode (mode 2), but vatpit_callout_handler() only re-arms the channel 0 callout for TIMER_RATEGEN. A guest that programs mode 3 therefore receives a single IRQ0 and no further timer interrupts. Re-arm the callout for TIMER_SQWAVE as well, matching illumos change 13301. Reviewed by: markj Obtained from: illumos 93d78aba5b32996fc2ae893a6237a0d3972f86b2 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59816
-rw-r--r--sys/amd64/vmm/io/vatpit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/vmm/io/vatpit.c b/sys/amd64/vmm/io/vatpit.c
index 595c2e070c7a..bdc93d2b8e27 100644
--- a/sys/amd64/vmm/io/vatpit.c
+++ b/sys/amd64/vmm/io/vatpit.c
@@ -165,7 +165,7 @@ vatpit_callout_handler(void *a)
callout_deactivate(callout);
- if (c->mode == TIMER_RATEGEN) {
+ if (c->mode == TIMER_RATEGEN || c->mode == TIMER_SQWAVE) {
pit_timer_start_cntr0(vatpit);
}