Skip to content

Commit c89d780

Browse files
committed
Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 updates from Catalin Marinas: "The biggest part is the virtual CPU hotplug that touches ACPI, irqchip. We also have some GICv3 optimisation for pseudo-NMIs that has been queued via the arm64 tree. Otherwise the usual perf updates, kselftest, various small cleanups. Core: - Virtual CPU hotplug support for arm64 ACPI systems - cpufeature infrastructure cleanups and making the FEAT_ECBHB ID bits visible to guests - CPU errata: expand the speculative SSBS workaround to more CPUs - GICv3, use compile-time PMR values: optimise the way regular IRQs are masked/unmasked when GICv3 pseudo-NMIs are used, removing the need for a static key in fast paths by using a priority value chosen dynamically at boot time ACPI: - 'acpi=nospcr' option to disable SPCR as default console for arm64 - Move some ACPI code (cpuidle, FFH) to drivers/acpi/arm64/ Perf updates: - Rework of the IMX PMU driver to enable support for I.MX95 - Enable support for tertiary match groups in the CMN PMU driver - Initial refactoring of the CPU PMU code to prepare for the fixed instruction counter introduced by Arm v9.4 - Add missing PMU driver MODULE_DESCRIPTION() strings - Hook up DT compatibles for recent CPU PMUs Kselftest updates: - Kernel mode NEON fp-stress - Cleanups, spelling mistakes Miscellaneous: - arm64 Documentation update with a minor clarification on TBI - Fix missing IPI statistics - Implement raw_smp_processor_id() using thread_info rather than a per-CPU variable (better code generation) - Make MTE checking of in-kernel asynchronous tag faults conditional on KASAN being enabled - Minor cleanups, typos" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (69 commits) selftests: arm64: tags: remove the result script selftests: arm64: tags_test: conform test to TAP output perf: add missing MODULE_DESCRIPTION() macros arm64: smp: Fix missing IPI statistics irqchip/gic-v3: Fix 'broken_rdists' unused warning when !SMP and !ACPI ACPI: Add acpi=nospcr to disable ACPI SPCR as default console on ARM64 Documentation: arm64: Update memory.rst for TBI arm64/cpufeature: Replace custom macros with fields from ID_AA64PFR0_EL1 KVM: arm64: Replace custom macros with fields from ID_AA64PFR0_EL1 perf: arm_pmuv3: Include asm/arm_pmuv3.h from linux/perf/arm_pmuv3.h perf: arm_v6/7_pmu: Drop non-DT probe support perf/arm: Move 32-bit PMU drivers to drivers/perf/ perf: arm_pmuv3: Drop unnecessary IS_ENABLED(CONFIG_ARM64) check perf: arm_pmuv3: Avoid assigning fixed cycle counter with threshold arm64: Kconfig: Fix dependencies to enable ACPI_HOTPLUG_CPU perf: imx_perf: add support for i.MX95 platform perf: imx_perf: fix counter start and config sequence perf: imx_perf: refactor driver for imx93 perf: imx_perf: let the driver manage the counter usage rather the user perf: imx_perf: add macro definitions for parsing config attr ...
2 parents bbb3556 + 4f3a6c4 commit c89d780

Some content is hidden

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

86 files changed

+1603
-749
lines changed

Documentation/ABI/testing/sysfs-devices-system-cpu

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,3 +694,9 @@ Description:
694694
(RO) indicates whether or not the kernel directly supports
695695
modifying the crash elfcorehdr for CPU hot un/plug and/or
696696
on/offline changes.
697+
698+
What: /sys/devices/system/cpu/enabled
699+
Date: Nov 2022
700+
Contact: Linux kernel mailing list <[email protected]>
701+
Description:
702+
(RO) the list of CPUs that can be brought online.

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
acpi= [HW,ACPI,X86,ARM64,RISCV64,EARLY]
1313
Advanced Configuration and Power Interface
1414
Format: { force | on | off | strict | noirq | rsdt |
15-
copy_dsdt }
15+
copy_dsdt | nospcr }
1616
force -- enable ACPI if default was off
1717
on -- enable ACPI but allow fallback to DT [arm64,riscv64]
1818
off -- disable ACPI if default was on
@@ -21,8 +21,12 @@
2121
strictly ACPI specification compliant.
2222
rsdt -- prefer RSDT over (default) XSDT
2323
copy_dsdt -- copy DSDT to memory
24-
For ARM64 and RISCV64, ONLY "acpi=off", "acpi=on" or
25-
"acpi=force" are available
24+
nospcr -- disable console in ACPI SPCR table as
25+
default _serial_ console on ARM64
26+
For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
27+
"acpi=nospcr" are available
28+
For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"
29+
are available
2630

2731
See also Documentation/power/runtime_pm.rst, pci=noacpi
2832

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
.. _cpuhp_index:
3+
4+
====================
5+
CPU Hotplug and ACPI
6+
====================
7+
8+
CPU hotplug in the arm64 world is commonly used to describe the kernel taking
9+
CPUs online/offline using PSCI. This document is about ACPI firmware allowing
10+
CPUs that were not available during boot to be added to the system later.
11+
12+
``possible`` and ``present`` refer to the state of the CPU as seen by linux.
13+
14+
15+
CPU Hotplug on physical systems - CPUs not present at boot
16+
----------------------------------------------------------
17+
18+
Physical systems need to mark a CPU that is ``possible`` but not ``present`` as
19+
being ``present``. An example would be a dual socket machine, where the package
20+
in one of the sockets can be replaced while the system is running.
21+
22+
This is not supported.
23+
24+
In the arm64 world CPUs are not a single device but a slice of the system.
25+
There are no systems that support the physical addition (or removal) of CPUs
26+
while the system is running, and ACPI is not able to sufficiently describe
27+
them.
28+
29+
e.g. New CPUs come with new caches, but the platform's cache toplogy is
30+
described in a static table, the PPTT. How caches are shared between CPUs is
31+
not discoverable, and must be described by firmware.
32+
33+
e.g. The GIC redistributor for each CPU must be accessed by the driver during
34+
boot to discover the system wide supported features. ACPI's MADT GICC
35+
structures can describe a redistributor associated with a disabled CPU, but
36+
can't describe whether the redistributor is accessible, only that it is not
37+
'always on'.
38+
39+
arm64's ACPI tables assume that everything described is ``present``.
40+
41+
42+
CPU Hotplug on virtual systems - CPUs not enabled at boot
43+
---------------------------------------------------------
44+
45+
Virtual systems have the advantage that all the properties the system will
46+
ever have can be described at boot. There are no power-domain considerations
47+
as such devices are emulated.
48+
49+
CPU Hotplug on virtual systems is supported. It is distinct from physical
50+
CPU Hotplug as all resources are described as ``present``, but CPUs may be
51+
marked as disabled by firmware. Only the CPU's online/offline behaviour is
52+
influenced by firmware. An example is where a virtual machine boots with a
53+
single CPU, and additional CPUs are added once a cloud orchestrator deploys
54+
the workload.
55+
56+
For a virtual machine, the VMM (e.g. Qemu) plays the part of firmware.
57+
58+
Virtual hotplug is implemented as a firmware policy affecting which CPUs can be
59+
brought online. Firmware can enforce its policy via PSCI's return codes. e.g.
60+
``DENIED``.
61+
62+
The ACPI tables must describe all the resources of the virtual machine. CPUs
63+
that firmware wishes to disable either from boot (or later) should not be
64+
``enabled`` in the MADT GICC structures, but should have the ``online capable``
65+
bit set, to indicate they can be enabled later. The boot CPU must be marked as
66+
``enabled``. The 'always on' GICR structure must be used to describe the
67+
redistributors.
68+
69+
CPUs described as ``online capable`` but not ``enabled`` can be set to enabled
70+
by the DSDT's Processor object's _STA method. On virtual systems the _STA method
71+
must always report the CPU as ``present``. Changes to the firmware policy can
72+
be notified to the OS via device-check or eject-request.
73+
74+
CPUs described as ``enabled`` in the static table, should not have their _STA
75+
modified dynamically by firmware. Soft-restart features such as kexec will
76+
re-read the static properties of the system from these static tables, and
77+
may malfunction if these no longer describe the running system. Linux will
78+
re-discover the dynamic properties of the system from the _STA method later
79+
during boot.

Documentation/arch/arm64/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ARM64 Architecture
1313
asymmetric-32bit
1414
booting
1515
cpu-feature-registers
16+
cpu-hotplug
1617
elf_hwcaps
1718
hugetlbpage
1819
kdump

Documentation/arch/arm64/memory.rst

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ ARMv8.2 adds optional support for Large Virtual Address space. This is
1818
only available when running with a 64KB page size and expands the
1919
number of descriptors in the first level of translation.
2020

21-
User addresses have bits 63:48 set to 0 while the kernel addresses have
22-
the same bits set to 1. TTBRx selection is given by bit 63 of the
23-
virtual address. The swapper_pg_dir contains only kernel (global)
24-
mappings while the user pgd contains only user (non-global) mappings.
25-
The swapper_pg_dir address is written to TTBR1 and never written to
26-
TTBR0.
21+
TTBRx selection is given by bit 55 of the virtual address. The
22+
swapper_pg_dir contains only kernel (global) mappings while the user pgd
23+
contains only user (non-global) mappings. The swapper_pg_dir address is
24+
written to TTBR1 and never written to TTBR0.
2725

2826

2927
AArch64 Linux memory layout with 4KB pages + 4 levels (48-bit)::
@@ -65,29 +63,29 @@ Translation table lookup with 4KB pages::
6563
+--------+--------+--------+--------+--------+--------+--------+--------+
6664
|63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0|
6765
+--------+--------+--------+--------+--------+--------+--------+--------+
68-
| | | | | |
69-
| | | | | v
70-
| | | | | [11:0] in-page offset
71-
| | | | +-> [20:12] L3 index
72-
| | | +-----------> [29:21] L2 index
73-
| | +---------------------> [38:30] L1 index
74-
| +-------------------------------> [47:39] L0 index
75-
+-------------------------------------------------> [63] TTBR0/1
66+
| | | | | |
67+
| | | | | v
68+
| | | | | [11:0] in-page offset
69+
| | | | +-> [20:12] L3 index
70+
| | | +-----------> [29:21] L2 index
71+
| | +---------------------> [38:30] L1 index
72+
| +-------------------------------> [47:39] L0 index
73+
+----------------------------------------> [55] TTBR0/1
7674

7775

7876
Translation table lookup with 64KB pages::
7977

8078
+--------+--------+--------+--------+--------+--------+--------+--------+
8179
|63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0|
8280
+--------+--------+--------+--------+--------+--------+--------+--------+
83-
| | | | |
84-
| | | | v
85-
| | | | [15:0] in-page offset
86-
| | | +----------> [28:16] L3 index
87-
| | +--------------------------> [41:29] L2 index
88-
| +-------------------------------> [47:42] L1 index (48-bit)
89-
| [51:42] L1 index (52-bit)
90-
+-------------------------------------------------> [63] TTBR0/1
81+
| | | | |
82+
| | | | v
83+
| | | | [15:0] in-page offset
84+
| | | +----------> [28:16] L3 index
85+
| | +--------------------------> [41:29] L2 index
86+
| +-------------------------------> [47:42] L1 index (48-bit)
87+
| [51:42] L1 index (52-bit)
88+
+----------------------------------------> [55] TTBR0/1
9189

9290

9391
When using KVM without the Virtualization Host Extensions, the

Documentation/arch/arm64/silicon-errata.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,26 @@ stable kernels.
132132
+----------------+-----------------+-----------------+-----------------------------+
133133
| ARM | Cortex-A710 | #2224489 | ARM64_ERRATUM_2224489 |
134134
+----------------+-----------------+-----------------+-----------------------------+
135+
| ARM | Cortex-A710 | #3324338 | ARM64_ERRATUM_3194386 |
136+
+----------------+-----------------+-----------------+-----------------------------+
135137
| ARM | Cortex-A715 | #2645198 | ARM64_ERRATUM_2645198 |
136138
+----------------+-----------------+-----------------+-----------------------------+
139+
| ARM | Cortex-A720 | #3456091 | ARM64_ERRATUM_3194386 |
140+
+----------------+-----------------+-----------------+-----------------------------+
137141
| ARM | Cortex-X1 | #1502854 | N/A |
138142
+----------------+-----------------+-----------------+-----------------------------+
139143
| ARM | Cortex-X2 | #2119858 | ARM64_ERRATUM_2119858 |
140144
+----------------+-----------------+-----------------+-----------------------------+
141145
| ARM | Cortex-X2 | #2224489 | ARM64_ERRATUM_2224489 |
142146
+----------------+-----------------+-----------------+-----------------------------+
147+
| ARM | Cortex-X2 | #3324338 | ARM64_ERRATUM_3194386 |
148+
+----------------+-----------------+-----------------+-----------------------------+
149+
| ARM | Cortex-X3 | #3324335 | ARM64_ERRATUM_3194386 |
150+
+----------------+-----------------+-----------------+-----------------------------+
143151
| ARM | Cortex-X4 | #3194386 | ARM64_ERRATUM_3194386 |
144152
+----------------+-----------------+-----------------+-----------------------------+
153+
| ARM | Cortex-X925 | #3324334 | ARM64_ERRATUM_3194386 |
154+
+----------------+-----------------+-----------------+-----------------------------+
145155
| ARM | Neoverse-N1 | #1188873,1418040| ARM64_ERRATUM_1418040 |
146156
+----------------+-----------------+-----------------+-----------------------------+
147157
| ARM | Neoverse-N1 | #1349291 | N/A |
@@ -156,9 +166,13 @@ stable kernels.
156166
+----------------+-----------------+-----------------+-----------------------------+
157167
| ARM | Neoverse-N2 | #2253138 | ARM64_ERRATUM_2253138 |
158168
+----------------+-----------------+-----------------+-----------------------------+
169+
| ARM | Neoverse-N2 | #3324339 | ARM64_ERRATUM_3194386 |
170+
+----------------+-----------------+-----------------+-----------------------------+
159171
| ARM | Neoverse-V1 | #1619801 | N/A |
160172
+----------------+-----------------+-----------------+-----------------------------+
161-
| ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3312417 |
173+
| ARM | Neoverse-V2 | #3324336 | ARM64_ERRATUM_3194386 |
174+
+----------------+-----------------+-----------------+-----------------------------+
175+
| ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3194386 |
162176
+----------------+-----------------+-----------------+-----------------------------+
163177
| ARM | MMU-500 | #841119,826419 | N/A |
164178
+----------------+-----------------+-----------------+-----------------------------+

Documentation/devicetree/bindings/arm/pmu.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,20 @@ properties:
5353
- arm,cortex-a710-pmu
5454
- arm,cortex-a715-pmu
5555
- arm,cortex-a720-pmu
56+
- arm,cortex-a725-pmu
5657
- arm,cortex-x1-pmu
5758
- arm,cortex-x2-pmu
5859
- arm,cortex-x3-pmu
5960
- arm,cortex-x4-pmu
61+
- arm,cortex-x925-pmu
6062
- arm,neoverse-e1-pmu
6163
- arm,neoverse-n1-pmu
6264
- arm,neoverse-n2-pmu
65+
- arm,neoverse-n3-pmu
6366
- arm,neoverse-v1-pmu
67+
- arm,neoverse-v2-pmu
68+
- arm,neoverse-v3-pmu
69+
- arm,neoverse-v3ae-pmu
6470
- brcm,vulcan-pmu
6571
- cavium,thunder-pmu
6672
- nvidia,denver-pmu

Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ properties:
3030
- items:
3131
- const: fsl,imx8dxl-ddr-pmu
3232
- const: fsl,imx8-ddr-pmu
33+
- items:
34+
- const: fsl,imx95-ddr-pmu
35+
- const: fsl,imx93-ddr-pmu
3336

3437
reg:
3538
maxItems: 1

arch/arm/kernel/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o
7878
obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o
7979
obj-$(CONFIG_IWMMXT) += iwmmxt.o
8080
obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o
81-
obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_xscale.o perf_event_v6.o \
82-
perf_event_v7.o
8381
AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt
8482
obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o
8583
obj-$(CONFIG_VDSO) += vdso.o

arch/arm64/Kconfig

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ config ARM64
55
select ACPI_CCA_REQUIRED if ACPI
66
select ACPI_GENERIC_GSI if ACPI
77
select ACPI_GTDT if ACPI
8+
select ACPI_HOTPLUG_CPU if ACPI_PROCESSOR && HOTPLUG_CPU
89
select ACPI_IORT if ACPI
910
select ACPI_REDUCED_HARDWARE_ONLY if ACPI
1011
select ACPI_MCFG if (ACPI && PCI)
@@ -381,7 +382,7 @@ config BROKEN_GAS_INST
381382

382383
config BUILTIN_RETURN_ADDRESS_STRIPS_PAC
383384
bool
384-
# Clang's __builtin_return_adddress() strips the PAC since 12.0.0
385+
# Clang's __builtin_return_address() strips the PAC since 12.0.0
385386
# https://github.com/llvm/llvm-project/commit/2a96f47c5ffca84cd774ad402cacd137f4bf45e2
386387
default y if CC_IS_CLANG
387388
# GCC's __builtin_return_address() strips the PAC since 11.1.0,
@@ -1067,34 +1068,21 @@ config ARM64_ERRATUM_3117295
10671068

10681069
If unsure, say Y.
10691070

1070-
config ARM64_WORKAROUND_SPECULATIVE_SSBS
1071-
bool
1072-
10731071
config ARM64_ERRATUM_3194386
1074-
bool "Cortex-X4: 3194386: workaround for MSR SSBS not self-synchronizing"
1075-
select ARM64_WORKAROUND_SPECULATIVE_SSBS
1072+
bool "Cortex-{A720,X4,X925}/Neoverse-V3: workaround for MSR SSBS not self-synchronizing"
10761073
default y
10771074
help
1078-
This option adds the workaround for ARM Cortex-X4 erratum 3194386.
1075+
This option adds the workaround for the following errata:
10791076

1080-
On affected cores "MSR SSBS, #0" instructions may not affect
1081-
subsequent speculative instructions, which may permit unexepected
1082-
speculative store bypassing.
1083-
1084-
Work around this problem by placing a speculation barrier after
1085-
kernel changes to SSBS. The presence of the SSBS special-purpose
1086-
register is hidden from hwcaps and EL0 reads of ID_AA64PFR1_EL1, such
1087-
that userspace will use the PR_SPEC_STORE_BYPASS prctl to change
1088-
SSBS.
1089-
1090-
If unsure, say Y.
1091-
1092-
config ARM64_ERRATUM_3312417
1093-
bool "Neoverse-V3: 3312417: workaround for MSR SSBS not self-synchronizing"
1094-
select ARM64_WORKAROUND_SPECULATIVE_SSBS
1095-
default y
1096-
help
1097-
This option adds the workaround for ARM Neoverse-V3 erratum 3312417.
1077+
* ARM Cortex-A710 erratam 3324338
1078+
* ARM Cortex-A720 erratum 3456091
1079+
* ARM Cortex-X2 erratum 3324338
1080+
* ARM Cortex-X3 erratum 3324335
1081+
* ARM Cortex-X4 erratum 3194386
1082+
* ARM Cortex-X925 erratum 3324334
1083+
* ARM Neoverse N2 erratum 3324339
1084+
* ARM Neoverse V2 erratum 3324336
1085+
* ARM Neoverse-V3 erratum 3312417
10981086

10991087
On affected cores "MSR SSBS, #0" instructions may not affect
11001088
subsequent speculative instructions, which may permit unexepected
@@ -1108,7 +1096,6 @@ config ARM64_ERRATUM_3312417
11081096

11091097
If unsure, say Y.
11101098

1111-
11121099
config CAVIUM_ERRATUM_22375
11131100
bool "Cavium erratum 22375, 24313"
11141101
default y

0 commit comments

Comments
 (0)