Page MenuHomeFreeBSD

vmm: Add a bulk TMR reset hook for Intel APICv
Needs ReviewPublic

Authored by hayzam_gmail.com on Tue, Oct 13, 12:53 AM.

Details

Reviewers
markj
Group Reviewers
bhyve
Summary

vioapic_update_tmr() resets all 256 vectors before rebuilding the
level-triggered vector set. With Intel virtual interrupt delivery,
each per-vector reset loads the VMCS, reads and writes an EOI-exit
bitmap, and clears the VMCS.

Add an optional bulk-reset hook so VMX can clear the four EOI-exit
bitmaps with one VMCS load/clear pair. Clear the software TMR banks
directly when using the hook, and retain the per-vector fallback
for backends without it.

Test Plan

Tested a Windows 11 guest left at the desktop on a dual-Xeon E5-2680 v3
host, with 24 vCPUs and 24 GiB RAM assigned to the guest. All captures
used the same host kernel and VM configuration.

Three untraced 60-second windows per capture averaged 1090.1% aggregate
bhyve CPU on stock, 532.8% with this patch, and 583.4% on a patched
repeat: an observed 46-51% reduction in host CPU use.

Diff Detail

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