On 26/01/2022 12:44, Roger Pau Monné wrote: > On Wed, Jan 26, 2022 at 08:44:46AM +0000, Andrew Cooper wrote: >> All AMD IBRS-related features are in CPUID.0x80000008.ebx. Collect them in >> early_cpu_init() so init_speculative_mitigations() can use them. >> >> Rework the existing logic structure to fill in c->extended_cpuid_level and >> separate out the ambiguous use of ebx in an otherwise 0x80000008-specific >> logic block. >> >> Signed-off-by: Andrew Cooper <[email protected]> > Reviewed-by: Roger Pau Monné <[email protected]> > > It would be good to update the comment ahead of early_cpu_init to > mention it now also gather speculation-related fields from CPUID in > order to do early setup of mitigations. > > I think you could also use boot_cpu_data in spec_ctrl.c print_details > instead of fetching again the cpuid leafs?
Hmm - I may have a mistake here. Boot time CPUID handling is giant mess, and I haven't had time to finish my work to make BSP microcode loading dependent on xmalloc(), allowing it to move far earlier, and removing the early/late CPUID split. However, init_speculative_mitigations() is called after late CPUID setup, so e8b should be suitably collected. Let me try to figure out what's going on. For print_details(), I have a feeling that may have been an artefact of an early version of the logic, and likely can be cleaned up. ~Andrew
