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)
Oct 3 2024, 10:32 PM
Unknown Object (File)
Oct 3 2024, 12:29 AM
Unknown Object (File)
Oct 3 2024, 12:29 AM
Unknown Object (File)
Oct 1 2024, 12:59 PM
Unknown Object (File)
Sep 27 2024, 8:53 AM
Unknown Object (File)
Sep 27 2024, 3:56 AM
Unknown Object (File)
Sep 26 2024, 1:06 PM
Unknown Object (File)
Sep 23 2024, 4:02 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 Passed
Unit
No Test Coverage
Build Status
Buildable 51401
Build 48292: arc lint + arc unit

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
290

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.