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
Tento commit je obsažen v:
Bing Ma
2023-05-01 15:20:21 -07:00
odevzdal David Yat Sin
rodič d966243783
revize 1e6d728730
5 změnil soubory, kde provedl 140 přidání a 1 odebrání
+24
Zobrazit soubor
@@ -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