]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita9fa3fdbb8f776742098bb4ea0e26cceef5516fc
tree6c2c62b50e8b499db77ecb5f1b1d1570f06d49a8
parent43a220ca43c00c9d9a0bdd1cb31671b5b497f9f4
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