Skip to content

hv: write CNTHCTL_EL2 after counter redirection - #624

Merged
svenpeter42 merged 1 commit into
AsahiLinux:mainfrom
georgc4:hv-m3-secondary-cnthctl-sync
Jul 15, 2026
Merged

svenpeter42 merged 1 commit into
AsahiLinux:mainfrom
georgc4:hv-m3-secondary-cnthctl-sync

Conversation

@georgc4

@georgc4 georgc4 commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Write CNTHCTL_EL2 only after the secondary CPU's counter-redirection is configured. This only happens on M3+ because only these SOCs do counter redirection.

@svenpeter42 svenpeter42 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The fix seems correct but the reason needs to be adjusted: the CNTHCTL write has to be done after the counter redirection is configured and visible. I'd also add a comment before the isb to explain why it's there. That also explains why this only happens on M3+

@georgc4
georgc4 force-pushed the hv-m3-secondary-cnthctl-sync branch from 44dc597 to 5a77a1b Compare July 14, 2026 15:45
@georgc4
georgc4 requested a review from svenpeter42 July 14, 2026 15:48
@svenpeter42

Copy link
Copy Markdown
Member

please rebase to a single commit and drop the weird original explanation altogether

@georgc4
georgc4 force-pushed the hv-m3-secondary-cnthctl-sync branch from 5a77a1b to 448061c Compare July 14, 2026 17:03
@georgc4 georgc4 changed the title hv: Synchronize GXF context before restoring CNTHCTL hv: write CNTHCTL_EL2 after counter redirection Jul 14, 2026
@georgc4

georgc4 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Squashed commits and retitled PR

@svenpeter42

Copy link
Copy Markdown
Member

LGTM now, just needs a rebase on the current main

@georgc4
georgc4 force-pushed the hv-m3-secondary-cnthctl-sync branch from 448061c to 98e87d2 Compare July 14, 2026 18:07
@georgc4

georgc4 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Rebased

Comment thread src/hv.c Resolved
@georgc4
georgc4 force-pushed the hv-m3-secondary-cnthctl-sync branch from 98e87d2 to a3f49bb Compare July 14, 2026 21:31
@georgc4

georgc4 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Added the space after the comment

Signed-off-by: Carlos Georges <cg3527@columbia.edu>
Signed-off-by: Georges, Carlos <carlos.georges@intel.com>
@georgc4
georgc4 force-pushed the hv-m3-secondary-cnthctl-sync branch from a3f49bb to 2b0f584 Compare July 14, 2026 21:33
@svenpeter42
svenpeter42 merged commit a35e52d into AsahiLinux:main Jul 15, 2026
7 checks passed
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