public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "mitchell.augustin via groups.io" <mitchell.augustin=canonical.com@groups.io>
To: "Gerd Hoffmann" <kraxel@redhat.com>, devel@edk2.groups.io
Subject: Re: [edk2-devel] [BUG] Extremely slow boot times with CPU and GPU passthrough and host phys-bits > 40
Date: Fri, 22 Nov 2024 14:32:14 -0800	[thread overview]
Message-ID: <5971.1732314734914804329@groups.io> (raw)
In-Reply-To: <sqpqbftklcx24l4sjngsb2tgan6k4a2mnhpd3t2iz6pdqjzy57@o3mbmyjwgqkb>

[-- Attachment #1: Type: text/plain, Size: 2516 bytes --]

Thanks, Gerd.

This result is unfortunately more confusing. When I force physbits=40 and virtual bits=48 via -cpu host,host-phys-bits=on,host-phys-bits-limit=40,la57=off, and set `pci=realloc pci=nocrs` (and I confirmed that I see "40 bits physical, 48 bits virtual" in the guest lscpu), I still see the BAR assignment errors:
[   20.543572] NVRM: This PCI I/O region assigned to your NVIDIA device is invalid:
[   20.543572] NVRM: BAR0 is 0M @ 0x0 (PCI:0000:06:00.0)
These are the same widths I see when not using CPU host passthrough, but when I don't use host passthrough, I don't see these errors. (so I guess there is something else that impacts this somehow, beyond the address widths.)
This holds true even when I try forcing various different values for opt/ovmf/X-PciMmio64Mb (I tried 32768, 65536, 131072, 262144, and 524288). (in some cases, I would see more BARs get assigned successfully, but would still get the above error whenever trying to load the GPU driver.)

> So you can try increase host-phys-bits-limit.  Values between 40 and 46 should have an effect

I do see a bit of a speedup with phys-bits=42 and la57=off, and the GPUs do work with those settings, but I do still see some "can't claim BAR 0" / "no compatible bridge window" messages during boot, so maybe that speedup is just because some BARs are getting skipped.

I also did some profiling of the guest kernel today (with my original slow VM config), to see if that gave me any valuable information. One thing of note is that it seems like the most time is spent in this pci_write_config_word() call in __pci_read_base() of drivers/pci/probe.c ( https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/probe.c?h=v6.12#n251 ). Each of those pci_write_config_word() calls takes about 2 seconds, but it adds up to a significant chunk of the initialization time since __pci_read_base() is executed somewhere between 20-40 times in my VM.
I don't know if that is necessarily indicative of an issue with the guest kernel or not, but wanted to add it here as a datapoint in case it rings any bells.

Thanks,
Mitchell Augustin


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120821): https://edk2.groups.io/g/devel/message/120821
Mute This Topic: https://groups.io/mt/109651206/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 3233 bytes --]

  parent reply	other threads:[~2024-11-22 22:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14 16:46 [edk2-devel] [BUG] Extremely slow boot times with CPU and GPU passthrough and host phys-bits > 40 mitchell.augustin via groups.io
2024-11-18 21:14 ` xpahos via groups.io
2024-11-19 22:25   ` mitchell.augustin via groups.io
2024-11-20  9:35     ` xpahos via groups.io
2024-11-20 11:26     ` Gerd Hoffmann via groups.io
2024-11-20 15:20       ` mitchell.augustin via groups.io
2024-11-20 20:00         ` mitchell.augustin via groups.io
2024-11-21 12:32         ` Gerd Hoffmann via groups.io
2024-11-22  0:23           ` mitchell.augustin via groups.io
2024-11-22 10:35             ` Gerd Hoffmann via groups.io
2024-11-22 17:38               ` Brian J. Johnson via groups.io
2024-11-22 22:32               ` mitchell.augustin via groups.io [this message]
2024-11-24  2:05                 ` mitchell.augustin via groups.io
2024-11-25 11:47                   ` Gerd Hoffmann via groups.io
2024-11-25 19:58                     ` mitchell.augustin via groups.io
2024-11-26  8:09                       ` Gerd Hoffmann via groups.io
2024-11-26 22:27                         ` mitchell.augustin via groups.io
2024-12-04 14:56                           ` mitchell.augustin via groups.io
2024-11-25 11:18                 ` Gerd Hoffmann via groups.io
2024-11-18 21:32 ` Ard Biesheuvel via groups.io

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5971.1732314734914804329@groups.io \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox