From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092222; cv=none; d=zohomail.com; s=zohoarc; b=FxPBmKI/Y/1usKdJTeAHo0gvqpMJAj2u4KbebdzjaOFftb0R/Gau4N5lQeFi1tucQwC/gLtkpI3pBm8hCUIKejGHokP8P9qwrudq2iRJUz2iiLeoh2LH9TiBWt7IkaQe5elG2lhLQceeqSfPY/LUEcuyqu0ezZoidKt9Vh/lbgE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092222; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Q51BAwygHk94gMP0pYmR8pMYm5CCos3BX5J3T9Z19ys=; b=DByryP1ermpbONpSRrDX+Vm82ZBUny1K7XtkitEdd/wiG1L5U9Yp4h+lIM6JMjD0k3/tEpcd5zQPWRBqZ39qVrT1fawJbWWcWWm2SHH21Ed7/AkUVzFQM/Zy/ce3k9NVNsy2zWI+KxcQ9L3WZQZnF1O3BxBLE4nwYzArqagIzSo= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092222488951.3876961987155; Fri, 26 May 2023 02:10:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRM-0002vG-5i; Fri, 26 May 2023 05:08:52 -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 1q2TRJ-0002uZ-NC for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:49 -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 1q2TRI-0000hI-71 for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:49 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-157-Uf_oKKUzNVi1webPiw-2VA-1; Fri, 26 May 2023 05:08:43 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D54A380213E; Fri, 26 May 2023 09:08:43 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFAE0C154D1; Fri, 26 May 2023 09:08:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q51BAwygHk94gMP0pYmR8pMYm5CCos3BX5J3T9Z19ys=; b=G3ZynIJHqEJMU450UQSeZqXzYlfOxMss1bHMjN7u+s3t4wIDdkiC2nsjoliAx2AE5DxEO5 572PiWIoZtwmdt30iO+4JG9vM6hswfAR6FYyALLYrJ89+FCeEIc5hIYlRH9j5vgl2ACPAH gLU/ZDuwle7mkemOf74VTEh5kYSK6l0= X-MC-Unique: Uf_oKKUzNVi1webPiw-2VA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 01/15] hw/hppa: Use MachineClass->default_nic in the hppa machine Date: Fri, 26 May 2023 11:08:26 +0200 Message-Id: <20230526090840.2225958-2-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092224196100003 Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Message-Id: <20230523110435.1375774-2-thuth@redhat.com> Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- hw/hppa/machine.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 8fea5fa6b8..b00a91ecfe 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -177,6 +177,7 @@ static void machine_hppa_init(MachineState *machine) const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; + MachineClass *mc =3D MACHINE_GET_CLASS(machine); DeviceState *dev, *dino_dev, *lasi_dev; PCIBus *pci_bus; ISABus *isa_bus; @@ -272,7 +273,7 @@ static void machine_hppa_init(MachineState *machine) =20 for (i =3D 0; i < nb_nics; i++) { if (!enable_lasi_lan()) { - pci_nic_init_nofail(&nd_table[i], pci_bus, "tulip", NULL); + pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic, NU= LL); } } =20 @@ -462,6 +463,7 @@ static void hppa_machine_init_class_init(ObjectClass *o= c, void *data) mc->default_ram_size =3D 512 * MiB; mc->default_boot_order =3D "cd"; mc->default_ram_id =3D "ram"; + mc->default_nic =3D "tulip"; =20 nc->nmi_monitor_handler =3D hppa_nmi; } --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092215; cv=none; d=zohomail.com; s=zohoarc; b=LtLqYe3nBq9ky0oC90LJqMCbeGVU6li5MVReDsdLu1/Tr8SuCwLfoaxmw0VcwM54RIddgRW3L31IBnKGJ66xwJSsdFagAU2sej6WIvk+mN6QKP61EjgVAotNEzil+1zPAKgQ6Wzt/FXzZLCNqIGVVheygfMJoFyx+djm8u8R1J0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092215; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ibbhxtNSljHoQcRBS6pwxQdnkxlIhBqmSheTOLY9/jg=; b=Zl7PZApugMmbMhel6cClXZgTAytXGw+iqGNGktuibhlbiKlxnEq/f0/3t3Hju5wdN08m9tIFmkAch+lVJkxM9vFPnnd4UOIcbfnQS/PvD5yLgSQuPl0BXSr4OL25aY2jFa43PQcVYQGESy5DHVJXf7qZn1GUdV5m6/zYBaEfcn4= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092215760459.9107474295929; Fri, 26 May 2023 02:10:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRK-0002uh-4d; Fri, 26 May 2023 05:08:50 -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 1q2TRJ-0002uS-EE for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:49 -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 1q2TRH-0000hG-Vx for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:49 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-245-MjvCVP4eOaK_Hp9hLEDImA-1; Fri, 26 May 2023 05:08:44 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6A1EB1C01700; Fri, 26 May 2023 09:08:44 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACE87C154D1; Fri, 26 May 2023 09:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ibbhxtNSljHoQcRBS6pwxQdnkxlIhBqmSheTOLY9/jg=; b=Ffq8yjUzh7XkfkZjA3Tn8ndxE6UCsJ5WzZV7uYcpWsKOuaEN3Bz3qXNUsClodcKM0BBU7+ C6PkKV6YPq1h6rsURuSbs8m9H+SL6wUhWf3X6Da/fZqNb3J8s6MDTa4+zSgusukL0jrO7/ 1ESeRWhUHx8Pz2oiTLz8ARblGSv5Xig= X-MC-Unique: MjvCVP4eOaK_Hp9hLEDImA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 02/15] hw/alpha: Use MachineClass->default_nic in the alpha machine Date: Fri, 26 May 2023 11:08:27 +0200 Message-Id: <20230526090840.2225958-3-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092217475100005 Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Message-Id: <20230523110435.1375774-3-thuth@redhat.com> Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- hw/alpha/dp264.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 4161f559a7..03495e1e60 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -49,6 +49,7 @@ static void clipper_init(MachineState *machine) const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; + MachineClass *mc =3D MACHINE_GET_CLASS(machine); AlphaCPU *cpus[4]; PCIBus *pci_bus; PCIDevice *pci_dev; @@ -124,7 +125,7 @@ static void clipper_init(MachineState *machine) =20 /* Network setup. e1000 is good enough, failing Tulip support. */ for (i =3D 0; i < nb_nics; i++) { - pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL); + pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic, NULL); } =20 /* Super I/O */ @@ -213,6 +214,7 @@ static void clipper_machine_init(MachineClass *mc) mc->is_default =3D true; mc->default_cpu_type =3D ALPHA_CPU_TYPE_NAME("ev67"); mc->default_ram_id =3D "ram"; + mc->default_nic =3D "e1000"; } =20 DEFINE_MACHINE("clipper", clipper_machine_init) --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092172; cv=none; d=zohomail.com; s=zohoarc; b=Knyplb4WIPVy9I4R3BW5eT+S36nNbIueTH+AYHsth32GOTa8y6S/jNa0wPMKPEsp4+5MhCgfKkvYFh4aF6Zd4vsH+ZmkLfJzfDjSFX7qyrI0jp54twgnjlDdhyyty1dVZCxQg+v1jq7ZnGpqQAPfqx6aS16lbOi98QqK3NFeXhY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092172; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jib+erXhgTwzTvbqxC1fW/Y+uBaFMjH4MhUK1y4ysMU=; b=MslwLTcFCU8KaXb0BZZcTx4UjE2oZdmZgCYFzvFEY5++4noTgvbAxvDu5riZQWdFPRM62p6Heplgps4xzYXv0KGWXiuEvUAv5DjAO0CKrxu3SFa5/SXiUU6I8C0OvI7/3seJH6QGEHdSBxcpTPR8ZZ5+JJoDvZzDRNlZ/NNJKKo= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092172369971.7374003025709; Fri, 26 May 2023 02:09:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRO-0002wJ-PU; Fri, 26 May 2023 05:08:54 -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 1q2TRN-0002vV-3P for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:53 -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 1q2TRL-0000hq-KI for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:52 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-45-8QzHZMQuNNySFhrgZ_LDVQ-1; Fri, 26 May 2023 05:08:46 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 682EB3C0D185; Fri, 26 May 2023 09:08:45 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB204C15612; Fri, 26 May 2023 09:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jib+erXhgTwzTvbqxC1fW/Y+uBaFMjH4MhUK1y4ysMU=; b=NQegzM/2UU8yDIkcAmrhKYJbPBcCt2tZhdV/LK2PgX7JdiPK788h5Lmne3DlKtIHF/4PmD dsYxCiSHfOOGUx7H12qWUE07KkdJTzRKQu2FZDL3H4xd/HOdLE8q/9CawL4DPCbEC9fRh5 51VbZf/4sFba5oJp2gyq3Iai49Y3VY4= X-MC-Unique: 8QzHZMQuNNySFhrgZ_LDVQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 03/15] hw/arm: Use MachineClass->default_nic in the virt machine Date: Fri, 26 May 2023 11:08:28 +0200 Message-Id: <20230526090840.2225958-4-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092174335100010 Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Message-Id: <20230523110435.1375774-4-thuth@redhat.com> Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- hw/arm/virt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index b99ae18501..9b9f7d9c68 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1426,6 +1426,7 @@ static void create_pcie(VirtMachineState *vms) int i, ecam_id; PCIHostState *pci; MachineState *ms =3D MACHINE(vms); + MachineClass *mc =3D MACHINE_GET_CLASS(ms); =20 dev =3D qdev_new(TYPE_GPEX_HOST); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); @@ -1479,7 +1480,7 @@ static void create_pcie(VirtMachineState *vms) NICInfo *nd =3D &nd_table[i]; =20 if (!nd->model) { - nd->model =3D g_strdup("virtio"); + nd->model =3D g_strdup(mc->default_nic); } =20 pci_nic_init_nofail(nd, pci->bus, nd->model, NULL); @@ -3033,6 +3034,7 @@ static void virt_machine_class_init(ObjectClass *oc, = void *data) mc->auto_enable_numa_with_memhp =3D true; mc->auto_enable_numa_with_memdev =3D true; mc->default_ram_id =3D "mach-virt.ram"; + mc->default_nic =3D "virtio-net-pci"; =20 object_class_property_add(oc, "acpi", "OnOffAuto", virt_get_acpi, virt_set_acpi, --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092307; cv=none; d=zohomail.com; s=zohoarc; b=hpLiaQrUX4hSHm37iM05fgQ8L/0CjAWGZFOAnnlrcrAM9Hmh6hLrxtPE0iTVPvJVELDYFCsLMb4+0oSzJm2Yehy9V4n3C0PWYXWECS2oXbT/o6kn/Dx+qSDn9LITg4Fdb2AVMhcGubV46H0pVYF4D3s1BbHkK66IC/tNt2osU3I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092307; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YC6jIvP2QXQOLHf9hCxS1/9g4h0h+RAusucAoyZ/Zjw=; b=Nyd8oPNHFOeV3OmS+tfoGSU2Kfoi1hfC31ER30on5oJXLq/Tv34dKkW7WBNQXHdtsUpLghSos4AS2G9u5kkPsRZdS+CmlAM9N97bC7DwqoshCGL1LF6KcHRt5u9fDcGoVQVlD5nzO2LDSXJydgGOF27AtWV8vnrIELM2rgyho14= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092307716335.64652747822333; Fri, 26 May 2023 02:11:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRN-0002vT-0A; Fri, 26 May 2023 05:08:53 -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 1q2TRL-0002v5-GT for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:51 -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 1q2TRK-0000hd-1W for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:51 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-63-Dliami3IMw2N3ZKVvWuGyw-1; Fri, 26 May 2023 05:08:47 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 091D68015D8; Fri, 26 May 2023 09:08:47 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8815C154D2; Fri, 26 May 2023 09:08:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YC6jIvP2QXQOLHf9hCxS1/9g4h0h+RAusucAoyZ/Zjw=; b=J6iAdsNmQbbayzzpkyjadZG2ssymxsNFIJsYq6rgpdARpWKib9X+LlfH2pMvqV/ZJLg4HL WmJEI1D1DYNhtR4RRIscCyvmgIjsBo92If/+QDtY+Qk0ypgaK4w0fVaSgiAafrfANsfSJT 9zWTmTOGd99Czlwv6+fjCy9RnpBDoYU= X-MC-Unique: Dliami3IMw2N3ZKVvWuGyw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao Subject: [PULL 04/15] hw/loongarch64: Use MachineClass->default_nic in the virt machine Date: Fri, 26 May 2023 11:08:29 +0200 Message-Id: <20230526090840.2225958-5-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092308596100001 Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Message-Id: <20230523110435.1375774-5-thuth@redhat.com> Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Song Gao Tested-by: Song Gao Signed-off-by: Thomas Huth --- hw/loongarch/virt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 2b7588e32a..ceddec1b23 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -474,6 +474,7 @@ static DeviceState *create_platform_bus(DeviceState *pc= h_pic) =20 static void loongarch_devices_init(DeviceState *pch_pic, LoongArchMachineS= tate *lams) { + MachineClass *mc =3D MACHINE_GET_CLASS(lams); DeviceState *gpex_dev; SysBusDevice *d; PCIBus *pci_bus; @@ -528,7 +529,7 @@ static void loongarch_devices_init(DeviceState *pch_pic= , LoongArchMachineState * NICInfo *nd =3D &nd_table[i]; =20 if (!nd->model) { - nd->model =3D g_strdup("virtio"); + nd->model =3D g_strdup(mc->default_nic); } =20 pci_nic_init_nofail(nd, pci_bus, nd->model, NULL); @@ -1038,6 +1039,7 @@ static void loongarch_class_init(ObjectClass *oc, voi= d *data) mc->default_boot_order =3D "c"; mc->no_cdrom =3D 1; mc->get_hotplug_handler =3D virt_machine_get_hotplug_handler; + mc->default_nic =3D "virtio-net-pci"; hc->plug =3D loongarch_machine_device_plug_cb; hc->pre_plug =3D virt_machine_device_pre_plug; hc->unplug_request =3D virt_machine_device_unplug_request; --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092246; cv=none; d=zohomail.com; s=zohoarc; b=iHqEo2ye4onJTommG7p4C5LJwNNt/dn4o4oVmPlcn8tCm/WmEQ4yo8m69G9J+h3GIekusC2PuPiXqbh4z+9n1WSfFG8/Jkteq2nw+bTA0l1jtTNPEyUIW3cQlC8yv7UrWaz2BXy5zu9Q8OwiIX0ay6OObJHaYveZs9hOfBMFhSk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092246; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jQZcidCD9FXsEpzsaTAYOMpwzI84iEJUxvi1todzSl8=; b=C6XlxVzflFg+uVbEBEUzc8tnEWJmMDr6QcmndzxHjhFRtTzzpoGmx5nLnAjcQi2OrT8AIynN5CFQ44bt18fqFiL4u2+XuG3qOkLyqHAkLLkeAdWDLQ08IpVUTtA6NKpiX+rFBihas1LKvspumj7FZiDQ6mV4M6gWqRRAqQo6uY0= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092246234892.6637673826052; Fri, 26 May 2023 02:10:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRR-0002yo-Ee; Fri, 26 May 2023 05:08:57 -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 1q2TRP-0002wY-KQ for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:55 -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 1q2TRO-0000iN-4f for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:55 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-173-1LZsr1lDNb2lCHh3zfeyxw-1; Fri, 26 May 2023 05:08:48 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 211388032F5; Fri, 26 May 2023 09:08:48 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55AA3C0448E; Fri, 26 May 2023 09:08:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jQZcidCD9FXsEpzsaTAYOMpwzI84iEJUxvi1todzSl8=; b=ZHelkXEGmkiRQJiSd6fVo77Jw/NuUATle5LAgSQe1SL2rngnEhsIYGfFU5yG/OubY8vR7l I7jb83TnkP4Njw5DfIHVAF1O9phY5dGdg8umCeQRm6kd7J1cLaN7UNlaQpV2fdbZ3X8mBp 2ZScRUGg7WLNchcNJGGhhoikQfkzTfg= X-MC-Unique: 1LZsr1lDNb2lCHh3zfeyxw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 05/15] hw/xtensa: Use MachineClass->default_nic in the virt machine Date: Fri, 26 May 2023 11:08:30 +0200 Message-Id: <20230526090840.2225958-6-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092247608100003 Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Message-Id: <20230523110435.1375774-6-thuth@redhat.com> Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- hw/xtensa/virt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/xtensa/virt.c b/hw/xtensa/virt.c index a18e3fc910..b87f842e74 100644 --- a/hw/xtensa/virt.c +++ b/hw/xtensa/virt.c @@ -38,7 +38,8 @@ #include "xtensa_memory.h" #include "xtensa_sim.h" =20 -static void create_pcie(CPUXtensaState *env, int irq_base, hwaddr addr_bas= e) +static void create_pcie(MachineState *ms, CPUXtensaState *env, int irq_bas= e, + hwaddr addr_base) { hwaddr base_ecam =3D addr_base + 0x00100000; hwaddr size_ecam =3D 0x03f00000; @@ -54,6 +55,7 @@ static void create_pcie(CPUXtensaState *env, int irq_base= , hwaddr addr_base) MemoryRegion *mmio_alias; MemoryRegion *mmio_reg; =20 + MachineClass *mc =3D MACHINE_GET_CLASS(ms); DeviceState *dev; PCIHostState *pci; qemu_irq *extints; @@ -104,7 +106,7 @@ static void create_pcie(CPUXtensaState *env, int irq_ba= se, hwaddr addr_base) NICInfo *nd =3D &nd_table[i]; =20 if (!nd->model) { - nd->model =3D g_strdup("virtio"); + nd->model =3D g_strdup(mc->default_nic); } =20 pci_nic_init_nofail(nd, pci->bus, nd->model, NULL); @@ -117,7 +119,7 @@ static void xtensa_virt_init(MachineState *machine) XtensaCPU *cpu =3D xtensa_sim_common_init(machine); CPUXtensaState *env =3D &cpu->env; =20 - create_pcie(env, 0, 0xf0000000); + create_pcie(machine, env, 0, 0xf0000000); xtensa_sim_load_kernel(cpu, machine); } =20 @@ -127,6 +129,7 @@ static void xtensa_virt_machine_init(MachineClass *mc) mc->init =3D xtensa_virt_init; mc->max_cpus =3D 32; mc->default_cpu_type =3D XTENSA_DEFAULT_CPU_TYPE; + mc->default_nic =3D "virtio-net-pci"; } =20 DEFINE_MACHINE("virt", xtensa_virt_machine_init) --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092253; cv=none; d=zohomail.com; s=zohoarc; b=C066A0YwVbuVZbxvsvgPrjrXsaOn0jvtTUYBN+XXDdSDYQnB/JM+0J7I9zvaE47ZEvcbbzijtrtfao8TvJUbwBUuvQJvFpK0XCw5LPTOwujtMMkTvt74UCAlhQNC9fSK/+igyQEj/tBOlz0r43pA/TQv2R6T/yWuKi0saFZB1Zk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092253; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nHAj5Sdtzp9c1CV+g4uL/M86MOEDCpQItDSUIgjkW6s=; b=TY3m2vHQFD8WIBEptN5r8/pRp45j1rXUmkdGLxcncYTmSBriV33YxNqrMEXKCTpHEYQf/1uu/FMcSnINWNcCY4NPQP9v/dlGfY7SgzqgYNaiUUEGX8IRm4DulTLlgK0jSQJ4WbT3vU+7c71tpS4KU12N4OGeTRI1PPPvWkVCO24= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092253923922.513833946299; Fri, 26 May 2023 02:10:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRQ-0002yB-Od; Fri, 26 May 2023 05:08:56 -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 1q2TRP-0002wZ-Mi for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2TRO-0000iQ-6M for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:55 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-38-H0ummxZFM9eJCI-eGireuw-1; Fri, 26 May 2023 05:08:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2B6C9101A531; Fri, 26 May 2023 09:08:49 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65161C15612; Fri, 26 May 2023 09:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092133; 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: in-reply-to:in-reply-to:references:references; bh=nHAj5Sdtzp9c1CV+g4uL/M86MOEDCpQItDSUIgjkW6s=; b=LCnsFLlEJdiCOqhFzM4mkL2P/SfrlTMUuTJE3/ch4LerH2Zp8kPMssw2Y0A++vcleEPTeK o0iT0HSxaQWxcB30RQvtu0KOOA6R291RCrQpQ4qmOoXQLYbyH5KW7bsiCJ13ZewEu71HAt 481GvA9YMCpu5xm5SpFKpgmS5oyXojY= X-MC-Unique: H0ummxZFM9eJCI-eGireuw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Marcin Juszkiewicz Subject: [PULL 06/15] hw/arm: Use MachineClass->default_nic in the sbsa-ref machine Date: Fri, 26 May 2023 11:08:31 +0200 Message-Id: <20230526090840.2225958-7-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092255610100007 Content-Type: text/plain; charset="utf-8" Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Message-Id: <20230524082037.1620952-1-thuth@redhat.com> Reviewed-by: Richard Henderson Tested-by: Marcin Juszkiewicz Signed-off-by: Thomas Huth --- hw/arm/sbsa-ref.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 792371fdce..9c3e670ec6 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -596,6 +596,7 @@ static void create_pcie(SBSAMachineState *sms) hwaddr size_mmio_high =3D sbsa_ref_memmap[SBSA_PCIE_MMIO_HIGH].size; hwaddr base_pio =3D sbsa_ref_memmap[SBSA_PCIE_PIO].base; int irq =3D sbsa_ref_irqmap[SBSA_PCIE]; + MachineClass *mc =3D MACHINE_GET_CLASS(sms); MemoryRegion *mmio_alias, *mmio_alias_high, *mmio_reg; MemoryRegion *ecam_alias, *ecam_reg; DeviceState *dev; @@ -641,7 +642,7 @@ static void create_pcie(SBSAMachineState *sms) NICInfo *nd =3D &nd_table[i]; =20 if (!nd->model) { - nd->model =3D g_strdup("e1000e"); + nd->model =3D g_strdup(mc->default_nic); } =20 pci_nic_init_nofail(nd, pci->bus, nd->model, NULL); @@ -858,6 +859,7 @@ static void sbsa_ref_class_init(ObjectClass *oc, void *= data) mc->minimum_page_bits =3D 12; mc->block_default_type =3D IF_IDE; mc->no_cdrom =3D 1; + mc->default_nic =3D "e1000e"; mc->default_ram_size =3D 1 * GiB; mc->default_ram_id =3D "sbsa-ref.ram"; mc->default_cpus =3D 4; --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092254; cv=none; d=zohomail.com; s=zohoarc; b=kaXFFjzXjDQtgU122E7XzMlmoVXjYA6QBAMn5OUHf3bnPy77CUHBPFiBL7d7ks8HC+djINa8dZOrhRWYYyyefmKcIJmLZjx/onvIVneZEQjW3S4sgGRwOWnf2SZaM2wmG/dPbGf270I54CKAZ032cF8rDverHldjmFfoiYravtM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092254; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FOT2Js3b4mm4Jy9Geh3nYmXhP7NcBm28PYHB/D1n35I=; b=Okece6qRLfBp8rpELhfRsumWkfsWkLlsxww13I+X9gaOvCCH02trovvTL2IMFRI6oUGyJA4Qke8t4LIDe9ZbYyD3bW1uVd1vO1ainTz+SLpikk40V7fWgOBfdCYxw3RcX5SXj7Plsj1Fl4WN5l0hvKsmXSW9pmGvpmdq1kOJDlU= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092254434663.4190188920718; Fri, 26 May 2023 02:10:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRV-0003AY-MU; Fri, 26 May 2023 05:09:01 -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 1q2TRR-0002zK-Pk for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2TRQ-0000ia-AZ for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:57 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-470-3r50-6JTPAyahj-cpunOhg-1; Fri, 26 May 2023 05:08:50 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 41050185A78E; Fri, 26 May 2023 09:08:50 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id 714F0C154D1; Fri, 26 May 2023 09:08:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FOT2Js3b4mm4Jy9Geh3nYmXhP7NcBm28PYHB/D1n35I=; b=Vv5X20ADM5QuCNdu3v4XG4zTRCQ7pGbTnWiM7xPWnHLdfzAGSVN7yOkEDIjnv4g+Vb3pFc p5atidsTvSZYYZdjejTtyDLXUWMqkMgZSdaHrKJTK2R0krs2JBp3D74dnZz6+iUOzJRvx1 6/wLFiHDyV3voFj6dVbN/ajZmGcxSUg= X-MC-Unique: 3r50-6JTPAyahj-cpunOhg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 07/15] hw/mips: Use MachineClass->default_nic in the virt machine Date: Fri, 26 May 2023 11:08:32 +0200 Message-Id: <20230526090840.2225958-8-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092256433100015 From: Philippe Mathieu-Daud=C3=A9 Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Inspired-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230524122559.28863-1-philmd@linaro.org> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- hw/mips/loongson3_virt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index 25534288dd..216812f660 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -406,6 +406,7 @@ static inline void loongson3_virt_devices_init(MachineS= tate *machine, PCIBus *pci_bus; DeviceState *dev; MemoryRegion *mmio_reg, *ecam_reg; + MachineClass *mc =3D MACHINE_GET_CLASS(machine); LoongsonMachineState *s =3D LOONGSON_MACHINE(machine); =20 dev =3D qdev_new(TYPE_GPEX_HOST); @@ -456,7 +457,7 @@ static inline void loongson3_virt_devices_init(MachineS= tate *machine, NICInfo *nd =3D &nd_table[i]; =20 if (!nd->model) { - nd->model =3D g_strdup("virtio"); + nd->model =3D g_strdup(mc->default_nic); } =20 pci_nic_init_nofail(nd, pci_bus, nd->model, NULL); @@ -619,6 +620,7 @@ static void loongson3v_machine_class_init(ObjectClass *= oc, void *data) mc->default_ram_size =3D 1600 * MiB; mc->kvm_type =3D mips_kvm_type; mc->minimum_page_bits =3D 14; + mc->default_nic =3D "virtio-net-pci"; } =20 static const TypeInfo loongson3_machine_types[] =3D { --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092171; cv=none; d=zohomail.com; s=zohoarc; b=MCG1gkfhDHeXFHgEJHVKk/ARHCl9J9EwfHbLC9E9oxRUlg2RmMra8b2HEWI2O5lsRKz917qI/z/kXf4L11za0FnCOHLqhejpOjIj5g0qfvh/kEKICWJ0FvThlWoZkay8CML6zvjdbkNfymzlwZbXaef/njG+j4d/fGFBroJBIJQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092171; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=a9I59SkqBH9pEciiDCZ+t1+clxWRnm4DnxLKkEpRnlA=; b=Ew+mH2DG/Zh7EL5/5H0c9QjsxPVGHzYo8rRMIeF6hUIVP1VHl9RBnSrYp/RcC3vUSrb/NDT46/TlUYyTs1qC14no8sP2CAkZtQ0XV2mZZtH3M7P+fPCfsxNWaT1B0IVdSqy5piM+BX1LVOrxXhZ9Jfv5TUPwqGPuyD2+STT6vpo= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092171845135.8054598648622; Fri, 26 May 2023 02:09:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRS-0002zc-BF; Fri, 26 May 2023 05:08:58 -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 1q2TRQ-0002yY-Qj for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2TRO-0000iI-Tg for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:56 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-296-rKknUq7gNi-Y11Q2ZRlgVA-1; Fri, 26 May 2023 05:08:51 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4341C101A53A; Fri, 26 May 2023 09:08:51 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8387FC15612; Fri, 26 May 2023 09:08:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092133; 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: in-reply-to:in-reply-to:references:references; bh=a9I59SkqBH9pEciiDCZ+t1+clxWRnm4DnxLKkEpRnlA=; b=ORq0e+7ccn1T78tETtpHNvab1YdARixv/Jyo83un6E5UoCmfv6HvpQ4m0ZVC1+pbUB1yPv aKaT13aSwEwopjsdf/FM/frzKrjiwnUbIvjnZQbsT/OjNT/M7EuIO7i0IzTGRBrJjz6VX8 jZH4EK4/a9Yeehx6/neWH4ycicB2Bc8= X-MC-Unique: rKknUq7gNi-Y11Q2ZRlgVA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Ani Sinha Subject: [PULL 08/15] tests/qtest/usb-hcd-uhci-test: Check whether "usb-storage" is available Date: Fri, 26 May 2023 11:08:33 +0200 Message-Id: <20230526090840.2225958-9-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092173849100007 Content-Type: text/plain; charset="utf-8" The "usb-storage" device might not have been compiled into the binary (e.g. when compiling with "--without-default-devices"), so we have to check first before using it. Message-Id: <20230525081016.1870364-2-thuth@redhat.com> Reviewed-by: Ani Sinha Signed-off-by: Thomas Huth --- tests/qtest/usb-hcd-uhci-test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qtest/usb-hcd-uhci-test.c b/tests/qtest/usb-hcd-uhci-tes= t.c index 84ac2f3c1a..28751f53da 100644 --- a/tests/qtest/usb-hcd-uhci-test.c +++ b/tests/qtest/usb-hcd-uhci-test.c @@ -74,7 +74,9 @@ int main(int argc, char **argv) qtest_add_func("/uhci/pci/init", test_uhci_init); qtest_add_func("/uhci/pci/port1", test_port_1); qtest_add_func("/uhci/pci/hotplug", test_uhci_hotplug); - qtest_add_func("/uhci/pci/hotplug/usb-storage", test_usb_storage_hotpl= ug); + if (qtest_has_device("usb-storage")) { + qtest_add_func("/uhci/pci/hotplug/usb-storage", test_usb_storage_h= otplug); + } =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { qs =3D qtest_pc_boot("%s", cmd); --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092192; cv=none; d=zohomail.com; s=zohoarc; b=hXqWMeQb4KvCY9jkHaP9n63Zh57Vmzr84M/EjONO+dhiEEMq2Nrk46P505SgofRekaRZiQX4voP4GhKC9nuHmDB9ToJrxdM2DXtiFBlxzUE9eYd+Z1IXN544LfCrY+Epcw3UfjFUDIVEETsNMcpYJxNpKwd4bZ12oL0VWaai208= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092192; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=m8oJSri4O/ld7IJotySeu6D2Ij5y8UgX+DZBTNHtWok=; b=fsj1oIO4sX5Fqd1CGXDdWzzsPJnfrvRLF8BqHgSCs1yLZgfJDyYrpPcYVoG0owJa0gAxnPKLYNOQOzzPH4+0p5m3YyTZa+UZV6+e0OomMuQNo4kbB9NTTEc85sgOj3dqHi/7fTsO7i1WZaT8IpGTyLlLX1yQOsTd8K9PCvN/KVg= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092192052176.58324388366213; Fri, 26 May 2023 02:09:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRU-000373-Uy; Fri, 26 May 2023 05:09:00 -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 1q2TRT-000335-8i for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:59 -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 1q2TRR-0000jD-O0 for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:58 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-591-z6fu7JljPki9vYVLR1a3jg-1; Fri, 26 May 2023 05:08:53 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 49AEB85A5BB; Fri, 26 May 2023 09:08:53 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id 867D8C154D1; Fri, 26 May 2023 09:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092137; 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: in-reply-to:in-reply-to:references:references; bh=m8oJSri4O/ld7IJotySeu6D2Ij5y8UgX+DZBTNHtWok=; b=ReW4T8jZiX/Xoxp+jNV4E4ShrDNDATBegV9L6QYS9ASpxQ0QU6dz2BS/yiP4Yd0Bm0CEgV +b4oHoqjuoIkYlkRWcw/AQt7LXbY5WN8HyTi16xzHv1+Kn2uWIvifyU3uyoS/iEtkhPae6 0pRakaaJt1Nsno8fl8ACCTw2pCffZHA= X-MC-Unique: z6fu7JljPki9vYVLR1a3jg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Fabiano Rosas Subject: [PULL 09/15] tests/qtest: Check for virtio-blk before using -cdrom with the arm virt machine Date: Fri, 26 May 2023 11:08:34 +0200 Message-Id: <20230526090840.2225958-10-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092194020100003 Content-Type: text/plain; charset="utf-8" The arm "virt" machine needs "virtio-blk-pci" for devices that get attached via the "-cdrom" option. Since this is an optional device that might not be available in the binary, we should check for the availability of this device first before using it. Message-Id: <20230525081016.1870364-3-thuth@redhat.com> Reviewed-by: Fabiano Rosas Signed-off-by: Thomas Huth --- tests/qtest/bios-tables-test.c | 2 +- tests/qtest/cdrom-test.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 159e4edb8f..ed1c69cf01 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -2164,7 +2164,7 @@ int main(int argc, char *argv[]) } } } else if (strcmp(arch, "aarch64") =3D=3D 0) { - if (has_tcg) { + if (has_tcg && qtest_has_device("virtio-blk-pci")) { qtest_add_func("acpi/virt", test_acpi_virt_tcg); qtest_add_func("acpi/virt/acpihmatvirt", test_acpi_virt_tcg_acpi_hmat); diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c index d1cc375849..f2a8d91929 100644 --- a/tests/qtest/cdrom-test.c +++ b/tests/qtest/cdrom-test.c @@ -264,9 +264,13 @@ int main(int argc, char **argv) const char *armmachines[] =3D { "realview-eb", "realview-eb-mpcore", "realview-pb-a8", "realview-pbx-a9", "versatileab", "versatilepb", "vexpress-a15= ", - "vexpress-a9", "virt", NULL + "vexpress-a9", NULL }; add_cdrom_param_tests(armmachines); + if (qtest_has_device("virtio-blk-pci")) { + const char *virtmachine[] =3D { "virt", NULL }; + add_cdrom_param_tests(virtmachine); + } } else { const char *nonemachine[] =3D { "none", NULL }; add_cdrom_param_tests(nonemachine); --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092213; cv=none; d=zohomail.com; s=zohoarc; b=RN780HCDXS/lbhtbqLMHdtW5hR7YdNn08OUdNeV+43RTzcdmwo/tw84kWA9DnROjDfbJER1ELFL835KmzWj3EJatKQuuW8mHEbLsIRaY+Pq+RmadlAkjVybqMyQXJ9AaP67v/8edv+swTTHLSkz6Asjuk/wy+2d6Vstc2wgsb7s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092213; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9ZZx3B25Wj3YuEZ2HOnTvDgUDAEPRVELYqzbvcmGB8E=; b=jRnRNfWYzMremW7QMaXipEWSjgklDeUeaR75ATWIQwMKkRO07VQ8Y1aSwAmwZNPupmxc9Va9XLxWVr6WWTnDhB5j/y/HbuCvoxBdm2MY+f/oALfWoXV6l5fHNJ2FxG86a1k4xd4VCGqxIg3ThqvmDwvaxRpoLc57xCqRH2LE9x0= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092213696796.7501636349946; Fri, 26 May 2023 02:10:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRU-00035P-GM; Fri, 26 May 2023 05:09:00 -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 1q2TRS-0002zT-3f for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2TRQ-0000iw-Kg for qemu-devel@nongnu.org; Fri, 26 May 2023 05:08:57 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-60-orIIUjMjOcyryx6K4j0C4w-1; Fri, 26 May 2023 05:08:54 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4384D3C0D185; Fri, 26 May 2023 09:08:54 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8AC40C154D1; Fri, 26 May 2023 09:08:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092136; 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: in-reply-to:in-reply-to:references:references; bh=9ZZx3B25Wj3YuEZ2HOnTvDgUDAEPRVELYqzbvcmGB8E=; b=XdsH5h/3UFFCIOCZkWzoG5O5iifBGeNKS8k+VJ0iudSrtuapI4GY5xZ7EL9FoTrloSMv8h wDs6O/8b/B9kSpmLSrv5Xx/Rfgcr7agTMPpplpF4v3VY+Ds9/Ipvme561zHyOxQdAjbH7t 8buyhiL4oCpMVaBry1JXvJvIt7E/tnM= X-MC-Unique: orIIUjMjOcyryx6K4j0C4w-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Fabiano Rosas Subject: [PULL 10/15] tests/qtest/rtl8139-test: Check whether the rtl8139 device is available Date: Fri, 26 May 2023 11:08:35 +0200 Message-Id: <20230526090840.2225958-11-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092214303100001 Content-Type: text/plain; charset="utf-8" Though we are already using CONFIG_RTL8139_PCI in the meson.build file for testing whether the rtl8139 device is available or not, this is not enough: The CONFIG switch might have been selected by another target (e.g. the mips fuloong2e machine has the rtl8139 chip soldered on the board), so CONFIG_RTL8139_PCI ends up in config_all_devices and the test then gets executed on x86. We need an additional run-time check to be on the safe side to make this test also work when configure has been run with "--without-default-devices". Message-Id: <20230525081016.1870364-4-thuth@redhat.com> Reviewed-by: Fabiano Rosas Signed-off-by: Thomas Huth --- tests/qtest/rtl8139-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qtest/rtl8139-test.c b/tests/qtest/rtl8139-test.c index 4bd240e9ee..4dc0a0d22e 100644 --- a/tests/qtest/rtl8139-test.c +++ b/tests/qtest/rtl8139-test.c @@ -209,6 +209,10 @@ int main(int argc, char **argv) =20 g_test_init(&argc, &argv, NULL); =20 + if (!qtest_has_device("rtl8139")) { + return 0; + } + qtest_start("-device rtl8139"); =20 qtest_add_func("/rtl8139/nop", nop); --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092172; cv=none; d=zohomail.com; s=zohoarc; b=Xn1YgLUXk+/Fux8Nq7c/l/cXvr72a/B18I5lrDHT6a9PhfjGuFAhqjHWSs2oeYm/lW/aDnVx4HgwFqRMNwMGJ1XMnfh1NaiErGq2S8DcVw9IYzgC9zc/0Dk563gY7XGrsNI8/W/0wVi0SZBNqzRmB0M1EQWr/hHy9npf+IkNn88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092172; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jRSmNcbLsD3YnzGbuB6oDZcfpK/RFjWfTS+JK5RIMHU=; b=ZMpUi2oJFwz2grH7r9YjvQmX5u4QOrIDpRerbiKnwabyCkB60jjbQlvvo606dfIrH6aMVAmZ4tNYbJCYlLKTdzk7jU1auX9r9/XtVGVKtPKRhVw+IYHbTjZciyAtX08nBVk6FehUw/mx6fb1gJhbmFj0XIAe4Q5iRVZT58DgTZg= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092172323538.8596164327845; Fri, 26 May 2023 02:09:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRX-0003Fs-8K; Fri, 26 May 2023 05:09:03 -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 1q2TRV-0003Aq-Or for qemu-devel@nongnu.org; Fri, 26 May 2023 05:09:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2TRT-0000kw-7O for qemu-devel@nongnu.org; Fri, 26 May 2023 05:09:01 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-184-ejd6TP3QMUWdIGWv0Lwrmg-1; Fri, 26 May 2023 05:08:55 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4022C800B2A; Fri, 26 May 2023 09:08:55 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id 81B12C0448E; Fri, 26 May 2023 09:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092138; 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: in-reply-to:in-reply-to:references:references; bh=jRSmNcbLsD3YnzGbuB6oDZcfpK/RFjWfTS+JK5RIMHU=; b=SfUvv3YOGG8J74xPJkcWeCOyItrzkfF1ymPYMvOiPjCBlWwtDQiE3kVuIYvZv8c2p/gE00 sA55cChKilc13rKrrP2xhoNU2obrkwnqkY06AvtuiEtpqXj4R8+edd+Bsqc+7qyOAJrXfo /hri7xuWQzF9F67LdfV8g++R37X30fY= X-MC-Unique: ejd6TP3QMUWdIGWv0Lwrmg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Ani Sinha Subject: [PULL 11/15] tests/qtest/usb-hcd-ehci-test: Check for EHCI and UHCI HCDs before using them Date: Fri, 26 May 2023 11:08:36 +0200 Message-Id: <20230526090840.2225958-12-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092174335100009 Content-Type: text/plain; charset="utf-8" The devices might not be available in the binary (e.g. when compiling with "--without-default-devices"), so we have to check before we can use them. Message-Id: <20230525081016.1870364-5-thuth@redhat.com> Reviewed-by: Ani Sinha Signed-off-by: Thomas Huth --- tests/qtest/usb-hcd-ehci-test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/qtest/usb-hcd-ehci-test.c b/tests/qtest/usb-hcd-ehci-tes= t.c index c51e8bb223..87e37cdd7c 100644 --- a/tests/qtest/usb-hcd-ehci-test.c +++ b/tests/qtest/usb-hcd-ehci-test.c @@ -149,6 +149,11 @@ int main(int argc, char **argv) =20 g_test_init(&argc, &argv, NULL); =20 + if (!qtest_has_device("ich9-usb-ehci1") || + !qtest_has_device("ich9-usb-uhci1")) { + return 0; + } + qtest_add_func("/ehci/pci/uhci-port-1", pci_uhci_port_1); qtest_add_func("/ehci/pci/ehci-port-1", pci_ehci_port_1); qtest_add_func("/ehci/pci/ehci-config", pci_ehci_config); --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092254; cv=none; d=zohomail.com; s=zohoarc; b=H4IhZ87UHGsS2wGyX4RF7nkW3yU3geQxSvoOXe/GfI4c6PlAvwBsESz8KDFJgv8uN0tqifTWMEUfZWJdRqvxbSaNdDnPITn2Wyb2DwKKYamXxi/EplUILen/xa2JSYTCc92jGaad8PrHlX/uJnkSCDdELPgTqRXCiU4MydJHi9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092254; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6y1zQGFPIYTRlYFZ1m6N9MVEIpi+f+Fj9potENB3HBQ=; b=SaD00M/IsARQWVY/xVR5ImRKFQ9V/PP2QCB7ZLX95PL4ww1eXJfN3swCCkYAORsnUi+ll0dUHjpmWNSGfWmWj57I7wg+vairy5P8NuRb50V08B/RvwhmT8pvLkLAojzCKFK8/gNbhsNji3c/b2hO3SJ1FX0Hnpg4Us7AmgDn7Wg= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092254553145.42161005627565; Fri, 26 May 2023 02:10:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRi-0003JV-8K; Fri, 26 May 2023 05:09:14 -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 1q2TRg-0003JI-U9 for qemu-devel@nongnu.org; Fri, 26 May 2023 05:09:12 -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 1q2TRS-0000kr-VH for qemu-devel@nongnu.org; Fri, 26 May 2023 05:09:12 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-655-7exvE7r0N2qUR9tx3QCkZQ-1; Fri, 26 May 2023 05:08:56 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 60A8D85A5AA; Fri, 26 May 2023 09:08:56 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82363C154D1; Fri, 26 May 2023 09:08:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6y1zQGFPIYTRlYFZ1m6N9MVEIpi+f+Fj9potENB3HBQ=; b=EPUTX5sTZZSrrvjfIYrBGaL3r5ysdEXy8xhMRy1C9PNH6LCU3b/+qgPhJoNMZjPKlJGJXg PxxJT1NGO+gsFc63rNYFyBQhpEmnY8TWwtD16u0cjcoetaSQgQwNot7vIWg5RZHhn/K0zb ox0yi1Xk5vbJYQURi5tVWd6VJgbUW8E= X-MC-Unique: 7exvE7r0N2qUR9tx3QCkZQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 12/15] tests/qtest/ac97-test: add up-/downsampling tests Date: Fri, 26 May 2023 11:08:37 +0200 Message-Id: <20230526090840.2225958-13-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092256132100012 From: Volker R=C3=BCmelin Test if the audio subsystem can handle extreme up- and down- sampling ratios like 44100/1 and 1/44100. For some time these used to trigger QEMU aborts. The test was taken from https://gitlab.com/qemu-project/qemu/-/issues/71 where it was used to demonstrate a very different issue. Suggested-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Volker R=C3=BCmelin Message-Id: <20230520113313.5177-1-vr_qemu@t-online.de> Signed-off-by: Thomas Huth --- tests/qtest/ac97-test.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/tests/qtest/ac97-test.c b/tests/qtest/ac97-test.c index 74103efdfa..b71bd60a8a 100644 --- a/tests/qtest/ac97-test.c +++ b/tests/qtest/ac97-test.c @@ -42,16 +42,54 @@ static void *ac97_create(void *pci_bus, QGuestAllocator= *alloc, void *addr) return &ac97->obj; } =20 +/* + * This is rather a test of the audio subsystem and not an AC97 test. Test= if + * the audio subsystem can handle a 44100/1 upsample ratio. For some time = this + * used to trigger QEMU aborts. + */ +static void ac97_playback_upsample(void *obj, void *data, QGuestAllocator = *alloc) +{ + QAC97 *ac97 =3D obj; + QPCIDevice *dev =3D &ac97->dev; + QPCIBar bar0; + + qpci_device_enable(dev); + bar0 =3D qpci_iomap(dev, 0, NULL); + /* IOBAR0 offset 0x2c: PCM Front DAC Rate */ + qpci_io_writew(dev, bar0, 0x2c, 0x1); +} + +/* + * This test is similar to the playback upsample test. QEMU shouldn't abor= t if + * asked for a 1/44100 downsample ratio. + */ +static void ac97_record_downsample(void *obj, void *data, QGuestAllocator = *alloc) +{ + QAC97 *ac97 =3D obj; + QPCIDevice *dev =3D &ac97->dev; + QPCIBar bar0; + + qpci_device_enable(dev); + bar0 =3D qpci_iomap(dev, 0, NULL); + /* IOBAR0 offset 0x32: PCM L/R ADC Rate */ + qpci_io_writew(dev, bar0, 0x32, 0x1); +} + static void ac97_register_nodes(void) { QOSGraphEdgeOptions opts =3D { - .extra_device_opts =3D "addr=3D04.0", + .extra_device_opts =3D "addr=3D04.0,audiodev=3Dsnd0", + .after_cmd_line =3D "-audiodev none,id=3Dsnd0" + ",out.frequency=3D44100,in.frequency=3D44100", }; add_qpci_address(&opts, &(QPCIAddress) { .devfn =3D QPCI_DEVFN(4, 0) }= ); =20 qos_node_create_driver("AC97", ac97_create); qos_node_produces("AC97", "pci-device"); qos_node_consumes("AC97", "pci-bus", &opts); + + qos_add_test("playback_upsample", "AC97", ac97_playback_upsample, NULL= ); + qos_add_test("record_downsample", "AC97", ac97_record_downsample, NULL= ); } =20 libqos_init(ac97_register_nodes); --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092319; cv=none; d=zohomail.com; s=zohoarc; b=J4pg1sN5ayQAEDVtrMWGTE2k86UEiYGNJtyjZGtegbYVE1yEqTX7ID8eCCG1VndXDZBBt/zp6rsoKHnuyjuf1CM3Rh4Hhf7UuRT0GFyrAOr/XvWb2ODpHOrjvvY9kNoF/8ovK7EOz/ayLPMhFuPxxkdNTSY1ny7AvbmiwMwpa+I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092319; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lEy1EnPNjKiC9Xew0JwSdNOd0hK/nxorYYyEySf/o/E=; b=S7oW/ZHg2c4ADZE8OF5WBRIbcM2XezRBhH5KeRJ4F6QfKeIDVj30EQCsQdzY6AlcTpWEQgrk7rYgEjJnUnSO9PYqMGdYXlAsMhtm2zCoLrfFbFzMhN07PBu9lMhNLlClI2Rq9vVZmvdRWw+45OEKZTcDjWG0crlT1PFpPKxLLeA= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092319039548.717697260285; Fri, 26 May 2023 02:11:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRZ-0003ID-1z; Fri, 26 May 2023 05:09:05 -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 1q2TRX-0003Fw-8A for qemu-devel@nongnu.org; Fri, 26 May 2023 05:09:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2TRV-0000lC-8n for qemu-devel@nongnu.org; Fri, 26 May 2023 05:09:02 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-324-Ad_Zkm3YME-oSuRUCTZfLg-1; Fri, 26 May 2023 05:08:58 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A6FBF8015D8; Fri, 26 May 2023 09:08:57 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4680C154D1; Fri, 26 May 2023 09:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lEy1EnPNjKiC9Xew0JwSdNOd0hK/nxorYYyEySf/o/E=; b=P88Q9ReFXf5HaN3m6LdtG1uSc2tsfnITB5niCVxxTsck6jdfBaljS0SegLhTop2wlk6KwW l//C0m17I1iJs4xn6pvFh+ix6N/GBfmIz6HSNwj5h8uNHN8pZ4CwR1ISq8rbjvD1meyirt HwclQVHytW423LvWiKp/T/IHOoysa8Q= X-MC-Unique: Ad_Zkm3YME-oSuRUCTZfLg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Igor Mammedov , Shaoqin Huang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 13/15] machine: do not crash if default RAM backend name has been stolen Date: Fri, 26 May 2023 11:08:38 +0200 Message-Id: <20230526090840.2225958-14-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092321012100003 From: Igor Mammedov QEMU aborts when default RAM backend should be used (i.e. no explicit '-machine memory-backend=3D' specified) but user has created an object which 'id' equals to default RAM backend name used by board. $QEMU -machine pc \ -object memory-backend-ram,id=3Dpc.ram,size=3D4294967296 Actual results: QEMU 7.2.0 monitor - type 'help' for more information (qemu) Unexpected error in object_property_try_add() at ../qom/object.c:12= 39: qemu-kvm: attempt to add duplicate property 'pc.ram' to object (type 'cont= ainer') Aborted (core dumped) Instead of abort, check for the conflicting 'id' and exit with an error, suggesting how to remedy the issue. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D2207886 Signed-off-by: Igor Mammedov Message-Id: <20230522131717.3780533-1-imammedo@redhat.com> Tested-by: Thomas Huth Reviewed-by: Thomas Huth Reviewed-by: Shaoqin Huang Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- hw/core/machine.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index 07f763eb2e..1000406211 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1338,6 +1338,14 @@ void machine_run_board_init(MachineState *machine, c= onst char *mem_path, Error * } } else if (machine_class->default_ram_id && machine->ram_size && numa_uses_legacy_mem()) { + if (object_property_find(object_get_objects_root(), + machine_class->default_ram_id)) { + error_setg(errp, "object name '%s' is reserved for the default" + " RAM backend, it can't be used for any other purposes." + " Change the object's 'id' to something else", + machine_class->default_ram_id); + return; + } if (!create_default_memdev(current_machine, mem_path, errp)) { return; } --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092251; cv=none; d=zohomail.com; s=zohoarc; b=FryMy0qmIUNRaHdDEMAQIDYWSWSeWgtphQKSrNL83oxmMpaC+mHLiO2q6NqvnnSo8NTVP8UxjZf0B6szxIme8ZyTf1lH2C+vIWrat9wDUPEZmoyFd2LJ8MEZ9hbKEmoRqQCmYasmkRHPzVXTaIkhk+VtG6zf7SoXEP0AhjxmO/U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092251; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RHMD4w4KaQMdD/nnfIPm2Wj9G/KP0/XEcrg4Bepn3CU=; b=jsnLuAbd17rRNwmkqmqiZwBUiXmEyxEDxJiKw/epDV/zzEhaZy6kjFPtFNFfgVMAmV7BTRQ1eKXvYDmbCqlmwzYL9FcmpupLBeH6bsMtPh+oqJfnUbe5TG4nkkO/367PnR/xZN6EqzbV9Nwu8GioujyiktsDRRhVfMxEWsTbw0U= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16850922510241023.2997002562295; Fri, 26 May 2023 02:10:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRa-0003IF-Gk; Fri, 26 May 2023 05:09:06 -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 1q2TRY-0003Hl-1N for qemu-devel@nongnu.org; Fri, 26 May 2023 05:09:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2TRV-0000lL-Bd for qemu-devel@nongnu.org; Fri, 26 May 2023 05:09:03 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-330-F5itWIxzMPmNWdmGpkEg5w-1; Fri, 26 May 2023 05:08:59 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 85C4D3C0D1A9; Fri, 26 May 2023 09:08:58 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB55BC154D2; Fri, 26 May 2023 09:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RHMD4w4KaQMdD/nnfIPm2Wj9G/KP0/XEcrg4Bepn3CU=; b=XHFbHmglhoVoPvPVr2bJEp6ejZn1evF2zl9AFz9FdMCj8PRzYPAcS/3BCxst87M6Ft20Lh QpSeGCOXVqZPx0ayT4VsGhvkangu7LY4cEhRNL4X8cRGorBRepyx6yDWxR7dJZ+JbK5bu8 lgkO4zs68eIEc1rEtIyPEzLvd/n5DzE= X-MC-Unique: F5itWIxzMPmNWdmGpkEg5w-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Subject: [PULL 14/15] lsi53c895a: disable reentrancy detection for MMIO region, too Date: Fri, 26 May 2023 11:08:39 +0200 Message-Id: <20230526090840.2225958-15-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092252096100001 Content-Type: text/plain; charset="utf-8" While trying to use a SCSI disk on the LSI controller with an older version of Fedora (25), I'm getting: qemu: warning: Blocked re-entrant IO on MemoryRegion: lsi-mmio at addr: 0x= 34 and the SCSI controller is not usable. Seems like we have to disable the reentrancy checker for the MMIO region, too, to get this working again. The problem could be reproduced it like this: ./qemu-system-x86_64 -accel kvm -m 2G -machine q35 \ -device lsi53c810,id=3Dlsi1 -device scsi-hd,drive=3Dd0 \ -drive if=3Dnone,id=3Dd0,file=3D.../somedisk.qcow2 \ -cdrom Fedora-Everything-netinst-i386-25-1.3.iso Where somedisk.qcow2 is an image that contains already some partitions and file systems. In the boot menu of Fedora, go to "Troubleshooting" -> "Rescue a Fedora system" -> "3) Skip to shell" Then check "dmesg | grep -i 53c" for failure messages, and try to mount a partition from somedisk.qcow2. Message-Id: <20230516090556.553813-1-thuth@redhat.com> Signed-off-by: Thomas Huth --- hw/scsi/lsi53c895a.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index db27872963..048436352b 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -2307,6 +2307,7 @@ static void lsi_scsi_realize(PCIDevice *dev, Error **= errp) * re-entrancy guard. */ s->ram_io.disable_reentrancy_guard =3D true; + s->mmio_io.disable_reentrancy_guard =3D true; =20 address_space_init(&s->pci_io_as, pci_address_space_io(dev), "lsi-pci-= io"); qdev_init_gpio_out(d, &s->ext_irq, 1); --=20 2.31.1 From nobody Fri Apr 26 01:02:26 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685092204; cv=none; d=zohomail.com; s=zohoarc; b=iYyNd/uTePFZL5QtXfb4sZu7o1z0y1Me2TbMR9om5/7jVdDSwMMo6UOdpml9BheK480ioBWsCi62cNiqtmQcPbnZWVnCXtVcECCmUGKsvJsTq17Q13x/pnSBAMqsiBIvh6R1/NNT1iC/42WLGv3El+51hDsyUbq7Q4gw2/nALv8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685092204; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TcDh0MJ4Y2p99oRb3z+69aOpUYuaxf8ymmYkg4MCcrI=; b=GK2Rdqp+WN1p27gcUNLRC93+Aidxz8BVvoFWc8j2ca9s8YMQJUwvOwdSQZTgg2UYm6NdqxeCQstvn27aGRISVJz8QErESnC8dtKFv5sDTcjrSpQfRT98QTr3vXVSlx8KzbngUqdnElJi+pCgAT+9YNqFeaxh77jmnlw3p7MnC3A= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685092204722589.6643958149733; Fri, 26 May 2023 02:10:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2TRb-0003Il-P0; Fri, 26 May 2023 05:09:07 -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 1q2TRa-0003Ic-Kl for qemu-devel@nongnu.org; Fri, 26 May 2023 05:09:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2TRX-0000lp-QL for qemu-devel@nongnu.org; Fri, 26 May 2023 05:09:05 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-414--efr1JosPVavhGccRukhBQ-1; Fri, 26 May 2023 05:09:00 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AAAEA101A53B; Fri, 26 May 2023 09:08:59 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8FE3C154D1; Fri, 26 May 2023 09:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685092143; 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: in-reply-to:in-reply-to:references:references; bh=TcDh0MJ4Y2p99oRb3z+69aOpUYuaxf8ymmYkg4MCcrI=; b=itL5rk3qZ7L2jOW3Hb3qNQOdS5FzpTPsmaDRWXHNikZrLU7eSlWGQJ2dn+TIoNsRedQZpm ZUCuY35AgjMW1kMsILuBIEIGJV4+qxXkMyHyjYJ3BJa+GSMKCi2EbBwSXc0huIjZJB7waX 36hZ/uYbcNwlA+FHtbFj48x4CyyHCr8= X-MC-Unique: -efr1JosPVavhGccRukhBQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Stefan Hajnoczi , Alexander Bulekov Subject: [PULL 15/15] hw/scsi/lsi53c895a: Fix reentrancy issues in the LSI controller (CVE-2023-0330) Date: Fri, 26 May 2023 11:08:40 +0200 Message-Id: <20230526090840.2225958-16-thuth@redhat.com> In-Reply-To: <20230526090840.2225958-1-thuth@redhat.com> References: <20230526090840.2225958-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1685092205516100001 Content-Type: text/plain; charset="utf-8" We cannot use the generic reentrancy guard in the LSI code, so we have to manually prevent endless reentrancy here. The problematic lsi_execute_script() function has already a way to detect whether too many instructions have been executed - we just have to slightly change the logic here that it also takes into account if the function has been called too often in a reentrant way. The code in fuzz-lsi53c895a-test.c has been taken from an earlier patch by Mauro Matteo Cascella. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1563 Message-Id: <20230522091011.1082574-1-thuth@redhat.com> Reviewed-by: Stefan Hajnoczi Reviewed-by: Alexander Bulekov Signed-off-by: Thomas Huth --- hw/scsi/lsi53c895a.c | 23 +++++++++++++++------ tests/qtest/fuzz-lsi53c895a-test.c | 33 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 048436352b..f7d45b0b20 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -1134,15 +1134,24 @@ static void lsi_execute_script(LSIState *s) uint32_t addr, addr_high; int opcode; int insn_processed =3D 0; + static int reentrancy_level; + + reentrancy_level++; =20 s->istat1 |=3D LSI_ISTAT1_SRUN; again: - if (++insn_processed > LSI_MAX_INSN) { - /* Some windows drivers make the device spin waiting for a memory - location to change. If we have been executed a lot of code then - assume this is the case and force an unexpected device disconne= ct. - This is apparently sufficient to beat the drivers into submissi= on. - */ + /* + * Some windows drivers make the device spin waiting for a memory loca= tion + * to change. If we have executed more than LSI_MAX_INSN instructions = then + * assume this is the case and force an unexpected device disconnect. = This + * is apparently sufficient to beat the drivers into submission. + * + * Another issue (CVE-2023-0330) can occur if the script is programmed= to + * trigger itself again and again. Avoid this problem by stopping after + * being called multiple times in a reentrant way (8 is an arbitrary v= alue + * which should be enough for all valid use cases). + */ + if (++insn_processed > LSI_MAX_INSN || reentrancy_level > 8) { if (!(s->sien0 & LSI_SIST0_UDC)) { qemu_log_mask(LOG_GUEST_ERROR, "lsi_scsi: inf. loop with UDC masked"); @@ -1596,6 +1605,8 @@ again: } } trace_lsi_execute_script_stop(); + + reentrancy_level--; } =20 static uint8_t lsi_reg_readb(LSIState *s, int offset) diff --git a/tests/qtest/fuzz-lsi53c895a-test.c b/tests/qtest/fuzz-lsi53c89= 5a-test.c index 2012bd54b7..1b55928b9f 100644 --- a/tests/qtest/fuzz-lsi53c895a-test.c +++ b/tests/qtest/fuzz-lsi53c895a-test.c @@ -8,6 +8,36 @@ #include "qemu/osdep.h" #include "libqtest.h" =20 +/* + * This used to trigger a DMA reentrancy issue + * leading to memory corruption bugs like stack + * overflow or use-after-free + * https://gitlab.com/qemu-project/qemu/-/issues/1563 + */ +static void test_lsi_dma_reentrancy(void) +{ + QTestState *s; + + s =3D qtest_init("-M q35 -m 512M -nodefaults " + "-blockdev driver=3Dnull-co,node-name=3Dnull0 " + "-device lsi53c810 -device scsi-cd,drive=3Dnull0"); + + qtest_outl(s, 0xcf8, 0x80000804); /* PCI Command Register */ + qtest_outw(s, 0xcfc, 0x7); /* Enables accesses */ + qtest_outl(s, 0xcf8, 0x80000814); /* Memory Bar 1 */ + qtest_outl(s, 0xcfc, 0xff100000); /* Set MMIO Address*/ + qtest_outl(s, 0xcf8, 0x80000818); /* Memory Bar 2 */ + qtest_outl(s, 0xcfc, 0xff000000); /* Set RAM Address*/ + qtest_writel(s, 0xff000000, 0xc0000024); + qtest_writel(s, 0xff000114, 0x00000080); + qtest_writel(s, 0xff00012c, 0xff000000); + qtest_writel(s, 0xff000004, 0xff000114); + qtest_writel(s, 0xff000008, 0xff100014); + qtest_writel(s, 0xff10002f, 0x000000ff); + + qtest_quit(s); +} + /* * This used to trigger a UAF in lsi_do_msgout() * https://gitlab.com/qemu-project/qemu/-/issues/972 @@ -124,5 +154,8 @@ int main(int argc, char **argv) qtest_add_func("fuzz/lsi53c895a/lsi_do_msgout_cancel_req", test_lsi_do_msgout_cancel_req); =20 + qtest_add_func("fuzz/lsi53c895a/lsi_dma_reentrancy", + test_lsi_dma_reentrancy); + return g_test_run(); } --=20 2.31.1