i#3098: fix shared ibt table races #3103
Merged
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.
Fixes two races with shared ibt tables:
Adding a new table entry must write the start_pc before the tag.
This is accomplished with a new ENTRY_SET_TO_ENTRY hashtablex.h
optional specifier. For ARM races in ARM lockless data structure reads #2502 a new MEMORY_STORE_BARRIER macro
is added.
Resizing a table must not clear the tags in the old table to avoid
losing the tag on the target_delete ibl path.
Adds a test api.ibl-stress which uses the DR IR to synthetically
construct thousands of basic blocks with indirect branches betweent
them.
To make the test work, relaxes several is-on-stack checks to support
pre-building basic blocks (#2463) from generated code or other
locations not known prior to starting the application.
Issue: #3098, #2502, #2463
Fixes #3098