On 28.08.2025 17:03, Andrew Cooper wrote:
> @@ -20,6 +22,9 @@ unsigned int __ro_after_init ler_msr;
>  static bool __initdata opt_ler;
>  boolean_param("ler", opt_ler);
>  
> +int8_t __ro_after_init opt_fred = 0;

Can't this be __initdata now that we have ...

> @@ -299,6 +304,37 @@ void __init traps_init(void)
>      /* Replace early pagefault with real pagefault handler. */
>      _update_gate_addr_lower(&bsp_idt[X86_EXC_PF], entry_PF);
>  
> +    /*
> +     * Xen doesn't use GS like most software does, and doesn't need the LKGS
> +     * instruction in order to manage PV guests.  No need to check for it.
> +     */
> +    if ( !cpu_has_fred )
> +    {
> +        if ( opt_fred == 1 )
> +            printk(XENLOG_WARNING "FRED not available, ignoring\n");
> +        opt_fred = 0;
> +    }
> +
> +    if ( opt_fred == -1 )
> +        opt_fred = !pv_shim;
> +
> +    if ( opt_fred )
> +    {
> +#ifdef CONFIG_PV32
> +        if ( opt_pv32 )
> +        {
> +            opt_pv32 = 0;
> +            printk(XENLOG_INFO "Disabling PV32 due to FRED\n");
> +        }
> +#endif
> +        setup_force_cpu_cap(X86_FEATURE_XEN_FRED);

... this? All non-__init uses could use the synthetic feature bit.

Jan

Reply via email to