Page MenuHomeFreeBSD

Rework armv8 CPU identification
ClosedPublic

Authored by wma_semihalf.com on Jul 9 2015, 7:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 26, 6:03 AM
Unknown Object (File)
Fri, Apr 26, 6:03 AM
Unknown Object (File)
Dec 25 2023, 10:44 PM
Unknown Object (File)
Dec 25 2023, 9:24 AM
Unknown Object (File)
Dec 20 2023, 2:25 AM
Unknown Object (File)
Nov 13 2023, 2:35 PM
Unknown Object (File)
Nov 11 2023, 2:28 PM
Unknown Object (File)
Nov 11 2023, 1:25 PM
Subscribers

Details

Summary

This commit adds a possibility to identify the CPU during runtime.

It is necessary to provide a way for workarounds and erratum
to be applied only for certain HW versions.

The copy of midr was stored into pcpu to allow an access from EL0
(midr is el1 and above accessible) and to provide a fast and
convenient way for assambly code to read it (pcpu is used quite often
so there is a chance it's inside the cache).
The midr is also better way of identification than using user-friendly
cpu_desc structure, because it can be compiled into comparision of
single u32 with only one access to the memory - this is crucial
for some erratums which are called from performance-critical
places.

Changes in cpu_identify makes this function safe to be called
on non-boot CPUs.

New function CPU_MATCH was implemented which returns boolean
value based on mathing masked MIDR with chip identification.
Example of usage:

printf("is thunder: %d\n", CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK,
    CPU_IMPL_CAVIUM, CPU_PART_THUNDER, 0, 0));
printf("is generic: %d\n", CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK,
    CPU_IMPL_ARM, CPU_PART_FOUNDATION, 0, 0));

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

wma_semihalf.com retitled this revision from to Rework armv8 CPU identification.
wma_semihalf.com updated this object.
wma_semihalf.com edited the test plan for this revision. (Show Details)
wma_semihalf.com added reviewers: andrew, emaste, zbb.
wma_semihalf.com set the repository for this revision to rS FreeBSD src repository - subversion.
andrew edited edge metadata.
This revision is now accepted and ready to land.Jul 9 2015, 10:29 AM
This revision was automatically updated to reflect the committed changes.