diff options
author | Avi Kivity <avi@redhat.com> | 2011-09-20 06:43:14 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-09-25 12:52:59 -0400 |
commit | 7460fb4a340033107530df19e7e125bd0969bfb2 (patch) | |
tree | 02f2aedd48af0a2e316b28d6a5b21a7a96442ac6 /arch/x86/include/asm/kvm_host.h | |
parent | 1cd196ea42c526549ded4fd29809c3fdaa4a7f41 (diff) |
KVM: Fix simultaneous NMIs
If simultaneous NMIs happen, we're supposed to queue the second
and next (collapsing them), but currently we sometimes collapse
the second into the first.
Fix by using a counter for pending NMIs instead of a bool; since
the counter limit depends on whether the processor is currently
in an NMI handler, which can only be checked in vcpu context
(via the NMI mask), we add a new KVM_REQ_NMI to request recalculation
of the counter.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/kvm_host.h')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 6ab4241c27c..ab62711ccb7 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -413,8 +413,9 @@ struct kvm_vcpu_arch { | |||
413 | u32 tsc_catchup_mult; | 413 | u32 tsc_catchup_mult; |
414 | s8 tsc_catchup_shift; | 414 | s8 tsc_catchup_shift; |
415 | 415 | ||
416 | bool nmi_pending; | 416 | atomic_t nmi_queued; /* unprocessed asynchronous NMIs */ |
417 | bool nmi_injected; | 417 | unsigned nmi_pending; /* NMI queued after currently running handler */ |
418 | bool nmi_injected; /* Trying to inject an NMI this entry */ | ||
418 | 419 | ||
419 | struct mtrr_state_type mtrr_state; | 420 | struct mtrr_state_type mtrr_state; |
420 | u32 pat; | 421 | u32 pat; |