public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [PATCH qemu-server v4] fix #7711: pci: try to detect large memory region preconditions
Date: Mon, 24 Aug 2026 16:40:25 +0200	[thread overview]
Message-ID: <0400f75a-49a0-48d1-b1e6-48b3ad9e0bd5@proxmox.com> (raw)
In-Reply-To: <547e153f-7799-4d1c-856e-460b08477e8a@proxmox.com>

Am 24.08.26 um 3:55 PM schrieb Fiona Ebner:
> Am 09.07.26 um 1:54 PM schrieb Dominik Csapak:
>> diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
>> index 59a37098..a80d56a1 100644
>> --- a/src/PVE/QemuServer.pm
>> +++ b/src/PVE/QemuServer.pm
>> @@ -5688,21 +5688,43 @@ sub vm_start_nolock {
>>          PVE::QemuServer::PCI::reserve_pci_usage($pci_reserve_list, $vmid, $start_timeout);
>>  
>>          my $uuid;
>> +        my $need_min_phys_bits = 0;
>> +        my $arch = PVE::QemuServer::Helpers::get_vm_arch($conf);
>> +        my $available_phys_bits =
>> +            PVE::QemuServer::CPUConfig::available_phys_bits_heuristic($conf, $arch);
>>          for my $id (sort keys %$pci_devices) {
>>              my $d = $pci_devices->{$id};
>>              my ($index) = ($id =~ m/^hostpci(\d+)$/);
>>  
>>              my $chosen_mdev;
>>              for my $dev ($d->{ids}->@*) {
>> -                my $info =
>> -                    eval { PVE::QemuServer::PCI::prepare_pci_device($vmid, $dev->{id}, $index, $d) };
>> +
>> +                my $info = eval {
>> +                    PVE::QemuServer::PCI::prepare_pci_device($vmid, $dev->{id}, $index, $d);
>> +                };
>>                  if ($d->{mdev} || $d->{nvidia}) {
>>                      warn $@ if $@;
>>                      $chosen_mdev = $info;
>> -                    last if $chosen_mdev; # if successful, we're done
>>                  } else {
>>                      die $@ if $@;
>>                  }
>> +
>> +                # don't check the phys bits requirements for mediated devices (except new nvidia interface)
>> +                if (!$d->{mdev} || $d->{nvidia}) {
>> +                    my $phys_bits_for_dev = eval {
>> +                        PVE::QemuServer::PCI::min_phys_bits_needed(
>> +                            $conf, $dev->{id}, $available_phys_bits,
>> +                        );
>> +                    };
>> +                    warn "could not determine needed MMIO size for '$dev->{id}': $@\n" if $@;
>> +
>> +                    if (
>> +                        defined($phys_bits_for_dev) && $phys_bits_for_dev > $need_min_phys_bits
>> +                    ) {
>> +                        $need_min_phys_bits = $phys_bits_for_dev;
>> +                    }
>> +                }
>> +                last if $chosen_mdev; # if successful, we're done

One more thing noticed while I reviewed another patch of yours: we don't
need to do the check if the device is not the $chosen_mdev, or?

Currently, the check is done even if the prepare call fails with an
error in the nvidia case. See my reply there for more context:

https://lore.proxmox.com/pve-devel/4210ce86-02eb-41ae-828d-9f08b6074c6b@proxmox.com/





      reply	other threads:[~2026-08-24 14:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 11:53 [PATCH qemu-server v4] fix #7711: pci: try to detect large memory region preconditions Dominik Csapak
2026-08-24 13:55 ` Fiona Ebner
2026-08-24 14:40   ` Fiona Ebner [this message]

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=0400f75a-49a0-48d1-b1e6-48b3ad9e0bd5@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal