public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Mitchell Augustin <mitchell.augustin@canonical.com>
Cc: linux-pci@vger.kernel.org, kvm@vger.kernel.org,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: drivers/pci: (and/or KVM): Slow PCI initialization during VM boot with passthrough of large BAR Nvidia GPUs on DGX H100
Date: Wed, 27 Nov 2024 10:22:43 -0700	[thread overview]
Message-ID: <20241127102243.57cddb78.alex.williamson@redhat.com> (raw)
In-Reply-To: <CAHTA-uY3pyDLH9-hy1RjOqrRR+OU=Ko6hJ4xWmMTyoLwHhgTOQ@mail.gmail.com>

On Tue, 26 Nov 2024 19:12:35 -0600
Mitchell Augustin <mitchell.augustin@canonical.com> wrote:

> Thanks for the breakdown!
> 
> > That alone calls __pci_read_base() three separate times, each time
> > disabling and re-enabling decode on the bridge. [...] So we're
> > really being bitten that we toggle decode-enable/memory enable
> > around reading each BAR size  
> 
> That makes sense to me. Is this something that could theoretically be
> done in a less redundant way, or is there some functional limitation
> that would prevent that or make it inadvisable? (I'm still new to pci
> subsystem debugging, so apologies if that's a bit vague.)

The only requirement is that decode should be disabled while sizing
BARs, the fact that we repeat it around each BAR is, I think, just the
way the code is structured.  It doesn't take into account that toggling
the command register bit is not a trivial operation in a virtualized
environment.  IMO we should push the command register manipulation up a
layer so that we only toggle it once per device rather than once per
BAR.  Thanks,

Alex


  reply	other threads:[~2024-11-27 17:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-25 22:46 drivers/pci: (and/or KVM): Slow PCI initialization during VM boot with passthrough of large BAR Nvidia GPUs on DGX H100 Mitchell Augustin
2024-11-26 17:34 ` Alex Williamson
2024-11-26 22:18   ` Mitchell Augustin
2024-11-26 22:41     ` Alex Williamson
2024-11-26 23:08       ` Mitchell Augustin
2024-11-27  0:02         ` Alex Williamson
2024-11-27  1:12           ` Mitchell Augustin
2024-11-27 17:22             ` Alex Williamson [this message]
2024-12-02 19:36               ` Mitchell Augustin
2024-12-03 18:34                 ` Mitchell Augustin
2024-12-03 19:20                 ` Alex Williamson
2024-12-03 20:33                   ` Mitchell Augustin
2024-12-03 22:06                     ` Alex Williamson
2024-12-03 23:09                       ` Mitchell Augustin
2024-12-03 23:30                         ` Alex Williamson
2024-12-06  0:09                           ` Mitchell Augustin
2025-01-08 23:06                             ` Mitchell Augustin
2025-01-13 18:22                               ` Alex Williamson
2025-01-13 19:43                                 ` Mitchell Augustin

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-all 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=20241127102243.57cddb78.alex.williamson@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mitchell.augustin@canonical.com \
    /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