VM boots slowly with large-BAR GPU Passthrough due to pci/probe.c redundancy
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| linux (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
| Jammy |
Fix Released
|
Medium
|
Keifer Snedeker | ||
| Noble |
Fix Released
|
Medium
|
Mitchell Augustin | ||
| Oracular |
Fix Released
|
Medium
|
Mitchell Augustin | ||
Bug Description
For Ubuntu 24.04 users facing this issue - please see this related bug report for a workaround to achieve much faster VM boots with large GPU passthrough: https:/
(The fix in *this* bug report reduced the slowness by half without additional user intervention, but much faster speeds can be achieved on Noble with the fw_cfg changes described in the report linked above)
SRU Justification:
[ Impact ]
VM guests that have large-BAR GPUs passed through to them will take 2x as long to initialize all device BARs without this patch
[ Test Plan ]
I verified that this patch applies cleanly to the Noble kernel
and resolves the bug on DGX H100 and DGX A100. I observed no regressions.
This can be verified on any machine with a sufficiently large BAR and the
capability to pass through to a VM using vfio.
To verify no regressions, I applied this patch to the guest kernel, then
rebooted and confirmed that:
1. The measured PCI initialization time on boot was ~50% of the unmodified kernel
2. Relevant parts of /proc/iomem mappings, the PCI init section of dmesg output, and lspci -vv output remained unchanged between the system with the unmodified kernel and with the patched kernel
3. The Nvidia driver still successfully loaded and was shown via nvidia-smi after the patch was applied
[ Fix ]
Roughly half of the time consuming device configuration options invoked during
the PCI probe function can be eliminated by rearranging the memory and I/O disable/enable
calls such that they only occur per-device rather than per-BAR. This is what the upstream
patch does, and it results in roughly half the excess initialization time being eliminated
reliably during VM boot.
[ Where problems could occur ]
I do not expect any regressions. The only callers of ABIs changed by this patch are also adjusted within this patch, and the functional change only removes entirely redundant calls to disable/enable PCI memory/IO.
[ Additional Context ]
Upstream patch: https://<email address hidden>/
Upstream bug report: https:/
CVE References
- 2022-49636
- 2022-49728
- 2023-53034
- 2024-36476
- 2024-36945
- 2024-39282
- 2024-41932
- 2024-41935
- 2024-43098
- 2024-45828
- 2024-46753
- 2024-46812
- 2024-46821
- 2024-47141
- 2024-47143
- 2024-47408
- 2024-47711
- 2024-47726
- 2024-47794
- 2024-47809
- 2024-48873
- 2024-48875
- 2024-48876
- 2024-48881
- 2024-49568
- 2024-49569
- 2024-49571
- 2024-49865
- 2024-49893
- 2024-49914
- 2024-49920
- 2024-49921
- 2024-49968
- 2024-49972
- 2024-50009
- 2024-50019
- 2024-50020
- 2024-50021
- 2024-50022
- 2024-50023
- 2024-50024
- 2024-50025
- 2024-50026
- 2024-50027
- 2024-50028
- 2024-50029
- 2024-50030
- 2024-50031
- 2024-50033
- 2024-50035
- 2024-50036
- 2024-50038
- 2024-50039
- 2024-50040
- 2024-50041
- 2024-50042
- 2024-50044
- 2024-50045
- 2024-50046
- 2024-50047
- 2024-50048
- 2024-50049
- 2024-50051
- 2024-50055
- 2024-50056
- 2024-50057
- 2024-50058
- 2024-50059
- 2024-50060
- 2024-50061
- 2024-50062
- 2024-50063
- 2024-50064
- 2024-50089
- 2024-50090
- 2024-50093
- 2024-50095
- 2024-50096
- 2024-50117
- 2024-50134
- 2024-50148
- 2024-50171
- 2024-50180
- 2024-50181
- 2024-50182
- 2024-50183
- 2024-50184
- 2024-50185
- 2024-50186
- 2024-50187
- 2024-50188
- 2024-50189
- 2024-50191
- 2024-50229
- 2024-50233
- 2024-51729
- 2024-52319
- 2024-52332
- 2024-53104
- 2024-53144
- 2024-53156
- 2024-53165
- 2024-53168
- 2024-53170
- 2024-53179
- 2024-53681
- 2024-53682
- 2024-53685
- 2024-53687
- 2024-53690
- 2024-54191
- 2024-54193
- 2024-54455
- 2024-54460
- 2024-54680
- 2024-54683
- 2024-55639
- 2024-55641
- 2024-55642
- 2024-55881
- 2024-55916
- 2024-56368
- 2024-56369
- 2024-56372
- 2024-56550
- 2024-56551
- 2024-56552
- 2024-56557
- 2024-56558
- 2024-56559
- 2024-56561
- 2024-56562
- 2024-56563
- 2024-56564
- 2024-56565
- 2024-56566
- 2024-56567
- 2024-56568
- 2024-56569
- 2024-56570
- 2024-56572
- 2024-56573
- 2024-56574
- 2024-56575
- 2024-56576
- 2024-56577
- 2024-56578
- 2024-56579
- 2024-56580
- 2024-56581
- 2024-56582
- 2024-56583
- 2024-56584
- 2024-56585
- 2024-56586
- 2024-56587
- 2024-56588
- 2024-56589
- 2024-56590
- 2024-56591
- 2024-56592
- 2024-56593
- 2024-56594
- 2024-56595
- 2024-56596
- 2024-56597
- 2024-56598
- 2024-56599
- 2024-56600
- 2024-56601
- 2024-56602
- 2024-56603
- 2024-56604
- 2024-56605
- 2024-56606
- 2024-56607
- 2024-56608
- 2024-56609
- 2024-56610
- 2024-56611
- 2024-56613
- 2024-56614
- 2024-56615
- 2024-56616
- 2024-56617
- 2024-56618
- 2024-56619
- 2024-56620
- 2024-56621
- 2024-56622
- 2024-56623
- 2024-56624
- 2024-56625
- 2024-56626
- 2024-56627
- 2024-56628
- 2024-56629
- 2024-56630
- 2024-56631
- 2024-56632
- 2024-56633
- 2024-56634
- 2024-56635
- 2024-56636
- 2024-56637
- 2024-56638
- 2024-56639
- 2024-56640
- 2024-56641
- 2024-56642
- 2024-56643
- 2024-56644
- 2024-56645
- 2024-56646
- 2024-56647
- 2024-56648
- 2024-56649
- 2024-56650
- 2024-56651
- 2024-56652
- 2024-56653
- 2024-56654
- 2024-56655
- 2024-56656
- 2024-56657
- 2024-56658
- 2024-56659
- 2024-56660
- 2024-56662
- 2024-56663
- 2024-56664
- 2024-56665
- 2024-56667
- 2024-56669
- 2024-56670
- 2024-56671
- 2024-56672
- 2024-56673
- 2024-56675
- 2024-56709
- 2024-56710
- 2024-56711
- 2024-56712
- 2024-56713
- 2024-56714
- 2024-56715
- 2024-56716
- 2024-56717
- 2024-56718
- 2024-56719
- 2024-56757
- 2024-56758
- 2024-56759
- 2024-56760
- 2024-56761
- 2024-56763
- 2024-56764
- 2024-56765
- 2024-56766
- 2024-56767
- 2024-56768
- 2024-56769
- 2024-56770
- 2024-56771
- 2024-56772
- 2024-56773
- 2024-56774
- 2024-56775
- 2024-56776
- 2024-56777
- 2024-56778
- 2024-56779
- 2024-56780
- 2024-56781
- 2024-56782
- 2024-56783
- 2024-56784
- 2024-56785
- 2024-56786
- 2024-56787
- 2024-57791
- 2024-57792
- 2024-57793
- 2024-57795
- 2024-57798
- 2024-57799
- 2024-57801
- 2024-57802
- 2024-57804
- 2024-57805
- 2024-57806
- 2024-57807
- 2024-57809
- 2024-57838
- 2024-57839
- 2024-57841
- 2024-57843
- 2024-57849
- 2024-57850
- 2024-57857
- 2024-57872
- 2024-57874
- 2024-57875
- 2024-57876
- 2024-57878
- 2024-57879
- 2024-57880
- 2024-57881
- 2024-57882
- 2024-57883
- 2024-57884
- 2024-57885
- 2024-57886
- 2024-57887
- 2024-57888
- 2024-57889
- 2024-57890
- 2024-57892
- 2024-57893
- 2024-57894
- 2024-57895
- 2024-57896
- 2024-57897
- 2024-57898
- 2024-57899
- 2024-57900
- 2024-57901
- 2024-57902
- 2024-57903
- 2024-57904
- 2024-57905
- 2024-57906
- 2024-57907
- 2024-57908
- 2024-57910
- 2024-57911
- 2024-57912
- 2024-57913
- 2024-57916
- 2024-57917
- 2024-57918
- 2024-57919
- 2024-57921
- 2024-57924
- 2024-57925
- 2024-57926
- 2024-57929
- 2024-57931
- 2024-57932
- 2024-57933
- 2024-57934
- 2024-57935
- 2024-57938
- 2024-57939
- 2024-57940
- 2024-57944
- 2024-57945
- 2024-57946
- 2024-58093
- 2024-8805
- 2025-21629
- 2025-21630
- 2025-21631
- 2025-21632
- 2025-21633
- 2025-21634
- 2025-21635
- 2025-21636
- 2025-21637
- 2025-21638
- 2025-21639
- 2025-21640
- 2025-21642
- 2025-21643
- 2025-21644
- 2025-21645
- 2025-21646
- 2025-21647
- 2025-21648
- 2025-21649
- 2025-21650
- 2025-21651
- 2025-21652
- 2025-21653
- 2025-21654
- 2025-21655
- 2025-21656
- 2025-21658
- 2025-21659
- 2025-21660
- 2025-21661
- 2025-21662
- 2025-21663
- 2025-21664
- 2025-21941
- 2025-21956
- 2025-21957
- 2025-21959
- 2025-21962
- 2025-21963
- 2025-21964
- 2025-21968
- 2025-21970
- 2025-21975
- 2025-21981
- 2025-21991
- 2025-21992
- 2025-21994
- 2025-21996
- 2025-21999
- 2025-22004
- 2025-22005
- 2025-22007
- 2025-22008
- 2025-22010
- 2025-22014
- 2025-22018
- 2025-22020
- 2025-22021
- 2025-22025
- 2025-22035
- 2025-22044
- 2025-22045
- 2025-22050
- 2025-22054
- 2025-22055
- 2025-22056
- 2025-22060
- 2025-22063
- 2025-22066
- 2025-22071
- 2025-22073
- 2025-22075
- 2025-22079
- 2025-22081
- 2025-22086
- 2025-22089
- 2025-22097
- 2025-2312
- 2025-23136
- 2025-23138
- 2025-37785
- 2025-38152
- 2025-38575
- 2025-38637
- 2025-39728
- 2025-39735
| Changed in linux (Ubuntu): | |
| assignee: | nobody → Mitchell Augustin (mitchellaugustin) |
| status: | New → In Progress |
| Changed in linux (Ubuntu Noble): | |
| status: | New → In Progress |
| Changed in linux (Ubuntu): | |
| status: | In Progress → Invalid |
| Changed in linux (Ubuntu Noble): | |
| assignee: | nobody → Mitchell Augustin (mitchellaugustin) |
| Changed in linux (Ubuntu): | |
| assignee: | Mitchell Augustin (mitchellaugustin) → nobody |
| Changed in linux (Ubuntu Oracular): | |
| status: | New → In Progress |
| assignee: | nobody → Mitchell Augustin (mitchellaugustin) |
| Changed in linux (Ubuntu Noble): | |
| status: | In Progress → Fix Committed |
| Changed in linux (Ubuntu Oracular): | |
| status: | In Progress → Fix Committed |
| Changed in linux (Ubuntu Noble): | |
| importance: | Undecided → Medium |
| Changed in linux (Ubuntu Oracular): | |
| importance: | Undecided → Medium |
| Changed in linux (Ubuntu Jammy): | |
| importance: | Undecided → Medium |
| Changed in linux (Ubuntu Jammy): | |
| status: | New → In Progress |
| tags: | added: kernel-daily-bug |
| Changed in linux (Ubuntu Jammy): | |
| status: | In Progress → Fix Committed |
| Changed in linux (Ubuntu Jammy): | |
| assignee: | nobody → Keifer Snedeker (ks0) |
| description: | updated |
| description: | updated |
| description: | updated |

Upstream patch submitted to kernel-team list with subject [SRU][N/O][PATCH 0/1] PCI: Batch BAR sizing operations