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)
Tue, Oct 1, 12:59 PM
Unknown Object (File)
Fri, Sep 27, 8:53 AM
Unknown Object (File)
Fri, Sep 27, 3:56 AM
Unknown Object (File)
Thu, Sep 26, 1:06 PM
Unknown Object (File)
Mon, Sep 23, 4:02 PM
Unknown Object (File)
Fri, Sep 20, 2:48 AM
Unknown Object (File)
Tue, Sep 17, 8:32 AM
Unknown Object (File)
Tue, Sep 17, 4:13 AM
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 51184
Build 48075: 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.