KVM: VMX: set vmx->emulation_required only when needed.
authorGleb Natapov <gleb@redhat.com>
Mon, 21 Jan 2013 13:36:49 +0000 (15:36 +0200)
committerMarcelo Tosatti <mtosatti@redhat.com>
Thu, 24 Jan 2013 02:40:31 +0000 (00:40 -0200)
commit141687869fb904e912568c6b94a6b1fa2114f6ed
tree6c2c62b50e8b499db77ecb5f1b1d1570f06d49a8
parent378a8b099fc207ddcb91b19a8c1457667e0af398
KVM: VMX: set vmx->emulation_required only when needed.

If emulate_invalid_guest_state=false vmx->emulation_required is never
actually used, but it ends up to be always set to true since
handle_invalid_guest_state(), the only place it is reset back to
false, is never called. This, besides been not very clean, makes vmexit
and vmentry path to check emulate_invalid_guest_state needlessly.

The patch fixes that by keeping emulation_required coherent with
emulate_invalid_guest_state setting.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/vmx.c