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
Dieser Commit ist enthalten in:
Bing Ma
2023-05-01 15:20:21 -07:00
committet von David Yat Sin
Ursprung d966243783
Commit 1e6d728730
5 geänderte Dateien mit 140 neuen und 1 gelöschten Zeilen
+24
Datei anzeigen
@@ -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