]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86: Handle errors when RIP is set during far jumps
authorNadav Amit <namit@cs.technion.ac.il>
Thu, 18 Sep 2014 19:39:39 +0000 (22:39 +0300)
committerJiri Slaby <jslaby@suse.cz>
Mon, 16 Feb 2015 13:38:41 +0000 (14:38 +0100)
commit74b0a4b9b2a2e38b9459aa8f606503ff8c61e100
tree1d8b1fc4636aa4cf9439fcd642df9f91c36532ed
parent293e0568a4320cec3d5226fbb3ed14abac3b05d1
KVM: x86: Handle errors when RIP is set during far jumps

commit d1442d85cc30ea75f7d399474ca738e0bc96f715 upstream.

Far jmp/call/ret may fault while loading a new RIP.  Currently KVM does not
handle this case, and may result in failed vm-entry once the assignment is
done.  The tricky part of doing so is that loading the new CS affects the
VMCS/VMCB state, so if we fail during loading the new RIP, we are left in
unconsistent state.  Therefore, this patch saves on 64-bit the old CS
descriptor and restores it if loading RIP failed.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Bruce Rogers <brogers@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/x86/kvm/emulate.c