search for: copy_to

Displaying 20 results from an estimated 27 matches for "copy_to".

2018 Aug 14
1
R CMD check warnings on Windows
...#39;, 'auto_copy.tbl_cube', 'auto_copy.tbl_df', 'cbind.grouped_df', 'collapse.data.frame', 'collect.data.frame', 'common_by.NULL', 'common_by.character', 'common_by.default', 'common_by.list', 'compute.data.frame', 'copy_to.DBIConnection', 'copy_to.src_local', 'default_missing.data.frame', 'default_missing.default', 'dim.tbl_cube', 'distinct.data.frame', 'distinct.default', 'distinct.grouped_df', 'distinct.tbl_df', 'distinct_.data.frame', '...
2018 Nov 02
3
[PULL] vhost: cleanups and fixes
On Fri, Nov 02, 2018 at 09:14:51AM -0700, Linus Torvalds wrote: > On Fri, Nov 2, 2018 at 6:04 AM Michael S. Tsirkin <mst at redhat.com> wrote: > > > > I've tried making access_ok mask the parameter it gets. > > PLEASE don't do this. Okay. > Just use "copy_to/from_user()". Just for completeness I'd like to point out for vhost the copies are done from the kernel thread. So yes we can switch to copy_to/from_user but for e.g. 32-bit userspace running on top of a 64 bit kernel it is IIUC not sufficient - we must *also* do access_ok checks on cont...
2018 Nov 02
3
[PULL] vhost: cleanups and fixes
On Fri, Nov 02, 2018 at 09:14:51AM -0700, Linus Torvalds wrote: > On Fri, Nov 2, 2018 at 6:04 AM Michael S. Tsirkin <mst at redhat.com> wrote: > > > > I've tried making access_ok mask the parameter it gets. > > PLEASE don't do this. Okay. > Just use "copy_to/from_user()". Just for completeness I'd like to point out for vhost the copies are done from the kernel thread. So yes we can switch to copy_to/from_user but for e.g. 32-bit userspace running on top of a 64 bit kernel it is IIUC not sufficient - we must *also* do access_ok checks on cont...
2018 Nov 02
2
[PULL] vhost: cleanups and fixes
...1, 2018 at 4:00 PM Kees Cook <keescook at chromium.org> wrote: > > > > > > + memset(&rsp, 0, sizeof(rsp)); > > > + rsp.response = VIRTIO_SCSI_S_FUNCTION_REJECTED; > > > + resp = vq->iov[out].iov_base; > > > + ret = __copy_to_user(resp, &rsp, sizeof(rsp)); > > > > > > Is it actually safe to trust that iov_base has passed an earlier > > > access_ok() check here? Why not just use copy_to_user() instead? > > > > Good point. > > > > We really should have removed those...
2018 Nov 02
2
[PULL] vhost: cleanups and fixes
...1, 2018 at 4:00 PM Kees Cook <keescook at chromium.org> wrote: > > > > > > + memset(&rsp, 0, sizeof(rsp)); > > > + rsp.response = VIRTIO_SCSI_S_FUNCTION_REJECTED; > > > + resp = vq->iov[out].iov_base; > > > + ret = __copy_to_user(resp, &rsp, sizeof(rsp)); > > > > > > Is it actually safe to trust that iov_base has passed an earlier > > > access_ok() check here? Why not just use copy_to_user() instead? > > > > Good point. > > > > We really should have removed those...
2019 Sep 08
3
[PATCH 2/2] vhost: re-introducing metadata acceleration through kernel virtual address
On Thu, Sep 05, 2019 at 08:27:36PM +0800, Jason Wang wrote: > This is a rework on the commit 7f466032dc9e ("vhost: access vq > metadata through kernel virtual address"). > > It was noticed that the copy_to/from_user() friends that was used to > access virtqueue metdata tends to be very expensive for dataplane > implementation like vhost since it involves lots of software checks, > speculation barriers, So if we drop speculation barrier, there's a problem here in access will now be specu...
2019 Sep 08
3
[PATCH 2/2] vhost: re-introducing metadata acceleration through kernel virtual address
On Thu, Sep 05, 2019 at 08:27:36PM +0800, Jason Wang wrote: > This is a rework on the commit 7f466032dc9e ("vhost: access vq > metadata through kernel virtual address"). > > It was noticed that the copy_to/from_user() friends that was used to > access virtqueue metdata tends to be very expensive for dataplane > implementation like vhost since it involves lots of software checks, > speculation barriers, So if we drop speculation barrier, there's a problem here in access will now be specu...
2013 Jun 01
2
[LLVMdev] Compile Linux Kernel module into LLVM bitcode
Greetings, I am trying to compile a linux kernel module (currently a small part of the gpu driver) into the bitcode ".bc" format so that I can run a pass on it using the "opt" command. This pass will count the number of times copy_to/from_user() is invoked. Compiling the gnu driver kernel modules works with clang as a front end. However, I am unable to get the "-emit-llvm" flag to work. I am using the typical Makefile system (kbuild) included with the kernel, as such: $ make V=1 CC=clang CFLAGS="-emit-llvm -c...
2019 Sep 09
0
[PATCH 2/2] vhost: re-introducing metadata acceleration through kernel virtual address
On 2019/9/8 ??7:05, Michael S. Tsirkin wrote: > On Thu, Sep 05, 2019 at 08:27:36PM +0800, Jason Wang wrote: >> This is a rework on the commit 7f466032dc9e ("vhost: access vq >> metadata through kernel virtual address"). >> >> It was noticed that the copy_to/from_user() friends that was used to >> access virtqueue metdata tends to be very expensive for dataplane >> implementation like vhost since it involves lots of software checks, >> speculation barriers, > So if we drop speculation barrier, > there's a problem here in acc...
2019 Sep 09
1
[PATCH 2/2] vhost: re-introducing metadata acceleration through kernel virtual address
...5, Michael S. Tsirkin wrote: > > On Thu, Sep 05, 2019 at 08:27:36PM +0800, Jason Wang wrote: > > > This is a rework on the commit 7f466032dc9e ("vhost: access vq > > > metadata through kernel virtual address"). > > > > > > It was noticed that the copy_to/from_user() friends that was used to > > > access virtqueue metdata tends to be very expensive for dataplane > > > implementation like vhost since it involves lots of software checks, > > > speculation barriers, > > So if we drop speculation barrier, > > there...
2019 Sep 05
0
[PATCH 2/2] vhost: re-introducing metadata acceleration through kernel virtual address
This is a rework on the commit 7f466032dc9e ("vhost: access vq metadata through kernel virtual address"). It was noticed that the copy_to/from_user() friends that was used to access virtqueue metdata tends to be very expensive for dataplane implementation like vhost since it involves lots of software checks, speculation barriers, hardware feature toggling (e.g SMAP). The extra cost will be more obvious when transferring small packets...
2013 Jun 01
0
[LLVMdev] Compile Linux Kernel module into LLVM bitcode
...On 01/06/13 09:59, Kevin Boos wrote: > Greetings, > > I am trying to compile a linux kernel module (currently a small part of the gpu driver) into the bitcode ".bc" format so that I can run a pass on it using the "opt" command. This pass will count the number of times copy_to/from_user() is invoked. > > Compiling the gnu driver kernel modules works with clang as a front end. However, I am unable to get the "-emit-llvm" flag to work. > > I am using the typical Makefile system (kbuild) included with the kernel, as such: > $ make V=1 CC=clang CFLAG...
2019 May 24
10
[PATCH net-next 0/6] vhost: accelerate metadata access
...ent. Thanks Changes from RFC V3: - rebase to net-next - Tweak on the comments Changes from RFC V2: - switch to use direct mapping instead of vmap() - switch to use spinlock + RCU to synchronize MMU notifier and vhost data/control path - set dirty pages in the invalidation callbacks - always use copy_to/from_users() friends for the archs that may need flush_dcache_pages() - various minor fixes Changes from V4: - use invalidate_range() instead of invalidate_range_start() - track dirty pages Changes from V3: - don't try to use vmap for file backed pages - rebase to master Changes from V2: - fi...
2019 May 24
10
[PATCH net-next 0/6] vhost: accelerate metadata access
...ent. Thanks Changes from RFC V3: - rebase to net-next - Tweak on the comments Changes from RFC V2: - switch to use direct mapping instead of vmap() - switch to use spinlock + RCU to synchronize MMU notifier and vhost data/control path - set dirty pages in the invalidation callbacks - always use copy_to/from_users() friends for the archs that may need flush_dcache_pages() - various minor fixes Changes from V4: - use invalidate_range() instead of invalidate_range_start() - track dirty pages Changes from V3: - don't try to use vmap for file backed pages - rebase to master Changes from V2: - fi...
2013 Jun 08
1
[LLVMdev] Compile Linux Kernel module into LLVM bitcode
...9:59, Kevin Boos wrote: > > Greetings, > > > > I am trying to compile a linux kernel module (currently a small part of the gpu driver) into the bitcode ".bc" format so that I can run a pass on it using the "opt" command. This pass will count the number of times copy_to/from_user() is invoked. > > > > Compiling the gnu driver kernel modules works with clang as a front end. However, I am unable to get the "-emit-llvm" flag to work. > > > > I am using the typical Makefile system (kbuild) included with the kernel, as such: > >...
2019 Apr 23
7
[RFC PATCH V3 0/6] vhost: accelerate metadata access
...improvement on TX PPS. TCP_STREAM doesn't see obvious improvement. Thanks Changes from RFC V2: - switch to use direct mapping instead of vmap() - switch to use spinlock + RCU to synchronize MMU notifier and vhost data/control path - set dirty pages in the invalidation callbacks - always use copy_to/from_users() friends for the archs that may need flush_dcache_pages() - various minor fixes Changes from V4: - use invalidate_range() instead of invalidate_range_start() - track dirty pages Changes from V3: - don't try to use vmap for file backed pages - rebase to master Changes from V2: - fi...
2018 Nov 02
0
[PULL] vhost: cleanups and fixes
On Fri, Nov 2, 2018 at 6:04 AM Michael S. Tsirkin <mst at redhat.com> wrote: > > I've tried making access_ok mask the parameter it gets. PLEASE don't do this. Just use "copy_to/from_user()". We have had lots of bugs because code bitrots. And no, the access_ok() checks aren't expensive, not even in a loop. They *used* to be somewhat expensive compared to the access, but that simply isn't true any more. The real expense in copy_to_user and friends are in the...
2018 Nov 02
0
[PULL] vhost: cleanups and fixes
On Fri, Nov 2, 2018 at 9:59 AM Michael S. Tsirkin <mst at redhat.com> wrote: > > Just for completeness I'd like to point out for vhost the copies are > done from the kernel thread. So yes we can switch to copy_to/from_user > but for e.g. 32-bit userspace running on top of a 64 bit kernel it is > IIUC not sufficient - we must *also* do access_ok checks on control path > when addresses are passed to the kernel and when current points to the > correct task struct. Don't you take over the VM wi...
2018 Nov 02
2
[PULL] vhost: cleanups and fixes
...ov 02, 2018 at 10:10:45AM -0700, Linus Torvalds wrote: > On Fri, Nov 2, 2018 at 9:59 AM Michael S. Tsirkin <mst at redhat.com> wrote: > > > > Just for completeness I'd like to point out for vhost the copies are > > done from the kernel thread. So yes we can switch to copy_to/from_user > > but for e.g. 32-bit userspace running on top of a 64 bit kernel it is > > IIUC not sufficient - we must *also* do access_ok checks on control path > > when addresses are passed to the kernel and when current points to the > > correct task struct. > > Don...
2019 Jun 05
0
[PATCH net-next 0/6] vhost: accelerate metadata access
...- rebase to net-next > - Tweak on the comments > Changes from RFC V2: > - switch to use direct mapping instead of vmap() > - switch to use spinlock + RCU to synchronize MMU notifier and vhost > data/control path > - set dirty pages in the invalidation callbacks > - always use copy_to/from_users() friends for the archs that may need > flush_dcache_pages() > - various minor fixes > Changes from V4: > - use invalidate_range() instead of invalidate_range_start() > - track dirty pages > Changes from V3: > - don't try to use vmap for file backed pages >...