-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: only pass TSC deadline feature if the host supports it #4655
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
Conversation
728c92b
to
f061302
Compare
In commit f5906ee we moved the initialization of the list but forgot to change it here. Fixes: f5906ee Signed-off-by: Pablo Barbáchano <[email protected]>
AMD hosts do not have TSC deadline enabled, and that seems to cause issues like in firecracker-microvm#4099. Only expose TSC_DEADLINE to the guest if the host supports it. Closes firecracker-microvm#4099 Signed-off-by: Pablo Barbáchano <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4655 +/- ##
=======================================
Coverage 82.08% 82.08%
=======================================
Files 255 255
Lines 31257 31264 +7
=======================================
+ Hits 25656 25663 +7
Misses 5601 5601
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -247,7 +247,14 @@ impl super::Cpuid { | |||
// operation using a TSC deadline value. | |||
// | |||
// tsc_deadline: 24, | |||
set_bit(&mut leaf_1.result.ecx, ECX_TSC_DEADLINE_BITINDEX, true); | |||
let host_leaf_1 = cpuid(0x1); |
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.
Lest we forget: in case this makes it off the draft, we'll need to update the doc: https://github.com/firecracker-microvm/firecracker/blob/main/docs/cpu_templates/cpuid-normalization.md
set_bit( | ||
&mut leaf_1.result.ecx, | ||
ECX_TSC_DEADLINE_BITINDEX, | ||
host_tsc_deadline, |
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.
This causes a 40-50% regression in boot time. Currently investigating.
Superseded by #4666 |
Changes
...
Reason
...
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md
.PR Checklist
PR.
CHANGELOG.md
.TODO
s link to an issue.contribution quality standards.
rust-vmm
.