@@ -130,6 +130,7 @@ KVM_X86_OP(desc_intercepted)
KVM_X86_OP(msr_write_intercepted)
KVM_X86_OP(control_msr_intercept)
KVM_X86_OP(fault_gla)
+KVM_X86_OP_NULL(control_singlestep)
#undef KVM_X86_OP
#undef KVM_X86_OP_NULL
@@ -1511,6 +1511,7 @@ struct kvm_x86_ops {
void (*vcpu_deliver_sipi_vector)(struct kvm_vcpu *vcpu, u8 vector);
u64 (*fault_gla)(struct kvm_vcpu *vcpu);
+ void (*control_singlestep)(struct kvm_vcpu *vcpu, bool enable);
};
struct kvm_x86_nested_ops {
@@ -7627,6 +7627,16 @@ static u64 vmx_fault_gla(struct kvm_vcpu *vcpu)
return ~0ull;
}
+static void vmx_control_singlestep(struct kvm_vcpu *vcpu, bool enable)
+{
+ if (enable)
+ exec_controls_setbit(to_vmx(vcpu),
+ CPU_BASED_MONITOR_TRAP_FLAG);
+ else
+ exec_controls_clearbit(to_vmx(vcpu),
+ CPU_BASED_MONITOR_TRAP_FLAG);
+}
+
static struct kvm_x86_ops vmx_x86_ops __initdata = {
.hardware_unsetup = hardware_unsetup,
@@ -7771,6 +7781,7 @@ static struct kvm_x86_ops vmx_x86_ops __initdata = {
.vcpu_deliver_sipi_vector = kvm_vcpu_deliver_sipi_vector,
.fault_gla = vmx_fault_gla,
+ .control_singlestep = vmx_control_singlestep,
};
static __init void vmx_setup_user_return_msrs(void)