Lines Matching refs:cmd
386 static int dmirror_read(struct dmirror *dmirror, struct hmm_dmirror_cmd *cmd) in dmirror_read() argument
390 unsigned long size = cmd->npages << PAGE_SHIFT; in dmirror_read()
393 start = cmd->addr; in dmirror_read()
409 start = cmd->addr + (bounce.cpages << PAGE_SHIFT); in dmirror_read()
413 cmd->faults++; in dmirror_read()
417 if (copy_to_user(u64_to_user_ptr(cmd->ptr), bounce.ptr, in dmirror_read()
421 cmd->cpages = bounce.cpages; in dmirror_read()
452 static int dmirror_write(struct dmirror *dmirror, struct hmm_dmirror_cmd *cmd) in dmirror_write() argument
456 unsigned long size = cmd->npages << PAGE_SHIFT; in dmirror_write()
459 start = cmd->addr; in dmirror_write()
467 if (copy_from_user(bounce.ptr, u64_to_user_ptr(cmd->ptr), in dmirror_write()
480 start = cmd->addr + (bounce.cpages << PAGE_SHIFT); in dmirror_write()
484 cmd->faults++; in dmirror_write()
488 cmd->cpages = bounce.cpages; in dmirror_write()
778 struct hmm_dmirror_cmd *cmd) in dmirror_exclusive() argument
781 unsigned long size = cmd->npages << PAGE_SHIFT; in dmirror_exclusive()
788 start = cmd->addr; in dmirror_exclusive()
839 if (copy_to_user(u64_to_user_ptr(cmd->ptr), bounce.ptr, in dmirror_exclusive()
844 cmd->cpages = bounce.cpages; in dmirror_exclusive()
901 struct hmm_dmirror_cmd *cmd) in dmirror_migrate_to_system() argument
904 unsigned long size = cmd->npages << PAGE_SHIFT; in dmirror_migrate_to_system()
913 start = cmd->addr; in dmirror_migrate_to_system()
922 cmd->cpages = 0; in dmirror_migrate_to_system()
950 cmd->cpages += dmirror_successful_migrated_pages(&args); in dmirror_migrate_to_system()
961 struct hmm_dmirror_cmd *cmd) in dmirror_migrate_to_device() argument
964 unsigned long size = cmd->npages << PAGE_SHIFT; in dmirror_migrate_to_device()
974 start = cmd->addr; in dmirror_migrate_to_device()
1025 if (copy_to_user(u64_to_user_ptr(cmd->ptr), bounce.ptr, in dmirror_migrate_to_device()
1029 cmd->cpages = bounce.cpages; in dmirror_migrate_to_device()
1165 struct hmm_dmirror_cmd *cmd) in dmirror_snapshot() argument
1169 unsigned long size = cmd->npages << PAGE_SHIFT; in dmirror_snapshot()
1181 start = cmd->addr; in dmirror_snapshot()
1194 uptr = u64_to_user_ptr(cmd->ptr); in dmirror_snapshot()
1212 cmd->cpages += n; in dmirror_snapshot()
1304 struct hmm_dmirror_cmd cmd; in dmirror_fops_unlocked_ioctl() local
1312 if (copy_from_user(&cmd, uarg, sizeof(cmd))) in dmirror_fops_unlocked_ioctl()
1315 if (cmd.addr & ~PAGE_MASK) in dmirror_fops_unlocked_ioctl()
1317 if (cmd.addr >= (cmd.addr + (cmd.npages << PAGE_SHIFT))) in dmirror_fops_unlocked_ioctl()
1320 cmd.cpages = 0; in dmirror_fops_unlocked_ioctl()
1321 cmd.faults = 0; in dmirror_fops_unlocked_ioctl()
1325 ret = dmirror_read(dmirror, &cmd); in dmirror_fops_unlocked_ioctl()
1329 ret = dmirror_write(dmirror, &cmd); in dmirror_fops_unlocked_ioctl()
1333 ret = dmirror_migrate_to_device(dmirror, &cmd); in dmirror_fops_unlocked_ioctl()
1337 ret = dmirror_migrate_to_system(dmirror, &cmd); in dmirror_fops_unlocked_ioctl()
1341 ret = dmirror_exclusive(dmirror, &cmd); in dmirror_fops_unlocked_ioctl()
1345 ret = dmirror_check_atomic(dmirror, cmd.addr, in dmirror_fops_unlocked_ioctl()
1346 cmd.addr + (cmd.npages << PAGE_SHIFT)); in dmirror_fops_unlocked_ioctl()
1350 ret = dmirror_snapshot(dmirror, &cmd); in dmirror_fops_unlocked_ioctl()
1364 if (copy_to_user(uarg, &cmd, sizeof(cmd))) in dmirror_fops_unlocked_ioctl()