Invalidate CPU I-cache on Apple Silicon#259
Merged
SChernykh merged 1 commit intotevador:masterfrom Dec 17, 2022
Merged
Conversation
Collaborator
|
This issue keeps coming up a lot. Just a reminder (for future reference): we're already using the gcc/clang __builtin___clear_cache() and on MacOS that is simply a call to sys_icache_invalidate(). So the real question to answer is, do we have enough of those __builtin___clear_cache() invocations, in the right places? Example clang implementation: https://codebrowser.dev/llvm/compiler-rt/lib/builtins/clear_cache.c.html |
hyc
reviewed
Nov 30, 2022
Call __builtin___clear_cache() after pthread_jit_write_protect_np() according to https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon
9ab7d58 to
7245f13
Compare
hyc
approved these changes
Nov 30, 2022
Collaborator
hyc
left a comment
There was a problem hiding this comment.
Approving, even though it seems this isn't fixing any crashes. It is at least following the letter of the Apple docs.
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.
Call sys_icache_invalidate() after pthread_jit_write_protect_np() according to https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon