From nobody Mon Sep 8 16:46:12 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=1755622419; cv=none; d=zohomail.com; s=zohoarc; b=UDdVScJ01S3ReV0KRNt3oFDYyapOF6s9rR7HqyMFsXaVHgsYHKZZX5JHvs9dcdeD0EQBnvd+Ech/q7WcdgUE4f1L17nhFG3xGSGqpSmNzcUnA1/p7CaLQwZX2c+MDQ7CSUWp/9MH97kpAEwOs95GdociNQMmIFOrVbFGPNSV46A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1755622419; 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=cTeDFiVSWf+IT5jJnc0ghpZJpNQKLzlEqCkV2hhe5is=; b=hmH2Ytf5uE9RWzAjNaksz4ojwzGxP2AHPdmv2Rh4XV1GXSm4zg4jvumIvwW2r6iWrIIKBzk9GagKDnS7UQ5KGVAZ+YFyUNw3/j/YkC0uW7BGJNoq9SwLkAVp51oLwI12EPMbeU8gvfdCgFGD2HJBzSAZ92YOQaTQT13cNZ0LrfU= 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 1755622419892183.5536748789109; Tue, 19 Aug 2025 09:53:39 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 3223CBD1; Tue, 19 Aug 2025 12:53:39 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 5E7C211FA; Tue, 19 Aug 2025 12:24:58 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 63F5CA7E; Tue, 19 Aug 2025 12:24:53 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 582EFE90 for ; Tue, 19 Aug 2025 12:23:19 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-651-pqGiMeZQP_-JsMlTg2ju8Q-1; Tue, 19 Aug 2025 12:23:17 -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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A91B418003FD for ; Tue, 19 Aug 2025 16:23:16 +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 D3A3B180044F for ; Tue, 19 Aug 2025 16:23:15 +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=1755620599; 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=Xsqg5AuRLOZBgRTS5XHOPONuMuZfmgLaT0Exu7iYnVg=; b=ENBdAXliBdYQK90vCiMQu6Ewfgvnyu/TnM5iQPQgBLBR9zB84vOINXv85+vsS85w9jEygI 5Za9UdZpsdy+b2i6Cn7iJMxhT0Xu6xcetea/xXcS5H8wPnCFLqUQjEzii3fYlrjYawQMsx W/LNTd1oMJ4wUZpYpF3xoIoMkXnZA5k= X-MC-Unique: pqGiMeZQP_-JsMlTg2ju8Q-1 X-Mimecast-MFC-AGG-ID: pqGiMeZQP_-JsMlTg2ju8Q_1755620596 To: devel@lists.libvirt.org Subject: [PATCH 27/31] qemu: Use qemu-xhci by default on RISC-V Date: Tue, 19 Aug 2025 18:22:31 +0200 Message-ID: <20250819162235.468215-28-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: 7twehKvKR4DHK_kzXIClhvn1ovWFb0fOZ-4xcbVCitY_1755620596 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 6DKZPNVUJLKBQYGQ6SG6J73DLBQKORGC X-Message-ID-Hash: 6DKZPNVUJLKBQYGQ6SG6J73DLBQKORGC 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: 1755622420909124100 Content-Type: text/plain; charset="utf-8"; x-default="true" Currently we fall back to the x86-derived default of piix3-uhci, which is a USB1 controller that's not virtualization-friendly and overall a terrible choice for a modern architecture. The fact that we didn't choose a better default when RISC-V support was introduced was an oversight which is now addressed. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 3 ++- ...ault-models.riscv64-latest.abi-update.args | 15 +++++------ ...fault-models.riscv64-latest.abi-update.xml | 26 ++++++++----------- ...64-virt-default-models.riscv64-latest.args | 15 +++++------ ...v64-virt-default-models.riscv64-latest.xml | 26 ++++++++----------- ...r-default-virt-riscv64.riscv64-latest.args | 5 ++-- ...er-default-virt-riscv64.riscv64-latest.xml | 12 +++------ tests/qemuxmlconftest.c | 2 +- 8 files changed, 45 insertions(+), 59 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3886b59026..d5ddc4ef43 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4321,7 +4321,8 @@ qemuDomainDefaultUSBControllerModel(const virDomainDe= f *def, { bool abiUpdate =3D !!(parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE); =20 - if (ARCH_IS_LOONGARCH(def->os.arch)) { + if (ARCH_IS_LOONGARCH(def->os.arch) || + qemuDomainIsRISCVVirt(def)) { /* Use qemu-xhci (USB3) for modern architectures */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-late= st.abi-update.args b/tests/qemuxmlconfdata/riscv64-virt-default-models.risc= v64-latest.abi-update.args index 00ecc83126..99e1946d98 100644 --- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-= update.args +++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-= update.args @@ -28,20 +28,19 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-guest= /.config \ -boot strict=3Don \ -device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus= ":"pcie.0","multifunction":true,"addr":"0x1"}' \ -device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus= ":"pcie.0","addr":"0x1.0x1"}' \ --device '{"driver":"pcie-pci-bridge","id":"pci.3","bus":"pci.1","addr":"0x= 0"}' \ --device '{"driver":"pcie-root-port","port":10,"chassis":4,"id":"pci.4","bu= s":"pcie.0","addr":"0x1.0x2"}' \ --device '{"driver":"pcie-root-port","port":11,"chassis":5,"id":"pci.5","bu= s":"pcie.0","addr":"0x1.0x3"}' \ --device '{"driver":"pcie-root-port","port":12,"chassis":6,"id":"pci.6","bu= s":"pcie.0","addr":"0x1.0x4"}' \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.3","addr":"0x1"}= ' \ --device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.4","addr":"0x= 0"}' \ +-device '{"driver":"pcie-root-port","port":10,"chassis":3,"id":"pci.3","bu= s":"pcie.0","addr":"0x1.0x2"}' \ +-device '{"driver":"pcie-root-port","port":11,"chassis":4,"id":"pci.4","bu= s":"pcie.0","addr":"0x1.0x3"}' \ +-device '{"driver":"pcie-root-port","port":12,"chassis":5,"id":"pci.5","bu= s":"pcie.0","addr":"0x1.0x4"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci.2","addr":"0x0"}' \ +-device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.3","addr":"0x= 0"}' \ -netdev '{"type":"user","id":"hostnet0"}' \ --device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":= "52:54:00:09:a4:37","bus":"pci.2","addr":"0x0"}' \ +-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":= "52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=3Dcharserial0 \ -serial chardev:charserial0 \ -chardev socket,id=3Dchrtpm,path=3D/dev/test \ -tpmdev emulator,id=3Dtpm-tpm0,chardev=3Dchrtpm \ -device '{"driver":"tpm-tis-device","tpmdev":"tpm-tpm0","id":"tpm0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.5= ","addr":"0x0"}' \ +-device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.4= ","addr":"0x0"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-late= st.abi-update.xml b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv= 64-latest.abi-update.xml index 4543364c89..620da73422 100644 --- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-= update.xml +++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-= update.xml @@ -17,11 +17,11 @@ destroy /usr/bin/qemu-system-riscv64 - -
+ +
-
+
@@ -34,29 +34,25 @@
- - -
- - + - +
- + - +
- + - +
-
+
@@ -72,7 +68,7 @@