aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r--drivers/kvm/svm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 3bf25795b3ef..59c930f276e2 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -575,6 +575,8 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)
575 memset(vcpu->svm->db_regs, 0, sizeof(vcpu->svm->db_regs)); 575 memset(vcpu->svm->db_regs, 0, sizeof(vcpu->svm->db_regs));
576 init_vmcb(vcpu->svm->vmcb); 576 init_vmcb(vcpu->svm->vmcb);
577 577
578 fx_init(vcpu);
579
578 return 0; 580 return 0;
579 581
580out2: 582out2:
@@ -1387,6 +1389,10 @@ again:
1387 save_db_regs(vcpu->svm->host_db_regs); 1389 save_db_regs(vcpu->svm->host_db_regs);
1388 load_db_regs(vcpu->svm->db_regs); 1390 load_db_regs(vcpu->svm->db_regs);
1389 } 1391 }
1392
1393 fx_save(vcpu->host_fx_image);
1394 fx_restore(vcpu->guest_fx_image);
1395
1390 asm volatile ( 1396 asm volatile (
1391#ifdef CONFIG_X86_64 1397#ifdef CONFIG_X86_64
1392 "push %%rbx; push %%rcx; push %%rdx;" 1398 "push %%rbx; push %%rcx; push %%rdx;"
@@ -1496,6 +1502,9 @@ again:
1496#endif 1502#endif
1497 : "cc", "memory" ); 1503 : "cc", "memory" );
1498 1504
1505 fx_save(vcpu->guest_fx_image);
1506 fx_restore(vcpu->host_fx_image);
1507
1499 if ((vcpu->svm->vmcb->save.dr7 & 0xff)) 1508 if ((vcpu->svm->vmcb->save.dr7 & 0xff))
1500 load_db_regs(vcpu->svm->host_db_regs); 1509 load_db_regs(vcpu->svm->host_db_regs);
1501 1510