From nobody Sat Apr 11 21:29:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1773080128; cv=none; d=zohomail.com; s=zohoarc; b=YDZo+LI2LDxjNx22069nMAGMNOf8jcruSapnic5jn+6/6jqIH4EcVf1W9eNaOLojFZvXNTdhCLL1+39K86A37eITftagfokgrG6ojtRjo5fJKrbajytCZ6V4nmAuBojXe7Li56eOF/3qW7ft148hwPhfx8Y7icC5NgqMWyLcsVc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773080128; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+9mgYnbUSzE3hHMpeCFGm4KApWZdtZgL8pwOnpPUrG4=; b=XksMkOhxVL7e+nC70o1wv9WoEUvYf5QlG+YsnCT1sSIln82rFMtMmZxmK3TCHjRes33fZhzemSKP94HYdPoXPh6BEOjRJjRXnoaOmoBCY9dAHM6FUdwj9kFa0q8cbGnfj+Lo0s0qKVDTgsRRbLYBD9AU4UoaWqeTTIwLRrihlvQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773080128529394.42510766038663; Mon, 9 Mar 2026 11:15:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzf8G-0007RR-Ko; Mon, 09 Mar 2026 14:15:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vzf8D-0007QN-BR for qemu-devel@nongnu.org; Mon, 09 Mar 2026 14:15:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vzf8A-0008Dz-Dd for qemu-devel@nongnu.org; Mon, 09 Mar 2026 14:15:03 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-107-EmmJh1tYMY-oz6nzxSbVGQ-1; Mon, 09 Mar 2026 14:14:57 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 437521956094; Mon, 9 Mar 2026 18:14:56 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.34.113]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 77F0719560A6; Mon, 9 Mar 2026 18:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773080101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=+9mgYnbUSzE3hHMpeCFGm4KApWZdtZgL8pwOnpPUrG4=; b=LsRqEVfVTX0HwNtIWSRMD20GrFc4dBlz5PQKJoe3ejFDkL0mvoctQzX6SwrM5xC+6y4008 Xsh0G0R5An5qXNEsuuJd+/f6xSIjw0P/yLJmW7iQCknG3PsHMAIVWB9aGS3BrvYUrkfh1V +2suX/yoTEUW0fs1egOBNyDlsXlFQls= X-MC-Unique: EmmJh1tYMY-oz6nzxSbVGQ-1 X-Mimecast-MFC-AGG-ID: EmmJh1tYMY-oz6nzxSbVGQ_1773080096 From: Thomas Huth To: Mark Cave-Ayland , qemu-devel@nongnu.org Cc: Artyom Tarasenko Subject: [PATCH v2] hw/sparc64/sun4u: Mark unusable PCI busses as full to ease device plugging Date: Mon, 9 Mar 2026 19:14:52 +0100 Message-ID: <20260309181452.83702-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1773080129476158500 Content-Type: text/plain; charset="utf-8" From: Thomas Huth When trying to plug a PCI device to a Sparc64 machine, you currently have to specify the right bus ("bus=3DpciB"), otherwise you get this error: $ qemu-system-sparc64 -device virtio-scsi-pci qemu-system-sparc64: -device virtio-scsi-pci: PCI: no slot/function available for virtio-scsi-pci, all in use or reserved This is quite annoying for the unexperienced users, and it also breaks e.g. the iotests ("make check-block") when running with qemu-system-sparc64. Mark the non-usable PCI busses as full now, so that QEMU can automatically plug new PCI devices to the right "pciB" bus. Signed-off-by: Thomas Huth --- v2: Do the change in the machine code, not in the sabre device hw/sparc64/sun4u.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index b8bda1eb816..37539535c6c 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -723,6 +723,13 @@ static void sun4uv_init(MemoryRegion *address_space_me= m, fw_cfg_add_i16(fw_cfg, FW_CFG_SPARC64_DEPTH, graphic_depth); =20 qemu_register_boot_set(fw_cfg_boot_set, fw_cfg); + + /* + * Mark internal PCI busses as full so that the plugging of additional + * PCI devices happens on the right bus that still has free slots: + */ + qbus_mark_full(&pci_bus->qbus); + qbus_mark_full(&pci_busA->qbus); } =20 enum { --=20 2.53.0