libhsakmt: Add support functions for ASAN

Add support functions to remap the first page of device memory (GPU/GTT)
to share host ASAN logic.

Signed-off-by: David Yat Sin <David.YatSin@amd.com>
Change-Id: I4c27d5417ba80a172dccb0a079a597c5dc1c8f85


[ROCm/ROCR-Runtime commit: 1e6d728730]
Этот коммит содержится в:
Bing Ma authored and David Yat Sin committed 2023-05-17 13:38:19 -04:00
1 родитель 4d26b1cf48
Коммит a868d0972b
5 files changed
+140 -1

No files matched your search

+24
Просмотреть файл
@@ -913,6 +913,30 @@ hsaKmtOpenSMI(
int *fd // OUT: anonymous file handle
);
/**
If this is GPU Mapped memory, remap the first page at this address to be normal system memory
This is used in ASAN mode to remap the first page of device memory to share host ASAN logic.
This function is only supported when libhsakmt is compiled in ASAN mode.
*/
HSAKMT_STATUS
HSAKMTAPI
hsaKmtReplaceAsanHeaderPage(
void *addr // IN: Start of othe virtual address page
);
/**
If this is GPU Mapped memory, remap the first page back to the original GPU memory
This is used in ASAN mode to remap the first page back to its original mapping.
This function is only supported when libhsakmt is compiled in ASAN mode.
*/
HSAKMT_STATUS
HSAKMTAPI
hsaKmtReturnAsanHeaderPage(
void *addr // IN: Start of othe virtual address page
);
#ifdef __cplusplus
} //extern "C"
#endif