2
0

libhsakmt: update create queue for exception handling

Update hsaKmtCreateQueue to initialize the new save area header with the
exception payload and event ID.

Signed-by-off: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Sean Keely <sean.keely@amd.com>
Change-Id: Icd38062dc982cb29b30644699014eeb0b3e26d00


[ROCm/ROCR-Runtime commit: 96c7a5c9dc]
Este cometimento está contido em:
Jonathan Kim
2021-05-10 11:56:06 -04:00
cometido por Jonathan Kim
ascendente 14d821391e
cometimento fe03b35c8e
2 ficheiros modificados com 15 adições e 2 eliminações
+7
Ver ficheiro
@@ -689,6 +689,12 @@ typedef struct
// debugger. Must be 64 byte aligned.
HSAuint32 DebugSize; // Byte size of the memory reserved for the
// debugger. Must be 64 byte aligned.
volatile HSAint64 *ErrorReason; // Address of the HSA signal payload for
// reporting the error reason bitmask.
// Must be 4 byte aligned.
HSAuint32 ErrorEventId; // Event ID used for exception signalling.
// Must be 4 byte aligned.
HSAuint32 Reserved1;
} HsaUserContextSaveAreaHeader;
@@ -738,6 +744,7 @@ typedef struct _HsaQueueResource
HSAuint64 QueueRptrValue;
};
volatile HSAint64* ErrorReason; /** exception bits signal payload */
} HsaQueueResource;
+8 -2
Ver ficheiro
@@ -588,7 +588,9 @@ static void free_queue(struct queue *q)
static int handle_concrete_asic(struct queue *q,
struct kfd_ioctl_create_queue_args *args,
uint32_t NodeId)
uint32_t NodeId,
HsaEvent *Event,
volatile HSAint64 *ErrPayload)
{
const struct device_info *dev_info = q->dev_info;
bool ret;
@@ -626,6 +628,10 @@ static int handle_concrete_asic(struct queue *q,
args->ctx_save_restore_address = (uintptr_t)q->ctx_save_restore;
header = (HsaUserContextSaveAreaHeader *)q->ctx_save_restore;
header->ErrorEventId = 0;
if (Event)
header->ErrorEventId = Event->EventId;
header->ErrorReason = ErrPayload;
header->DebugOffset = q->ctx_save_restore_size - q->debug_memory_size;
header->DebugSize = q->debug_memory_size;
}
@@ -724,7 +730,7 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtCreateQueue(HSAuint32 NodeId,
QueueResource->QueueWptrValue = (uintptr_t)&q->wptr;
}
err = handle_concrete_asic(q, &args, NodeId);
err = handle_concrete_asic(q, &args, NodeId, Event, QueueResource->ErrorReason);
if (err != HSAKMT_STATUS_SUCCESS) {
free_queue(q);
return err;