On 23.02.2024 13:06, Roger Pau Monne wrote:
> --- a/xen/arch/x86/spec_ctrl.c
> +++ b/xen/arch/x86/spec_ctrl.c
> @@ -239,6 +239,7 @@ static int __init cf_check parse_spec_ctrl(const char *s)
>          /* Xen's speculative sidechannel mitigation settings. */
>          else if ( !strncmp(s, "bti-thunk=", 10) )
>          {
> +#ifdef CONFIG_INDIRECT_THUNK
>              s += 10;
>  
>              if ( !cmdline_strcmp(s, "retpoline") )

              if ( !IS_ENABLED(CONFIG_INDIRECT_THUNK) )
              {
                  no_config_param("INDIRECT_THUNK", "spec-ctrl", s, ss);
                  rc = -EINVAL;
              }
              else if ( !cmdline_strcmp(s, "retpoline") )

?

Also, while touching INDIRECT_THUNK, could I talk you into also adjusting
documentation accordingly? It presently mentions INDIRECT_THUNK, when
really it means CONFIG_INDIRECT_THUNK.

Jan

> @@ -249,6 +250,10 @@ static int __init cf_check parse_spec_ctrl(const char *s)
>                  opt_thunk = THUNK_JMP;
>              else
>                  rc = -EINVAL;
> +#else
> +            no_config_param("INDIRECT_THUNK", "spec-ctrl", s, ss);
> +            rc = -EINVAL;
> +#endif
>          }
>  
>          /* Bits in MSR_SPEC_CTRL. */


Reply via email to