Lines Matching refs:kdata
627 struct privcmd_dm_op kdata; in privcmd_ioctl_dm_op() local
635 if (copy_from_user(&kdata, udata, sizeof(kdata))) in privcmd_ioctl_dm_op()
639 if (data->domid != DOMID_INVALID && data->domid != kdata.dom) in privcmd_ioctl_dm_op()
642 if (kdata.num == 0) in privcmd_ioctl_dm_op()
645 if (kdata.num > privcmd_dm_op_max_num) in privcmd_ioctl_dm_op()
648 kbufs = kcalloc(kdata.num, sizeof(*kbufs), GFP_KERNEL); in privcmd_ioctl_dm_op()
652 if (copy_from_user(kbufs, kdata.ubufs, in privcmd_ioctl_dm_op()
653 sizeof(*kbufs) * kdata.num)) { in privcmd_ioctl_dm_op()
658 for (i = 0; i < kdata.num; i++) { in privcmd_ioctl_dm_op()
681 xbufs = kcalloc(kdata.num, sizeof(*xbufs), GFP_KERNEL); in privcmd_ioctl_dm_op()
687 rc = lock_pages(kbufs, kdata.num, pages, nr_pages); in privcmd_ioctl_dm_op()
691 for (i = 0; i < kdata.num; i++) { in privcmd_ioctl_dm_op()
697 rc = HYPERVISOR_dm_op(kdata.dom, kdata.num, xbufs); in privcmd_ioctl_dm_op()
752 struct privcmd_mmap_resource kdata; in privcmd_ioctl_mmap_resource() local
757 if (copy_from_user(&kdata, udata, sizeof(kdata))) in privcmd_ioctl_mmap_resource()
761 if (data->domid != DOMID_INVALID && data->domid != kdata.dom) in privcmd_ioctl_mmap_resource()
765 if (!!kdata.addr != !!kdata.num) in privcmd_ioctl_mmap_resource()
768 xdata.domid = kdata.dom; in privcmd_ioctl_mmap_resource()
769 xdata.type = kdata.type; in privcmd_ioctl_mmap_resource()
770 xdata.id = kdata.id; in privcmd_ioctl_mmap_resource()
772 if (!kdata.addr && !kdata.num) { in privcmd_ioctl_mmap_resource()
782 vma = find_vma(mm, kdata.addr); in privcmd_ioctl_mmap_resource()
788 pfns = kcalloc(kdata.num, sizeof(*pfns), GFP_KERNEL | __GFP_NOWARN); in privcmd_ioctl_mmap_resource()
795 unsigned int nr = DIV_ROUND_UP(kdata.num, XEN_PFN_PER_PAGE); in privcmd_ioctl_mmap_resource()
804 for (i = 0; i < kdata.num; i++) { in privcmd_ioctl_mmap_resource()
813 xdata.frame = kdata.idx; in privcmd_ioctl_mmap_resource()
814 xdata.nr_frames = kdata.num; in privcmd_ioctl_mmap_resource()
831 rc = apply_to_page_range(r.mm, kdata.addr, in privcmd_ioctl_mmap_resource()
832 kdata.num << PAGE_SHIFT, in privcmd_ioctl_mmap_resource()
837 DOMID_SELF : kdata.dom; in privcmd_ioctl_mmap_resource()
842 kdata.addr & PAGE_MASK, in privcmd_ioctl_mmap_resource()
843 pfns, kdata.num, errs, in privcmd_ioctl_mmap_resource()
849 else if (num != kdata.num) { in privcmd_ioctl_mmap_resource()