search for: copy_from_user

Displaying 20 results from an estimated 662 matches for "copy_from_user".

2016 Mar 18
4
[PATCH] gpu/drm: Use u64_to_user_pointer
...rgs->cmdbufs); + relocs = u64_to_user_ptr(args->relocs); + waitchks = u64_to_user_ptr(args->waitchks); + while (num_cmdbufs) { struct drm_tegra_cmdbuf cmdbuf; struct host1x_bo *bo; @@ -389,7 +390,7 @@ int tegra_drm_submit(struct tegra_drm_context *context, goto fail; } - if (copy_from_user(&syncpt, (void __user *)(uintptr_t)args->syncpts, + if (copy_from_user(&syncpt, u64_to_user_ptr(args->syncpts), sizeof(syncpt))) { err = -EFAULT; goto fail; diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 9807bc9..fe3a4aa 100644 --- a/driver...
2016 Mar 18
4
[PATCH] gpu/drm: Use u64_to_user_pointer
...rgs->cmdbufs); + relocs = u64_to_user_ptr(args->relocs); + waitchks = u64_to_user_ptr(args->waitchks); + while (num_cmdbufs) { struct drm_tegra_cmdbuf cmdbuf; struct host1x_bo *bo; @@ -389,7 +390,7 @@ int tegra_drm_submit(struct tegra_drm_context *context, goto fail; } - if (copy_from_user(&syncpt, (void __user *)(uintptr_t)args->syncpts, + if (copy_from_user(&syncpt, u64_to_user_ptr(args->syncpts), sizeof(syncpt))) { err = -EFAULT; goto fail; diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 9807bc9..fe3a4aa 100644 --- a/driver...
2016 Mar 18
0
[PATCH] gpu/drm: Use u64_to_user_pointer
...oss ARCH=m68k All warnings (new ones prefixed by >>): drivers/gpu/drm/vc4/vc4_bo.c: In function 'vc4_create_shader_bo_ioctl': drivers/gpu/drm/vc4/vc4_bo.c:502:2: error: implicit declaration of function 'u64_to_user_ptr' [-Werror=implicit-function-declaration] if (copy_from_user(bo->base.vaddr, ^ In file included from arch/m68k/include/asm/uaccess.h:4:0, from include/linux/uaccess.h:5, from include/linux/highmem.h:8, from include/drm/drmP.h:40, from drivers/gpu/drm/vc4/vc4_drv.h:9,...
2011 Mar 06
1
[PATCH] vhost: copy_from_user -> __copy_from_user
copy_from_user is pretty high on perf top profile, replacing it with __copy_from_user helps. It's also safe because we do access_ok checks during setup. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/vhost/vhost.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --g...
2011 Mar 06
1
[PATCH] vhost: copy_from_user -> __copy_from_user
copy_from_user is pretty high on perf top profile, replacing it with __copy_from_user helps. It's also safe because we do access_ok checks during setup. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/vhost/vhost.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --g...
2005 Jul 22
1
Re: zaptel make problems
On a different note using Fedora Core 3 I get CC [M] /usr/src/zaptel/zaptel.o /usr/src/zaptel/zaptel.c: In function `zt_chan_write': /usr/src/zaptel/zaptel.c:1745: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result /usr/src/zaptel/zaptel.c: In function `ioctl_load_zone': /usr/src/zaptel/zaptel.c:2392: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result /usr/src/zaptel/zaptel.c: In function `zt_common_ioctl'...
2015 Feb 04
1
[PATCH v3 18/18] vhost: vhost_scsi_handle_vq() should just use copy_from_user()
...c78d87 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -1079,7 +1079,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) req_size, vq->iov[0].iov_len); break; } - ret = memcpy_fromiovecend(req, &vq->iov[0], 0, req_size); + ret = copy_from_user(req, vq->iov[0].iov_base, req_size); if (unlikely(ret)) { vq_err(vq, "Faulted on virtio_scsi_cmd_req\n"); break; diff --git a/include/linux/uio.h b/include/linux/uio.h index 02bd8a9..3e0cb4e 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -135,6 +135,4 @@ stati...
2015 Feb 04
1
[PATCH v3 18/18] vhost: vhost_scsi_handle_vq() should just use copy_from_user()
...c78d87 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -1079,7 +1079,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) req_size, vq->iov[0].iov_len); break; } - ret = memcpy_fromiovecend(req, &vq->iov[0], 0, req_size); + ret = copy_from_user(req, vq->iov[0].iov_base, req_size); if (unlikely(ret)) { vq_err(vq, "Faulted on virtio_scsi_cmd_req\n"); break; diff --git a/include/linux/uio.h b/include/linux/uio.h index 02bd8a9..3e0cb4e 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -135,6 +135,4 @@ stati...
2019 Aug 02
2
[PATCH V2 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...rectness not performance improvement > > The topic is whether we should revert > commit 7f466032dc9 ("vhost: access vq metadata through kernel virtual address") > > or keep it in. The only reason to keep it is performance. Yikes, I'm not sure you can ever win against copy_from_user using mmu_notifiers? The synchronization requirements are likely always more expensive unless large and scattered copies are being done.. The rcu is about the only simple approach that could be less expensive, and that gets back to the question if you can block an invalidate_start_range in synchr...
2019 Aug 02
2
[PATCH V2 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...rectness not performance improvement > > The topic is whether we should revert > commit 7f466032dc9 ("vhost: access vq metadata through kernel virtual address") > > or keep it in. The only reason to keep it is performance. Yikes, I'm not sure you can ever win against copy_from_user using mmu_notifiers? The synchronization requirements are likely always more expensive unless large and scattered copies are being done.. The rcu is about the only simple approach that could be less expensive, and that gets back to the question if you can block an invalidate_start_range in synchr...
2005 Jun 30
0
[PATCH][10/10] Use copy_from_user when accessing guest_pt
Use copy_from_user when accessing guest_pt[] Signed-off-by: Arun Sharma <arun.sharma@intel.com> diff -r 2d289d7ab961 -r d0eccea63a24 xen/arch/x86/shadow.c --- a/xen/arch/x86/shadow.c Thu Jun 30 05:26:09 2005 +++ b/xen/arch/x86/shadow.c Thu Jun 30 05:26:24 2005 @@ -1906,7 +1906,7 @@ unsigned long gpfn, un...
2007 May 02
3
[RELEASE] Lguest for 2.6.21
Hi all, Lguest is a simple hypervisor which runs Linux under Linux, without needing VT hardware. Two people asked if I had a version of lguest which worked on other-than-bleeding-edge-mm kernels, so I did a backport of the latest version to 2.6.21. http://lguest.ozlabs.org/lguest-2.6.21-254.patch.gz See Documentation/lguest/lguest.txt for how to run, drivers/lguest/README for the draft code
2007 May 02
3
[RELEASE] Lguest for 2.6.21
Hi all, Lguest is a simple hypervisor which runs Linux under Linux, without needing VT hardware. Two people asked if I had a version of lguest which worked on other-than-bleeding-edge-mm kernels, so I did a backport of the latest version to 2.6.21. http://lguest.ozlabs.org/lguest-2.6.21-254.patch.gz See Documentation/lguest/lguest.txt for how to run, drivers/lguest/README for the draft code
2005 Jan 21
0
Problem compiling zaptel-1.0.3
...10 SUBDIRS=/home/sbn/src/zaptel-1.0.3 modules make[1]: Entering directory `/home/sbn/src/linux-2.6.10' CC [M] /home/sbn/src/zaptel-1.0.3/zaptel.o /home/sbn/src/zaptel-1.0.3/zaptel.c: In function `zt_chan_write': /home/sbn/src/zaptel-1.0.3/zaptel.c:1720: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result /home/sbn/src/zaptel-1.0.3/zaptel.c: In function `ioctl_load_zone': /home/sbn/src/zaptel-1.0.3/zaptel.c:2356: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result /home/sbn/src/zaptel-1.0.3/zaptel.c:...
2019 Aug 04
3
[PATCH V2 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...e topic is whether we should revert > > > commit 7f466032dc9 ("vhost: access vq metadata through kernel virtual address") > > > > > > or keep it in. The only reason to keep it is performance. > > > > Yikes, I'm not sure you can ever win against copy_from_user using > > mmu_notifiers? > > Ever since copy_from_user started playing with flags (for SMAP) and > added speculation barriers there's a chance we can win by accessing > memory through the kernel address. You think copy_to_user will be more expensive than the minimum two atom...
2019 Aug 04
3
[PATCH V2 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...e topic is whether we should revert > > > commit 7f466032dc9 ("vhost: access vq metadata through kernel virtual address") > > > > > > or keep it in. The only reason to keep it is performance. > > > > Yikes, I'm not sure you can ever win against copy_from_user using > > mmu_notifiers? > > Ever since copy_from_user started playing with flags (for SMAP) and > added speculation barriers there's a chance we can win by accessing > memory through the kernel address. You think copy_to_user will be more expensive than the minimum two atom...
2020 Apr 07
0
[vhost:vhost 32/44] drivers/gpu/drm/virtio/virtgpu_ioctl.c:113:7: error: implicit declaration of function 'copy_from_user'; did you mean 'sg_copy_from_buffer'?
...ate Reported-by: kbuild test robot <lkp at intel.com> All errors (new ones prefixed by >>): drivers/gpu/drm/virtio/virtgpu_ioctl.c: In function 'virtio_gpu_execbuffer_ioctl': >> drivers/gpu/drm/virtio/virtgpu_ioctl.c:113:7: error: implicit declaration of function 'copy_from_user'; did you mean 'sg_copy_from_buffer'? [-Werror=implicit-function-declaration] 113 | if (copy_from_user(bo_handles, user_bo_handles, | ^~~~~~~~~~~~~~ | sg_copy_from_buffer drivers/gpu/drm/virtio/virtgpu_ioctl.c: In function 'virtio_gpu_getparam...
2019 Aug 03
0
[PATCH V2 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...t > > > > The topic is whether we should revert > > commit 7f466032dc9 ("vhost: access vq metadata through kernel virtual address") > > > > or keep it in. The only reason to keep it is performance. > > Yikes, I'm not sure you can ever win against copy_from_user using > mmu_notifiers? Ever since copy_from_user started playing with flags (for SMAP) and added speculation barriers there's a chance we can win by accessing memory through the kernel address. Another reason would be to access it from e.g. softirq context. copy_from_user will only work i...
2020 Aug 24
0
[PATCH v6 01/76] KVM: SVM: nested: Don't allocate VMCB structures on stack
...VMCB_SIZE); + if (kvm_state->format != KVM_STATE_NESTED_FORMAT_SVM) return -EINVAL; @@ -1095,13 +1099,22 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu, return -EINVAL; if (kvm_state->size < sizeof(*kvm_state) + KVM_STATE_NESTED_SVM_VMCB_SIZE) return -EINVAL; - if (copy_from_user(&ctl, &user_vmcb->control, sizeof(ctl))) - return -EFAULT; - if (copy_from_user(&save, &user_vmcb->save, sizeof(save))) - return -EFAULT; - if (!nested_vmcb_check_controls(&ctl)) - return -EINVAL; + ret = -ENOMEM; + ctl = kzalloc(sizeof(*ctl), GFP_KERNEL); + save =...
2007 Apr 18
0
[Bridge] [PATCH] (4/11) bridge - ioctl cleanup and consolidation
...clude <asm/uaccess.h> #include "br_private.h" -static int br_dev_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) -{ - unsigned long args[4]; - unsigned long *data; - - if (cmd != SIOCDEVPRIVATE) - return -EOPNOTSUPP; - - data = (unsigned long *)rq->ifr_data; - if (copy_from_user(args, data, 4*sizeof(unsigned long))) - return -EFAULT; - - return br_ioctl_device(dev->priv, args[0], args[1], args[2], args[3]); -} - static struct net_device_stats *br_dev_get_stats(struct net_device *dev) { struct net_bridge *br; @@ -115,7 +100,7 @@ ether_setup(dev); - dev->do_...