WSL2-Linux-Kernel/arch/arc
Eugeniy Paltsev e6a72b7dae ARCv2: lib: memeset: fix doing prefetchw outside of buffer
ARCv2 optimized memset 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 issues in SMP config when next line was already owned by
other core. Fix the issue by avoiding the PREFETCHW

Some more details:

The current code has 3 logical loops (ignroing the unaligned part)
  (a) Big loop for doing aligned 64 bytes per iteration with PREALLOC
  (b) Loop for 32 x 2 bytes with PREFETCHW
  (c) any left over bytes

loop (a) was already eliding the last 64 bytes, so PREALLOC was
safe. The fix was removing PREFETCW from (b).

Another potential issue (applicable to configs with 32 or 128 byte L1
cache line) is that PREALLOC assumes 64 byte cache line and may not do
the right thing specially for 32b. While it would be easy to adapt,
there are no known configs with those lie sizes, so for now, just
compile out PREALLOC in such cases.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Cc: stable@vger.kernel.org #4.4+
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
[vgupta: rewrote changelog, used asm .macro vs. "C" macro]
2019-01-17 16:24:39 -08:00
..
boot ARC: [plat-hsdk] Enable DW APB GPIO support 2018-11-12 10:38:27 -08:00
configs ARC: change defconfig defaults to ARCv2 2018-11-30 10:54:01 -08:00
include ARC: perf: map generic branches to correct hardware condition 2019-01-17 14:38:00 -08:00
kernel ARC: show_regs: lockdep: re-enable preemption 2019-01-17 14:38:00 -08:00
lib ARCv2: lib: memeset: fix doing prefetchw outside of buffer 2019-01-17 16:24:39 -08:00
mm ARC: mm: do_page_fault fixes #1: relinquish mmap_sem if signal arrives while handle_mm_fault 2019-01-17 16:24:39 -08:00
oprofile
plat-axs10x PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
plat-eznps
plat-hsdk PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
plat-sim
plat-tb10x
Kbuild
Kconfig Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
Kconfig.debug
Makefile ARC: change defconfig defaults to ARCv2 2018-11-30 10:54:01 -08:00