public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 3/3] fix #6466: aarch64: pci: properly print higher-index PCI bridge addresses
Date: Wed, 18 Jun 2025 17:20:09 +0200	[thread overview]
Message-ID: <20250618152009.120524-4-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250618152009.120524-1-f.ebner@proxmox.com>

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@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



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2025-06-18 15:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18 15:20 [pve-devel] [PATCH-SERIES qemu-server master+stable-bookworm 0/3] fix #6466: aarch64: re-allow PXE boot on OVMF Fiona Ebner
2025-06-18 15:20 ` [pve-devel] [PATCH qemu-server 1/3] cfg2cmd: print vga: fix call to print_pcie_addr() Fiona Ebner
2025-06-18 15:20 ` [pve-devel] [PATCH qemu-server 2/3] pci: code cleanup: remove superfluous machine type parameter from print_pci_addr Fiona Ebner
2025-06-18 15:20 ` Fiona Ebner [this message]
2025-07-15 12:30 ` [pve-devel] [PATCH-SERIES qemu-server master+stable-bookworm 0/3] fix #6466: aarch64: re-allow PXE boot on OVMF Fiona Ebner
2025-07-15 17:17 ` [pve-devel] applied: " Thomas Lamprecht

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=20250618152009.120524-4-f.ebner@proxmox.com \
    --to=f.ebner@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