libhsakmt: Prevent hsaKmtRegisterMemory* from registering non-userptr
hsaKmtRegisterMemory* can only register OS allocated userptr.
v2: Apply changes to all hsaKmtRegisterMemory* stuff.(Philip)
v3: Unlock aperture->fmm_mutex to aviod deadlock.
Suggested-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: I1045af7edb4da8206cb878f64c0176ba4fc59f60
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>
[ROCm/ROCR-Runtime commit: 4844a70d94]
Este cometimento está contido em:
cometido por
Chris Freehill
ascendente
20566a9b38
cometimento
b8d1ddd431
@@ -3533,6 +3533,10 @@ HSAKMT_STATUS fmm_register_memory(void *address, uint64_t size_in_bytes,
|
||||
} else if (object->userptr) {
|
||||
/* Update an existing userptr */
|
||||
++object->registration_count;
|
||||
} else {
|
||||
/* Not a userptr when we are expecting one */
|
||||
pthread_mutex_unlock(&aperture->fmm_mutex);
|
||||
return HSAKMT_STATUS_INVALID_HANDLE;
|
||||
}
|
||||
/* Successful vm_find_object returns with aperture locked */
|
||||
|
||||
|
||||
Criar uma nova questão referindo esta
Bloquear um utilizador