Fix type mismatch passed to queue suspend/resume

The queue IDs passed over to the kernel via kfd_ioctl_dbg_trap_args->ptr
should be a list of uint32_t's.  Need to convert from the passed in
64 bit HSA_QUEUEID to 32 bit uint32_t's.

Change-Id: I8718566d9f9ffc90ce0b2ecc129b10c49d73186a
Signed-off-by: Philip Cox <Philip.Cox@amd.com>


[ROCm/ROCR-Runtime commit: 608bc7c3a0]
This commit is contained in:
Philip Cox
2019-05-14 09:37:50 -04:00
parent 84cc063225
commit 3d13159fd6
4 changed files with 43 additions and 5 deletions
+22 -4
View File
@@ -440,15 +440,25 @@ hsaKmtQueueSuspend(
HSAuint32 GracePeriod, // IN
HSAuint32 Flags) // IN
{
HSAKMT_STATUS result;
uint32_t *queue_ids_ptr;
CHECK_KFD_OPEN();
return debug_trap(INVALID_NODEID,
queue_ids_ptr = convert_queue_ids(NumQueues, Queues);
if (!queue_ids_ptr)
return HSAKMT_STATUS_NO_MEMORY;
result = debug_trap(INVALID_NODEID,
KFD_IOC_DBG_TRAP_NODE_SUSPEND,
Flags,
NumQueues,
GracePeriod,
Pid,
(HSAuint64)Queues);
(HSAuint64)queue_ids_ptr);
free(queue_ids_ptr);
return result;
}
/**
* Resume the execution of a set of queues. If a queue is not
@@ -493,14 +503,22 @@ hsaKmtQueueResume(
HSA_QUEUEID *Queues, // IN
HSAuint32 Flags) // IN
{
HSAKMT_STATUS result;
uint32_t *queue_ids_ptr;
CHECK_KFD_OPEN();
return debug_trap(INVALID_NODEID,
queue_ids_ptr = convert_queue_ids(NumQueues, Queues);
if (!queue_ids_ptr)
return HSAKMT_STATUS_NO_MEMORY;
result = debug_trap(INVALID_NODEID,
KFD_IOC_DBG_TRAP_NODE_RESUME,
Flags,
NumQueues,
0,
Pid,
(HSAuint64) Queues);
(HSAuint64)queue_ids_ptr);
free(queue_ids_ptr);
return result;
}