Fix up hijacking on x86 (preserve async continuation register)#123084
Merged
eduardo-vp merged 5 commits intodotnet:mainfrom Jan 15, 2026
Merged
Fix up hijacking on x86 (preserve async continuation register)#123084eduardo-vp merged 5 commits intodotnet:mainfrom
eduardo-vp merged 5 commits intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request attempts to fix GC hijacking on x86 to preserve the ECX register during garbage collection, as it may contain an async continuation according to the CLR ABI. The PR adds the PTFF_SAVE_RCX flag definition and includes it in the register save flags for two hijack handlers.
Changes:
- Adds
PTFF_SAVE_RCXconstant definition in i386/AsmMacros.inc - Updates
_RhpGcProbeHijack@0to include PTFF_SAVE_RCX in its register save flags - Updates
_RhpGcStressHijack@0to include PTFF_SAVE_RCX in its register save flags
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/coreclr/nativeaot/Runtime/i386/AsmMacros.inc | Adds PTFF_SAVE_RCX flag constant (0x00000200h) for saving ECX register during hijack |
| src/coreclr/nativeaot/Runtime/i386/GcProbe.asm | Updates two hijack functions to include PTFF_SAVE_RCX in their save flags when waiting for GC |
Co-authored-by: Copilot <[email protected]>
jkotas
reviewed
Jan 12, 2026
VSadov
reviewed
Jan 13, 2026
6 tasks
3 tasks
jkotas
reviewed
Jan 15, 2026
jkotas
approved these changes
Jan 15, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Flag ecx (see async calling convention) during GC as it might contain an async continuation.
Contributes to #122492.