Add support for per device debug register state tracking
Change-Id: I8d51670f5de8d379ead898d484f668a8034f9878 Signed-off-by: Yair Shachar <Yair.Shachar@amd.com>
Этот коммит содержится в:
1 родитель
a4cf02d797
Коммит
8f529e3c72
2 files changed
+17
-5
No files matched your search
+16
-5
@@ -28,6 +28,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
static bool is_device_debugged[MAX_NODES] = {false};
|
||||||
|
int debug_get_reg_status(uint32_t node_id, bool* is_debugged);
|
||||||
|
|
||||||
HSAKMT_STATUS
|
HSAKMT_STATUS
|
||||||
HSAKMTAPI
|
HSAKMTAPI
|
||||||
hsaKmtDbgRegister(
|
hsaKmtDbgRegister(
|
||||||
@@ -47,9 +50,10 @@ hsaKmtDbgRegister(
|
|||||||
args.gpu_id = gpu_id;
|
args.gpu_id = gpu_id;
|
||||||
long err = kmtIoctl(kfd_fd, AMDKFD_IOC_DBG_REGISTER, &args);
|
long err = kmtIoctl(kfd_fd, AMDKFD_IOC_DBG_REGISTER, &args);
|
||||||
|
|
||||||
if (err == 0)
|
if (err == 0) {
|
||||||
|
is_device_debugged[NodeId] = true;
|
||||||
result = HSAKMT_STATUS_SUCCESS;
|
result = HSAKMT_STATUS_SUCCESS;
|
||||||
else
|
} else
|
||||||
result = HSAKMT_STATUS_ERROR;
|
result = HSAKMT_STATUS_ERROR;
|
||||||
|
|
||||||
return (result);
|
return (result);
|
||||||
@@ -75,9 +79,10 @@ hsaKmtDbgUnregister(
|
|||||||
memset(&args, 0, sizeof(args));
|
memset(&args, 0, sizeof(args));
|
||||||
args.gpu_id = gpu_id;
|
args.gpu_id = gpu_id;
|
||||||
long err = kmtIoctl(kfd_fd, AMDKFD_IOC_DBG_UNREGISTER, &args);
|
long err = kmtIoctl(kfd_fd, AMDKFD_IOC_DBG_UNREGISTER, &args);
|
||||||
if (err == 0)
|
if (err == 0) {
|
||||||
|
is_device_debugged[NodeId] = false;
|
||||||
result = HSAKMT_STATUS_SUCCESS;
|
result = HSAKMT_STATUS_SUCCESS;
|
||||||
else
|
} else
|
||||||
result = HSAKMT_STATUS_ERROR;
|
result = HSAKMT_STATUS_ERROR;
|
||||||
|
|
||||||
return (result);
|
return (result);
|
||||||
@@ -276,4 +281,10 @@ hsaKmtDbgAddressWatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* =============================================================================== */
|
/* =============================================================================== */
|
||||||
|
int debug_get_reg_status(uint32_t node_id, bool* is_debugged)
|
||||||
|
{
|
||||||
|
if ( node_id >= MAX_NODES)
|
||||||
|
return -1;
|
||||||
|
else
|
||||||
|
return (is_device_debugged[node_id]);
|
||||||
|
}
|
||||||
@@ -131,6 +131,7 @@ static svm_t svm = {
|
|||||||
INIT_MANAGEBLE_APERTURE(0, 0)
|
INIT_MANAGEBLE_APERTURE(0, 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern int debug_get_reg_status(uint32_t node_id, bool* is_debugged);
|
||||||
static HSAKMT_STATUS dgpu_mem_init(uint32_t node_id, void **base, void **limit);
|
static HSAKMT_STATUS dgpu_mem_init(uint32_t node_id, void **base, void **limit);
|
||||||
static int set_dgpu_aperture(uint32_t node_id, uint64_t base, uint64_t limit);
|
static int set_dgpu_aperture(uint32_t node_id, uint64_t base, uint64_t limit);
|
||||||
static void __fmm_release(void *address,
|
static void __fmm_release(void *address,
|
||||||
|
|||||||
Reference in new issue
Block a user