KVM: x86: Inject #GP with the right rip on efer writes
commitf7461bdc19bb04af2bd14b2936a485bbcfd9fb02
authorRoedel, Joerg <Joerg.Roedel@amd.com>
Thu, 6 May 2010 09:38:43 +0000 (6 11:38 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:16:15 +0000 (5 11:16 -0700)
tree18e93a0c13e3e32f58b64abfa27ab97f5bbdb060
parent36d26d70df7a96e2c906e1bf126afe975cbe02fa
KVM: x86: Inject #GP with the right rip on efer writes

This patch fixes a bug in the KVM efer-msr write path. If a
guest writes to a reserved efer bit the set_efer function
injects the #GP directly. The architecture dependent wrmsr
function does not see this, assumes success and advances the
rip. This results in a #GP in the guest with the wrong rip.
This patch fixes this by reporting efer write errors back to
the architectural wrmsr function.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
(cherry picked from commit b69e8caef5b190af48c525f6d715e7b7728a77f6)
arch/x86/kvm/x86.c