Page MenuHomeFreeBSD

vmm: Normalize a zero PIT count before starting channel 0
AcceptedPublic

Authored by hayzam_gmail.com on Thu, Sep 17, 12:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 17, 9:14 PM
Unknown Object (File)
Thu, Sep 17, 4:47 PM
Unknown Object (File)
Thu, Sep 17, 2:12 PM
Unknown Object (File)
Thu, Sep 17, 1:49 PM
Unknown Object (File)
Thu, Sep 17, 1:25 PM
Unknown Object (File)
Thu, Sep 17, 1:25 PM
Unknown Object (File)
Thu, Sep 17, 7:31 AM
Unknown Object (File)
Thu, Sep 17, 2:44 AM
Subscribers

Details

Reviewers
markj
Group Reviewers
bhyve
Summary

pit_timer_start_cntr0() does not schedule a callout when the initial
count is zero. The counter write handler normalizes a programmed zero
count only after calling it, leaving an initially unarmed channel 0
without a scheduled timer event.

Move the existing normalization before the timer-start call. Retain the
historical 0xffff representation of a zero count.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77006
Build 73889: arc lint + arc unit

Event Timeline

How did you notice the problem?

This revision is now accepted and ready to land.Thu, Sep 17, 1:48 PM

How did you notice the problem?

The symptom was a legacy guest hanging at the BIOS screen with its tick frozen while I was bringing up CSMWrap (https://github.com/CSMWrap/CSMWrap) on bhyve. I traced that back to SeaBIOS programming the PIT with a zero count for the normal ~18 Hz tick, which led me to this code.