On 29.04.2024 17:16, Andrew Cooper wrote:
> @@ -2493,38 +2491,14 @@ const struct hvm_function_table * __init 
> start_svm(void)
>  
>      setup_vmcb_dump();
>  
> -    if ( boot_cpu_data.extended_cpuid_level >= 0x8000000aU )
> -        svm_feature_flags = cpuid_edx(0x8000000aU);
> -
> -    printk("SVM: Supported advanced features:\n");
> -
>      /* DecodeAssists fast paths assume nextrip is valid for fast rIP update. 
> */
> -    if ( !cpu_has_svm_nrips )
> -        __clear_bit(SVM_FEATURE_DECODEASSISTS, &svm_feature_flags);
> +    if ( !cpu_has_nrips )
> +        setup_clear_cpu_cap(X86_FEATURE_DECODE_ASSIST);

Should we grow any alternatives patching based on this feature (or any
other which someone might later add clearing of next to here as well),
this is too late: alternative_instructions() runs a bit earlier than
do_presmp_initcalls(). If this is to be kept, a comment towards the
possible pitfall is imo required.

Jan

Reply via email to