search for: __copy_from_user

Displaying 20 results from an estimated 63 matches for "__copy_from_user".

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 --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index ade0568..01701...
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 --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index ade0568..01701...
2016 Mar 18
0
[PATCH] gpu/drm: Use u64_to_user_pointer
...>> arch/m68k/include/asm/uaccess_mm.h:368:2: warning: passing argument 2 of '__constant_copy_from_user' makes pointer from integer without a cast __constant_copy_from_user(to, from, n) : \ ^ >> arch/m68k/include/asm/uaccess_mm.h:379:37: note: in expansion of macro '__copy_from_user' #define copy_from_user(to, from, n) __copy_from_user(to, from, n) ^ drivers/gpu/drm/vc4/vc4_bo.c:502:6: note: in expansion of macro 'copy_from_user' if (copy_from_user(bo->base.vaddr, ^ arch/m68k/include/asm/uaccess_mm....
2016 Mar 18
4
[PATCH] gpu/drm: Use u64_to_user_pointer
Use the newly added u64_to_user_pointer a bit more frequently. Signed-off-by: Joe Perches <joe at perches.com> --- drivers/gpu/drm/armada/armada_gem.c | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 7 ++++--- drivers/gpu/drm/tegra/drm.c | 15 ++++++++------- drivers/gpu/drm/vc4/vc4_bo.c | 4 ++-- drivers/gpu/drm/vc4/vc4_gem.c | 10 +++++-----
2016 Mar 18
4
[PATCH] gpu/drm: Use u64_to_user_pointer
Use the newly added u64_to_user_pointer a bit more frequently. Signed-off-by: Joe Perches <joe at perches.com> --- drivers/gpu/drm/armada/armada_gem.c | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 7 ++++--- drivers/gpu/drm/tegra/drm.c | 15 ++++++++------- drivers/gpu/drm/vc4/vc4_bo.c | 4 ++-- drivers/gpu/drm/vc4/vc4_gem.c | 10 +++++-----
2019 Dec 18
0
[PATCH 1/1] drivers/vhost : Removes unnecessary 'else' in vhost_copy_from_user
...rs/vhost/vhost.c b/drivers/vhost/vhost.c > index f44340b41494..b23d1b74c32f 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -824,34 +824,32 @@ static int vhost_copy_from_user(struct vhost_virtqueue *vq, void *to, > > if (!vq->iotlb) > return __copy_from_user(to, from, size); > - else { > - /* This function should be called after iotlb > - * prefetch, which means we're sure that vq > - * could be access through iotlb. So -EAGAIN should > - * not happen in this case. > - */ > - void __user *uaddr = vhost_vq_meta_fetch(v...
2011 Mar 17
1
[PULL net-2.6] vhost: cleanups and fixes
...: check the support of mergeable buffer outside the receive loop vhost-net: Unify the code of mergeable and big buffer handling vhost: lock receive queue, not the socket Krishna Kumar (1): vhost: Cleanup vhost.c and net.c Michael S. Tsirkin (2): vhost: copy_from_user -> __copy_from_user vhost-net: remove unlocked use of receive_queue drivers/vhost/net.c | 159 ++++++++----------------------------------------- drivers/vhost/vhost.c | 55 ++++++++++++----- 2 files changed, 64 insertions(+), 150 deletions(-)
2011 Mar 17
1
[PULL net-2.6] vhost: cleanups and fixes
...: check the support of mergeable buffer outside the receive loop vhost-net: Unify the code of mergeable and big buffer handling vhost: lock receive queue, not the socket Krishna Kumar (1): vhost: Cleanup vhost.c and net.c Michael S. Tsirkin (2): vhost: copy_from_user -> __copy_from_user vhost-net: remove unlocked use of receive_queue drivers/vhost/net.c | 159 ++++++++----------------------------------------- drivers/vhost/vhost.c | 55 ++++++++++++----- 2 files changed, 64 insertions(+), 150 deletions(-)
2013 Oct 10
10
[PATCH 0/4] x86: XSA-67 follow-up
1: correct LDT checks 2: add address validity check to guest_map_l1e() 3: use {rd,wr}{fs,gs}base when available 4: check for canonical address before doing page walks Signed-off-by: Jan Beulich <jbeulich@suse.com>
2016 Jun 17
2
[RFC PATCH] vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost
...;vq->avail->ring[last_avail_idx & (vq->num - 1)]))) { vq_err(vq, "Failed to read head: idx %d address %p\n", last_avail_idx, @@ -1450,7 +1450,7 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, i, vq->num, head); return -EINVAL; } - ret = __copy_from_user(&desc, vq->desc + i, sizeof desc); + ret = __copy_from_user_mm(vq->dev->mm, &desc, vq->desc + i, sizeof desc); if (unlikely(ret)) { vq_err(vq, "Failed to get descriptor: idx %d addr %p\n", i, vq->desc + i); @@ -1622,7 +1622,7 @@ static bool vhost_...
2016 Jun 17
2
[RFC PATCH] vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost
...;vq->avail->ring[last_avail_idx & (vq->num - 1)]))) { vq_err(vq, "Failed to read head: idx %d address %p\n", last_avail_idx, @@ -1450,7 +1450,7 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, i, vq->num, head); return -EINVAL; } - ret = __copy_from_user(&desc, vq->desc + i, sizeof desc); + ret = __copy_from_user_mm(vq->dev->mm, &desc, vq->desc + i, sizeof desc); if (unlikely(ret)) { vq_err(vq, "Failed to get descriptor: idx %d addr %p\n", i, vq->desc + i); @@ -1622,7 +1622,7 @@ static bool vhost_...
2008 Jan 05
11
[PATCH] Fix performance problems with mprotect()
While working on a database scaling problem using a SAP database test suite we discovered that these enterprise level large shared memory databases are very heavy users of mprotect(), to the extent that the performance overhead in current Xenolinux impacts scaling beyond a few cpus quite badly. A single cpu run under Xen has a nominal impact, but scaling out to 8 cpus results in a performance of
2005 Mar 14
4
[patch/unstable] page table cleanups
...copy_to_user(&shadow_linear_pg_table[va >> PAGE_SHIFT], + &zero, sizeof(zero))) { vmx_shadow_clear_state(ed->domain); return; } - if (__get_user(gpte, (unsigned long *) - &linear_pg_table[va >> PAGE_SHIFT])) { + if (__copy_from_user(&gpte, + &linear_pg_table[va >> PAGE_SHIFT], + sizeof(gpte))) { return; } l1pte_propagate_from_guest(ed->domain, &gpte, &spte); - if (__put_user(spte, (unsigned long *) - &shadow_linear_pg_table[va >> PAGE_SHIFT]))...
2013 Jun 27
2
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...) > + return NULL; > + > + len = sizeof(pkt->hdr); > + if (unlikely(vq->iov[0].iov_len != len)) { > + vq_err(vq, "Expecting pkt->hdr = %d, got %zu bytes\n", > + len, vq->iov[0].iov_len); > + kfree(pkt); > + return NULL; > + } > + ret = __copy_from_user(&pkt->hdr, vq->iov[0].iov_base, len); > + if (ret) { > + vq_err(vq, "Faulted on virtio_vsock_hdr\n"); > + kfree(pkt); > + return NULL; > + } > + > + pkt->len = pkt->hdr.len; > + pkt->off = 0; > + > + /* No payload */ > + if (!pkt->...
2013 Jun 27
2
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...) > + return NULL; > + > + len = sizeof(pkt->hdr); > + if (unlikely(vq->iov[0].iov_len != len)) { > + vq_err(vq, "Expecting pkt->hdr = %d, got %zu bytes\n", > + len, vq->iov[0].iov_len); > + kfree(pkt); > + return NULL; > + } > + ret = __copy_from_user(&pkt->hdr, vq->iov[0].iov_base, len); > + if (ret) { > + vq_err(vq, "Faulted on virtio_vsock_hdr\n"); > + kfree(pkt); > + return NULL; > + } > + > + pkt->len = pkt->hdr.len; > + pkt->off = 0; > + > + /* No payload */ > + if (!pkt->...
2016 Jun 18
0
[RFC PATCH] vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost
...dx & (vq->num - 1)]))) { > vq_err(vq, "Failed to read head: idx %d address %p\n", > last_avail_idx, > @@ -1450,7 +1450,7 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, > i, vq->num, head); > return -EINVAL; > } > - ret = __copy_from_user(&desc, vq->desc + i, sizeof desc); > + ret = __copy_from_user_mm(vq->dev->mm, &desc, vq->desc + i, sizeof desc); > if (unlikely(ret)) { > vq_err(vq, "Failed to get descriptor: idx %d addr %p\n", > i, vq->desc + i); > @@ -1622,7 +162...
2013 Jun 27
0
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...kt = kzalloc(sizeof(*pkt), GFP_KERNEL); + if (!pkt) + return NULL; + + len = sizeof(pkt->hdr); + if (unlikely(vq->iov[0].iov_len != len)) { + vq_err(vq, "Expecting pkt->hdr = %d, got %zu bytes\n", + len, vq->iov[0].iov_len); + kfree(pkt); + return NULL; + } + ret = __copy_from_user(&pkt->hdr, vq->iov[0].iov_base, len); + if (ret) { + vq_err(vq, "Faulted on virtio_vsock_hdr\n"); + kfree(pkt); + return NULL; + } + + pkt->len = pkt->hdr.len; + pkt->off = 0; + + /* No payload */ + if (!pkt->len) + return pkt; + + /* The pkt is too big */ + if (...
2005 Jun 30
0
[PATCH][10/10] Use copy_from_user when accessing guest_pt
...s(d, gpfn, PGT_snapshot); - l1_pgentry_t *snapshot; // could be L1s or L2s or ... + l1_pgentry_t *snapshot, gpte; // could be L1s or L2s or ... int entries_match; perfc_incrc(snapshot_entry_matches_calls); @@ -1916,10 +1916,14 @@ snapshot = map_domain_page(smfn); + if (__copy_from_user(&gpte, &guest_pt[index], + sizeof(gpte))) + return 0; + // This could probably be smarter, but this is sufficent for // our current needs. // - entries_match = !l1e_has_changed(guest_pt[index], snapshot[index], + entries_match = !l1e_has_c...
2018 Dec 10
1
[PATCH net 4/4] vhost: log dirty page correctly
...6/include/asm/smap.h:stac Cyclomatic Complexity 1 arch/x86/include/asm/uaccess.h:set_fs Cyclomatic Complexity 1 arch/x86/include/asm/uaccess_32.h:raw_copy_to_user Cyclomatic Complexity 5 arch/x86/include/asm/uaccess_32.h:raw_copy_from_user Cyclomatic Complexity 1 include/linux/uaccess.h:__copy_from_user Cyclomatic Complexity 1 include/linux/uaccess.h:__copy_to_user Cyclomatic Complexity 2 include/linux/uaccess.h:copy_from_user Cyclomatic Complexity 2 include/linux/uaccess.h:copy_to_user Cyclomatic Complexity 4 include/linux/poll.h:poll_wait Cyclomatic Complexity 1 include/linux/poll...
2010 Feb 24
4
Re: [Xen-changelog] [xen-3.4-testing] x86: Generalise BUGFRAME_dump mechanism to allow polled UART irq to
...     show_execution_state(regs); > -        regs->eip = (unsigned long)eip; > -        return; > -    } > - > -    /* WARN, BUG or ASSERT: decode the filename pointer and line number. */ > +    /* Decode first pointer argument. */ >     if ( !is_kernel(eip) || >          __copy_from_user(&bug_str, eip, sizeof(bug_str)) || >          (bug_str.mov != 0xbc) ) >         goto die; > -    filename = bug_str(bug_str, eip); > +    p = bug_str(bug_str, eip); > +    if ( !is_kernel(p) ) > +        goto die; >     eip += sizeof(bug_str); > > -    if ( !is_kernel...