[pve-devel] [PATCH qemu-server 3/3] fix #6466: aarch64: pci: properly print higher-index PCI bridge addresses

Fiona Ebner f.ebner at proxmox.com
Wed Jun 18 17:20:09 CEST 2025


For aarch64, the virt machine has an initial pcie.0 bus. The other pci
bridges that get added on top are called pci.N, see the relevant
section in config_to_command() which adds them.

In particular this fixes adding an RNG device, which is require for
OVMF PXE boot.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 src/PVE/QemuServer/PCI.pm | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/PVE/QemuServer/PCI.pm b/src/PVE/QemuServer/PCI.pm
index 89931465..59106876 100644
--- a/src/PVE/QemuServer/PCI.pm
+++ b/src/PVE/QemuServer/PCI.pm
@@ -286,17 +286,16 @@ my $get_addr_mapping_from_id = sub {
 sub print_pci_addr {
     my ($id, $bridges, $arch) = @_;
 
-    my $res = '';
+    die "aarch64 cannot use IDE devices\n" if $arch eq 'aarch64' && $id =~ /^ide/;
 
-    # using same bus slots on all HW, so we need to check special cases here:
-    my $busname = 'pci';
-    if ($arch eq 'aarch64') {
-        die "aarch64 cannot use IDE devices\n" if $id =~ /^ide/;
-        $busname = 'pcie';
-    }
+    my $res = '';
 
     my $map = get_pci_addr_map();
     if (my $d = $get_addr_mapping_from_id->($map, $id)) {
+        # Using same bus slots on all HW, so we need to check special cases here. For aarch64, the
+        # virt machine has an initial pcie.0. The other pci bridges that get added are called pci.N.
+        my $busname = $arch eq 'aarch64' && $d->{bus} eq 0 ? 'pcie' : 'pci';
+
         $res = ",bus=$busname.$d->{bus},addr=$d->{addr}";
         $bridges->{ $d->{bus} } = 1 if $bridges;
     }
-- 
2.39.5





More information about the pve-devel mailing list