linux-stable/arch/arc
Eugeniy Paltsev 2fc69e55f3 ARCv2: lib: memcpy: fix doing prefetchw outside of buffer
[ Upstream commit f8a15f9766 ]

ARCv2 optimized memcpy uses PREFETCHW instruction for prefetching the
next cache line but doesn't ensure that the line is not past the end of
the buffer. PRETECHW changes the line ownership and marks it dirty,
which can cause data corruption if this area is used for DMA IO.

Fix the issue by avoiding the PREFETCHW. This leads to performance
degradation but it is OK as we'll introduce new memcpy implementation
optimized for unaligned memory access using.

We also cut off all PREFETCH instructions at they are quite useless
here:
 * we call PREFETCH right before LOAD instruction call.
 * we copy 16 or 32 bytes of data (depending on CONFIG_ARC_HAS_LL64)
   in a main logical loop. so we call PREFETCH 4 times (or 2 times)
   for each L1 cache line (in case of 64B L1 cache Line which is
   default case). Obviously this is not optimal.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-03-23 20:09:51 +01:00
..
boot ARC: dma [IOC]: mark DMA devices connected as dma-coherent 2018-08-31 12:47:26 -07:00
configs arc: [devboards] Add support of NFSv3 ACL 2018-12-08 12:59:10 +01:00
include ARC: fix __ffs return value to avoid build warnings 2019-03-05 17:58:48 +01:00
kernel ARC: show_regs: lockdep: avoid page allocator... 2019-03-05 17:58:48 +01:00
lib ARCv2: lib: memcpy: fix doing prefetchw outside of buffer 2019-03-23 20:09:51 +01:00
mm ARC: adjust memblock_reserve of kernel memory 2019-01-31 08:14:35 +01:00
oprofile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
plat-axs10x ARC: [plat-axs103] refactor the quad core DT quirk code 2017-12-20 12:41:45 -08:00
plat-eznps arc: [plat-eznps] fix printk warning in arc/plat-eznps/mtm.c 2018-07-30 11:48:49 -07:00
plat-hsdk ARCv2: [plat-hsdk]: Save accl reg pair by default 2018-07-19 10:36:45 -07:00
plat-sim ARC: [plat-sim] Include this platform unconditionally 2017-08-04 13:49:47 +05:30
plat-tb10x arc: select GPIOLIB directly 2016-04-26 14:07:59 +02:00
Kbuild
Kconfig clocksource/drivers/arc_timer: Utilize generic sched_clock 2019-01-09 17:38:42 +01:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile ARC: change defconfig defaults to ARCv2 2018-12-08 12:59:10 +01:00