Commit 43c0edd
Myron Stowe
PCI: Batch BAR sizing operations
JIRA: https://issues.redhat.com/browse/RHEL-76025
Upstream Status: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=enumeration&id=4453f360862e5d9f0807941d613162c3f7a36559
In maintainer's PCI 'enumeration' branch, slated for v6.14.
https://lore.kernel.org/all/20250120224418.GA906057@bhelgaas/
commit 4453f36 (pci/enumeration)
Author: Alex Williamson <alex.williamson@redhat.com>
Date: Mon Jan 20 11:21:59 2025 -0700
PCI: Batch BAR sizing operations
Toggling memory enable is free on bare metal, but potentially expensive
in virtualized environments as the device MMIO spaces are added and
removed from the VM address space, including DMA mapping of those spaces
through the IOMMU where peer-to-peer is supported. Currently memory
decode is disabled around sizing each individual BAR, even for SR-IOV
BARs while VF Enable is cleared.
This can be better optimized for virtual environments by sizing a set
of BARs at once, stashing the resulting mask into an array, while only
toggling memory enable once. This also naturally improves the SR-IOV
path as the caller becomes responsible for any necessary decode disables
while sizing BARs, therefore SR-IOV BARs are sized relying only on the
VF Enable rather than toggling the PF memory enable in the command
register.
Link: https://lore.kernel.org/r/20250120182202.1878581-1-alex.williamson@redhat.com
Reported-by: Mitchell Augustin <mitchell.augustin@canonical.com>
Link: https://lore.kernel.org/r/CAHTA-uYp07FgM6T1OZQKqAdSA5JrZo0ReNEyZgQZub4mDRrV5w@mail.gmail.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Mitchell Augustin <mitchell.augustin@canonical.com>
Reviewed-by: Mitchell Augustin <mitchell.augustin@canonical.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Myron Stowe <mstowe@redhat.com>1 parent 8db6275 commit 43c0edd
3 files changed
+78
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
747 | 747 | | |
748 | 748 | | |
749 | 749 | | |
| 750 | + | |
750 | 751 | | |
751 | 752 | | |
752 | 753 | | |
| |||
783 | 784 | | |
784 | 785 | | |
785 | 786 | | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
786 | 791 | | |
787 | 792 | | |
788 | 793 | | |
| |||
796 | 801 | | |
797 | 802 | | |
798 | 803 | | |
799 | | - | |
| 804 | + | |
| 805 | + | |
800 | 806 | | |
801 | 807 | | |
802 | 808 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| 289 | + | |
| 290 | + | |
289 | 291 | | |
290 | | - | |
| 292 | + | |
291 | 293 | | |
292 | 294 | | |
293 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
167 | 206 | | |
168 | 207 | | |
169 | 208 | | |
170 | 209 | | |
171 | 210 | | |
172 | 211 | | |
| 212 | + | |
173 | 213 | | |
174 | 214 | | |
175 | 215 | | |
176 | 216 | | |
177 | | - | |
| 217 | + | |
178 | 218 | | |
179 | | - | |
| 219 | + | |
180 | 220 | | |
181 | | - | |
182 | 221 | | |
183 | 222 | | |
184 | 223 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | 224 | | |
197 | 225 | | |
198 | 226 | | |
199 | | - | |
200 | | - | |
201 | | - | |
| 227 | + | |
202 | 228 | | |
203 | 229 | | |
204 | 230 | | |
| |||
238 | 264 | | |
239 | 265 | | |
240 | 266 | | |
241 | | - | |
242 | | - | |
243 | | - | |
| 267 | + | |
244 | 268 | | |
245 | 269 | | |
246 | 270 | | |
247 | 271 | | |
248 | 272 | | |
249 | 273 | | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | 274 | | |
254 | 275 | | |
255 | 276 | | |
| |||
320 | 341 | | |
321 | 342 | | |
322 | 343 | | |
| 344 | + | |
323 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
324 | 349 | | |
325 | 350 | | |
326 | 351 | | |
| |||
329 | 354 | | |
330 | 355 | | |
331 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
332 | 374 | | |
333 | 375 | | |
334 | 376 | | |
335 | | - | |
| 377 | + | |
| 378 | + | |
336 | 379 | | |
337 | 380 | | |
338 | 381 | | |
339 | 382 | | |
340 | 383 | | |
341 | 384 | | |
342 | 385 | | |
343 | | - | |
| 386 | + | |
344 | 387 | | |
345 | 388 | | |
346 | 389 | | |
| |||
0 commit comments