Skip to content

Commit 4e6bd13

Browse files
committed
Merge branch 'iommufd/arm-smmuv3-nested' of iommu/linux into iommufd for-next
Common SMMUv3 patches for the following patches adding nesting, shared branch with the iommu tree. * 'iommufd/arm-smmuv3-nested' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/iommu/linux: iommu/arm-smmu-v3: Expose the arm_smmu_attach interface iommu/arm-smmu-v3: Implement IOMMU_HWPT_ALLOC_NEST_PARENT iommu/arm-smmu-v3: Support IOMMU_GET_HW_INFO via struct arm_smmu_hw_info iommu/arm-smmu-v3: Report IOMMU_CAP_ENFORCE_CACHE_COHERENCY for CANWBS ACPI/IORT: Support CANWBS memory access flag ACPICA: IORT: Update for revision E.f vfio: Remove VFIO_TYPE1_NESTING_IOMMU ... Signed-off-by: Jason Gunthorpe <[email protected]>
2 parents b047c06 + f6681ab commit 4e6bd13

File tree

1,549 files changed

+10856
-8549
lines changed

Some content is hidden

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

1,549 files changed

+10856
-8549
lines changed

.mailmap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,16 @@ Ezequiel Garcia <[email protected]> <[email protected]>
203203
204204
205205
206+
206207
Felipe W Damasio <[email protected]>
207208
Felix Kuhling <[email protected]>
208209
Felix Moeller <[email protected]>
209210
210211
Filipe Lautert <[email protected]>
211212
213+
Fiona Behrens <[email protected]>
214+
215+
212216
Franck Bui-Huu <[email protected]>
213217
214218

CREDITS

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,10 +1358,6 @@ D: Major kbuild rework during the 2.5 cycle
13581358
D: ISDN Maintainer
13591359
S: USA
13601360

1361-
N: Gerrit Renker
1362-
1363-
D: DCCP protocol support.
1364-
13651361
N: Philip Gladstone
13661362
13671363
D: Kernel / timekeeping stuff
@@ -1677,11 +1673,6 @@ W: http://www.carumba.com/
16771673
D: bug toaster (A1 sauce makes all the difference)
16781674
D: Random linux hacker
16791675

1680-
N: James Hogan
1681-
1682-
D: Metag architecture maintainer
1683-
D: TZ1090 SoC maintainer
1684-
16851676
N: Tim Hockin
16861677
16871678
W: http://www.hockin.org/~thockin
@@ -1697,6 +1688,11 @@ D: hwmon subsystem maintainer
16971688
D: i2c-sis96x and i2c-stub SMBus drivers
16981689
S: USA
16991690

1691+
N: James Hogan
1692+
1693+
D: Metag architecture maintainer
1694+
D: TZ1090 SoC maintainer
1695+
17001696
N: Dirk Hohndel
17011697
17021698
D: The XFree86[tm] Project
@@ -1872,6 +1868,10 @@ S: K osmidomkum 723
18721868
S: 160 00 Praha 6
18731869
S: Czech Republic
18741870

1871+
N: Seth Jennings
1872+
1873+
D: Creation and maintenance of zswap
1874+
18751875
N: Jeremy Kerr
18761876
D: Maintainer of SPU File System
18771877

@@ -2188,19 +2188,6 @@ N: Mike Kravetz
21882188
21892189
D: Maintenance and development of the hugetlb subsystem
21902190

2191-
N: Seth Jennings
2192-
2193-
D: Creation and maintenance of zswap
2194-
2195-
N: Dan Streetman
2196-
2197-
D: Maintenance and development of zswap
2198-
D: Creation and maintenance of the zpool API
2199-
2200-
N: Vitaly Wool
2201-
2202-
D: Maintenance and development of zswap
2203-
22042191
N: Andreas S. Krebs
22052192
22062193
D: CYPRESS CY82C693 chipset IDE, Digital's PC-Alpha 164SX boards
@@ -3191,6 +3178,11 @@ N: Ken Pizzini
31913178
31923179
D: CDROM driver "sonycd535" (Sony CDU-535/531)
31933180

3181+
N: Mathieu Poirier
3182+
3183+
D: CoreSight kernel subsystem, Maintainer 2014-2022
3184+
D: Perf tool support for CoreSight
3185+
31943186
N: Stelian Pop
31953187
31963188
P: 1024D/EDBB6147 7B36 0E07 04BC 11DC A7A0 D3F7 7185 9E7A EDBB 6147
@@ -3300,6 +3292,10 @@ S: Schlossbergring 9
33003292
S: 79098 Freiburg
33013293
S: Germany
33023294

3295+
N: Gerrit Renker
3296+
3297+
D: DCCP protocol support.
3298+
33033299
N: Thomas Renninger
33043300
33053301
D: cpupowerutils
@@ -3576,11 +3572,6 @@ D: several improvements to system programs
35763572
S: Oldenburg
35773573
S: Germany
35783574

3579-
N: Mathieu Poirier
3580-
3581-
D: CoreSight kernel subsystem, Maintainer 2014-2022
3582-
D: Perf tool support for CoreSight
3583-
35843575
N: Robert Schwebel
35853576
35863577
W: https://www.schwebel.de
@@ -3771,6 +3762,11 @@ S: Chr. Winthersvej 1 B, st.th.
37713762
S: DK-1860 Frederiksberg C
37723763
S: Denmark
37733764

3765+
N: Dan Streetman
3766+
3767+
D: Maintenance and development of zswap
3768+
D: Creation and maintenance of the zpool API
3769+
37743770
N: Drew Sullivan
37753771
37763772
W: http://www.ss.org/
@@ -4286,6 +4282,10 @@ S: Pipers Way
42864282
S: Swindon. SN3 1RJ
42874283
S: England
42884284

4285+
N: Vitaly Wool
4286+
4287+
D: Maintenance and development of zswap
4288+
42894289
N: Chris Wright
42904290
42914291
D: hacking on LSM framework and security modules.

Documentation/arch/arm/mem_alignment.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ones.
1212

1313
Of course this is a bad idea to rely on the alignment trap to perform
1414
unaligned memory access in general. If those access are predictable, you
15-
are better to use the macros provided by include/asm/unaligned.h. The
15+
are better to use the macros provided by include/linux/unaligned.h. The
1616
alignment trap can fixup misaligned access for the exception cases, but at
1717
a high performance cost. It better be rare.
1818

Documentation/arch/arm64/silicon-errata.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ stable kernels.
146146
+----------------+-----------------+-----------------+-----------------------------+
147147
| ARM | Cortex-A715 | #2645198 | ARM64_ERRATUM_2645198 |
148148
+----------------+-----------------+-----------------+-----------------------------+
149+
| ARM | Cortex-A715 | #3456084 | ARM64_ERRATUM_3194386 |
150+
+----------------+-----------------+-----------------+-----------------------------+
149151
| ARM | Cortex-A720 | #3456091 | ARM64_ERRATUM_3194386 |
150152
+----------------+-----------------+-----------------+-----------------------------+
151153
| ARM | Cortex-A725 | #3456106 | ARM64_ERRATUM_3194386 |
@@ -186,6 +188,8 @@ stable kernels.
186188
+----------------+-----------------+-----------------+-----------------------------+
187189
| ARM | Neoverse-N2 | #3324339 | ARM64_ERRATUM_3194386 |
188190
+----------------+-----------------+-----------------+-----------------------------+
191+
| ARM | Neoverse-N3 | #3456111 | ARM64_ERRATUM_3194386 |
192+
+----------------+-----------------+-----------------+-----------------------------+
189193
| ARM | Neoverse-V1 | #1619801 | N/A |
190194
+----------------+-----------------+-----------------+-----------------------------+
191195
| ARM | Neoverse-V1 | #3324341 | ARM64_ERRATUM_3194386 |
@@ -289,3 +293,5 @@ stable kernels.
289293
+----------------+-----------------+-----------------+-----------------------------+
290294
| Microsoft | Azure Cobalt 100| #2253138 | ARM64_ERRATUM_2253138 |
291295
+----------------+-----------------+-----------------+-----------------------------+
296+
| Microsoft | Azure Cobalt 100| #3324339 | ARM64_ERRATUM_3194386 |
297+
+----------------+-----------------+-----------------+-----------------------------+
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
.. SPDX-License-Identifier: GPL-2.0+
2+
3+
===========
4+
Folio Queue
5+
===========
6+
7+
:Author: David Howells <[email protected]>
8+
9+
.. Contents:
10+
11+
* Overview
12+
* Initialisation
13+
* Adding and removing folios
14+
* Querying information about a folio
15+
* Querying information about a folio_queue
16+
* Folio queue iteration
17+
* Folio marks
18+
* Lockless simultaneous production/consumption issues
19+
20+
21+
Overview
22+
========
23+
24+
The folio_queue struct forms a single segment in a segmented list of folios
25+
that can be used to form an I/O buffer. As such, the list can be iterated over
26+
using the ITER_FOLIOQ iov_iter type.
27+
28+
The publicly accessible members of the structure are::
29+
30+
struct folio_queue {
31+
struct folio_queue *next;
32+
struct folio_queue *prev;
33+
...
34+
};
35+
36+
A pair of pointers are provided, ``next`` and ``prev``, that point to the
37+
segments on either side of the segment being accessed. Whilst this is a
38+
doubly-linked list, it is intentionally not a circular list; the outward
39+
sibling pointers in terminal segments should be NULL.
40+
41+
Each segment in the list also stores:
42+
43+
* an ordered sequence of folio pointers,
44+
* the size of each folio and
45+
* three 1-bit marks per folio,
46+
47+
but hese should not be accessed directly as the underlying data structure may
48+
change, but rather the access functions outlined below should be used.
49+
50+
The facility can be made accessible by::
51+
52+
#include <linux/folio_queue.h>
53+
54+
and to use the iterator::
55+
56+
#include <linux/uio.h>
57+
58+
59+
Initialisation
60+
==============
61+
62+
A segment should be initialised by calling::
63+
64+
void folioq_init(struct folio_queue *folioq);
65+
66+
with a pointer to the segment to be initialised. Note that this will not
67+
necessarily initialise all the folio pointers, so care must be taken to check
68+
the number of folios added.
69+
70+
71+
Adding and removing folios
72+
==========================
73+
74+
Folios can be set in the next unused slot in a segment struct by calling one
75+
of::
76+
77+
unsigned int folioq_append(struct folio_queue *folioq,
78+
struct folio *folio);
79+
80+
unsigned int folioq_append_mark(struct folio_queue *folioq,
81+
struct folio *folio);
82+
83+
Both functions update the stored folio count, store the folio and note its
84+
size. The second function also sets the first mark for the folio added. Both
85+
functions return the number of the slot used. [!] Note that no attempt is made
86+
to check that the capacity wasn't overrun and the list will not be extended
87+
automatically.
88+
89+
A folio can be excised by calling::
90+
91+
void folioq_clear(struct folio_queue *folioq, unsigned int slot);
92+
93+
This clears the slot in the array and also clears all the marks for that folio,
94+
but doesn't change the folio count - so future accesses of that slot must check
95+
if the slot is occupied.
96+
97+
98+
Querying information about a folio
99+
==================================
100+
101+
Information about the folio in a particular slot may be queried by the
102+
following function::
103+
104+
struct folio *folioq_folio(const struct folio_queue *folioq,
105+
unsigned int slot);
106+
107+
If a folio has not yet been set in that slot, this may yield an undefined
108+
pointer. The size of the folio in a slot may be queried with either of::
109+
110+
unsigned int folioq_folio_order(const struct folio_queue *folioq,
111+
unsigned int slot);
112+
113+
size_t folioq_folio_size(const struct folio_queue *folioq,
114+
unsigned int slot);
115+
116+
The first function returns the size as an order and the second as a number of
117+
bytes.
118+
119+
120+
Querying information about a folio_queue
121+
========================================
122+
123+
Information may be retrieved about a particular segment with the following
124+
functions::
125+
126+
unsigned int folioq_nr_slots(const struct folio_queue *folioq);
127+
128+
unsigned int folioq_count(struct folio_queue *folioq);
129+
130+
bool folioq_full(struct folio_queue *folioq);
131+
132+
The first function returns the maximum capacity of a segment. It must not be
133+
assumed that this won't vary between segments. The second returns the number
134+
of folios added to a segments and the third is a shorthand to indicate if the
135+
segment has been filled to capacity.
136+
137+
Not that the count and fullness are not affected by clearing folios from the
138+
segment. These are more about indicating how many slots in the array have been
139+
initialised, and it assumed that slots won't get reused, but rather the segment
140+
will get discarded as the queue is consumed.
141+
142+
143+
Folio marks
144+
===========
145+
146+
Folios within a queue can also have marks assigned to them. These marks can be
147+
used to note information such as if a folio needs folio_put() calling upon it.
148+
There are three marks available to be set for each folio.
149+
150+
The marks can be set by::
151+
152+
void folioq_mark(struct folio_queue *folioq, unsigned int slot);
153+
void folioq_mark2(struct folio_queue *folioq, unsigned int slot);
154+
void folioq_mark3(struct folio_queue *folioq, unsigned int slot);
155+
156+
Cleared by::
157+
158+
void folioq_unmark(struct folio_queue *folioq, unsigned int slot);
159+
void folioq_unmark2(struct folio_queue *folioq, unsigned int slot);
160+
void folioq_unmark3(struct folio_queue *folioq, unsigned int slot);
161+
162+
And the marks can be queried by::
163+
164+
bool folioq_is_marked(const struct folio_queue *folioq, unsigned int slot);
165+
bool folioq_is_marked2(const struct folio_queue *folioq, unsigned int slot);
166+
bool folioq_is_marked3(const struct folio_queue *folioq, unsigned int slot);
167+
168+
The marks can be used for any purpose and are not interpreted by this API.
169+
170+
171+
Folio queue iteration
172+
=====================
173+
174+
A list of segments may be iterated over using the I/O iterator facility using
175+
an ``iov_iter`` iterator of ``ITER_FOLIOQ`` type. The iterator may be
176+
initialised with::
177+
178+
void iov_iter_folio_queue(struct iov_iter *i, unsigned int direction,
179+
const struct folio_queue *folioq,
180+
unsigned int first_slot, unsigned int offset,
181+
size_t count);
182+
183+
This may be told to start at a particular segment, slot and offset within a
184+
queue. The iov iterator functions will follow the next pointers when advancing
185+
and prev pointers when reverting when needed.
186+
187+
188+
Lockless simultaneous production/consumption issues
189+
===================================================
190+
191+
If properly managed, the list can be extended by the producer at the head end
192+
and shortened by the consumer at the tail end simultaneously without the need
193+
to take locks. The ITER_FOLIOQ iterator inserts appropriate barriers to aid
194+
with this.
195+
196+
Care must be taken when simultaneously producing and consuming a list. If the
197+
last segment is reached and the folios it refers to are entirely consumed by
198+
the IOV iterators, an iov_iter struct will be left pointing to the last segment
199+
with a slot number equal to the capacity of that segment. The iterator will
200+
try to continue on from this if there's another segment available when it is
201+
used again, but care must be taken lest the segment got removed and freed by
202+
the consumer before the iterator was advanced.
203+
204+
It is recommended that the queue always contain at least one segment, even if
205+
that segment has never been filled or is entirely spent. This prevents the
206+
head and tail pointers from collapsing.
207+
208+
209+
API Function Reference
210+
======================
211+
212+
.. kernel-doc:: include/linux/folio_queue.h

Documentation/core-api/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Library functionality that is used throughout the kernel.
3737
kref
3838
cleanup
3939
assoc_array
40+
folio_queue
4041
xarray
4142
maple_tree
4243
idr

0 commit comments

Comments
 (0)