Skip to content

Commit cae4199

Browse files
committed
Merge tag 'powerpc-6.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc updates from Michael Ellerman: - Add support for syscall stack randomization - Add support for atomic operations to the 32 & 64-bit BPF JIT - Full support for KASAN on 64-bit Book3E - Add a watchdog driver for the new PowerVM hypervisor watchdog - Add a number of new selftests for the Power10 PMU support - Add a driver for the PowerVM Platform KeyStore - Increase the NMI watchdog timeout during live partition migration, to avoid timeouts due to increased memory access latency - Add support for using the 'linux,pci-domain' device tree property for PCI domain assignment - Many other small features and fixes Thanks to Alexey Kardashevskiy, Andy Shevchenko, Arnd Bergmann, Athira Rajeev, Bagas Sanjaya, Christophe Leroy, Erhard Furtner, Fabiano Rosas, Greg Kroah-Hartman, Greg Kurz, Haowen Bai, Hari Bathini, Jason A. Donenfeld, Jason Wang, Jiang Jian, Joel Stanley, Juerg Haefliger, Kajol Jain, Kees Cook, Laurent Dufour, Madhavan Srinivasan, Masahiro Yamada, Maxime Bizon, Miaoqian Lin, Murilo Opsfelder Araújo, Nathan Lynch, Naveen N. Rao, Nayna Jain, Nicholas Piggin, Ning Qiang, Pali Rohár, Petr Mladek, Rashmica Gupta, Sachin Sant, Scott Cheloha, Segher Boessenkool, Stephen Rothwell, Uwe Kleine-König, Wolfram Sang, Xiu Jianfeng, and Zhouyi Zhou. * tag 'powerpc-6.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (191 commits) powerpc/64e: Fix kexec build error EDAC/ppc_4xx: Include required of_irq header directly powerpc/pci: Fix PHB numbering when using opal-phbid powerpc/64: Init jump labels before parse_early_param() selftests/powerpc: Avoid GCC 12 uninitialised variable warning powerpc/cell/axon_msi: Fix refcount leak in setup_msi_msg_address powerpc/xive: Fix refcount leak in xive_get_max_prio powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader powerpc/perf: Include caps feature for power10 DD1 version powerpc: add support for syscall stack randomization powerpc: Move system_call_exception() to syscall.c powerpc/powernv: rename remaining rng powernv_ functions to pnv_ powerpc/powernv/kvm: Use darn for H_RANDOM on Power9 powerpc/powernv: Avoid crashing if rng is NULL selftests/powerpc: Fix matrix multiply assist test powerpc/signal: Update comment for clarity powerpc: make facility_unavailable_exception 64s powerpc/platforms/83xx/suspend: Remove write-only global variable powerpc/platforms/83xx/suspend: Prevent unloading the driver powerpc/platforms/83xx/suspend: Reorder to get rid of a forward declaration ...
2 parents 4d1044f + 4cfa6ff commit cae4199

File tree

276 files changed

+6805
-2116
lines changed

Some content is hidden

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

276 files changed

+6805
-2116
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
What: /sys/bus/event_source/devices/<dev>/caps
2+
Date: May 2022
3+
KernelVersion: 5.19
4+
Contact: Linux kernel mailing list <[email protected]>
5+
Description:
6+
Attribute group to describe the capabilities exposed
7+
for a particular pmu. Each attribute of this group can
8+
expose information specific to a PMU, say pmu_name, so that
9+
userspace can understand some of the feature which the
10+
platform specific PMU supports.
11+
12+
One of the example available capability in supported platform
13+
like Intel is pmu_name, which exposes underlying CPU name known
14+
to the PMU driver.
15+
16+
Example output in powerpc:
17+
grep . /sys/bus/event_source/devices/cpu/caps/*
18+
/sys/bus/event_source/devices/cpu/caps/pmu_name:POWER9

Documentation/admin-guide/kernel-parameters.txt

-6
Original file line numberDiff line numberDiff line change
@@ -3553,9 +3553,6 @@
35533553

35543554
noautogroup Disable scheduler automatic task group creation.
35553555

3556-
nobats [PPC] Do not use BATs for mapping kernel lowmem
3557-
on "Classic" PPC cores.
3558-
35593556
nocache [ARM]
35603557

35613558
nodsp [SH] Disable hardware DSP at boot time.
@@ -3725,9 +3722,6 @@
37253722

37263723
nolapic_timer [X86-32,APIC] Do not use the local APIC timer.
37273724

3728-
noltlbs [PPC] Do not use large page/tlb entries for kernel
3729-
lowmem mapping on PPC40x and PPC8xx
3730-
37313725
nomca [IA-64] Disable machine check abort handling
37323726

37333727
nomce [X86-32] Disable Machine Check Exception

Documentation/admin-guide/sysctl/kernel.rst

+12
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,18 @@ to the guest kernel command line (see
592592
Documentation/admin-guide/kernel-parameters.rst).
593593

594594

595+
nmi_wd_lpm_factor (PPC only)
596+
============================
597+
598+
Factor to apply to the NMI watchdog timeout (only when ``nmi_watchdog`` is
599+
set to 1). This factor represents the percentage added to
600+
``watchdog_thresh`` when calculating the NMI watchdog timeout during an
601+
LPM. The soft lockup timeout is not impacted.
602+
603+
A value of 0 means no change. The default value is 200 meaning the NMI
604+
watchdog is set to 30s (based on ``watchdog_thresh`` equal to 10).
605+
606+
595607
numa_balancing
596608
==============
597609

Documentation/powerpc/elf_hwcaps.rst

+231
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
.. _elf_hwcaps_powerpc:
2+
3+
==================
4+
POWERPC ELF HWCAPs
5+
==================
6+
7+
This document describes the usage and semantics of the powerpc ELF HWCAPs.
8+
9+
10+
1. Introduction
11+
---------------
12+
13+
Some hardware or software features are only available on some CPU
14+
implementations, and/or with certain kernel configurations, but have no other
15+
discovery mechanism available to userspace code. The kernel exposes the
16+
presence of these features to userspace through a set of flags called HWCAPs,
17+
exposed in the auxiliary vector.
18+
19+
Userspace software can test for features by acquiring the AT_HWCAP or
20+
AT_HWCAP2 entry of the auxiliary vector, and testing whether the relevant
21+
flags are set, e.g.::
22+
23+
bool floating_point_is_present(void)
24+
{
25+
unsigned long HWCAPs = getauxval(AT_HWCAP);
26+
if (HWCAPs & PPC_FEATURE_HAS_FPU)
27+
return true;
28+
29+
return false;
30+
}
31+
32+
Where software relies on a feature described by a HWCAP, it should check the
33+
relevant HWCAP flag to verify that the feature is present before attempting to
34+
make use of the feature.
35+
36+
HWCAP is the preferred method to test for the presence of a feature rather
37+
than probing through other means, which may not be reliable or may cause
38+
unpredictable behaviour.
39+
40+
Software that targets a particular platform does not necessarily have to
41+
test for required or implied features. For example if the program requires
42+
FPU, VMX, VSX, it is not necessary to test those HWCAPs, and it may be
43+
impossible to do so if the compiler generates code requiring those features.
44+
45+
2. Facilities
46+
-------------
47+
48+
The Power ISA uses the term "facility" to describe a class of instructions,
49+
registers, interrupts, etc. The presence or absence of a facility indicates
50+
whether this class is available to be used, but the specifics depend on the
51+
ISA version. For example, if the VSX facility is available, the VSX
52+
instructions that can be used differ between the v3.0B and v3.1B ISA
53+
versions.
54+
55+
3. Categories
56+
-------------
57+
58+
The Power ISA before v3.0 uses the term "category" to describe certain
59+
classes of instructions and operating modes which may be optional or
60+
mutually exclusive, the exact meaning of the HWCAP flag may depend on
61+
context, e.g., the presence of the BOOKE feature implies that the server
62+
category is not implemented.
63+
64+
4. HWCAP allocation
65+
-------------------
66+
67+
HWCAPs are allocated as described in Power Architecture 64-Bit ELF V2 ABI
68+
Specification (which will be reflected in the kernel's uapi headers).
69+
70+
5. The HWCAPs exposed in AT_HWCAP
71+
---------------------------------
72+
73+
PPC_FEATURE_32
74+
32-bit CPU
75+
76+
PPC_FEATURE_64
77+
64-bit CPU (userspace may be running in 32-bit mode).
78+
79+
PPC_FEATURE_601_INSTR
80+
The processor is PowerPC 601.
81+
Unused in the kernel since f0ed73f3fa2c ("powerpc: Remove PowerPC 601")
82+
83+
PPC_FEATURE_HAS_ALTIVEC
84+
Vector (aka Altivec, VMX) facility is available.
85+
86+
PPC_FEATURE_HAS_FPU
87+
Floating point facility is available.
88+
89+
PPC_FEATURE_HAS_MMU
90+
Memory management unit is present and enabled.
91+
92+
PPC_FEATURE_HAS_4xxMAC
93+
The processor is 40x or 44x family.
94+
95+
PPC_FEATURE_UNIFIED_CACHE
96+
The processor has a unified L1 cache for instructions and data, as
97+
found in NXP e200.
98+
Unused in the kernel since 39c8bf2b3cc1 ("powerpc: Retire e200 core (mpc555x processor)")
99+
100+
PPC_FEATURE_HAS_SPE
101+
Signal Processing Engine facility is available.
102+
103+
PPC_FEATURE_HAS_EFP_SINGLE
104+
Embedded Floating Point single precision operations are available.
105+
106+
PPC_FEATURE_HAS_EFP_DOUBLE
107+
Embedded Floating Point double precision operations are available.
108+
109+
PPC_FEATURE_NO_TB
110+
The timebase facility (mftb instruction) is not available.
111+
This is a 601 specific HWCAP, so if it is known that the processor
112+
running is not a 601, via other HWCAPs or other means, it is not
113+
required to test this bit before using the timebase.
114+
Unused in the kernel since f0ed73f3fa2c ("powerpc: Remove PowerPC 601")
115+
116+
PPC_FEATURE_POWER4
117+
The processor is POWER4 or PPC970/FX/MP.
118+
POWER4 support dropped from the kernel since 471d7ff8b51b ("powerpc/64s: Remove POWER4 support")
119+
120+
PPC_FEATURE_POWER5
121+
The processor is POWER5.
122+
123+
PPC_FEATURE_POWER5_PLUS
124+
The processor is POWER5+.
125+
126+
PPC_FEATURE_CELL
127+
The processor is Cell.
128+
129+
PPC_FEATURE_BOOKE
130+
The processor implements the embedded category ("BookE") architecture.
131+
132+
PPC_FEATURE_SMT
133+
The processor implements SMT.
134+
135+
PPC_FEATURE_ICACHE_SNOOP
136+
The processor icache is coherent with the dcache, and instruction storage
137+
can be made consistent with data storage for the purpose of executing
138+
instructions with the sequence (as described in, e.g., POWER9 Processor
139+
User's Manual, 4.6.2.2 Instruction Cache Block Invalidate (icbi))::
140+
141+
sync
142+
icbi (to any address)
143+
isync
144+
145+
PPC_FEATURE_ARCH_2_05
146+
The processor supports the v2.05 userlevel architecture. Processors
147+
supporting later architectures DO NOT set this feature.
148+
149+
PPC_FEATURE_PA6T
150+
The processor is PA6T.
151+
152+
PPC_FEATURE_HAS_DFP
153+
DFP facility is available.
154+
155+
PPC_FEATURE_POWER6_EXT
156+
The processor is POWER6.
157+
158+
PPC_FEATURE_ARCH_2_06
159+
The processor supports the v2.06 userlevel architecture. Processors
160+
supporting later architectures also set this feature.
161+
162+
PPC_FEATURE_HAS_VSX
163+
VSX facility is available.
164+
165+
PPC_FEATURE_PSERIES_PERFMON_COMPAT
166+
The processor supports architected PMU events in the range 0xE0-0xFF.
167+
168+
PPC_FEATURE_TRUE_LE
169+
The processor supports true little-endian mode.
170+
171+
PPC_FEATURE_PPC_LE
172+
The processor supports "PowerPC Little-Endian", that uses address
173+
munging to make storage access appear to be little-endian, but the
174+
data is stored in a different format that is unsuitable to be
175+
accessed by other agents not running in this mode.
176+
177+
6. The HWCAPs exposed in AT_HWCAP2
178+
----------------------------------
179+
180+
PPC_FEATURE2_ARCH_2_07
181+
The processor supports the v2.07 userlevel architecture. Processors
182+
supporting later architectures also set this feature.
183+
184+
PPC_FEATURE2_HTM
185+
Transactional Memory feature is available.
186+
187+
PPC_FEATURE2_DSCR
188+
DSCR facility is available.
189+
190+
PPC_FEATURE2_EBB
191+
EBB facility is available.
192+
193+
PPC_FEATURE2_ISEL
194+
isel instruction is available. This is superseded by ARCH_2_07 and
195+
later.
196+
197+
PPC_FEATURE2_TAR
198+
TAR facility is available.
199+
200+
PPC_FEATURE2_VEC_CRYPTO
201+
v2.07 crypto instructions are available.
202+
203+
PPC_FEATURE2_HTM_NOSC
204+
System calls fail if called in a transactional state, see
205+
Documentation/powerpc/syscall64-abi.rst
206+
207+
PPC_FEATURE2_ARCH_3_00
208+
The processor supports the v3.0B / v3.0C userlevel architecture. Processors
209+
supporting later architectures also set this feature.
210+
211+
PPC_FEATURE2_HAS_IEEE128
212+
IEEE 128-bit binary floating point is supported with VSX
213+
quad-precision instructions and data types.
214+
215+
PPC_FEATURE2_DARN
216+
darn instruction is available.
217+
218+
PPC_FEATURE2_SCV
219+
The scv 0 instruction may be used for system calls, see
220+
Documentation/powerpc/syscall64-abi.rst.
221+
222+
PPC_FEATURE2_HTM_NO_SUSPEND
223+
A limited Transactional Memory facility that does not support suspend is
224+
available, see Documentation/powerpc/transactional_memory.rst.
225+
226+
PPC_FEATURE2_ARCH_3_1
227+
The processor supports the v3.1 userlevel architecture. Processors
228+
supporting later architectures also set this feature.
229+
230+
PPC_FEATURE2_MMA
231+
MMA facility is available.

Documentation/powerpc/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ powerpc
1717
dawr-power9
1818
dscr
1919
eeh-pci-error-recovery
20+
elf_hwcaps
2021
elfnote
2122
firmware-assisted-dump
2223
hvcs

Documentation/watchdog/watchdog-parameters.rst

+12
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,18 @@ pnx833x_wdt:
425425

426426
-------------------------------------------------
427427

428+
pseries-wdt:
429+
action:
430+
Action taken when watchdog expires: 0 (power off), 1 (restart),
431+
2 (dump and restart). (default=1)
432+
timeout:
433+
Initial watchdog timeout in seconds. (default=60)
434+
nowayout:
435+
Watchdog cannot be stopped once started.
436+
(default=kernel config parameter)
437+
438+
-------------------------------------------------
439+
428440
rc32434_wdt:
429441
timeout:
430442
Watchdog timeout value, in seconds (default=20)

MAINTAINERS

+2-2
Original file line numberDiff line numberDiff line change
@@ -11628,8 +11628,8 @@ F: drivers/macintosh/
1162811628

1162911629
LINUX FOR POWERPC (32-BIT AND 64-BIT)
1163011630
M: Michael Ellerman <[email protected]>
11631-
R: Benjamin Herrenschmidt <[email protected]>
11632-
R: Paul Mackerras <[email protected]>
11631+
R: Nicholas Piggin <[email protected]>
11632+
R: Christophe Leroy <[email protected]>
1163311633
1163411634
S: Supported
1163511635
W: https://github.com/linuxppc/wiki/wiki

arch/powerpc/Kconfig

+16-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ config 64BIT
1111

1212
config LIVEPATCH_64
1313
def_bool PPC64
14-
depends on LIVEPATCH
14+
depends on LIVEPATCH
1515

1616
config MMU
1717
bool
@@ -192,8 +192,10 @@ config PPC
192192
select HAVE_ARCH_JUMP_LABEL_RELATIVE
193193
select HAVE_ARCH_KASAN if PPC32 && PPC_PAGE_SHIFT <= 14
194194
select HAVE_ARCH_KASAN if PPC_RADIX_MMU
195+
select HAVE_ARCH_KASAN if PPC_BOOK3E_64
195196
select HAVE_ARCH_KASAN_VMALLOC if HAVE_ARCH_KASAN
196197
select HAVE_ARCH_KFENCE if PPC_BOOK3S_32 || PPC_8xx || 40x
198+
select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
197199
select HAVE_ARCH_KGDB
198200
select HAVE_ARCH_MMAP_RND_BITS
199201
select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
@@ -253,6 +255,7 @@ config PPC
253255
select IOMMU_HELPER if PPC64
254256
select IRQ_DOMAIN
255257
select IRQ_FORCED_THREADING
258+
select KASAN_VMALLOC if KASAN && MODULES
256259
select MMU_GATHER_PAGE_SIZE
257260
select MMU_GATHER_RCU_TABLE_FREE
258261
select MMU_GATHER_MERGE_VMAS
@@ -376,6 +379,17 @@ config PPC_DCR
376379
depends on PPC_DCR_NATIVE || PPC_DCR_MMIO
377380
default y
378381

382+
config PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT
383+
depends on PPC32
384+
depends on !PPC_PMAC && !PPC_CHRP
385+
bool "Assign PCI bus numbers from zero individually for each PCI domain"
386+
help
387+
By default on PPC32 were PCI bus numbers unique across all PCI domains.
388+
So system could have only 256 PCI buses independently of available
389+
PCI domains. When this option is enabled then PCI bus numbers are
390+
PCI domain dependent and each PCI controller on own domain can have
391+
256 PCI buses, like it is on other Linux architectures.
392+
379393
config PPC_OF_PLATFORM_PCI
380394
bool
381395
depends on PCI
@@ -452,7 +466,7 @@ choice
452466
default MATH_EMULATION_FULL
453467
depends on MATH_EMULATION
454468

455-
config MATH_EMULATION_FULL
469+
config MATH_EMULATION_FULL
456470
bool "Emulate all the floating point instructions"
457471
help
458472
Select this option will enable the kernel to support to emulate
@@ -554,7 +568,6 @@ config KEXEC_FILE
554568
bool "kexec file based system call"
555569
select KEXEC_CORE
556570
select HAVE_IMA_KEXEC if IMA
557-
select BUILD_BIN2C
558571
select KEXEC_ELF
559572
depends on PPC64
560573
depends on CRYPTO=y

0 commit comments

Comments
 (0)