Skip to content

Commit 145ff1e

Browse files
committed
Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 and cross-arch updates from Catalin Marinas: "Here's a slightly wider-spread set of updates for 5.9. Going outside the usual arch/arm64/ area is the removal of read_barrier_depends() series from Will and the MSI/IOMMU ID translation series from Lorenzo. The notable arm64 updates include ARMv8.4 TLBI range operations and translation level hint, time namespace support, and perf. Summary: - Removal of the tremendously unpopular read_barrier_depends() barrier, which is a NOP on all architectures apart from Alpha, in favour of allowing architectures to override READ_ONCE() and do whatever dance they need to do to ensure address dependencies provide LOAD -> LOAD/STORE ordering. This work also offers a potential solution if compilers are shown to convert LOAD -> LOAD address dependencies into control dependencies (e.g. under LTO), as weakly ordered architectures will effectively be able to upgrade READ_ONCE() to smp_load_acquire(). The latter case is not used yet, but will be discussed further at LPC. - Make the MSI/IOMMU input/output ID translation PCI agnostic, augment the MSI/IOMMU ACPI/OF ID mapping APIs to accept an input ID bus-specific parameter and apply the resulting changes to the device ID space provided by the Freescale FSL bus. - arm64 support for TLBI range operations and translation table level hints (part of the ARMv8.4 architecture version). - Time namespace support for arm64. - Export the virtual and physical address sizes in vmcoreinfo for makedumpfile and crash utilities. - CPU feature handling cleanups and checks for programmer errors (overlapping bit-fields). - ACPI updates for arm64: disallow AML accesses to EFI code regions and kernel memory. - perf updates for arm64. - Miscellaneous fixes and cleanups, most notably PLT counting optimisation for module loading, recordmcount fix to ignore relocations other than R_AARCH64_CALL26, CMA areas reserved for gigantic pages on 16K and 64K configurations. - Trivial typos, duplicate words" Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (82 commits) arm64: use IRQ_STACK_SIZE instead of THREAD_SIZE for irq stack arm64/mm: save memory access in check_and_switch_context() fast switch path arm64: sigcontext.h: delete duplicated word arm64: ptrace.h: delete duplicated word arm64: pgtable-hwdef.h: delete duplicated words bus: fsl-mc: Add ACPI support for fsl-mc bus/fsl-mc: Refactor the MSI domain creation in the DPRC driver of/irq: Make of_msi_map_rid() PCI bus agnostic of/irq: make of_msi_map_get_device_domain() bus agnostic dt-bindings: arm: fsl: Add msi-map device-tree binding for fsl-mc bus of/device: Add input id to of_dma_configure() of/iommu: Make of_map_rid() PCI agnostic ACPI/IORT: Add an input ID to acpi_dma_configure() ACPI/IORT: Remove useless PCI bus walk ACPI/IORT: Make iort_msi_map_rid() PCI agnostic ACPI/IORT: Make iort_get_device_domain IRQ domain agnostic ACPI/IORT: Make iort_match_node_callback walk the ACPI namespace for NC arm64: enable time namespace support arm64/vdso: Restrict splitting VVAR VMA arm64/vdso: Handle faults on timens page ...
2 parents 8c4e1c0 + 0e4cd9f commit 145ff1e

File tree

98 files changed

+1892
-1091
lines changed

Some content is hidden

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

98 files changed

+1892
-1091
lines changed

Documentation/RCU/Design/Requirements/Requirements.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ again without disrupting RCU readers.
463463
This guarantee was only partially premeditated. DYNIX/ptx used an
464464
explicit memory barrier for publication, but had nothing resembling
465465
``rcu_dereference()`` for subscription, nor did it have anything
466-
resembling the ``smp_read_barrier_depends()`` that was later subsumed
466+
resembling the dependency-ordering barrier that was later subsumed
467467
into ``rcu_dereference()`` and later still into ``READ_ONCE()``. The
468468
need for these operations made itself known quite suddenly at a
469469
late-1990s meeting with the DEC Alpha architects, back in the days when

Documentation/admin-guide/kdump/vmcoreinfo.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ It exists in the sparse memory mapping model, and it is also somewhat
9393
similar to the mem_map variable, both of them are used to translate an
9494
address.
9595

96+
MAX_PHYSMEM_BITS
97+
----------------
98+
99+
Defines the maximum supported physical address space memory.
100+
96101
page
97102
----
98103

@@ -399,6 +404,17 @@ KERNELPACMASK
399404
The mask to extract the Pointer Authentication Code from a kernel virtual
400405
address.
401406

407+
TCR_EL1.T1SZ
408+
------------
409+
410+
Indicates the size offset of the memory region addressed by TTBR1_EL1.
411+
The region size is 2^(64-T1SZ) bytes.
412+
413+
TTBR1_EL1 is the table base address register specified by ARMv8-A
414+
architecture which is used to lookup the page-tables for the Virtual
415+
addresses in the higher VA range (refer to ARMv8 ARM document for
416+
more details).
417+
402418
arm
403419
===
404420

Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ Documentation/devicetree/bindings/iommu/iommu.txt.
2828
For arm-smmu binding, see:
2929
Documentation/devicetree/bindings/iommu/arm,smmu.yaml.
3030

31+
The MSI writes are accompanied by sideband data which is derived from the ICID.
32+
The msi-map property is used to associate the devices with both the ITS
33+
controller and the sideband data which accompanies the writes.
34+
35+
For generic MSI bindings, see
36+
Documentation/devicetree/bindings/interrupt-controller/msi.txt.
37+
38+
For GICv3 and GIC ITS bindings, see:
39+
Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml.
40+
3141
Required properties:
3242

3343
- compatible
@@ -49,11 +59,6 @@ Required properties:
4959
region may not be present in some scenarios, such
5060
as in the device tree presented to a virtual machine.
5161

52-
- msi-parent
53-
Value type: <phandle>
54-
Definition: Must be present and point to the MSI controller node
55-
handling message interrupts for the MC.
56-
5762
- ranges
5863
Value type: <prop-encoded-array>
5964
Definition: A standard property. Defines the mapping between the child
@@ -119,6 +124,28 @@ Optional properties:
119124
associated with the listed IOMMU, with the iommu-specifier
120125
(i - icid-base + iommu-base).
121126

127+
- msi-map: Maps an ICID to a GIC ITS and associated msi-specifier
128+
data.
129+
130+
The property is an arbitrary number of tuples of
131+
(icid-base,gic-its,msi-base,length).
132+
133+
Any ICID in the interval [icid-base, icid-base + length) is
134+
associated with the listed GIC ITS, with the msi-specifier
135+
(i - icid-base + msi-base).
136+
137+
Deprecated properties:
138+
139+
- msi-parent
140+
Value type: <phandle>
141+
Definition: Describes the MSI controller node handling message
142+
interrupts for the MC. When there is no translation
143+
between the ICID and deviceID this property can be used
144+
to describe the MSI controller used by the devices on the
145+
mc-bus.
146+
The use of this property for mc-bus is deprecated. Please
147+
use msi-map.
148+
122149
Example:
123150

124151
smmu: iommu@5000000 {
@@ -128,13 +155,24 @@ Example:
128155
...
129156
};
130157

158+
gic: interrupt-controller@6000000 {
159+
compatible = "arm,gic-v3";
160+
...
161+
}
162+
its: gic-its@6020000 {
163+
compatible = "arm,gic-v3-its";
164+
msi-controller;
165+
...
166+
};
167+
131168
fsl_mc: fsl-mc@80c000000 {
132169
compatible = "fsl,qoriq-mc";
133170
reg = <0x00000008 0x0c000000 0 0x40>, /* MC portal base */
134171
<0x00000000 0x08340000 0 0x40000>; /* MC control reg */
135-
msi-parent = <&its>;
136172
/* define map for ICIDs 23-64 */
137173
iommu-map = <23 &smmu 23 41>;
174+
/* define msi map for ICIDs 23-64 */
175+
msi-map = <23 &its 23 41>;
138176
#address-cells = <3>;
139177
#size-cells = <1>;
140178

Documentation/memory-barriers.txt

Lines changed: 8 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -553,12 +553,12 @@ There are certain things that the Linux kernel memory barriers do not guarantee:
553553
DATA DEPENDENCY BARRIERS (HISTORICAL)
554554
-------------------------------------
555555

556-
As of v4.15 of the Linux kernel, an smp_read_barrier_depends() was
557-
added to READ_ONCE(), which means that about the only people who
558-
need to pay attention to this section are those working on DEC Alpha
559-
architecture-specific code and those working on READ_ONCE() itself.
560-
For those who need it, and for those who are interested in the history,
561-
here is the story of data-dependency barriers.
556+
As of v4.15 of the Linux kernel, an smp_mb() was added to READ_ONCE() for
557+
DEC Alpha, which means that about the only people who need to pay attention
558+
to this section are those working on DEC Alpha architecture-specific code
559+
and those working on READ_ONCE() itself. For those who need it, and for
560+
those who are interested in the history, here is the story of
561+
data-dependency barriers.
562562

563563
The usage requirements of data dependency barriers are a little subtle, and
564564
it's not always obvious that they're needed. To illustrate, consider the
@@ -2708,144 +2708,6 @@ the properties of the memory window through which devices are accessed and/or
27082708
the use of any special device communication instructions the CPU may have.
27092709

27102710

2711-
CACHE COHERENCY
2712-
---------------
2713-
2714-
Life isn't quite as simple as it may appear above, however: for while the
2715-
caches are expected to be coherent, there's no guarantee that that coherency
2716-
will be ordered. This means that while changes made on one CPU will
2717-
eventually become visible on all CPUs, there's no guarantee that they will
2718-
become apparent in the same order on those other CPUs.
2719-
2720-
2721-
Consider dealing with a system that has a pair of CPUs (1 & 2), each of which
2722-
has a pair of parallel data caches (CPU 1 has A/B, and CPU 2 has C/D):
2723-
2724-
:
2725-
: +--------+
2726-
: +---------+ | |
2727-
+--------+ : +--->| Cache A |<------->| |
2728-
| | : | +---------+ | |
2729-
| CPU 1 |<---+ | |
2730-
| | : | +---------+ | |
2731-
+--------+ : +--->| Cache B |<------->| |
2732-
: +---------+ | |
2733-
: | Memory |
2734-
: +---------+ | System |
2735-
+--------+ : +--->| Cache C |<------->| |
2736-
| | : | +---------+ | |
2737-
| CPU 2 |<---+ | |
2738-
| | : | +---------+ | |
2739-
+--------+ : +--->| Cache D |<------->| |
2740-
: +---------+ | |
2741-
: +--------+
2742-
:
2743-
2744-
Imagine the system has the following properties:
2745-
2746-
(*) an odd-numbered cache line may be in cache A, cache C or it may still be
2747-
resident in memory;
2748-
2749-
(*) an even-numbered cache line may be in cache B, cache D or it may still be
2750-
resident in memory;
2751-
2752-
(*) while the CPU core is interrogating one cache, the other cache may be
2753-
making use of the bus to access the rest of the system - perhaps to
2754-
displace a dirty cacheline or to do a speculative load;
2755-
2756-
(*) each cache has a queue of operations that need to be applied to that cache
2757-
to maintain coherency with the rest of the system;
2758-
2759-
(*) the coherency queue is not flushed by normal loads to lines already
2760-
present in the cache, even though the contents of the queue may
2761-
potentially affect those loads.
2762-
2763-
Imagine, then, that two writes are made on the first CPU, with a write barrier
2764-
between them to guarantee that they will appear to reach that CPU's caches in
2765-
the requisite order:
2766-
2767-
CPU 1 CPU 2 COMMENT
2768-
=============== =============== =======================================
2769-
u == 0, v == 1 and p == &u, q == &u
2770-
v = 2;
2771-
smp_wmb(); Make sure change to v is visible before
2772-
change to p
2773-
<A:modify v=2> v is now in cache A exclusively
2774-
p = &v;
2775-
<B:modify p=&v> p is now in cache B exclusively
2776-
2777-
The write memory barrier forces the other CPUs in the system to perceive that
2778-
the local CPU's caches have apparently been updated in the correct order. But
2779-
now imagine that the second CPU wants to read those values:
2780-
2781-
CPU 1 CPU 2 COMMENT
2782-
=============== =============== =======================================
2783-
...
2784-
q = p;
2785-
x = *q;
2786-
2787-
The above pair of reads may then fail to happen in the expected order, as the
2788-
cacheline holding p may get updated in one of the second CPU's caches while
2789-
the update to the cacheline holding v is delayed in the other of the second
2790-
CPU's caches by some other cache event:
2791-
2792-
CPU 1 CPU 2 COMMENT
2793-
=============== =============== =======================================
2794-
u == 0, v == 1 and p == &u, q == &u
2795-
v = 2;
2796-
smp_wmb();
2797-
<A:modify v=2> <C:busy>
2798-
<C:queue v=2>
2799-
p = &v; q = p;
2800-
<D:request p>
2801-
<B:modify p=&v> <D:commit p=&v>
2802-
<D:read p>
2803-
x = *q;
2804-
<C:read *q> Reads from v before v updated in cache
2805-
<C:unbusy>
2806-
<C:commit v=2>
2807-
2808-
Basically, while both cachelines will be updated on CPU 2 eventually, there's
2809-
no guarantee that, without intervention, the order of update will be the same
2810-
as that committed on CPU 1.
2811-
2812-
2813-
To intervene, we need to interpolate a data dependency barrier or a read
2814-
barrier between the loads (which as of v4.15 is supplied unconditionally
2815-
by the READ_ONCE() macro). This will force the cache to commit its
2816-
coherency queue before processing any further requests:
2817-
2818-
CPU 1 CPU 2 COMMENT
2819-
=============== =============== =======================================
2820-
u == 0, v == 1 and p == &u, q == &u
2821-
v = 2;
2822-
smp_wmb();
2823-
<A:modify v=2> <C:busy>
2824-
<C:queue v=2>
2825-
p = &v; q = p;
2826-
<D:request p>
2827-
<B:modify p=&v> <D:commit p=&v>
2828-
<D:read p>
2829-
smp_read_barrier_depends()
2830-
<C:unbusy>
2831-
<C:commit v=2>
2832-
x = *q;
2833-
<C:read *q> Reads from v after v updated in cache
2834-
2835-
2836-
This sort of problem can be encountered on DEC Alpha processors as they have a
2837-
split cache that improves performance by making better use of the data bus.
2838-
While most CPUs do imply a data dependency barrier on the read when a memory
2839-
access depends on a read, not all do, so it may not be relied on.
2840-
2841-
Other CPUs may also have split caches, but must coordinate between the various
2842-
cachelets for normal memory accesses. The semantics of the Alpha removes the
2843-
need for hardware coordination in the absence of memory barriers, which
2844-
permitted Alpha to sport higher CPU clock rates back in the day. However,
2845-
please note that (again, as of v4.15) smp_read_barrier_depends() should not
2846-
be used except in Alpha arch-specific code and within the READ_ONCE() macro.
2847-
2848-
28492711
CACHE COHERENCY VS DMA
28502712
----------------------
28512713

@@ -3009,10 +2871,8 @@ caches with the memory coherence system, thus making it seem like pointer
30092871
changes vs new data occur in the right order.
30102872

30112873
The Alpha defines the Linux kernel's memory model, although as of v4.15
3012-
the Linux kernel's addition of smp_read_barrier_depends() to READ_ONCE()
3013-
greatly reduced Alpha's impact on the memory model.
3014-
3015-
See the subsection on "Cache Coherency" above.
2874+
the Linux kernel's addition of smp_mb() to READ_ONCE() on Alpha greatly
2875+
reduced its impact on the memory model.
30162876

30172877

30182878
VIRTUAL MACHINE GUESTS

0 commit comments

Comments
 (0)