-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Load R2R images on osx-arm64 according to Apple's guidelines #67118
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
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
* use MAP_PRIVATE for the mapped file * correct the condition
This allows to keep the instruction cache flush logic identical between platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now. Not sure if pulsing the write mode is a perf concern as before. Seems in line with what we did before and seems pretty clean now in terms of readability. Also confirmed that the debugger breakpoints work as expected and that the code that's running comes from the R2R image itself. Thanks @jgiannuzzi
if (((pSection->Characteristics & VAL32(IMAGE_SCN_MEM_EXECUTE)) != 0)) | ||
{ | ||
#ifdef __APPLE__ | ||
dwNewProtection = PAGE_READWRITE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Thanks for fixing @jgiannuzzi |
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/2074029121 |
@mangod9 backporting to release/6.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Load R2R images on osx-arm64 according to Apple's guidelines
Using index info to reconstruct a base tree...
M src/coreclr/pal/src/map/map.cpp
M src/coreclr/vm/peimagelayout.cpp
Falling back to patching base and 3-way merge...
Auto-merging src/coreclr/vm/peimagelayout.cpp
Auto-merging src/coreclr/pal/src/map/map.cpp
CONFLICT (content): Merge conflict in src/coreclr/pal/src/map/map.cpp
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Load R2R images on osx-arm64 according to Apple's guidelines
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
Closes #65341.
This PR changes how R2R images are loaded on Apple Silicon by following Apple's guidelines. Without this change, debugging is broken on this platform, as the R2R memory cannot be written to.