KVM: nSVM: Check for NRIPS support before updating control field
authorBandan Das <bsd@redhat.com>
Thu, 11 Jun 2015 06:05:33 +0000 (02:05 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 19 Jun 2015 15:16:26 +0000 (17:16 +0200)
commitf104765b4f81fd74d69e0eb161e89096deade2db
tree25e36bd9849498c5a939277cd6d31176bf525203
parent0b8ba4a2b65860ac1fcd5be6cfca5d3b27a5b170
KVM: nSVM: Check for NRIPS support before updating control field

If hardware doesn't support DecodeAssist - a feature that provides
more information about the intercept in the VMCB, KVM decodes the
instruction and then updates the next_rip vmcb control field.
However, NRIP support itself depends on cpuid Fn8000_000A_EDX[NRIPS].
Since skip_emulated_instruction() doesn't verify nrip support
before accepting control.next_rip as valid, avoid writing this
field if support isn't present.

Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c