Project

General

Profile

Actions

Bug #14260

closed

bhyve PICs should use unsigned levels

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

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Both the AT-PIC and IO-APIC in the bhyve kernel device emulation use signed integers to record the level of their represented interrupt pins. Since a negative level is nonsensical in both cases, they should be updated to use an unsigned value instead.

Actions #1

Updated by Electric Monk 5 months ago

  • Gerrit CR set to 1867
Actions #2

Updated by Patrick Mooney 5 months ago

The old (signed integer) logic dealing with interrupt pin levels did nothing when those values would overflow/underflow. As part of updating that logic, we should instead emit an error if the value(s) would otherwise exceed the acceptable range. Some dtrace probes, as well as in-memory (mdb accessible) stats would be useful in cases where one wants to observe those potential errors.

Actions #3

Updated by Patrick Mooney 4 months ago

This was tested on the typical battery of guests, with all booting and running as expected. During guest operation, the newly-added statistics were inspected with mdb -k, showing the IOAPIC (and occasionally ATPIC) interrupt counts rising, but the saturation counts staying zero. A guest was also booted with propolis which also behaved as normal.

Actions #4

Updated by Patrick Mooney 4 months ago

Overflowing (or underflowing) the interrupt levels is considered broken behavior from the emulation, and it is expected that such a condition is not triggered.

Actions #5

Updated by Patrick Mooney 4 months ago

I also checked that the assertion/deassertion dtrace probes added by this wad were firing as part of the pin states changing.

Actions #6

Updated by Electric Monk 4 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit c6282d59cf9020f4e180f8297038e65177088092

commit  c6282d59cf9020f4e180f8297038e65177088092
Author: Patrick Mooney <pmooney@pfmooney.com>
Date:   2022-01-13T00:42:20.000Z

    14260 bhyve PICs should use unsigned levels
    Reviewed by: Dan Cross <cross@oxidecomputer.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF