• P
    Improve __copy_to_user and __copy_from_user performance · d5c13edb
    popcornmix 提交于
    raspberrypi inclusion
    category: feature
    bugzilla: 50432
    
    --------------------------------
    
    Provide a __copy_from_user that uses memcpy. On BCM2708, use
    optimised memcpy/memmove/memcmp/memset implementations.
    
    arch/arm: Add mmiocpy/set aliases for memcpy/set
    
    See: https://github.com/raspberrypi/linux/issues/1082
    
    copy_from_user: CPU_SW_DOMAIN_PAN compatibility
    
    The downstream copy_from_user acceleration must also play nice with
    CONFIG_CPU_SW_DOMAIN_PAN.
    
    See: https://github.com/raspberrypi/linux/issues/1381Signed-off-by: NPhil Elwell <phil@raspberrypi.org>
    
    Fix copy_from_user if BCM2835_FAST_MEMCPY=n
    
    The change which introduced CONFIG_BCM2835_FAST_MEMCPY unconditionally
    changed the behaviour of arm_copy_from_user. The page pinning code
    is not safe on ARMv7 if LPAE & high memory is enabled and causes
    crashes which look like PTE corruption.
    
    Make __copy_from_user_memcpy conditional on CONFIG_2835_FAST_MEMCPY=y
    which is really an ARMv6 / Pi1 optimization and not necessary on newer
    ARM processors.
    
    arm: fix mmap unlocks in uaccess_with_memcpy.c
    
    This is a regression that was added with the commit 192a4e923ef092924dd013e7326f2ec520ee4783 as of rpi-5.8.y, since that is when the move to the mmap locking API was introduced - d8ed45c5
    
    The issue is that when the patch to improve performance for the __copy_to_user and __copy_from_user functions were added for the Raspberry Pi, some of the mmaps were incorrectly mapped to write instead of read. This would cause a verity of issues, and in my case, prevent the booting of a squashfs filesystem on rpi-5.8-y and above. An example of the panic you would see from this can be seen at https://pastebin.com/raw/jBz5xCzLSigned-off-by: NChristian Lamparter <chunkeey@gmail.com>
    Signed-off-by: NChristopher Blake <chrisrblake93@gmail.com>
    Signed-off-by: NFang Yafen <yafen@iscas.ac.cn>
    Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
    d5c13edb
memmove_rpi.S 2.2 KB