Project

General

Profile

Actions

Bug #13301

closed

bhyve PIT not periodic for square wave mode

Added by Patrick Mooney 6 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
bhyve
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
bhyve
Gerrit CR:

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

Related to illumos gate - Bug #13362: bhyve PIT should count square wave properlyNew

Actions
Actions #1

Updated by Electric Monk 6 months ago

  • Gerrit CR set to 1056
Actions #2

Updated by Patrick Mooney 5 months ago

  • Related to Bug #13362: bhyve PIT should count square wave properly added
Actions #3

Updated by Patrick Mooney 5 months 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.

Actions #4

Updated by Patrick Mooney 5 months 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.

Actions #5

Updated by Electric Monk 5 months 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>

Actions

Also available in: Atom PDF