Use aligned size for looking up userptr object after allocation
The alignment performed in vm_find_object_by_address isn't sufficient because it doesn't take into account the offset from the start of the page. This fixes a bug where certain unaligned userpointers and sizes fail to register correctly. Change-Id: I17872e264467a619f5e1bedb7e1ed3d994a856bf
This commit is contained in:
+1
-1
@@ -1832,7 +1832,7 @@ static HSAKMT_STATUS fmm_register_user_memory(void *addr, HSAuint64 size, vm_obj
|
||||
|
||||
/* Find the object and set its userptr address */
|
||||
pthread_mutex_lock(&aperture->fmm_mutex);
|
||||
obj = vm_find_object_by_address(aperture, svm_addr, size);
|
||||
obj = vm_find_object_by_address(aperture, svm_addr, aligned_size);
|
||||
if (obj == NULL) {
|
||||
pthread_mutex_unlock(&aperture->fmm_mutex);
|
||||
return HSAKMT_STATUS_ERROR;
|
||||
|
||||
مرجع در شماره جدید
Block a user