From nobody Mon Sep 8 17:08:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1755621550; cv=none; d=zohomail.com; s=zohoarc; b=L2m2Db710CTW7QvtnCsJaFm1ArtMw5pt5ym+ubw1bAvw2TvwwJBno37LYV/HuiDd5wqzGFuLLNTTd1AqXARHiL6mJ9tlx37sog4KudLp5FK/8dFX9o2htkqVjlpLdq5rTxuJ1M7pfJFHu06KSGCNVwZpdNtQPdubvREKeJP/mc4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1755621550; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=Y17nlA3lZljd1/ziQ3ioQFRgXDCZeLUFkp/lAtea518=; b=BrrsiRNz0KsA6JSPNfemiaHIc0Y//dONBTqBs+J2kbvnx9b0xlV/DlGg5H3hEj+iF8DxpkvFk5VGJPY4UM6eti45/az/MBK4avnSDfVYghqPrepJCGDdVEMgKZMisP/DTI4N2AC4WuYtowRChSuef1EOTDzv8p1KlHAXHdIsyKw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1755621550643469.17877088067667; Tue, 19 Aug 2025 09:39:10 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 0141C11A7; Tue, 19 Aug 2025 12:39:09 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 1F89DE8C; Tue, 19 Aug 2025 12:23:32 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 122D4B3A; Tue, 19 Aug 2025 12:23:25 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id EAAC6B7C for ; Tue, 19 Aug 2025 12:22:57 -0400 (EDT) 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-348-7I1wj4jlNrG938oXSMrcJA-1; Tue, 19 Aug 2025 12:22:56 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 5926619775AD for ; Tue, 19 Aug 2025 16:22:55 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.45.224.253]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5F5EA180044F for ; Tue, 19 Aug 2025 16:22:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1755620577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AMZRXWJrrU4rx6xR59TLFHuSiws4vJp6scyW3grzX54=; b=R+PP+WMZkzkhKXTntXEn9YuoVvCdgHIHFrMpM84y/3ItwTTSZnK49xSK+FrAHagm6Xhw8o gRvOVXr/a9XFSWKp4CzlW7RunHvmuHNadihgIfn+oiBGvURoLQdAXD+D28TK35PrsQ5FxI OEr5XdjPYI5GEJNq5EFHn+vi5TMZfOU= X-MC-Unique: 7I1wj4jlNrG938oXSMrcJA-1 X-Mimecast-MFC-AGG-ID: 7I1wj4jlNrG938oXSMrcJA_1755620575 To: devel@lists.libvirt.org Subject: [PATCH 11/31] qemu: Fix PCI/USB handling for Arm realview boards Date: Tue, 19 Aug 2025 18:22:15 +0200 Message-ID: <20250819162235.468215-12-abologna@redhat.com> In-Reply-To: <20250819162235.468215-1-abologna@redhat.com> References: <20250819162235.468215-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: GFbdQGEB1-WkYKrkG-mG81h5h2a29uTf_TpAB1u9tl8_1755620575 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ZFI4ZMZJ2PN3M5E73IP4ES4AQOEVYL4B X-Message-ID-Hash: ZFI4ZMZJ2PN3M5E73IP4ES4AQOEVYL4B X-MailFrom: abologna@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Andrea Bolognani via Devel Reply-To: Andrea Bolognani X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1755621552566124100 Content-Type: text/plain; charset="utf-8"; x-default="true" Only the -eb variants of the realview board support PCI devices, so those are the only ones that should automatically get a USB controller (addDefaultUSB). Additionally, they should get a PCI controller added automatically (addPCIRoot) too, same as versatilepb. Finally, qemuDomainSupportsPCI() should correctly report the fact that these machine types support PCI. As a consequence of these fixes, the USB controllers now correctly get assigned PCI addresses across the board. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 3 ++- src/qemu/qemu_postparse.c | 10 ++++------ ...h64-realview-minimal.aarch64-latest.abi-update.args | 2 +- ...ch64-realview-minimal.aarch64-latest.abi-update.xml | 5 ++++- .../aarch64-realview-minimal.aarch64-latest.args | 2 +- .../aarch64-realview-minimal.aarch64-latest.xml | 5 ++++- ...b-controller-automatic-realview.aarch64-latest.args | 2 +- ...sb-controller-automatic-realview.aarch64-latest.xml | 5 ++++- ...r-automatic-unavailable-realview.aarch64-latest.xml | 5 ++++- ...oller-default-fallback-realview.aarch64-latest.args | 2 +- ...roller-default-fallback-realview.aarch64-latest.xml | 5 ++++- ...usb-controller-default-realview.aarch64-latest.args | 2 +- .../usb-controller-default-realview.aarch64-latest.xml | 5 ++++- ...ler-default-unavailable-realview.aarch64-latest.xml | 5 ++++- 14 files changed, 39 insertions(+), 19 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e45757ccd5..81a8ca906d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -7688,7 +7688,8 @@ qemuDomainSupportsPCI(const virDomainDef *def) * machine types support PCI */ if (ARCH_IS_ARM(def->os.arch)) { if (qemuDomainIsARMVirt(def) || - STREQ(def->os.machine, "versatilepb")) { + STREQ(def->os.machine, "versatilepb") || + STRPREFIX(def->os.machine, "realview-eb")) { return true; } return false; diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index 5f59b79d56..3c481ead5e 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -1291,13 +1291,11 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *drive= r, case VIR_ARCH_ARMV7L: case VIR_ARCH_ARMV7B: case VIR_ARCH_AARCH64: - if (STREQ(def->os.machine, "versatilepb")) - addPCIRoot =3D true; - - /* Add default USB for the two machine types which historically - * supported -usb */ + /* Add default PCI and USB for the two machine types which + * historically supported -usb */ if (STREQ(def->os.machine, "versatilepb") || - STRPREFIX(def->os.machine, "realview")) { + STRPREFIX(def->os.machine, "realview-eb")) { + addPCIRoot =3D true; addDefaultUSB =3D true; if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) usbModel =3D VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.= abi-update.args b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-la= test.abi-update.args index fc88d9cf6b..0d956241fc 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-upd= ate.args +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-upd= ate.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-aarch64= test/.config \ -rtc base=3Dutc \ -no-shutdown \ -boot strict=3Don \ --device '{"driver":"pci-ohci","id":"usb"}' \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.= abi-update.xml b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-lat= est.abi-update.xml index b16454b94c..c31c7b2bbc 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-upd= ate.xml +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-upd= ate.xml @@ -15,7 +15,10 @@ destroy /usr/bin/qemu-system-aarch64 - + +
+ +