Skip to content

Commit 6112bd0

Browse files
committed
Merge tag 'powerpc-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc updates from Michael Ellerman: - Convert to the generic mmap support (ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT) - Add support for outline-only KASAN with 64-bit Radix MMU (P9 or later) - Increase SIGSTKSZ and MINSIGSTKSZ and add support for AT_MINSIGSTKSZ - Enable the DAWR (Data Address Watchpoint) on POWER9 DD2.3 or later - Drop support for system call instruction emulation - Many other small features and fixes Thanks to Alexey Kardashevskiy, Alistair Popple, Andy Shevchenko, Bagas Sanjaya, Bjorn Helgaas, Bo Liu, Chen Huang, Christophe Leroy, Colin Ian King, Daniel Axtens, Dwaipayan Ray, Fabiano Rosas, Finn Thain, Frank Rowand, Fuqian Huang, Guilherme G. Piccoli, Hangyu Hua, Haowen Bai, Haren Myneni, Hari Bathini, He Ying, Jason Wang, Jiapeng Chong, Jing Yangyang, Joel Stanley, Julia Lawall, Kajol Jain, Kevin Hao, Krzysztof Kozlowski, Laurent Dufour, Lv Ruyi, Madhavan Srinivasan, Magali Lemes, Miaoqian Lin, Minghao Chi, Nathan Chancellor, Naveen N. Rao, Nicholas Piggin, Oliver O'Halloran, Oscar Salvador, Pali Rohár, Paul Mackerras, Peng Wu, Qing Wang, Randy Dunlap, Reza Arbab, Russell Currey, Sohaib Mohamed, Vaibhav Jain, Vasant Hegde, Wang Qing, Wang Wensheng, Xiang wangx, Xiaomeng Tong, Xu Wang, Yang Guang, Yang Li, Ye Bin, YueHaibing, Yu Kuai, Zheng Bin, Zou Wei, and Zucheng Zheng. * tag 'powerpc-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (200 commits) powerpc/64: Include cache.h directly in paca.h powerpc/64s: Only set HAVE_ARCH_UNMAPPED_AREA when CONFIG_PPC_64S_HASH_MMU is set powerpc/xics: Include missing header powerpc/powernv/pci: Drop VF MPS fixup powerpc/fsl_book3e: Don't set rodata RO too early powerpc/microwatt: Add mmu bits to device tree powerpc/powernv/flash: Check OPAL flash calls exist before using powerpc/powermac: constify device_node in of_irq_parse_oldworld() powerpc/powermac: add missing g5_phy_disable_cpu1() declaration selftests/powerpc/pmu: fix spelling mistake "mis-match" -> "mismatch" powerpc: Enable the DAWR on POWER9 DD2.3 and above powerpc/64s: Add CPU_FTRS_POWER10 to ALWAYS mask powerpc/64s: Add CPU_FTRS_POWER9_DD2_2 to CPU_FTRS_ALWAYS mask powerpc: Fix all occurences of "the the" selftests/powerpc/pmu/ebb: remove fixed_instruction.S powerpc/platforms/83xx: Use of_device_get_match_data() powerpc/eeh: Drop redundant spinlock initialization powerpc/iommu: Add missing of_node_put in iommu_init_early_dart powerpc/pseries/vas: Call misc_deregister if sysfs init fails powerpc/papr_scm: Fix leaking nvdimm_events_map elements ...
2 parents 907bb57 + dcf280e commit 6112bd0

504 files changed

Lines changed: 3409 additions & 4602 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/ABI/testing/sysfs-class-cxl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ What: /sys/class/cxl/<afu>/api_version_compatible
103103
Date: September 2014
104104
Contact: linuxppc-dev@lists.ozlabs.org
105105
Description: read only
106-
Decimal value of the the lowest version of the userspace API
107-
this this kernel supports.
106+
Decimal value of the lowest version of the userspace API
107+
this kernel supports.
108108
Users: https://github.com/ibm-capi/libcxl
109109

110110

Documentation/devicetree/bindings/powerpc/fsl/cache_sram.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

Documentation/powerpc/dawr-power9.rst

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,23 @@
22
DAWR issues on POWER9
33
=====================
44

5-
On POWER9 the Data Address Watchpoint Register (DAWR) can cause a checkstop
6-
if it points to cache inhibited (CI) memory. Currently Linux has no way to
7-
distinguish CI memory when configuring the DAWR, so (for now) the DAWR is
8-
disabled by this commit::
9-
10-
commit 9654153158d3e0684a1bdb76dbababdb7111d5a0
11-
Author: Michael Neuling <mikey@neuling.org>
12-
Date: Tue Mar 27 15:37:24 2018 +1100
13-
powerpc: Disable DAWR in the base POWER9 CPU features
5+
On older POWER9 processors, the Data Address Watchpoint Register (DAWR) can
6+
cause a checkstop if it points to cache inhibited (CI) memory. Currently Linux
7+
has no way to distinguish CI memory when configuring the DAWR, so on affected
8+
systems, the DAWR is disabled.
9+
10+
Affected processor revisions
11+
============================
12+
13+
This issue is only present on processors prior to v2.3. The revision can be
14+
found in /proc/cpuinfo::
15+
16+
processor : 0
17+
cpu : POWER9, altivec supported
18+
clock : 3800.000000MHz
19+
revision : 2.3 (pvr 004e 1203)
20+
21+
On a system with the issue, the DAWR is disabled as detailed below.
1422

1523
Technical Details:
1624
==================

Documentation/powerpc/kasan.txt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
KASAN is supported on powerpc on 32-bit and Radix 64-bit only.
2+
3+
32 bit support
4+
==============
5+
6+
KASAN is supported on both hash and nohash MMUs on 32-bit.
7+
8+
The shadow area sits at the top of the kernel virtual memory space above the
9+
fixmap area and occupies one eighth of the total kernel virtual memory space.
10+
11+
Instrumentation of the vmalloc area is optional, unless built with modules,
12+
in which case it is required.
13+
14+
64 bit support
15+
==============
16+
17+
Currently, only the radix MMU is supported. There have been versions for hash
18+
and Book3E processors floating around on the mailing list, but nothing has been
19+
merged.
20+
21+
KASAN support on Book3S is a bit tricky to get right:
22+
23+
- It would be good to support inline instrumentation so as to be able to catch
24+
stack issues that cannot be caught with outline mode.
25+
26+
- Inline instrumentation requires a fixed offset.
27+
28+
- Book3S runs code with translations off ("real mode") during boot, including a
29+
lot of generic device-tree parsing code which is used to determine MMU
30+
features.
31+
32+
- Some code - most notably a lot of KVM code - also runs with translations off
33+
after boot.
34+
35+
- Therefore any offset has to point to memory that is valid with
36+
translations on or off.
37+
38+
One approach is just to give up on inline instrumentation. This way boot-time
39+
checks can be delayed until after the MMU is set is up, and we can just not
40+
instrument any code that runs with translations off after booting. This is the
41+
current approach.
42+
43+
To avoid this limitiation, the KASAN shadow would have to be placed inside the
44+
linear mapping, using the same high-bits trick we use for the rest of the linear
45+
mapping. This is tricky:
46+
47+
- We'd like to place it near the start of physical memory. In theory we can do
48+
this at run-time based on how much physical memory we have, but this requires
49+
being able to arbitrarily relocate the kernel, which is basically the tricky
50+
part of KASLR. Not being game to implement both tricky things at once, this
51+
is hopefully something we can revisit once we get KASLR for Book3S.
52+
53+
- Alternatively, we can place the shadow at the _end_ of memory, but this
54+
requires knowing how much contiguous physical memory a system has _at compile
55+
time_. This is a big hammer, and has some unfortunate consequences: inablity
56+
to handle discontiguous physical memory, total failure to boot on machines
57+
with less memory than specified, and that machines with more memory than
58+
specified can't use it. This was deemed unacceptable.

arch/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,12 +1019,10 @@ config PAGE_SIZE_LESS_THAN_64KB
10191019
depends on !IA64_PAGE_SIZE_64KB
10201020
depends on !PAGE_SIZE_64KB
10211021
depends on !PARISC_PAGE_SIZE_64KB
1022-
depends on !PPC_64K_PAGES
10231022
depends on PAGE_SIZE_LESS_THAN_256KB
10241023

10251024
config PAGE_SIZE_LESS_THAN_256KB
10261025
def_bool y
1027-
depends on !PPC_256K_PAGES
10281026
depends on !PAGE_SIZE_256KB
10291027

10301028
# This allows to use a set of generic functions to determine mmap base

arch/arm64/include/asm/processor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@
9292
#endif /* CONFIG_COMPAT */
9393

9494
#ifndef CONFIG_ARM64_FORCE_52BIT
95-
#define arch_get_mmap_end(addr) ((addr > DEFAULT_MAP_WINDOW) ? TASK_SIZE :\
96-
DEFAULT_MAP_WINDOW)
95+
#define arch_get_mmap_end(addr, len, flags) \
96+
(((addr) > DEFAULT_MAP_WINDOW) ? TASK_SIZE : DEFAULT_MAP_WINDOW)
9797

9898
#define arch_get_mmap_base(addr, base) ((addr > DEFAULT_MAP_WINDOW) ? \
9999
base + TASK_SIZE - DEFAULT_MAP_WINDOW :\

arch/powerpc/Kconfig

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ config PPC
109109
# Please keep this list sorted alphabetically.
110110
#
111111
select ARCH_32BIT_OFF_T if PPC32
112+
select ARCH_DISABLE_KASAN_INLINE if PPC_RADIX_MMU
112113
select ARCH_ENABLE_MEMORY_HOTPLUG
113114
select ARCH_ENABLE_MEMORY_HOTREMOVE
114115
select ARCH_HAS_COPY_MC if PPC64
@@ -118,7 +119,6 @@ config PPC
118119
select ARCH_HAS_DEBUG_WX if STRICT_KERNEL_RWX
119120
select ARCH_HAS_DEVMEM_IS_ALLOWED
120121
select ARCH_HAS_DMA_MAP_DIRECT if PPC_PSERIES
121-
select ARCH_HAS_ELF_RANDOMIZE
122122
select ARCH_HAS_FORTIFY_SOURCE
123123
select ARCH_HAS_GCOV_PROFILE_ALL
124124
select ARCH_HAS_HUGEPD if HUGETLB_PAGE
@@ -155,10 +155,12 @@ config PPC
155155
select ARCH_USE_MEMTEST
156156
select ARCH_USE_QUEUED_RWLOCKS if PPC_QUEUED_SPINLOCKS
157157
select ARCH_USE_QUEUED_SPINLOCKS if PPC_QUEUED_SPINLOCKS
158+
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
158159
select ARCH_WANT_IPC_PARSE_VERSION
159160
select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
160161
select ARCH_WANT_LD_ORPHAN_WARN
161162
select ARCH_WANTS_MODULES_DATA_IN_VMALLOC if PPC_BOOK3S_32 || PPC_8xx
163+
select ARCH_WANTS_NO_INSTR
162164
select ARCH_WEAK_RELEASE_ACQUIRE
163165
select BINFMT_ELF
164166
select BUILDTIME_TABLE_SORT
@@ -190,7 +192,8 @@ config PPC
190192
select HAVE_ARCH_JUMP_LABEL
191193
select HAVE_ARCH_JUMP_LABEL_RELATIVE
192194
select HAVE_ARCH_KASAN if PPC32 && PPC_PAGE_SHIFT <= 14
193-
select HAVE_ARCH_KASAN_VMALLOC if PPC32 && PPC_PAGE_SHIFT <= 14
195+
select HAVE_ARCH_KASAN if PPC_RADIX_MMU
196+
select HAVE_ARCH_KASAN_VMALLOC if HAVE_ARCH_KASAN
194197
select HAVE_ARCH_KFENCE if PPC_BOOK3S_32 || PPC_8xx || 40x
195198
select HAVE_ARCH_KGDB
196199
select HAVE_ARCH_MMAP_RND_BITS
@@ -210,7 +213,7 @@ config PPC
210213
select HAVE_EFFICIENT_UNALIGNED_ACCESS if !(CPU_LITTLE_ENDIAN && POWER7_CPU)
211214
select HAVE_FAST_GUP
212215
select HAVE_FTRACE_MCOUNT_RECORD
213-
select HAVE_FUNCTION_DESCRIPTORS if PPC64 && !CPU_LITTLE_ENDIAN
216+
select HAVE_FUNCTION_DESCRIPTORS if PPC64_ELF_ABI_V1
214217
select HAVE_FUNCTION_ERROR_INJECTION
215218
select HAVE_FUNCTION_GRAPH_TRACER
216219
select HAVE_FUNCTION_TRACER
@@ -760,6 +763,22 @@ config PPC_256K_PAGES
760763

761764
endchoice
762765

766+
config PAGE_SIZE_4KB
767+
def_bool y
768+
depends on PPC_4K_PAGES
769+
770+
config PAGE_SIZE_16KB
771+
def_bool y
772+
depends on PPC_16K_PAGES
773+
774+
config PAGE_SIZE_64KB
775+
def_bool y
776+
depends on PPC_64K_PAGES
777+
778+
config PAGE_SIZE_256KB
779+
def_bool y
780+
depends on PPC_256K_PAGES
781+
763782
config PPC_PAGE_SHIFT
764783
int
765784
default 18 if PPC_256K_PAGES

arch/powerpc/Kconfig.debug

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,4 +374,5 @@ config PPC_FAST_ENDIAN_SWITCH
374374
config KASAN_SHADOW_OFFSET
375375
hex
376376
depends on KASAN
377-
default 0xe0000000
377+
default 0xe0000000 if PPC32
378+
default 0xa80e000000000000 if PPC64

arch/powerpc/Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ endif
8989

9090
ifdef CONFIG_PPC64
9191
ifndef CONFIG_CC_IS_CLANG
92-
cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1)
93-
cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mcall-aixdesc)
94-
aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1)
95-
aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2
92+
cflags-$(CONFIG_PPC64_ELF_ABI_V1) += $(call cc-option,-mabi=elfv1)
93+
cflags-$(CONFIG_PPC64_ELF_ABI_V1) += $(call cc-option,-mcall-aixdesc)
94+
aflags-$(CONFIG_PPC64_ELF_ABI_V1) += $(call cc-option,-mabi=elfv1)
95+
aflags-$(CONFIG_PPC64_ELF_ABI_V2) += -mabi=elfv2
9696
endif
9797
endif
9898

@@ -141,7 +141,7 @@ endif
141141

142142
CFLAGS-$(CONFIG_PPC64) := $(call cc-option,-mtraceback=no)
143143
ifndef CONFIG_CC_IS_CLANG
144-
ifdef CONFIG_CPU_LITTLE_ENDIAN
144+
ifdef CONFIG_PPC64_ELF_ABI_V2
145145
CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc))
146146
AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2)
147147
else
@@ -213,7 +213,7 @@ CHECKFLAGS += -m$(BITS) -D__powerpc__ -D__powerpc$(BITS)__
213213
ifdef CONFIG_CPU_BIG_ENDIAN
214214
CHECKFLAGS += -D__BIG_ENDIAN__
215215
else
216-
CHECKFLAGS += -D__LITTLE_ENDIAN__ -D_CALL_ELF=2
216+
CHECKFLAGS += -D__LITTLE_ENDIAN__
217217
endif
218218

219219
ifdef CONFIG_476FPE_ERR46

arch/powerpc/boot/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@ BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
3838
$(LINUXINCLUDE)
3939

4040
ifdef CONFIG_PPC64_BOOT_WRAPPER
41-
BOOTCFLAGS += -m64
41+
ifdef CONFIG_CPU_LITTLE_ENDIAN
42+
BOOTCFLAGS += -m64 -mcpu=powerpc64le
4243
else
43-
BOOTCFLAGS += -m32
44+
BOOTCFLAGS += -m64 -mcpu=powerpc64
45+
endif
46+
else
47+
BOOTCFLAGS += -m32 -mcpu=powerpc
4448
endif
4549

4650
BOOTCFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include)
@@ -49,6 +53,8 @@ ifdef CONFIG_CPU_BIG_ENDIAN
4953
BOOTCFLAGS += -mbig-endian
5054
else
5155
BOOTCFLAGS += -mlittle-endian
56+
endif
57+
ifdef CONFIG_PPC64_ELF_ABI_V2
5258
BOOTCFLAGS += $(call cc-option,-mabi=elfv2)
5359
endif
5460

0 commit comments

Comments
 (0)