Skip to content

Conversation

@eduardo-vp
Copy link
Member

@eduardo-vp eduardo-vp commented Jan 12, 2026

Flag ecx (see async calling convention) during GC as it might contain an async continuation.

Contributes to #122492.

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

@eduardo-vp eduardo-vp changed the title Fix up hijacking on x86 Fix up hijacking on x86 (preserve async continuation register) Jan 12, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_RCX constant definition in i386/AsmMacros.inc
  • Updates _RhpGcProbeHijack@0 to include PTFF_SAVE_RCX in its register save flags
  • Updates _RhpGcStressHijack@0 to 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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@eduardo-vp eduardo-vp merged commit 9b7bb6d into dotnet:main Jan 15, 2026
100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants