Skip to content
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

feat: Check if VM supports TSC #3

Merged
merged 2 commits into from
Oct 16, 2024
Merged

Conversation

ariesdevil
Copy link
Contributor

@ariesdevil ariesdevil commented Oct 5, 2024

Invariant TSC could make sure TSC got synced among multiple CPUs, so we check CPUID first, 0x80000007 is a specific CPUID leaf used to query the advanced power management features of a processor, including support for an invariant TSC.

In some VMs, the Max Extended Function in CPUID is < 0x80000007, we should enable TSC if the system clock source is TSC.

FYI: CPUID explorer

src/tsc_now.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. Generally looks good.

Waiting for other maintainer's review.

Copy link
Collaborator

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andylokandy @zhongzc I'm yet to have time check if has_invariant_tsc work reasonably. Would you take a look?

@Xuanwo Xuanwo merged commit 910e54d into fast:main Oct 16, 2024
8 checks passed
@ariesdevil ariesdevil deleted the dev_ariesdevil branch October 16, 2024 05:21
@tisonkun
Copy link
Collaborator

@ariesdevil I noticed that we don't release this patch. Do you need a new version for use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants