linux-brain/arch/powerpc
Chris Packham eeab3452c8 powerpc/setup_64: Set cache-line-size based on cache-block-size
commit 94c0b013c98583614e1ad911e8795ca36da34a85 upstream.

If {i,d}-cache-block-size is set and {i,d}-cache-line-size is not, use
the block-size value for both. Per the devicetree spec cache-line-size
is only needed if it differs from the block size.

Originally the code would fallback from block size to line size. An
error message was printed if both properties were missing.

Later the code was refactored to use clearer names and logic but it
inadvertently made line size a required property, meaning on systems
without a line size property we fall back to the default from the
cputable.

On powernv (OPAL) platforms, since the introduction of device tree CPU
features (5a61ef74f2 ("powerpc/64s: Support new device tree binding
for discovering CPU features")), that has led to the wrong value being
used, as the fallback value is incorrect for Power8/Power9 CPUs.

The incorrect values flow through to the VDSO and also to the sysconf
values, SC_LEVEL1_ICACHE_LINESIZE etc.

Fixes: bd067f83b0 ("powerpc/64: Fix naming of cache block vs. cache line")
Cc: stable@vger.kernel.org # v4.11+
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reported-by: Qian Cai <cai@lca.pw>
[mpe: Add even more detail to change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200416221908.7886-1-chris.packham@alliedtelesis.co.nz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-29 16:31:32 +02:00
..
boot powerpc/44x: Adjust indentation in ibm4xx_denali_fixup_memsize 2020-02-11 04:34:12 -08:00
configs powerpc/mm/radix: Make Radix require HUGETLB_PAGE 2019-05-02 09:58:55 +02:00
crypto powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
include powerpc: Make setjmp/longjmp signature standard 2020-04-17 10:48:54 +02:00
kernel powerpc/setup_64: Set cache-line-size based on cache-block-size 2020-04-29 16:31:32 +02:00
kvm KVM: PPC: Book3S PR: Free shared page if mmu initialization fails 2020-02-11 04:34:11 -08:00
lib powerpc/64: Fix memcmp reading past the end of src/dest 2019-04-03 06:26:29 +02:00
math-emu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm powerpc/fsl_booke: Avoid creating duplicate tlb1 entry 2020-04-17 10:48:55 +02:00
net powerpc/bpf: Fix tail call implementation 2019-12-05 09:19:39 +01:00
oprofile treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
perf powerpc/perf: Fix unit_sel/cache_sel checks 2019-12-05 09:20:41 +01:00
platforms powerpc/maple: Fix declaration made after definition 2020-04-23 10:30:18 +02:00
purgatory powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
sysdev powerpc/xive: Use XIVE_BAD_IRQ instead of zero to catch non configured IPIs 2020-04-17 10:48:53 +02:00
tools powerpc/tools: Don't quote $objdump in scripts 2020-01-04 19:12:42 +01:00
xmon powerpc: Make setjmp/longjmp signature standard 2020-04-17 10:48:54 +02:00
Kconfig of: Add OF_DMA_DEFAULT_COHERENT & select it on powerpc 2020-02-11 04:34:03 -08:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile powerpc: vdso: Make vdso32 installation conditional in vdso_install 2020-01-27 14:50:40 +01:00
Makefile.postlink License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00