KVM: VMX: refactor/fix IRQ and NMI injectability determination
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 26 Sep 2008 07:30:49 +0000 (09:30 +0200)
committerAvi Kivity <avi@redhat.com>
Wed, 31 Dec 2008 14:51:40 +0000 (16:51 +0200)
commit33f089ca5a61f7aead26e8e1866dfc961dd88a9e
tree41b23c564a9459bbc81e426503e0dc103cf7f45a
parent448fa4a9c5dbc6941dd19ed09692c588d815bb06
KVM: VMX: refactor/fix IRQ and NMI injectability determination

There are currently two ways in VMX to check if an IRQ or NMI can be
injected:
 - vmx_{nmi|irq}_enabled and
 - vcpu.arch.{nmi|interrupt}_window_open.
Even worse, one test (at the end of vmx_vcpu_run) uses an inconsistent,
likely incorrect logic.

This patch consolidates and unifies the tests over
{nmi|interrupt}_window_open as cache + vmx_update_window_states
for updating the cache content.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/vmx.c