On 29.04.2024 17:16, Andrew Cooper wrote: > Now that the SVM feature leaf has been included in normal feature handling, it > is available early enough for init_speculation_mitigations() to use. > > No functional change. > > Signed-off-by: Andrew Cooper <[email protected]>
Reviewed-by: Jan Beulich <[email protected]> even if ... > --- a/xen/arch/x86/include/asm/cpufeature.h > +++ b/xen/arch/x86/include/asm/cpufeature.h > @@ -217,6 +217,9 @@ static inline bool boot_cpu_has(unsigned int feat) > #define cpu_has_rfds_no boot_cpu_has(X86_FEATURE_RFDS_NO) > #define cpu_has_rfds_clear boot_cpu_has(X86_FEATURE_RFDS_CLEAR) > > +/* CPUID level 0x8000000a.edx */ > +#define cpu_has_v_spec_ctrl boot_cpu_has(X86_FEATURE_V_SPEC_CTRL) ... the names here were to change (see comment on the earlier patch). In fact ... > @@ -1896,12 +1895,8 @@ void __init init_speculation_mitigations(void) > * > * No need for SCF_ist_sc_msr because Xen's value is restored > * atomically WRT NMIs in the VMExit path. > - * > - * TODO: Adjust cpu_has_svm_spec_ctrl to be usable earlier on boot. > */ > - if ( opt_msr_sc_hvm && > - (boot_cpu_data.extended_cpuid_level >= 0x8000000aU) && > - (cpuid_edx(0x8000000aU) & (1u << SVM_FEATURE_SPEC_CTRL)) ) > + if ( opt_msr_sc_hvm && cpu_has_v_spec_ctrl ) > setup_force_cpu_cap(X86_FEATURE_SC_MSR_HVM); > } ... the use here demonstrates my earlier point quite well: It being AMD's feature is completely invisible here when not considering the code being replaced. But yes, when looking at the entire comment / block, it still is visible. Jan
