Bug #14260
closedbhyve PICs should use unsigned levels
100%
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.
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.
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.
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.
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.
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>