HomeFreeBSD

linuxkpi: Define `cpu_data(cpu)`

Description

linuxkpi: Define cpu_data(cpu)

cpu_data(cpu) evaluates to a struct cpuinfo_x86 filled with
attributes of the given CPU number. The CPU number is an index in the
__cpu_data[] array with MAXCPU entries. On FreeBSD, we simply
initialize all of them like we do with boot_cpu_data.

While here, we add the x86_model field to the struct cpuinfo_x86. We
use CPUID_TO_MODEL() to set it.

At the same time, we fix the value of x86 which should have been set
to the CPU family. It was using the same implementation as
CPUID_TO_MODEL() before. It now uses CPUID_TO_FAMILY().

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38542

(cherry picked from commit a27902c1838836b3fb00cd660ce37a4f20bd7991)

Details

Provenance
dumbbellAuthored on Feb 10 2023, 3:38 PM
Reviewer
manu
Differential Revision
D38542: linuxkpi: Define `cpu_data(cpu)`
Parents
rG1d5100d9be2d: linuxkpi: Add `sg_alloc_table_from_pages_segment()`
Branches
Unknown
Tags
Unknown