diff options
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 02a4269be645..279a2ae21b4f 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -1065,26 +1065,16 @@ static void update_db_intercept(struct kvm_vcpu *vcpu) | |||
1065 | vcpu->guest_debug = 0; | 1065 | vcpu->guest_debug = 0; |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | static int svm_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg) | 1068 | static void svm_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg) |
1069 | { | 1069 | { |
1070 | int old_debug = vcpu->guest_debug; | ||
1071 | struct vcpu_svm *svm = to_svm(vcpu); | 1070 | struct vcpu_svm *svm = to_svm(vcpu); |
1072 | 1071 | ||
1073 | vcpu->guest_debug = dbg->control; | ||
1074 | |||
1075 | update_db_intercept(vcpu); | ||
1076 | |||
1077 | if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP) | 1072 | if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP) |
1078 | svm->vmcb->save.dr7 = dbg->arch.debugreg[7]; | 1073 | svm->vmcb->save.dr7 = dbg->arch.debugreg[7]; |
1079 | else | 1074 | else |
1080 | svm->vmcb->save.dr7 = vcpu->arch.dr7; | 1075 | svm->vmcb->save.dr7 = vcpu->arch.dr7; |
1081 | 1076 | ||
1082 | if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP) | 1077 | update_db_intercept(vcpu); |
1083 | svm->vmcb->save.rflags |= X86_EFLAGS_TF | X86_EFLAGS_RF; | ||
1084 | else if (old_debug & KVM_GUESTDBG_SINGLESTEP) | ||
1085 | svm->vmcb->save.rflags &= ~(X86_EFLAGS_TF | X86_EFLAGS_RF); | ||
1086 | |||
1087 | return 0; | ||
1088 | } | 1078 | } |
1089 | 1079 | ||
1090 | static void load_host_msrs(struct kvm_vcpu *vcpu) | 1080 | static void load_host_msrs(struct kvm_vcpu *vcpu) |