ASAN: Remap first page of allocations to host mem
When compiling in ASAN mode, remap the first page of device allocations to system memory. ASAN's memory allocator uses a small amount of extra memory to store data for housekeeping purpose. But because this memory is from the GPU memory pool, it might have uncommon memory type for host to access. Mapping this section of memory to the host makes this memory accessible to ASAN. Change-Id: I36f659d616a4d15558372592439a8723c5c84a69 Signed-off-by: Bing Ma <Bing.Ma@amd.com>
Цей коміт міститься в:
1 джерело
a1f3b619a7
коміт
50e754d08b
6 files changed
+49
-7
No files matched your search
@@ -1084,6 +1084,8 @@ hsa_status_t
|
||||
TRY;
|
||||
IS_OPEN();
|
||||
|
||||
core::MemoryRegion::AllocateFlags alloc_flag = core::MemoryRegion::AllocateNoFlags;
|
||||
|
||||
if (size == 0 || ptr == NULL) {
|
||||
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -1091,8 +1093,7 @@ hsa_status_t
|
||||
const core::MemoryRegion* mem_region = core::MemoryRegion::Convert(region);
|
||||
IS_VALID(mem_region);
|
||||
|
||||
return core::Runtime::runtime_singleton_->AllocateMemory(
|
||||
mem_region, size, core::MemoryRegion::AllocateNoFlags, ptr);
|
||||
return core::Runtime::runtime_singleton_->AllocateMemory(mem_region, size, alloc_flag, ptr);
|
||||
CATCH;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Заблокувати користувача