diff options
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 97f4265cda38..70020e505c22 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -1096,30 +1096,14 @@ static void vmx_cache_reg(struct kvm_vcpu *vcpu, enum kvm_reg reg) | |||
1096 | } | 1096 | } |
1097 | } | 1097 | } |
1098 | 1098 | ||
1099 | static int set_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg) | 1099 | static void set_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg) |
1100 | { | 1100 | { |
1101 | int old_debug = vcpu->guest_debug; | ||
1102 | unsigned long flags; | ||
1103 | |||
1104 | vcpu->guest_debug = dbg->control; | ||
1105 | if (!(vcpu->guest_debug & KVM_GUESTDBG_ENABLE)) | ||
1106 | vcpu->guest_debug = 0; | ||
1107 | |||
1108 | if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP) | 1101 | if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP) |
1109 | vmcs_writel(GUEST_DR7, dbg->arch.debugreg[7]); | 1102 | vmcs_writel(GUEST_DR7, dbg->arch.debugreg[7]); |
1110 | else | 1103 | else |
1111 | vmcs_writel(GUEST_DR7, vcpu->arch.dr7); | 1104 | vmcs_writel(GUEST_DR7, vcpu->arch.dr7); |
1112 | 1105 | ||
1113 | flags = vmcs_readl(GUEST_RFLAGS); | ||
1114 | if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP) | ||
1115 | flags |= X86_EFLAGS_TF | X86_EFLAGS_RF; | ||
1116 | else if (old_debug & KVM_GUESTDBG_SINGLESTEP) | ||
1117 | flags &= ~(X86_EFLAGS_TF | X86_EFLAGS_RF); | ||
1118 | vmcs_writel(GUEST_RFLAGS, flags); | ||
1119 | |||
1120 | update_exception_bitmap(vcpu); | 1106 | update_exception_bitmap(vcpu); |
1121 | |||
1122 | return 0; | ||
1123 | } | 1107 | } |
1124 | 1108 | ||
1125 | static __init int cpu_has_kvm_support(void) | 1109 | static __init int cpu_has_kvm_support(void) |