Enable CNTVCT on cloned vCPUs#230
Merged
Merged
Conversation
jserv
reviewed
Jul 20, 2026
jserv
reviewed
Jul 20, 2026
jserv
reviewed
Jul 20, 2026
jserv
reviewed
Jul 20, 2026
jserv
reviewed
Jul 20, 2026
jserv
reviewed
Jul 20, 2026
doanbaotrung
force-pushed
the
cloned-vcpu
branch
from
July 20, 2026 05:00
2e8a7b3 to
3d8f99a
Compare
Collaborator
Author
|
Implemented the reviewed fixes in
|
doanbaotrung
force-pushed
the
cloned-vcpu
branch
2 times, most recently
from
July 20, 2026 05:24
91c02c0 to
78cc0fc
Compare
Define the EL0 timer access mask once and reuse it for bootstrap, CLONE_THREAD, and CLONE_VM vCPU setup. Extend the CNTVCT regression test to also read CNTPCT_EL0 and cover the raw CLONE_VM path so both cloned-vCPU setup sites are exercised. Fix sysprog21#229
doanbaotrung
force-pushed
the
cloned-vcpu
branch
from
July 20, 2026 05:45
78cc0fc to
37c3c53
Compare
Contributor
|
Thank @doanbaotrung for contributing! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Worker vCPUs created for clone threads did not get CNTKCTL_EL1 configured, even though the initial vCPU enables EL0 access to the architected counter.
Set CNTKCTL_EL1 during cloned vCPU setup so CNTVCT_EL0 reads work from guest threads as they do on the main vCPU. Add a pthread regression test that reads CNTVCT_EL0 from both main and worker vCPUs.
Fix #229
Summary by cubic
Enable EL0 reads of the architected timers on all vCPUs by using a single CNTKCTL_EL1 mask in bootstrap and both cloned-vCPU paths (CLONE_THREAD and CLONE_VM). Restores CNTVCT_EL0/CNTPCT_EL0 for guest threads and adds a regression test. Fixes #229.
Written for commit 37c3c53. Summary will update on new commits.