forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 77
[SWDEV-563823][Compiler-rt][ASan] Simplify API Logic 'asan_hsa_amd_ipc_memory_create'. #475
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
Open
ampandey-AMD
wants to merge
8
commits into
ROCm:amd-staging
Choose a base branch
from
ampandey-AMD:fix-swdev-563823-ipc-handles
base: amd-staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
49399fa
[SWDEV-563823][Compiler-rt][ASan] Simplify API Logic
ampandey-AMD 14df989
Address comments of @bing-ma.
ampandey-AMD 1a25efe
Improve ASan implementations of hsa api calls based on @bing-ma
ampandey-AMD c67a73b
Address @b-sumner comments.
ampandey-AMD 1f9b9c8
Improve code for edge cases testing.
ampandey-AMD 20bc0db
Revert "Improve code for edge cases testing."
ampandey-AMD 601f453
Improve code for edge cases testing.
ampandey-AMD eed8503
Address comments of @b-sumner.
ampandey-AMD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
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.
Should we use ptr_ here instead of ptr? It might be a bit clearer to do so.
Uh oh!
There was an error while loading. Please reload this page.
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.
We want hsa_amd_pointer_info interception to be unwavered and return successfully when ASan is enabled. Here the user pointer
ptris not the actual ASan mappedptr_. The ROCr runtime, given an interior pointer, returns the base of the whole mapped region (the page-aligned(kPageSize_) start: ptr_) when ASan is enabled.To keep the ASan illusion (that the user pointer is the “base” of the allocation and to hide the leading guard page), we shift the reported agentBaseAddress and hostBaseAddress forward by kPageSize_. We also replace sizeInBytes with
m->UsedSize()(user payload only), instead of the full mapping size that includes the guard page.If we passed ptr_ to the real function we would not add the offset, but then other interceptors (IPC create/attach) that rely on “user base = reported base” would break.
The current chosen scheme below:
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.
Is it not the case that the call at line 1562 to the real pointer info function will return the same result when given either ptr or ptr_? If that is true then I think ptr_ is a better choice since it is the illusion free value passed to the illusion free function.