aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@amd.com>2010-12-21 05:12:00 -0500
committerAvi Kivity <avi@redhat.com>2011-01-12 04:30:58 -0500
commiteea1cff9ab732ea56358ff5e1bd8b99db2e8402d (patch)
tree000abd8fa64f58602ebfc03b09e1f394c72f4ad7 /arch/x86/kvm/vmx.c
parenta63512a4d711c9bd6a5d03847f45fcf88cdea0c6 (diff)
KVM: x86: fix CR8 handling
The handling of CR8 writes in KVM is currently somewhat cumbersome. This patch makes it look like the other CR register handlers and fixes a possible issue in VMX, where the RIP would be incremented despite an injected #GP. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index c1952603d58..8e87bae09a7 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3185,8 +3185,8 @@ static int handle_cr(struct kvm_vcpu *vcpu)
3185 case 8: { 3185 case 8: {
3186 u8 cr8_prev = kvm_get_cr8(vcpu); 3186 u8 cr8_prev = kvm_get_cr8(vcpu);
3187 u8 cr8 = kvm_register_read(vcpu, reg); 3187 u8 cr8 = kvm_register_read(vcpu, reg);
3188 kvm_set_cr8(vcpu, cr8); 3188 err = kvm_set_cr8(vcpu, cr8);
3189 skip_emulated_instruction(vcpu); 3189 complete_insn_gp(vcpu, err);
3190 if (irqchip_in_kernel(vcpu->kvm)) 3190 if (irqchip_in_kernel(vcpu->kvm))
3191 return 1; 3191 return 1;
3192 if (cr8_prev <= cr8) 3192 if (cr8_prev <= cr8)