@@ -1257,6 +1257,7 @@ struct kvm_x86_ops {
u64 (*fault_gla)(struct kvm_vcpu *vcpu);
bool (*spt_fault)(struct kvm_vcpu *vcpu);
bool (*gpt_translation_fault)(struct kvm_vcpu *vcpu);
+ void (*control_singlestep)(struct kvm_vcpu *vcpu, bool enable);
};
struct kvm_arch_async_pf {
@@ -7837,6 +7837,16 @@ static bool vmx_gpt_translation_fault(struct kvm_vcpu *vcpu)
return true;
}
+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 __ro_after_init = {
.cpu_has_kvm_support = cpu_has_kvm_support,
.disabled_by_bios = vmx_disabled_by_bios,
@@ -7998,6 +8008,7 @@ static struct kvm_x86_ops vmx_x86_ops __ro_after_init = {
.fault_gla = vmx_fault_gla,
.spt_fault = vmx_spt_fault,
.gpt_translation_fault = vmx_gpt_translation_fault,
+ .control_singlestep = vmx_control_singlestep,
};
static void vmx_cleanup_l1d_flush(void)