-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x86: implement CPUID 15h support #143
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, minus these nits
kernel/arch/x86_64/apic.cpp
Outdated
|
||
for (int i = 0; i < CALIBRATION_TRIALS; i++) | ||
{ | ||
apic_calibrate(i); | ||
if (calibrate_apic) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't add {} around single-statement ifs
kernel/arch/x86_64/apic.cpp
Outdated
|
||
for (int i = 0; i < 3; i++) | ||
{ | ||
deltas[i] = calib.apic_ticks[i]; | ||
} | ||
|
||
apic_rate = calculate_frequency(deltas, 1); | ||
if (calibrate_apic) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and up there)
kernel/arch/x86_64/cpu.cpp
Outdated
{ | ||
if (ebx == 0 || eax == 0) | ||
{ | ||
INFO("x86cpu", "CPUID 0x15 is useless, reverting to calibration\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same single-brace statement (apply to elsewhere in the review)
Don't use INFO but pr_info (maybe pr_info("x86: ..."))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to get rid of INFO in this and other files in a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not asking you to get rid of all INFOs, just don't add new ones
kernel/arch/x86_64/cpu.cpp
Outdated
/* Some Intel SoCs don't report crystal clock. Though it can be | ||
* highly accurately calculated from CPU base frequency | ||
*/ | ||
auto numerator = ebx; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also: no auto
Also, please rebase on top of master! |
You have conflicts with master after my latest merge. Also small nit: s/x86_64/x86/ |
I renamed cpu to bootcpu_info, btw |
This allows us to get TSC and APIC rates without calibration on processors supporting this leaf. Signed-off-by: Peter Shkenev <[email protected]>
This allows us to get TSC and APIC rates without calibration on processors supporting this leaf.