[Azure] PCI: hv: Do not set PCI_COMMAND_MEMORY to reduce VM boot time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux-azure (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Medium
|
Tim Gardner | ||
Impish |
Fix Released
|
Medium
|
Tim Gardner | ||
Jammy |
Fix Released
|
Medium
|
Tim Gardner |
Bug Description
SRU Justification
[Impact]
A VM on Azure can have 14 GPUs, and each GPU may have a huge MMIO BAR,
e.g. 128 GB. Currently the boot time of such a VM can be 4+ minutes, and
most of the time is used by the host to unmap/map the vBAR from/to pBAR
when the VM clears and sets the PCI_COMMAND_MEMORY bit: each unmap/map
operation for a 128GB BAR needs about 1.8 seconds, and the pci-hyperv
driver and the Linux PCI subsystem flip the PCI_COMMAND_MEMORY bit
eight times (see pci_setup_device() -> pci_read_bases() and
pci_std_
seconds per GPU, i.e. 14.4 * 14 = 201.6 seconds in total.
Fix the slowness by not turning on the PCI_COMMAND_MEMORY in pci-hyperv.c,
so the bit stays in the off state before the PCI device driver calls
pci_enable_
pci_std_
With this change, the boot time of such a VM is reduced by
1.8 * (8-1) * 14 = 176.4 seconds.
[Test Case]
Microsoft tested
[Where things could go wrong]
PCI BAR setup could fail or be incorrect.
[Other Info]
SF: #00336342
CVE References
affects: | linux (Ubuntu) → linux-azure (Ubuntu) |
Changed in linux-azure (Ubuntu): | |
status: | New → Fix Released |
Changed in linux-azure (Ubuntu Jammy): | |
assignee: | nobody → Tim Gardner (timg-tpi) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in linux-azure (Ubuntu Impish): | |
assignee: | nobody → Tim Gardner (timg-tpi) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in linux-azure (Ubuntu Focal): | |
assignee: | nobody → Tim Gardner (timg-tpi) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in linux-azure (Ubuntu Focal): | |
status: | In Progress → Fix Committed |
Changed in linux-azure (Ubuntu Impish): | |
status: | In Progress → Fix Committed |
Changed in linux-azure (Ubuntu Jammy): | |
status: | In Progress → Fix Committed |
This bug is awaiting verification that the linux-azure/ 5.15.0- 1006.7 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification- needed- jammy' to 'verification- done-jammy' . If the problem still exists, change the tag 'verification- needed- jammy' to 'verification- failed- jammy'.
If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.
See https:/ /wiki.ubuntu. com/Testing/ EnableProposed for documentation how to enable and use -proposed. Thank you!