Skip to content

Commit 114143a

Browse files
committed
Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 updates from Will Deacon: "The highlights are support for Arm's "Permission Overlay Extension" using memory protection keys, support for running as a protected guest on Android as well as perf support for a bunch of new interconnect PMUs. Summary: ACPI: - Enable PMCG erratum workaround for HiSilicon HIP10 and 11 platforms. - Ensure arm64-specific IORT header is covered by MAINTAINERS. CPU Errata: - Enable workaround for hardware access/dirty issue on Ampere-1A cores. Memory management: - Define PHYSMEM_END to fix a crash in the amdgpu driver. - Avoid tripping over invalid kernel mappings on the kexec() path. - Userspace support for the Permission Overlay Extension (POE) using protection keys. Perf and PMUs: - Add support for the "fixed instruction counter" extension in the CPU PMU architecture. - Extend and fix the event encodings for Apple's M1 CPU PMU. - Allow LSM hooks to decide on SPE permissions for physical profiling. - Add support for the CMN S3 and NI-700 PMUs. Confidential Computing: - Add support for booting an arm64 kernel as a protected guest under Android's "Protected KVM" (pKVM) hypervisor. Selftests: - Fix vector length issues in the SVE/SME sigreturn tests - Fix build warning in the ptrace tests. Timers: - Add support for PR_{G,S}ET_TSC so that 'rr' can deal with non-determinism arising from the architected counter. Miscellaneous: - Rework our IPI-based CPU stopping code to try NMIs if regular IPIs don't succeed. - Minor fixes and cleanups" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (94 commits) perf: arm-ni: Fix an NULL vs IS_ERR() bug arm64: hibernate: Fix warning for cast from restricted gfp_t arm64: esr: Define ESR_ELx_EC_* constants as UL arm64: pkeys: remove redundant WARN perf: arm_pmuv3: Use BR_RETIRED for HW branch event if enabled MAINTAINERS: List Arm interconnect PMUs as supported perf: Add driver for Arm NI-700 interconnect PMU dt-bindings/perf: Add Arm NI-700 PMU perf/arm-cmn: Improve format attr printing perf/arm-cmn: Clean up unnecessary NUMA_NO_NODE check arm64/mm: use lm_alias() with addresses passed to memblock_free() mm: arm64: document why pte is not advanced in contpte_ptep_set_access_flags() arm64: Expose the end of the linear map in PHYSMEM_END arm64: trans_pgd: mark PTEs entries as valid to avoid dead kexec() arm64/mm: Delete __init region from memblock.reserved perf/arm-cmn: Support CMN S3 dt-bindings: perf: arm-cmn: Add CMN S3 perf/arm-cmn: Refactor DTC PMU register access perf/arm-cmn: Make cycle counts less surprising perf/arm-cmn: Improve build-time assertion ...
2 parents 8617d7d + 75078ba commit 114143a

File tree

125 files changed

+3393
-891
lines changed

Some content is hidden

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

125 files changed

+3393
-891
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
====================================
2+
Arm Network-on Chip Interconnect PMU
3+
====================================
4+
5+
NI-700 and friends implement a distinct PMU for each clock domain within the
6+
interconnect. Correspondingly, the driver exposes multiple PMU devices named
7+
arm_ni_<x>_cd_<y>, where <x> is an (arbitrary) instance identifier and <y> is
8+
the clock domain ID within that particular instance. If multiple NI instances
9+
exist within a system, the PMU devices can be correlated with the underlying
10+
hardware instance via sysfs parentage.
11+
12+
Each PMU exposes base event aliases for the interface types present in its clock
13+
domain. These require qualifying with the "eventid" and "nodeid" parameters
14+
to specify the event code to count and the interface at which to count it
15+
(per the configured hardware ID as reflected in the xxNI_NODE_INFO register).
16+
The exception is the "cycles" alias for the PMU cycle counter, which is encoded
17+
with the PMU node type and needs no further qualification.

Documentation/admin-guide/perf/dwc_pcie_pmu.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ Some of the events only exist for specific configurations.
4646
DesignWare Cores (DWC) PCIe PMU Driver
4747
=======================================
4848

49-
This driver adds PMU devices for each PCIe Root Port named based on the BDF of
49+
This driver adds PMU devices for each PCIe Root Port named based on the SBDF of
5050
the Root Port. For example,
5151

52-
30:03.0 PCI bridge: Device 1ded:8000 (rev 01)
52+
0001:30:03.0 PCI bridge: Device 1ded:8000 (rev 01)
5353

54-
the PMU device name for this Root Port is dwc_rootport_3018.
54+
the PMU device name for this Root Port is dwc_rootport_13018.
5555

5656
The DWC PCIe PMU driver registers a perf PMU driver, which provides
5757
description of available events and configuration options in sysfs, see
58-
/sys/bus/event_source/devices/dwc_rootport_{bdf}.
58+
/sys/bus/event_source/devices/dwc_rootport_{sbdf}.
5959

6060
The "format" directory describes format of the config fields of the
6161
perf_event_attr structure. The "events" directory provides configuration
@@ -66,16 +66,16 @@ The "perf list" command shall list the available events from sysfs, e.g.::
6666

6767
$# perf list | grep dwc_rootport
6868
<...>
69-
dwc_rootport_3018/Rx_PCIe_TLP_Data_Payload/ [Kernel PMU event]
69+
dwc_rootport_13018/Rx_PCIe_TLP_Data_Payload/ [Kernel PMU event]
7070
<...>
71-
dwc_rootport_3018/rx_memory_read,lane=?/ [Kernel PMU event]
71+
dwc_rootport_13018/rx_memory_read,lane=?/ [Kernel PMU event]
7272

7373
Time Based Analysis Event Usage
7474
-------------------------------
7575

7676
Example usage of counting PCIe RX TLP data payload (Units of bytes)::
7777

78-
$# perf stat -a -e dwc_rootport_3018/Rx_PCIe_TLP_Data_Payload/
78+
$# perf stat -a -e dwc_rootport_13018/Rx_PCIe_TLP_Data_Payload/
7979

8080
The average RX/TX bandwidth can be calculated using the following formula:
8181

@@ -88,7 +88,7 @@ Lane Event Usage
8888
Each lane has the same event set and to avoid generating a list of hundreds
8989
of events, the user need to specify the lane ID explicitly, e.g.::
9090

91-
$# perf stat -a -e dwc_rootport_3018/rx_memory_read,lane=4/
91+
$# perf stat -a -e dwc_rootport_13018/rx_memory_read,lane=4/
9292

9393
The driver does not support sampling, therefore "perf record" will not
9494
work. Per-task (without "-a") perf sessions are not supported.

Documentation/admin-guide/perf/hisi-pcie-pmu.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ The "identifier" sysfs file allows users to identify the version of the
2828
PMU hardware device.
2929

3030
The "bus" sysfs file allows users to get the bus number of Root Ports
31-
monitored by PMU.
31+
monitored by PMU. Furthermore users can get the Root Ports range in
32+
[bdf_min, bdf_max] from "bdf_min" and "bdf_max" sysfs attributes
33+
respectively.
3234

3335
Example usage of perf::
3436

Documentation/admin-guide/perf/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Performance monitor support
1616
starfive_starlink_pmu
1717
arm-ccn
1818
arm-cmn
19+
arm-ni
1920
xgene-pmu
2021
arm_dsu_pmu
2122
thunderx2-pmu

Documentation/arch/arm64/elf_hwcaps.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ HWCAP2_SME_SF8DP2
365365
HWCAP2_SME_SF8DP4
366366
Functionality implied by ID_AA64SMFR0_EL1.SF8DP4 == 0b1.
367367

368+
HWCAP2_POE
369+
Functionality implied by ID_AA64MMFR3_EL1.S1POE == 0b0001.
368370

369371
4. Unused AT_HWCAP bits
370372
-----------------------

Documentation/arch/arm64/silicon-errata.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ stable kernels.
5555
+----------------+-----------------+-----------------+-----------------------------+
5656
| Ampere | AmpereOne | AC03_CPU_38 | AMPERE_ERRATUM_AC03_CPU_38 |
5757
+----------------+-----------------+-----------------+-----------------------------+
58+
| Ampere | AmpereOne AC04 | AC04_CPU_10 | AMPERE_ERRATUM_AC03_CPU_38 |
59+
+----------------+-----------------+-----------------+-----------------------------+
5860
+----------------+-----------------+-----------------+-----------------------------+
5961
| ARM | Cortex-A510 | #2457168 | ARM64_ERRATUM_2457168 |
6062
+----------------+-----------------+-----------------+-----------------------------+
@@ -249,8 +251,8 @@ stable kernels.
249251
+----------------+-----------------+-----------------+-----------------------------+
250252
| Hisilicon | Hip08 SMMU PMCG | #162001800 | N/A |
251253
+----------------+-----------------+-----------------+-----------------------------+
252-
| Hisilicon | Hip08 SMMU PMCG | #162001900 | N/A |
253-
| | Hip09 SMMU PMCG | | |
254+
| Hisilicon | Hip{08,09,10,10C| #162001900 | N/A |
255+
| | ,11} SMMU PMCG | | |
254256
+----------------+-----------------+-----------------+-----------------------------+
255257
+----------------+-----------------+-----------------+-----------------------------+
256258
| Qualcomm Tech. | Kryo/Falkor v1 | E1003 | QCOM_FALKOR_ERRATUM_1003 |

Documentation/devicetree/bindings/perf/arm,cmn.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ properties:
1616
- arm,cmn-600
1717
- arm,cmn-650
1818
- arm,cmn-700
19+
- arm,cmn-s3
1920
- arm,ci-700
2021

2122
reg:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/perf/arm,ni.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Arm NI (Network-on-Chip Interconnect) Performance Monitors
8+
9+
maintainers:
10+
- Robin Murphy <[email protected]>
11+
12+
properties:
13+
compatible:
14+
const: arm,ni-700
15+
16+
reg:
17+
items:
18+
- description: Complete configuration register space
19+
20+
interrupts:
21+
minItems: 1
22+
maxItems: 32
23+
description: Overflow interrupts, one per clock domain, in order of domain ID
24+
25+
required:
26+
- compatible
27+
- reg
28+
- interrupts
29+
30+
additionalProperties: false

Documentation/virt/kvm/arm/hypercalls.rst

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,101 @@ Provides a discovery mechanism for other KVM/arm64 hypercalls.
4444
----------------------------------------
4545

4646
See ptp_kvm.rst
47+
48+
``ARM_SMCCC_KVM_FUNC_HYP_MEMINFO``
49+
----------------------------------
50+
51+
Query the memory protection parameters for a pKVM protected virtual machine.
52+
53+
+---------------------+-------------------------------------------------------------+
54+
| Presence: | Optional; pKVM protected guests only. |
55+
+---------------------+-------------------------------------------------------------+
56+
| Calling convention: | HVC64 |
57+
+---------------------+----------+--------------------------------------------------+
58+
| Function ID: | (uint32) | 0xC6000002 |
59+
+---------------------+----------+----+---------------------------------------------+
60+
| Arguments: | (uint64) | R1 | Reserved / Must be zero |
61+
| +----------+----+---------------------------------------------+
62+
| | (uint64) | R2 | Reserved / Must be zero |
63+
| +----------+----+---------------------------------------------+
64+
| | (uint64) | R3 | Reserved / Must be zero |
65+
+---------------------+----------+----+---------------------------------------------+
66+
| Return Values: | (int64) | R0 | ``INVALID_PARAMETER (-3)`` on error, else |
67+
| | | | memory protection granule in bytes |
68+
+---------------------+----------+----+---------------------------------------------+
69+
70+
``ARM_SMCCC_KVM_FUNC_MEM_SHARE``
71+
--------------------------------
72+
73+
Share a region of memory with the KVM host, granting it read, write and execute
74+
permissions. The size of the region is equal to the memory protection granule
75+
advertised by ``ARM_SMCCC_KVM_FUNC_HYP_MEMINFO``.
76+
77+
+---------------------+-------------------------------------------------------------+
78+
| Presence: | Optional; pKVM protected guests only. |
79+
+---------------------+-------------------------------------------------------------+
80+
| Calling convention: | HVC64 |
81+
+---------------------+----------+--------------------------------------------------+
82+
| Function ID: | (uint32) | 0xC6000003 |
83+
+---------------------+----------+----+---------------------------------------------+
84+
| Arguments: | (uint64) | R1 | Base IPA of memory region to share |
85+
| +----------+----+---------------------------------------------+
86+
| | (uint64) | R2 | Reserved / Must be zero |
87+
| +----------+----+---------------------------------------------+
88+
| | (uint64) | R3 | Reserved / Must be zero |
89+
+---------------------+----------+----+---------------------------------------------+
90+
| Return Values: | (int64) | R0 | ``SUCCESS (0)`` |
91+
| | | +---------------------------------------------+
92+
| | | | ``INVALID_PARAMETER (-3)`` |
93+
+---------------------+----------+----+---------------------------------------------+
94+
95+
``ARM_SMCCC_KVM_FUNC_MEM_UNSHARE``
96+
----------------------------------
97+
98+
Revoke access permission from the KVM host to a memory region previously shared
99+
with ``ARM_SMCCC_KVM_FUNC_MEM_SHARE``. The size of the region is equal to the
100+
memory protection granule advertised by ``ARM_SMCCC_KVM_FUNC_HYP_MEMINFO``.
101+
102+
+---------------------+-------------------------------------------------------------+
103+
| Presence: | Optional; pKVM protected guests only. |
104+
+---------------------+-------------------------------------------------------------+
105+
| Calling convention: | HVC64 |
106+
+---------------------+----------+--------------------------------------------------+
107+
| Function ID: | (uint32) | 0xC6000004 |
108+
+---------------------+----------+----+---------------------------------------------+
109+
| Arguments: | (uint64) | R1 | Base IPA of memory region to unshare |
110+
| +----------+----+---------------------------------------------+
111+
| | (uint64) | R2 | Reserved / Must be zero |
112+
| +----------+----+---------------------------------------------+
113+
| | (uint64) | R3 | Reserved / Must be zero |
114+
+---------------------+----------+----+---------------------------------------------+
115+
| Return Values: | (int64) | R0 | ``SUCCESS (0)`` |
116+
| | | +---------------------------------------------+
117+
| | | | ``INVALID_PARAMETER (-3)`` |
118+
+---------------------+----------+----+---------------------------------------------+
119+
120+
``ARM_SMCCC_KVM_FUNC_MMIO_GUARD``
121+
----------------------------------
122+
123+
Request that a given memory region is handled as MMIO by the hypervisor,
124+
allowing accesses to this region to be emulated by the KVM host. The size of the
125+
region is equal to the memory protection granule advertised by
126+
``ARM_SMCCC_KVM_FUNC_HYP_MEMINFO``.
127+
128+
+---------------------+-------------------------------------------------------------+
129+
| Presence: | Optional; pKVM protected guests only. |
130+
+---------------------+-------------------------------------------------------------+
131+
| Calling convention: | HVC64 |
132+
+---------------------+----------+--------------------------------------------------+
133+
| Function ID: | (uint32) | 0xC6000007 |
134+
+---------------------+----------+----+---------------------------------------------+
135+
| Arguments: | (uint64) | R1 | Base IPA of MMIO memory region |
136+
| +----------+----+---------------------------------------------+
137+
| | (uint64) | R2 | Reserved / Must be zero |
138+
| +----------+----+---------------------------------------------+
139+
| | (uint64) | R3 | Reserved / Must be zero |
140+
+---------------------+----------+----+---------------------------------------------+
141+
| Return Values: | (int64) | R0 | ``SUCCESS (0)`` |
142+
| | | +---------------------------------------------+
143+
| | | | ``INVALID_PARAMETER (-3)`` |
144+
+---------------------+----------+----+---------------------------------------------+

MAINTAINERS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ L: [email protected]
334334
L: [email protected] (moderated for non-subscribers)
335335
S: Maintained
336336
F: drivers/acpi/arm64
337+
F: include/linux/acpi_iort.h
337338

338339
ACPI FOR RISC-V (ACPI/riscv)
339340
M: Sunil V L <[email protected]>
@@ -1752,6 +1753,17 @@ F: drivers/mtd/maps/physmap-versatile.*
17521753
F: drivers/power/reset/arm-versatile-reboot.c
17531754
F: drivers/soc/versatile/
17541755

1756+
ARM INTERCONNECT PMU DRIVERS
1757+
M: Robin Murphy <[email protected]>
1758+
S: Supported
1759+
F: Documentation/admin-guide/perf/arm-cmn.rst
1760+
F: Documentation/admin-guide/perf/arm-ni.rst
1761+
F: Documentation/devicetree/bindings/perf/arm,cmn.yaml
1762+
F: Documentation/devicetree/bindings/perf/arm,ni.yaml
1763+
F: drivers/perf/arm-cmn.c
1764+
F: drivers/perf/arm-ni.c
1765+
F: tools/perf/pmu-events/arch/arm64/arm/cmn/
1766+
17551767
ARM KOMEDA DRM-KMS DRIVER
17561768
M: Liviu Dudau <[email protected]>
17571769
S: Supported

0 commit comments

Comments
 (0)