Jan Kiszka wrote:
Jiajun kindly provided me a RHEL kernel and initrd (2.6.18-53-el5) which
I ran for a while (or booted a few times) to trigger the hang. Basically
you need high IRQ load (preferably via LAPIC, to exploit that un-acked
IRQs will block low-prio IRQs as well) + high NMI load (e.g. via NMI
watchdog).
I was able to reproduce it easily by zapping the mmu every second.
Attached is a patch the fixes it for me. Basically it avoids the nmi
path if an interrupt is being injected. This is closer to my event
queue plan, and also is similar to what the code does today with
exceptions (avoid ->inject_pending_irq() if an exception is pending).
Please review (and test if possible).
--
error compiling committee.c: too many arguments to function
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ebf5406..93f9010 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3268,7 +3268,10 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu)
vmx_update_window_states(vcpu);
if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) {
- if (vcpu->arch.nmi_window_open) {
+ if (vcpu->arch.interrupt.pending) {
+ if (!vcpu->arch.nmi_window_open)
+ enable_nmi_window(vcpu);
+ } else if (vcpu->arch.nmi_window_open) {
vcpu->arch.nmi_pending = false;
vcpu->arch.nmi_injected = true;
} else {