direct access to kernel memory from user space - Linux

This is a discussion on direct access to kernel memory from user space - Linux ; Hello when one accesses "directly" to kernel memory with mmap from user space, do we really avoid memory copy from kernel space to user space ? Thank you...

+ Reply to Thread
Results 1 to 4 of 4

Thread: direct access to kernel memory from user space

  1. direct access to kernel memory from user space

    Hello

    when one accesses "directly" to kernel memory with mmap from user
    space, do we really avoid memory copy from kernel space to user space ?


    Thank you


  2. Re: direct access to kernel memory from user space


    yannouch wrote:

    > when one accesses "directly" to kernel memory with mmap from user
    > space, do we really avoid memory copy from kernel space to user space ?


    Yes, it's the same memory after all.

    DS


  3. Re: direct access to kernel memory from user space

    "yannouch" wrote:
    >
    >when one accesses "directly" to kernel memory with mmap from user
    >space, do we really avoid memory copy from kernel space to user space ?


    Yes, because of virtual memory page tables. It's possible (and quite
    common, in fact) for a single physical address to map to multiple virtual
    addresses. When you mmap from /dev/kmem, you are just requesting a
    user-mode virtual address that maps to the same physical memory as that
    kernel-mode virtual address.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.

  4. Re: direct access to kernel memory from user space

    On Sat, 13 Jan 2007 07:26:31 GMT Tim Roberts wrote:
    | "yannouch" wrote:
    |>
    |>when one accesses "directly" to kernel memory with mmap from user
    |>space, do we really avoid memory copy from kernel space to user space ?
    |
    | Yes, because of virtual memory page tables. It's possible (and quite
    | common, in fact) for a single physical address to map to multiple virtual
    | addresses. When you mmap from /dev/kmem, you are just requesting a
    | user-mode virtual address that maps to the same physical memory as that
    | kernel-mode virtual address.

    Even multiple virtual addresses within the same virtual address space.

    --
    |---------------------------------------/----------------------------------|
    | Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
    | first name lower case at ipal.net / spamtrap-2007-01-13-0949@ipal.net |
    |------------------------------------/-------------------------------------|

+ Reply to Thread