summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorPaolo Bonzini2015-06-04 10:44:44 +0200
committerPaolo Bonzini2015-06-04 10:44:44 +0200
commite69fab5df45f993cb3b8cc0625a7791e86450a99 (patch)
treeb50ecb0db7ec4eb9429150e53d7b3677cd556e35 /arch/x86/kvm/x86.c
parentkvm: x86: fix kvm_apic_has_events to check for NULL pointer (diff)
downloadkernel-qcow2-linux-e69fab5df45f993cb3b8cc0625a7791e86450a99.tar.gz
kernel-qcow2-linux-e69fab5df45f993cb3b8cc0625a7791e86450a99.tar.xz
kernel-qcow2-linux-e69fab5df45f993cb3b8cc0625a7791e86450a99.zip
KVM: x86: clear hidden CPU state at reset time
This was noticed by Radim while reviewing the implementation of system management mode. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 79dde1656db6..bd6bcd54cd44 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -7254,6 +7254,8 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
{
+ vcpu->arch.hflags = 0;
+
atomic_set(&vcpu->arch.nmi_queued, 0);
vcpu->arch.nmi_pending = 0;
vcpu->arch.nmi_injected = false;