Page MenuHomeFreeBSD

riscv: rework CPU identification [2/6]
ClosedPublic

Authored by mhorne on Apr 25 2023, 5:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 21 2024, 1:27 PM
Unknown Object (File)
Mar 21 2024, 1:26 PM
Unknown Object (File)
Mar 20 2024, 1:02 PM
Unknown Object (File)
Mar 20 2024, 12:56 PM
Unknown Object (File)
Mar 19 2024, 4:23 AM
Unknown Object (File)
Jan 7 2024, 2:24 PM
Unknown Object (File)
Jan 7 2024, 2:23 PM
Unknown Object (File)
Jan 7 2024, 2:11 PM
Subscribers

Details

Summary

Call identify_cpu() earlier for the BSP.

It is advantageous to have knowledge of ISA features as early as
possible. For example, the presence of newer virtual memory extensions
may be useful to pmap_bootstrap().

To achieve this, split out the printf() parts of identify_cpu() into a
separate function, identify_cpu_report(). This latter function will be
called later in boot after the console has been initialized.

Plus, a small trick in init_secondary() allows us to avoid interlaced
output from concurrent calls to identify_cpu_report() as APs are
started.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Apr 26 2023, 2:23 PM
jhb added inline comments.
sys/riscv/riscv/mp_machdep.c
291

On x86 this is called printcpuinfo(). arm64 appears to do this as a SYSINIT later in boot instead (cpu_features_sysinit).

I think I'd prefer to try to aim for some sort of consistency for function names maybe? x86 is a bit more of a mess as it splits identify_cpu up into multiple routines for multiple steps, but might be nice to call this printcpuinfo at least.

arm64 prints the info for the APs on the BSP FWIW in the sysinit rather than doing it during AP startup.

For x86 we assume all cores are the same and don't bother printing any features for APs.

Rebase and rename to printcpuinfo().

This revision now requires review to proceed.May 9 2023, 5:11 PM
This revision is now accepted and ready to land.May 11 2023, 3:14 PM
This revision was automatically updated to reflect the committed changes.