On 03.06.2024 13:30, Sergiy Kibrik wrote:
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -5197,7 +5197,7 @@ int hvm_debug_op(struct vcpu *v, int32_t op)
>      {
>          case XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON:
>          case XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF:
> -            if ( !cpu_has_monitor_trap_flag )
> +            if ( !using_vmx || !cpu_has_monitor_trap_flag )
>                  return -EOPNOTSUPP;
>              break;

Here and elsewhere you're adding a redundant check of cpu_has_vmx, even
if that's not visible without looking at using_vmx. I'm inclined to
think that adding IS_ENABLED() to the various cpu_has_* that you care
about might end up better (for being a little cheaper at runtime).

Jan

Reply via email to