Details
- Reviewers
kib - Commits
- rG2358492b0347: x86: Add zen identifier helper function
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 72101 Build 68984: arc lint + arc unit
Event Timeline
| sys/x86/include/x86_var.h | ||
|---|---|---|
| 135 | Will fix it before commit | |
| sys/x86/x86/identcpu.c | ||
|---|---|---|
| 2729 | Can this be a table of {family, model_min, model_max} ? | |
| sys/x86/include/specialreg.h | ||
|---|---|---|
| 307 | The constants are not from CPUID. Pleae use some different namespace for them. I think just CPU_AMD_ZENx is fine. Also, specialreg.h is for the hardware registers definitions. Better to place them in some other place, might be machine/cpu.h. | |
| sys/x86/x86/identcpu.c | ||
| 2729 | This requires the table to be sorted. At least, a comment is needed in the table herald. Can we scan the whole table? | |
This was also a requirement for https://reviews.freebsd.org/D56332 and should be useless now. However, amdtemp driver now hardcode this zen detection logic in the amdtemp.c file, we can use ident_zen_cpu to refactor the amdtemp code.
| sys/x86/include/specialreg.h | ||
|---|---|---|
| 307 | machine/cpu.h has i386 and amd64 variant. Can we put in x86/cputypes.h? | |
| sys/x86/include/specialreg.h | ||
|---|---|---|
| 307 | Yes, and it looks even more appropriate than what I proposed. | |
| sys/x86/include/x86_var.h | ||
|---|---|---|
| 135 | I still suggest to move the prototype to cputypes.h, perhaps under #ifdef _KERNEL. | |
| sys/x86/include/cputypes.h | ||
|---|---|---|
| 54 ↗ | (On Diff #175221) | Emm, It breaks again. I will fix it before merging. |
As reported by https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294468, cputypes.h is used in ASM code on i386 build so we cannot put the function declaration inside cputypes.h. machine/cpu.h also has this issue. @kib, is there any place you think that we can put?
Put #ifndef _LOCORE around the proto.
With _LOCORE I had the same build error. I was able to proceed by using LOCORE instead.
diff --git a/sys/x86/include/cputypes.h b/sys/x86/include/cputypes.h index ed26304a89ac..0b6f0f3746a9 100644 --- a/sys/x86/include/cputypes.h +++ b/sys/x86/include/cputypes.h @@ -54,7 +54,9 @@ #define CPU_AMD_UNKNOWN 0xffffffff #ifdef _KERNEL +#ifndef LOCORE u_int ident_zen_cpu(void); #endif +#endif #endif /* !_X86_CPUTYPES_H_ */
-------------------------------------------------------------- >>> Kernel build for GENERIC completed on Mon Apr 13 16:27:27 UTC 2026 -------------------------------------------------------------- >>> Kernel(s) GENERIC built in 144 seconds, ncpu: 32, make -j32 --------------------------------------------------------------