int hl_vm_init(struct hl_device *hdev);
void hl_vm_fini(struct hl_device *hdev);
-int hl_pin_host_memory(struct hl_device *hdev, u64 addr, u32 size,
+int hl_pin_host_memory(struct hl_device *hdev, u64 addr, u64 size,
struct hl_userptr *userptr);
int hl_unpin_host_memory(struct hl_device *hdev, struct hl_userptr *userptr);
void hl_userptr_delete_list(struct hl_device *hdev,
* - Pins the physical pages
* - Create a SG list from those pages
*/
-int hl_pin_host_memory(struct hl_device *hdev, u64 addr, u32 size,
+int hl_pin_host_memory(struct hl_device *hdev, u64 addr, u64 size,
struct hl_userptr *userptr)
{
u64 start, end;
int rc;
if (!size) {
- dev_err(hdev->dev, "size to pin is invalid - %d\n",
- size);
+ dev_err(hdev->dev, "size to pin is invalid - %llu\n", size);
return -EINVAL;
}
if (!access_ok((void __user *) (uintptr_t) addr, size)) {
- dev_err(hdev->dev, "user pointer is invalid - 0x%llx\n",
- addr);
+ dev_err(hdev->dev, "user pointer is invalid - 0x%llx\n", addr);
return -EFAULT;
}
if (((addr + size) < addr) ||
PAGE_ALIGN(addr + size) < (addr + size)) {
dev_err(hdev->dev,
- "user pointer 0x%llx + %u causes integer overflow\n",
+ "user pointer 0x%llx + %llu causes integer overflow\n",
addr, size);
return -EINVAL;
}
/* HL_MEM_OP_ALLOC- allocate device memory */
struct {
/* Size to alloc */
- __u32 mem_size;
- __u32 pad;
+ __u64 mem_size;
} alloc;
/* HL_MEM_OP_FREE - free device memory */
*/
__u64 hint_addr;
/* Size of allocated host memory */
- __u32 mem_size;
- __u32 pad;
+ __u64 mem_size;
} map_host;
/* HL_MEM_OP_UNMAP - unmap host memory */