KVM: nVMX: Fix conditions for interrupt injection
authorJan Kiszka <jan.kiszka@siemens.com>
Sun, 14 Apr 2013 10:12:48 +0000 (12:12 +0200)
committerGleb Natapov <gleb@redhat.com>
Sun, 14 Apr 2013 15:27:09 +0000 (18:27 +0300)
commite8457c67a4ec1268ec616bd8be1d9f1cc20f1493
tree31d8b6de0839c80fd31a0641fb60d6fdeacf74d7
parent5f3d5799974b89100268ba813cec8db7bd0693fb
KVM: nVMX: Fix conditions for interrupt injection

If we are entering guest mode, we do not want L0 to interrupt this
vmentry with all its side effects on the vmcs. Therefore, injection
shall be disallowed during L1->L2 transitions, as in the previous
version. However, this check is conceptually independent of
nested_exit_on_intr, so decouple it.

If L1 traps external interrupts, we can kick the guest from L2 to L1,
also just like the previous code worked. But we no longer need to
consider L1's idt_vectoring_info_field. It will always be empty at this
point. Instead, if L2 has pending events, those are now found in the
architectural queues and will, thus, prevent vmx_interrupt_allowed from
being called at all.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
arch/x86/kvm/vmx.c