KVM: x86: Inject #GP with the right rip on efer writes
authorRoedel, Joerg <Joerg.Roedel@amd.com>
Thu, 6 May 2010 09:38:43 +0000 (11:38 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:11:19 +0000 (11:11 -0700)
commitfbec9e1f76ac124d0902497409ac2c9364d9d9a4
treef83254184d137e53503b324dd46758affeb002d0
parentc86db80af03239bd1094b2953871a72a2d889991
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