THUNK: fix deregister memory issues

__fmm_release actually fails to find the object if address is not
pagesize aligned.  And the caller did not notice this as __fmm_release
has no err code return.

So to fix this, move the object lookup in caller, and use vm-object
instead. Also fmm_release will pass up the error code.

Change-Id: Ib8ea1ea5ae844844fd20e8e01f0fdb841d218f2c
Signed-off-by: xinhui pan <xinhui.pan@amd.com>


[ROCm/ROCR-Runtime commit: 8ee5647814]
This commit is contained in:
xinhui pan
2018-06-20 13:30:06 +08:00
committed by Felix Kuehling
parent 146d8ec61b
commit 78664b43e7
3 changed files with 43 additions and 49 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ void *fmm_allocate_doorbell(uint32_t gpu_id, uint64_t MemorySizeInBytes, uint64_
void *fmm_allocate_host(uint32_t node_id, uint64_t MemorySizeInBytes,
HsaMemFlags flags);
void fmm_print(uint32_t node);
void fmm_release(void *address);
HSAKMT_STATUS fmm_release(void *address);
int fmm_map_to_gpu(void *address, uint64_t size, uint64_t *gpuvm_address);
int fmm_unmap_from_gpu(void *address);
bool fmm_get_handle(void *address, uint64_t *handle);