After GICv4.1 Is Configured, the CPU Usage Reaches Almost 100% and the VM Performance Deteriorates
Symptom
After GICv4.1 and the interrupt passthrough feature are enabled, the CPU usage of QEMU reaches almost 100%, and the VM performance deteriorates.
Key Process and Cause Analysis
When the core binding ranges for vcpupin and emulatorpin overlap, the VM performance deteriorates.

WFI trapping is not triggered when the physical cores bound to a VM are idle. As a result, the vCPU keeps occupying the physical cores, and physical core resources cannot be allocated to QEMU, causing the VM performance to deteriorate.
Conclusion and Solution
Solution 1:
To forcibly enable WFI trapping, perform the following operation:
1 | echo 'Y' > /sys/module/kvm/parameters/force_wfi_trap |
Enabling WFI trapping will deteriorate the performance of interrupt passthrough.
Solution 2:
Bind different cores for vcpupin and emulatorpin or do not configure core binding for emulatorpin.
Parent topic: Libvirt