From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 9EEB31FF0B2 for ; Mon, 24 Aug 2026 16:40:36 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 77DA421630; Mon, 24 Aug 2026 16:40:35 +0200 (CEST) Message-ID: <0400f75a-49a0-48d1-b1e6-48b3ad9e0bd5@proxmox.com> Date: Mon, 24 Aug 2026 16:40:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH qemu-server v4] fix #7711: pci: try to detect large memory region preconditions From: Fiona Ebner To: Dominik Csapak , pve-devel@lists.proxmox.com References: <20260709115349.3822301-1-d.csapak@proxmox.com> <547e153f-7799-4d1c-856e-460b08477e8a@proxmox.com> Content-Language: en-US In-Reply-To: <547e153f-7799-4d1c-856e-460b08477e8a@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787582395349 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.174 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) KAM_MAILER 2 Automated Mailer Tag Left in Email RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: MDUKQVQZ5GQ3UP3FCATY6XS474FNMO5Y X-Message-ID-Hash: MDUKQVQZ5GQ3UP3FCATY6XS474FNMO5Y X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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/