lkml.org 
[lkml]   [2015]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] x86: Enable fast 32-bit put_user_64 for copy_to_user
    Date
    For fixed sized copies, copy_to_user() will utilize __put_user_size
    fastpaths. However, it is missing the translation for 64bit copies on
    x86/32. Testing on a Pinetrail Atom, the 64 bit put_user fastpath is
    substantially faster than the generic copy_to_user() fallback.

    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: x86@kernel.org
    CC: linux-kernel@vger.kernel.org
    ---
    arch/x86/include/asm/uaccess_32.h | 4 ++++
    1 file changed, 4 insertions(+)

    diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h
    index 3c03a5de64d3..0ed5504c6060 100644
    --- a/arch/x86/include/asm/uaccess_32.h
    +++ b/arch/x86/include/asm/uaccess_32.h
    @@ -59,6 +59,10 @@ __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)
    __put_user_size(*(u32 *)from, (u32 __user *)to,
    4, ret, 4);
    return ret;
    + case 8:
    + __put_user_size(*(u64 *)from, (u64 __user *)to,
    + 8, ret, 8);
    + return ret;
    }
    }
    return __copy_to_user_ll(to, from, n);
    --
    2.1.4


    \
     
     \ /
      Last update: 2015-04-15 12:21    [W:2.502 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site