From nobody Sat May 4 23:14:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616763277; cv=none; d=zohomail.com; s=zohoarc; b=ZLVrz/d/L76VDJOJJa8kEOIPpoo+FWsqmSe8PjxLdWmnp4zWnWj28/RHTOiwXyq1cdU61XkNNGW3l4QsqaFIMhQugynQNpIIM1RXZbbsNJj4g1wyxv9/i5eP5Vr4xwlanvJ0ZhpUqMEbHplOo09EC1ANY3+4/gUfuUdHhjpKNYc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616763277; 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=dQ+ENtLzktKZBnlnyipjl8d2V9gsFQP9rm1k+LUM2R0=; b=ZSfjq9vDmS0vRbQC2x9ZVwDBaIbGWmoiRcuwh3WrbtjxFCJPBqKgowq0qRMybHRV+0nbItFyj7uykmzG9V8tnXxvUapsUWC4GlW5eHncQ1JXhdDRjMQLFfQOl0WWU4Nbu8MiD5HoDzPYfUa/wHN4zCJIWwPtf7ljm6Uy9DceS6s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161676327725962.74269464954091; Fri, 26 Mar 2021 05:54:37 -0700 (PDT) Received: from localhost ([::1]:50400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPlz2-0001e3-4b for importer@patchew.org; Fri, 26 Mar 2021 08:54:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPluW-0005CQ-3A for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:49:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33263) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPluU-0003js-Cl for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:49:55 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-419-Gxk8on3zMSK-UnMsotFhbQ-1; Fri, 26 Mar 2021 08:49:49 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5152683DD53; Fri, 26 Mar 2021 12:49:48 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-102.ams2.redhat.com [10.36.112.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8FCA267CC4; Fri, 26 Mar 2021 12:49:34 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id ACFE01800386; Fri, 26 Mar 2021 13:49:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616762993; 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=dQ+ENtLzktKZBnlnyipjl8d2V9gsFQP9rm1k+LUM2R0=; b=iT2ZBRfl0fp13AP3ShLc+5QtU2rRxJJqaByuLpghhXJEAFNkk8b/mNIVShDCFgJyEuaFza 6+1K8uHlY/fOrJqQc+5uYq7GcXJOkJvP4vr3XnyjNY8qLlx28B5cd+8WJL3drbLHwz6XXe u5cZLVUkWRC4poFwv8khzVbX4RC88NI= X-MC-Unique: Gxk8on3zMSK-UnMsotFhbQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 1/9] usb: Remove "-usbdevice ccid" Date: Fri, 26 Mar 2021 13:49:24 +0100 Message-Id: <20210326124932.481942-2-kraxel@redhat.com> In-Reply-To: <20210326124932.481942-1-kraxel@redhat.com> References: <20210326124932.481942-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Richard Henderson , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Thomas Huth "-usbdevice ccid" was not documented and -usbdevice itself was marked as deprecated before QEMU v6.0. And searching for "-usbdevice ccid" in the internet does not show any useful results, so likely nobody was using the ccid device via the -usbdevice option. Remove it now. Signed-off-by: Thomas Huth Message-Id: <20210311092829.1479051-1-thuth@redhat.com> Signed-off-by: Gerd Hoffmann --- hw/usb/dev-smartcard-reader.c | 1 - docs/system/removed-features.rst | 6 ++++++ qemu-options.hx | 3 --- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index 80109fa55168..bc3d94092a23 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -1492,7 +1492,6 @@ static void ccid_register_types(void) type_register_static(&ccid_bus_info); type_register_static(&ccid_card_type_info); type_register_static(&ccid_info); - usb_legacy_register(TYPE_USB_CCID_DEV, "ccid", NULL); } =20 type_init(ccid_register_types) diff --git a/docs/system/removed-features.rst b/docs/system/removed-feature= s.rst index f28387f183cc..29e90601a51a 100644 --- a/docs/system/removed-features.rst +++ b/docs/system/removed-features.rst @@ -120,6 +120,12 @@ Drives with interface types other than ``if=3Dnone`` a= re for onboard devices. Drives the board doesn't pick up can no longer be used with -device. Use ``if=3Dnone`` instead. =20 +``-usbdevice ccid`` (removed in 6.0) +''''''''''''''''''''''''''''''''''''' + +This option was undocumented and not used in the field. +Use `-device usb-ccid`` instead. + =20 QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/qemu-options.hx b/qemu-options.hx index d60a03d3a973..fd21002bd61d 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1743,9 +1743,6 @@ SRST corresponding ``braille`` chardev automatically beside the ``usb-braille`` USB device). =20 - ``ccid`` - Smartcard reader device - ``keyboard`` Standard USB keyboard. Will override the PS/2 keyboard (if present= ). =20 --=20 2.30.2 From nobody Sat May 4 23:14:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616763183; cv=none; d=zohomail.com; s=zohoarc; b=cmSzRQ497e9oqZaTUr+YUq7vHEMk+188vM+NB0TOQDtV3+n/QnHal1D3BzajlY5MEHLvRfPjnz51o6Acgfd8x+ge+Cct9Cgir+UFRfV6oGhTP+6accqduCO/u0j7T/mEA8mmZr48qxe52xfCdKdRl3HkB2GzPox6Dk9lnsSunLY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616763183; 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=uF422SdPw6pQ2IpfMcBK4WN+J1RvZHgN3JIWHdwI2oA=; b=AH3tH6WHwUBkaYieQFHJbgMhB56JZ8G6eeefts5Fo80srv47Q1jQ64FXQCExpdYGXjnHPQzuWslhk8DI4Zf2HrJeyB3FSP+6p+8txjGelKjFWJxMkC5+eYQ71Y7oHF+We98JV8hjV/xwZ4OBQgmnoMVgX23+4TR8R8VZn5lr3nY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161676318382745.868038943057854; Fri, 26 Mar 2021 05:53:03 -0700 (PDT) Received: from localhost ([::1]:43896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPlxW-0007QS-IJ for importer@patchew.org; Fri, 26 Mar 2021 08:53:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPluv-0005Wt-DL for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53428) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPlup-0003tg-BY for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:21 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-4-T1tnY5m4O8CC2yF3US_imw-1; Fri, 26 Mar 2021 08:50:05 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A2B0587504F; Fri, 26 Mar 2021 12:50:04 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-102.ams2.redhat.com [10.36.112.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A36B250304; Fri, 26 Mar 2021 12:49:50 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BA8741800387; Fri, 26 Mar 2021 13:49:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616763010; 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=uF422SdPw6pQ2IpfMcBK4WN+J1RvZHgN3JIWHdwI2oA=; b=SEEsnDtAeqcye7bwtuOmYNv+eiqVOO1p7/iVz648d59xoJy3tvxZh48BbmPkOPIR2pWtWb +VLKhCrM+BbPkUpkLjRKrdFet+m+q6TyL6wGh/AuTDEf5EUke6a3njQHfyof74OfoetR8z OyIyWeSzOqfPL9AXejtlfBY8Zhy7Us0= X-MC-Unique: T1tnY5m4O8CC2yF3US_imw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 2/9] vhost-user-gpu: glFlush before notifying clients Date: Fri, 26 Mar 2021 13:49:25 +0100 Message-Id: <20210326124932.481942-3-kraxel@redhat.com> In-Reply-To: <20210326124932.481942-1-kraxel@redhat.com> References: <20210326124932.481942-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Richard Henderson , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau For similar reasons as commit 3af1671852 ("spice: flush on GL update before notifying client"), vhost-user-gpu must ensure the GL state is flushed before sharing its rendering result. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20210312100108.2706195-3-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann --- contrib/vhost-user-gpu/virgl.c | 3 +++ contrib/vhost-user-gpu/meson.build | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/vhost-user-gpu/virgl.c b/contrib/vhost-user-gpu/virgl.c index 8bb3c563d975..9e6660c7ab87 100644 --- a/contrib/vhost-user-gpu/virgl.c +++ b/contrib/vhost-user-gpu/virgl.c @@ -16,6 +16,8 @@ #include #include "virgl.h" =20 +#include + void vg_virgl_update_cursor_data(VuGpu *g, uint32_t resource_id, gpointer data) @@ -372,6 +374,7 @@ virgl_cmd_resource_flush(VuGpu *g, =20 VUGPU_FILL_CMD(rf); =20 + glFlush(); if (!rf.resource_id) { g_debug("bad resource id for flush..?"); return; diff --git a/contrib/vhost-user-gpu/meson.build b/contrib/vhost-user-gpu/me= son.build index 2fc2320b52fe..0ce1515a10e5 100644 --- a/contrib/vhost-user-gpu/meson.build +++ b/contrib/vhost-user-gpu/meson.build @@ -2,7 +2,7 @@ if 'CONFIG_TOOLS' in config_host and 'CONFIG_VIRGL' in conf= ig_host \ and 'CONFIG_GBM' in config_host and 'CONFIG_LINUX' in config_host \ and pixman.found() executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm= .c'), - dependencies: [qemuutil, pixman, gbm, virgl, vhost_user], + dependencies: [qemuutil, pixman, gbm, virgl, vhost_user, open= gl], install: true, install_dir: get_option('libexecdir')) =20 --=20 2.30.2 From nobody Sat May 4 23:14:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616763180; cv=none; d=zohomail.com; s=zohoarc; b=Yl2dDGk8D6eUm4rd2FceqZWpm0rimCDxEcl9SwNldf1IUulc4yTSB4Di36crmCXGx/Kx0O4SU6ho0rRj87mAeIV9CPKHlnNy/UDb5vYGK1pL76Ddu9uLbg6QwULS18DRxw+54vxAPEWDXkZlVkYogxTne0ytkiyZAbw6N3r7ZLo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616763180; 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=69FAynqWHPmlWpM56cuBR0GJ0qucK+d4jEWY5B+bot0=; b=bEfRRYItTWG+XY590cO5U+Bcq4dEnnbOv3fAHsijBnhreRKnILQPTiAqixkmOJCgG12gg40b/JcMLkSAhnjYcQ77/BdAUK6c19OqbDrAj7fpabU2f2M7m68fBNE9A2m/bL0EpmrHLUrQq+Nn0EfN1d/8u2WV0QuAvwsFHiG+jqI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616763180034300.9615442846397; Fri, 26 Mar 2021 05:53:00 -0700 (PDT) Received: from localhost ([::1]:43630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPlxT-0007K0-1E for importer@patchew.org; Fri, 26 Mar 2021 08:52:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPluq-0005RB-2g for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPlui-0003sF-DQ for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:15 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-199-66ekbsUrPCaRmObAMIwumQ-1; Fri, 26 Mar 2021 08:50:02 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1555C1052A18; Fri, 26 Mar 2021 12:50:01 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-102.ams2.redhat.com [10.36.112.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E6C01A866; Fri, 26 Mar 2021 12:49:50 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CA2771800389; Fri, 26 Mar 2021 13:49:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616763007; 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=69FAynqWHPmlWpM56cuBR0GJ0qucK+d4jEWY5B+bot0=; b=J1gvzLxKI9jdNQ2rtgH1YoisjHwlUpmK2XwXH1XvCrtBNiyaIfKEtc2XXFrORumqO61/Rp 0aem4P+fkXUFEOU5kPgKFHpw9ultvPdRXpCabx2LZXBpWWBv2QLmSJ7PeeGDr0LZOMkskE E0KhxlIjdBW21EtUbkAB+MQJDPhfv5I= X-MC-Unique: 66ekbsUrPCaRmObAMIwumQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 3/9] vhost-user-gpu: fix vugbm_device_init fallback Date: Fri, 26 Mar 2021 13:49:26 +0100 Message-Id: <20210326124932.481942-4-kraxel@redhat.com> In-Reply-To: <20210326124932.481942-1-kraxel@redhat.com> References: <20210326124932.481942-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Richard Henderson , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau vugbm implements GBM device wrapping, udmabuf and memory fallback. However, the fallback/detection logic is flawed, as if "/dev/udmabuf" failed to be opened, it will not initialize vugbm and crash later. Rework the vugbm_device_init() logic to initialize correctly in all cases. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20210312100108.2706195-4-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann --- contrib/vhost-user-gpu/vugbm.h | 2 +- contrib/vhost-user-gpu/vhost-user-gpu.c | 6 +--- contrib/vhost-user-gpu/vugbm.c | 44 +++++++++++-------------- 3 files changed, 22 insertions(+), 30 deletions(-) diff --git a/contrib/vhost-user-gpu/vugbm.h b/contrib/vhost-user-gpu/vugbm.h index 66f1520764a6..82bc4934e1ba 100644 --- a/contrib/vhost-user-gpu/vugbm.h +++ b/contrib/vhost-user-gpu/vugbm.h @@ -54,7 +54,7 @@ struct vugbm_buffer { uint32_t format; }; =20 -bool vugbm_device_init(struct vugbm_device *dev, int fd); +void vugbm_device_init(struct vugbm_device *dev, int fd); void vugbm_device_destroy(struct vugbm_device *dev); =20 bool vugbm_buffer_create(struct vugbm_buffer *buffer, struct vugbm_device = *dev, diff --git a/contrib/vhost-user-gpu/vhost-user-gpu.c b/contrib/vhost-user-g= pu/vhost-user-gpu.c index b27990ffdbc0..ef40fbccbbd9 100644 --- a/contrib/vhost-user-gpu/vhost-user-gpu.c +++ b/contrib/vhost-user-gpu/vhost-user-gpu.c @@ -1186,11 +1186,7 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } =20 - if (g.drm_rnode_fd >=3D 0) { - if (!vugbm_device_init(&g.gdev, g.drm_rnode_fd)) { - g_warning("Failed to init DRM device, using fallback path"); - } - } + vugbm_device_init(&g.gdev, g.drm_rnode_fd); =20 if ((!!opt_socket_path + (opt_fdnum !=3D -1)) !=3D 1) { g_printerr("Please specify either --fd or --socket-path\n"); diff --git a/contrib/vhost-user-gpu/vugbm.c b/contrib/vhost-user-gpu/vugbm.c index f5304ada2f1b..fb15d0372c25 100644 --- a/contrib/vhost-user-gpu/vugbm.c +++ b/contrib/vhost-user-gpu/vugbm.c @@ -199,55 +199,51 @@ vugbm_device_destroy(struct vugbm_device *dev) dev->device_destroy(dev); } =20 -bool +void vugbm_device_init(struct vugbm_device *dev, int fd) { - dev->fd =3D fd; + assert(!dev->inited); =20 #ifdef CONFIG_GBM - dev->dev =3D gbm_create_device(fd); -#endif - - if (0) { - /* nothing */ + if (fd >=3D 0) { + dev->dev =3D gbm_create_device(fd); } -#ifdef CONFIG_GBM - else if (dev->dev !=3D NULL) { + if (dev->dev !=3D NULL) { + dev->fd =3D fd; dev->alloc_bo =3D alloc_bo; dev->free_bo =3D free_bo; dev->get_fd =3D get_fd; dev->map_bo =3D map_bo; dev->unmap_bo =3D unmap_bo; dev->device_destroy =3D device_destroy; + dev->inited =3D true; } #endif #ifdef CONFIG_MEMFD - else if (g_file_test("/dev/udmabuf", G_FILE_TEST_EXISTS)) { + if (!dev->inited && g_file_test("/dev/udmabuf", G_FILE_TEST_EXISTS)) { dev->fd =3D open("/dev/udmabuf", O_RDWR); - if (dev->fd < 0) { - return false; + if (dev->fd >=3D 0) { + g_debug("Using experimental udmabuf backend"); + dev->alloc_bo =3D udmabuf_alloc_bo; + dev->free_bo =3D udmabuf_free_bo; + dev->get_fd =3D udmabuf_get_fd; + dev->map_bo =3D udmabuf_map_bo; + dev->unmap_bo =3D udmabuf_unmap_bo; + dev->device_destroy =3D udmabuf_device_destroy; + dev->inited =3D true; } - g_debug("Using experimental udmabuf backend"); - dev->alloc_bo =3D udmabuf_alloc_bo; - dev->free_bo =3D udmabuf_free_bo; - dev->get_fd =3D udmabuf_get_fd; - dev->map_bo =3D udmabuf_map_bo; - dev->unmap_bo =3D udmabuf_unmap_bo; - dev->device_destroy =3D udmabuf_device_destroy; } #endif - else { + if (!dev->inited) { g_debug("Using mem fallback"); dev->alloc_bo =3D mem_alloc_bo; dev->free_bo =3D mem_free_bo; dev->map_bo =3D mem_map_bo; dev->unmap_bo =3D mem_unmap_bo; dev->device_destroy =3D mem_device_destroy; - return false; + dev->inited =3D true; } - - dev->inited =3D true; - return true; + assert(dev->inited); } =20 static bool --=20 2.30.2 From nobody Sat May 4 23:14:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616763298; cv=none; d=zohomail.com; s=zohoarc; b=naMRQmBfN6/pugUypmdO+RjQwvXMrkWWeMg2ky+lWA7ERdSyn1opVb1W/ek1J1yTiHK3ezYI/3VNlbA1RcJFw/KfrPSzLDBNcNz3049v9FYQBaETug39cG8Z22H1fAG2yVQSHRQBYuX5AtBtwUIR35i9MknompYyEIp/ubn2daM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616763298; 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=HkQRFLotr81hYYBmwJM99a9KYbhdYBfCrWnmjeTnUPk=; b=ZFLffek8FyBMKE/RI6viU4jnHRjddUFQKP3IR210rHZzXwx5ICA2hJJkpEDrb+zgnxh1TVE5dSb+BETAPyiASBxoxOdIY8egxSj5jIf3o4fGXXfY9LRL9DFcHFd56Bke1tst1EG4dbW9byKWyytTMFLUROgvrlbdRQqhOYAcI8c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616763298760831.7839676907226; Fri, 26 Mar 2021 05:54:58 -0700 (PDT) Received: from localhost ([::1]:52468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPlzN-0002TJ-IK for importer@patchew.org; Fri, 26 Mar 2021 08:54:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPluy-0005bK-O6 for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPluv-0003yQ-3E for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:24 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-280-QArfoZeOPZSW44nLS6bjFQ-1; Fri, 26 Mar 2021 08:50:18 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 40360189CD03; Fri, 26 Mar 2021 12:50:17 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-102.ams2.redhat.com [10.36.112.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B84FC5C8AB; Fri, 26 Mar 2021 12:50:02 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D5A9F180038A; Fri, 26 Mar 2021 13:49:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616763020; 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=HkQRFLotr81hYYBmwJM99a9KYbhdYBfCrWnmjeTnUPk=; b=bp4e6Z7xJIUSm5X/iEyDsvLLth0JIAR0scSiK9B9FD8XgyHLj5JWlsK8HerUpaQZLasye8 gsdEtNxte93quL8UdGIDkZOEY0/y8uDv3neIkGTr1sTHUJ6mG2bXMR/ZOH6UnMNVlVLRye qVLIFp5tcxFIVSFpFl1E+uaO9Cr1FKo= X-MC-Unique: QArfoZeOPZSW44nLS6bjFQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 4/9] vhost-user-gpu: fix cursor move/update Date: Fri, 26 Mar 2021 13:49:27 +0100 Message-Id: <20210326124932.481942-5-kraxel@redhat.com> In-Reply-To: <20210326124932.481942-1-kraxel@redhat.com> References: <20210326124932.481942-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Richard Henderson , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau "move" is incorrectly initialized. Fix it by using a switch statement and also treating unknown commands with a fallback. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20210312100108.2706195-5-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann --- contrib/vhost-user-gpu/vhost-user-gpu.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/contrib/vhost-user-gpu/vhost-user-gpu.c b/contrib/vhost-user-g= pu/vhost-user-gpu.c index ef40fbccbbd9..f73f292c9f72 100644 --- a/contrib/vhost-user-gpu/vhost-user-gpu.c +++ b/contrib/vhost-user-gpu/vhost-user-gpu.c @@ -892,11 +892,8 @@ update_cursor_data_simple(VuGpu *g, uint32_t resource_= id, gpointer data) static void vg_process_cursor_cmd(VuGpu *g, struct virtio_gpu_update_cursor *cursor) { - bool move =3D cursor->hdr.type !=3D VIRTIO_GPU_CMD_MOVE_CURSOR; - - g_debug("%s move:%d\n", G_STRFUNC, move); - - if (move) { + switch (cursor->hdr.type) { + case VIRTIO_GPU_CMD_MOVE_CURSOR: { VhostUserGpuMsg msg =3D { .request =3D cursor->resource_id ? VHOST_USER_GPU_CURSOR_POS : VHOST_USER_GPU_CURSOR_POS_HIDE, @@ -907,8 +904,11 @@ vg_process_cursor_cmd(VuGpu *g, struct virtio_gpu_upda= te_cursor *cursor) .y =3D cursor->pos.y, } }; + g_debug("%s: move", G_STRFUNC); vg_send_msg(g, &msg, -1); - } else { + break; + } + case VIRTIO_GPU_CMD_UPDATE_CURSOR: { VhostUserGpuMsg msg =3D { .request =3D VHOST_USER_GPU_CURSOR_UPDATE, .size =3D sizeof(VhostUserGpuCursorUpdate), @@ -922,6 +922,7 @@ vg_process_cursor_cmd(VuGpu *g, struct virtio_gpu_updat= e_cursor *cursor) .hot_y =3D cursor->hot_y, } }; + g_debug("%s: update", G_STRFUNC); if (g->virgl) { vg_virgl_update_cursor_data(g, cursor->resource_id, msg.payload.cursor_update.data); @@ -930,6 +931,11 @@ vg_process_cursor_cmd(VuGpu *g, struct virtio_gpu_upda= te_cursor *cursor) msg.payload.cursor_update.data); } vg_send_msg(g, &msg, -1); + break; + } + default: + g_debug("%s: unknown cmd %d", G_STRFUNC, cursor->hdr.type); + break; } } =20 --=20 2.30.2 From nobody Sat May 4 23:14:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616763298; cv=none; d=zohomail.com; s=zohoarc; b=J2qkFb5I9aiRHD7gWxYracL8Xi1OMlIaw4eV1gMXF6O4dOx0P0yYeeSA83f0RLqKmGLMa6KiKjpqV9WGhN1vbEol36oIpEU0fnn7oyHTfqe5mOfxo/bS9FJ84B/3dO/zKimPus3n5YzlKmjyktVwqvk/lCbsey5pRL/d+N5RDaQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616763298; 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=4pBAjcmtyg6rE2zpwSo/x2DQw4BAZ3xqIBUH+psTKtU=; b=VgwREGpybt9XOhsEv0v+d2KrcNDvgPTvf+xlCxtlOXAPGAIVSYJGAJdZc/4VvfgX6sHK+ka1+UtS+q+3LGmHceQZFSCeHjRBIDtlVtU0ejRhJkwf/4u8L2OSFCmgeZsZoRZMH82LEvGL0WqqZznmQWfOrDuHFkutFgjrKYMHMLs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616763298504842.930376696365; Fri, 26 Mar 2021 05:54:58 -0700 (PDT) Received: from localhost ([::1]:52444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPlzN-0002Sl-C7 for importer@patchew.org; Fri, 26 Mar 2021 08:54:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPluy-0005Zp-1n for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:25422) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPlup-0003vi-BN for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:23 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-60-zclRglz4PAeS2KM0B_pHVQ-1; Fri, 26 Mar 2021 08:50:07 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A7D1C87A83C; Fri, 26 Mar 2021 12:50:06 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-102.ams2.redhat.com [10.36.112.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E65419D7C; Fri, 26 Mar 2021 12:50:06 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id E070A180038B; Fri, 26 Mar 2021 13:49:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616763012; 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=4pBAjcmtyg6rE2zpwSo/x2DQw4BAZ3xqIBUH+psTKtU=; b=a6iAd6iTayWDhHa/QI9m2xQDnQAXwm90VqLyWBnK6njyAYRCI6U+ZYQCSCms9Vfhk8zF+h 9QdJlo5VMw3045h65mwymiobB6CtTdYW6JfJIDxo+/eMEjjEhNuabt3du5vqN5OTpeXBkZ ztUqw7Nzm58H9gLwdsdJAb2t8UUXUPo= X-MC-Unique: zclRglz4PAeS2KM0B_pHVQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 5/9] hw/usb/hcd-ehci-sysbus: Free USBPacket on instance finalize() Date: Fri, 26 Mar 2021 13:49:28 +0100 Message-Id: <20210326124932.481942-6-kraxel@redhat.com> In-Reply-To: <20210326124932.481942-1-kraxel@redhat.com> References: <20210326124932.481942-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 When building with --enable-sanitizers we get: Direct leak of 32 byte(s) in 2 object(s) allocated from: #0 0x5618479ec7cf in malloc (qemu-system-aarch64+0x233b7cf) #1 0x7f675745f958 in g_malloc (/lib64/libglib-2.0.so.0+0x58958) #2 0x561847f02ca2 in usb_packet_init hw/usb/core.c:531:5 #3 0x561848df4df4 in usb_ehci_init hw/usb/hcd-ehci.c:2575:5 #4 0x561847c119ac in ehci_sysbus_init hw/usb/hcd-ehci-sysbus.c:73:5 #5 0x56184a5bdab8 in object_init_with_type qom/object.c:375:9 #6 0x56184a5bd955 in object_init_with_type qom/object.c:371:9 #7 0x56184a5a2bda in object_initialize_with_type qom/object.c:517:5 #8 0x56184a5a24d5 in object_initialize qom/object.c:536:5 #9 0x56184a5a2f6c in object_initialize_child_with_propsv qom/object.c= :566:5 #10 0x56184a5a2e60 in object_initialize_child_with_props qom/object.c= :549:10 #11 0x56184a5a3a1e in object_initialize_child_internal qom/object.c:6= 03:5 #12 0x561849542d18 in npcm7xx_init hw/arm/npcm7xx.c:427:5 Similarly to commit d710e1e7bd3 ("usb: ehci: fix memory leak in ehci"), fix by calling usb_ehci_finalize() to free the USBPacket. Fixes: 7341ea075c0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Message-Id: <20210323183701.281152-1-f4bug@amsat.org> Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci-sysbus.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c index e3758db1b18e..a12e21884894 100644 --- a/hw/usb/hcd-ehci-sysbus.c +++ b/hw/usb/hcd-ehci-sysbus.c @@ -74,6 +74,14 @@ static void ehci_sysbus_init(Object *obj) sysbus_init_mmio(d, &s->mem); } =20 +static void ehci_sysbus_finalize(Object *obj) +{ + EHCISysBusState *i =3D SYS_BUS_EHCI(obj); + EHCIState *s =3D &i->ehci; + + usb_ehci_finalize(s); +} + static void ehci_sysbus_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -94,6 +102,7 @@ static const TypeInfo ehci_type_info =3D { .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(EHCISysBusState), .instance_init =3D ehci_sysbus_init, + .instance_finalize =3D ehci_sysbus_finalize, .abstract =3D true, .class_init =3D ehci_sysbus_class_init, .class_size =3D sizeof(SysBusEHCIClass), --=20 2.30.2 From nobody Sat May 4 23:14:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616763184; cv=none; d=zohomail.com; s=zohoarc; b=CWx60HYuvPNZ1h12VStdaqumwj8nOy3B0P+/2IqjYjS6HzFwltSyglS5CL5GU9GqN1uy4Ty3uzXbuJ5pf0w9j1JVS0jLNnVpV7UgKWJHqtSDQneMDU0DShELpd7D96gNjtyCgDGTglvjH47Tc3CQ/QvGZIjKHbWzX86F/FHWL6s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616763184; 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=BbkbY9PGqnicrv9zSk0waCN8nAno4hlrHiPULYWCr0U=; b=dtc6ocgjYzx6U8w97o5dbdjDWPjUJyHTuW5P9het0d3skhtxNw6POTeO18GNeKvUS5TKvcTBx6lMLBUltoUYY7TtN7khn7LOTq/D/ikF0KTfcl2enmiIUY15IHzVSbsHl9jOXXwBK6wDs4FjVpRhoPO3xu7NMN29x8IAqZZ4aKc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616763184100745.8791213160649; Fri, 26 Mar 2021 05:53:04 -0700 (PDT) Received: from localhost ([::1]:43986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPlxW-0007SY-U9 for importer@patchew.org; Fri, 26 Mar 2021 08:53:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPluw-0005Y5-UZ for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:60491) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPlup-0003vb-BX for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:22 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-400-DB6ibyh2PtmBW3860Ik8eQ-1; Fri, 26 Mar 2021 08:50:09 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7E4DC83DEE8; Fri, 26 Mar 2021 12:50:08 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-102.ams2.redhat.com [10.36.112.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2EF57138E8; Fri, 26 Mar 2021 12:50:08 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id EF566180038E; Fri, 26 Mar 2021 13:49:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616763011; 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=BbkbY9PGqnicrv9zSk0waCN8nAno4hlrHiPULYWCr0U=; b=WbI+Dk8yLJsUm7Nbt5u2A5v2hLXtbv78Du05NWJBJDaC8911rB1S1UmhWRAza3W4KyT5ZD +2bks39IwtLRM5sXsWLtu9/AWjJRSjJm2zmLjkQQsG7iF5QaM6QOZqsq3J14gcWL6mMUXC Dp2uu/qPrmqYBVFNdEkBHyJHjr0NY1c= X-MC-Unique: DB6ibyh2PtmBW3860Ik8eQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 6/9] s390x: move S390_ADAPTER_SUPPRESSIBLE Date: Fri, 26 Mar 2021 13:49:29 +0100 Message-Id: <20210326124932.481942-7-kraxel@redhat.com> In-Reply-To: <20210326124932.481942-1-kraxel@redhat.com> References: <20210326124932.481942-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Richard Henderson , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The definition S390_ADAPTER_SUPPRESSIBLE was moved to "cpu.h", per suggestion of Thomas Huth. From interface design perspective, IMHO, not a good thing as it belongs to the public interface of css_register_io_adapters(). We did this because CONFIG_KVM requeires NEED_CPU_H and Thomas, and other commenters did not like the consequences of that. Moving the interrupt related declarations to s390_flic.h was suggested by Cornelia Huck. Signed-off-by: Halil Pasic Signed-off-by: Gerd Hoffmann Reviewed-by: Halil Pasic Tested-by: Halil Pasic Message-Id: <20210317095622.2839895-2-kraxel@redhat.com> Signed-off-by: Gerd Hoffmann --- include/hw/s390x/css.h | 7 ------- include/hw/s390x/s390_flic.h | 3 +++ target/s390x/cpu.h | 9 ++++++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h index 7901ab276ce9..bba7593d2eaa 100644 --- a/include/hw/s390x/css.h +++ b/include/hw/s390x/css.h @@ -12,7 +12,6 @@ #ifndef CSS_H #define CSS_H =20 -#include "cpu.h" #include "hw/s390x/adapter.h" #include "hw/s390x/s390_flic.h" #include "hw/s390x/ioinst.h" @@ -233,12 +232,6 @@ uint32_t css_get_adapter_id(CssIoAdapterType type, uin= t8_t isc); void css_register_io_adapters(CssIoAdapterType type, bool swap, bool maska= ble, uint8_t flags, Error **errp); =20 -#ifndef CONFIG_KVM -#define S390_ADAPTER_SUPPRESSIBLE 0x01 -#else -#define S390_ADAPTER_SUPPRESSIBLE KVM_S390_ADAPTER_SUPPRESSIBLE -#endif - #ifndef CONFIG_USER_ONLY SubchDev *css_find_subch(uint8_t m, uint8_t cssid, uint8_t ssid, uint16_t schid); diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h index e91b15d2d6af..3907a13d0766 100644 --- a/include/hw/s390x/s390_flic.h +++ b/include/hw/s390x/s390_flic.h @@ -134,6 +134,9 @@ void s390_flic_init(void); S390FLICState *s390_get_flic(void); QEMUS390FLICState *s390_get_qemu_flic(S390FLICState *fs); S390FLICStateClass *s390_get_flic_class(S390FLICState *fs); +void s390_crw_mchk(void); +void s390_io_interrupt(uint16_t subchannel_id, uint16_t subchannel_nr, + uint32_t io_int_parm, uint32_t io_int_word); bool ais_needed(void *opaque); =20 #endif /* HW_S390_FLIC_H */ diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 468b4430f339..2464d4076c0a 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -40,6 +40,12 @@ =20 #define S390_MAX_CPUS 248 =20 +#ifndef CONFIG_KVM +#define S390_ADAPTER_SUPPRESSIBLE 0x01 +#else +#define S390_ADAPTER_SUPPRESSIBLE KVM_S390_ADAPTER_SUPPRESSIBLE +#endif + typedef struct PSW { uint64_t mask; uint64_t addr; @@ -811,9 +817,6 @@ int cpu_s390x_signal_handler(int host_signum, void *pin= fo, void *puc); =20 =20 /* interrupt.c */ -void s390_crw_mchk(void); -void s390_io_interrupt(uint16_t subchannel_id, uint16_t subchannel_nr, - uint32_t io_int_parm, uint32_t io_int_word); #define RA_IGNORED 0 void s390_program_interrupt(CPUS390XState *env, uint32_t code, uintptr_t r= a); /* service interrupts are floating therefore we must not pass an cpustate = */ --=20 2.30.2 From nobody Sat May 4 23:14:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616763297; cv=none; d=zohomail.com; s=zohoarc; b=m11yNrjh4DEwLksmfb/8QA3GfCVuZXS9yzh6b/0ZnHWd6MMO2E7Q/yjQ4xFdq+PNWAj2RLlroA3y9gcsrLhbQ28PDZSxRhIIYBijbcdyaCFiHehbv+CsGHRBKGPFLgqENdgaXIPu+9l3S80Mw1aqxSq4sm0TG4ekNZzpb4eyjVs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616763297; 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=vxySh1EKFScsmQ+vPyvRKaFAgXcq9EkjH4Ox/0u0C0Y=; b=YL9bGWYJudtYoLOJVWl8c/+d4j6VGcqWd0Tap2qlagtrv70s4tYN1Ygg4H4PFkIy7dO3z4I1WOpUzaR4WaQwDMa8QiORlMTmVKjVr6K33QAV2hJ27rCdgeNDtlp0ay71ATln0Sga+gSxb8WAKIBhQ5kswrjiuae5r7umnim/a1o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616763297286164.42487735179566; Fri, 26 Mar 2021 05:54:57 -0700 (PDT) Received: from localhost ([::1]:52316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPlzM-0002Pg-3j for importer@patchew.org; Fri, 26 Mar 2021 08:54:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPlv4-0005oq-AU for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPlv2-00041z-Hl for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:30 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-180-ZDho8ywfP3-1tpA6MNxatw-1; Fri, 26 Mar 2021 08:50:23 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF95A81620; Fri, 26 Mar 2021 12:50:22 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-102.ams2.redhat.com [10.36.112.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0842419C84; Fri, 26 Mar 2021 12:50:10 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 08C55180038F; Fri, 26 Mar 2021 13:49:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616763027; 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=vxySh1EKFScsmQ+vPyvRKaFAgXcq9EkjH4Ox/0u0C0Y=; b=I5eRaq9jLvYAQziGSo3HoguquxDmqJnnAGu8lPczgCgqUBcMPNyfNQ8iJh7QEQA79KmJBn 5MiaCwwV64Xu6s8WxGdizeRNVDn2Nx8uiQWt7MRmaG+rrgDz3LtU0LeysyVPkog4OTo6oG mC0aTlB8taCpLf/EYrjSA6Y10UENfEI= X-MC-Unique: ZDho8ywfP3-1tpA6MNxatw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 7/9] s390x: add have_virtio_ccw Date: Fri, 26 Mar 2021 13:49:30 +0100 Message-Id: <20210326124932.481942-8-kraxel@redhat.com> In-Reply-To: <20210326124932.481942-1-kraxel@redhat.com> References: <20210326124932.481942-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Richard Henderson , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Introduce a symbol which can be used to prevent ccw modules being loaded into system emulators without ccw support. Signed-off-by: Gerd Hoffmann Reviewed-by: Halil Pasic Tested-by: Halil Pasic Message-Id: <20210317095622.2839895-3-kraxel@redhat.com> Signed-off-by: Gerd Hoffmann --- hw/s390x/virtio-ccw.h | 5 +++++ hw/s390x/virtio-ccw.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h index 49a2b8ca42df..0168232e3b8d 100644 --- a/hw/s390x/virtio-ccw.h +++ b/hw/s390x/virtio-ccw.h @@ -63,6 +63,11 @@ typedef struct VirtioBusClass VirtioCcwBusClass; DECLARE_OBJ_CHECKERS(VirtioCcwBusState, VirtioCcwBusClass, VIRTIO_CCW_BUS, TYPE_VIRTIO_CCW_BUS) =20 +/* + * modules can reference this symbol to avoid being loaded + * into system emulators without ccw support + */ +extern bool have_virtio_ccw; =20 struct VirtIOCCWDeviceClass { CCWDeviceClass parent_class; diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 06c06056814b..314ed7b24566 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -35,6 +35,8 @@ =20 #define NR_CLASSIC_INDICATOR_BITS 64 =20 +bool have_virtio_ccw =3D true; + static int virtio_ccw_dev_post_load(void *opaque, int version_id) { VirtioCcwDevice *dev =3D VIRTIO_CCW_DEVICE(opaque); --=20 2.30.2 From nobody Sat May 4 23:14:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616763432; cv=none; d=zohomail.com; s=zohoarc; b=E+MWAu8WE6A4oSl6t+bbWx35UbA3zcDJ8QA2X4Zy4+vMvLOBTP2CAqzIRvnbcUR3EKXrmiUcTLH+ra2zO3mHDyRWF2+AY6etLlLcT6OqEWLg/1BLVuLns8Qi9UEy9CT4y/ozL+47Q/NKP1eSbgEFKULDNIG5KEUA00yartm7RNA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616763432; 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=HrOjiFbElUI1UPiY3wTVIe5o3LRk5qFEdbWDNQIibHU=; b=ap93HIFAeeMt7ITAaeo6emN1LIq5o0yVruLrWI4PVOyTOkv5OCgX5rDxocpY1mWIh3sfkfyhn2+xEkQeX1cVgaTxKEf0oEzTggIeTL0DGI6vSlx7i4YsHox5zBuXktx4fSNNgkBAcMHB0krxl/JKtglKicsdiuB0NAHzXgUYAyc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616763432438531.6689133177714; Fri, 26 Mar 2021 05:57:12 -0700 (PDT) Received: from localhost ([::1]:58610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPm1X-00055G-E9 for importer@patchew.org; Fri, 26 Mar 2021 08:57:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPlvN-00064Y-DX for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31998) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPlvF-00048F-Ks for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:49 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-163-15rlRJHjOhi52YCkfIDJtg-1; Fri, 26 Mar 2021 08:50:34 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E1ED581627; Fri, 26 Mar 2021 12:50:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-102.ams2.redhat.com [10.36.112.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BFFB51B5C0; Fri, 26 Mar 2021 12:50:18 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1BFA71800393; Fri, 26 Mar 2021 13:49:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616763037; 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=HrOjiFbElUI1UPiY3wTVIe5o3LRk5qFEdbWDNQIibHU=; b=YWOMzIl1PsYohh+NNkLKWYOvyhq3lVkRr2jdVWrSr1cGvGUk+LC3Ik0exNxjH9uiT6WqB3 FsFExMTD/l4G457WwrKhVX3nAa211GRQgaDANHLkLJbkqePn3GhJp23uoINdrj3nTcaLvk GWHofpURJTkJPjGqFLCPIHFJ3MHnCGk= X-MC-Unique: 15rlRJHjOhi52YCkfIDJtg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 8/9] s390x: modularize virtio-gpu-ccw Date: Fri, 26 Mar 2021 13:49:31 +0100 Message-Id: <20210326124932.481942-9-kraxel@redhat.com> In-Reply-To: <20210326124932.481942-1-kraxel@redhat.com> References: <20210326124932.481942-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Richard Henderson , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Since the virtio-gpu-ccw device depends on the hw-display-virtio-gpu module, which provides the type virtio-gpu-device, packaging the hw-display-virtio-gpu module as a separate package that may or may not be installed along with the qemu package leads to problems. Namely if the hw-display-virtio-gpu is absent, qemu continues to advertise virtio-gpu-ccw, but it aborts not only when one attempts using virtio-gpu-ccw, but also when libvirtd's capability probing tries to instantiate the type to introspect it. Let us thus introduce a module named hw-s390x-virtio-gpu-ccw that is going to provide the virtio-gpu-ccw device. The hw-s390x prefix was chosen because it is not a portable device. With virtio-gpu-ccw built as a module, the correct way to package a modularized qemu is to require that hw-display-virtio-gpu must be installed whenever the module hw-s390x-virtio-gpu-ccw. Signed-off-by: Halil Pasic Signed-off-by: Gerd Hoffmann Reviewed-by: Halil Pasic Tested-by: Halil Pasic Message-Id: <20210317095622.2839895-4-kraxel@redhat.com> Signed-off-by: Gerd Hoffmann --- hw/s390x/virtio-ccw-gpu.c | 4 +++- util/module.c | 1 + hw/s390x/meson.build | 8 +++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/s390x/virtio-ccw-gpu.c b/hw/s390x/virtio-ccw-gpu.c index c301e2586bde..75a9e4bb3908 100644 --- a/hw/s390x/virtio-ccw-gpu.c +++ b/hw/s390x/virtio-ccw-gpu.c @@ -62,7 +62,9 @@ static const TypeInfo virtio_ccw_gpu =3D { =20 static void virtio_ccw_gpu_register(void) { - type_register_static(&virtio_ccw_gpu); + if (have_virtio_ccw) { + type_register_static(&virtio_ccw_gpu); + } } =20 type_init(virtio_ccw_gpu_register) diff --git a/util/module.c b/util/module.c index c65060c167df..cbe89fede628 100644 --- a/util/module.c +++ b/util/module.c @@ -304,6 +304,7 @@ static struct { { "virtio-gpu-pci-base", "hw-", "display-virtio-gpu-pci" }, { "virtio-gpu-pci", "hw-", "display-virtio-gpu-pci" }, { "vhost-user-gpu-pci", "hw-", "display-virtio-gpu-pci" }, + { "virtio-gpu-ccw", "hw-", "s390x-virtio-gpu-ccw" }, { "virtio-vga-base", "hw-", "display-virtio-vga" }, { "virtio-vga", "hw-", "display-virtio-vga" }, { "vhost-user-vga", "hw-", "display-virtio-vga" }, diff --git a/hw/s390x/meson.build b/hw/s390x/meson.build index 91495b563146..327e9c93afa9 100644 --- a/hw/s390x/meson.build +++ b/hw/s390x/meson.build @@ -34,7 +34,6 @@ virtio_ss.add(files('virtio-ccw.c')) virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio-ccw-ba= lloon.c')) virtio_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-ccw-blk.c'= )) virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-ccw-cry= pto.c')) -virtio_ss.add(when: 'CONFIG_VIRTIO_GPU', if_true: files('virtio-ccw-gpu.c'= )) virtio_ss.add(when: 'CONFIG_VIRTIO_INPUT', if_true: files('virtio-ccw-inpu= t.c')) virtio_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('virtio-ccw-net.c'= )) virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-ccw-rng.c'= )) @@ -48,3 +47,10 @@ virtio_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: fil= es('vhost-user-fs-ccw.c' s390x_ss.add_all(when: 'CONFIG_VIRTIO_CCW', if_true: virtio_ss) =20 hw_arch +=3D {'s390x': s390x_ss} + +hw_s390x_modules =3D {} +virtio_gpu_ccw_ss =3D ss.source_set() +virtio_gpu_ccw_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_CCW'], + if_true: [files('virtio-ccw-gpu.c'), pixman]) +hw_s390x_modules +=3D {'virtio-gpu-ccw': virtio_gpu_ccw_ss} +modules +=3D {'hw-s390x': hw_s390x_modules} --=20 2.30.2 From nobody Sat May 4 23:14:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616763437; cv=none; d=zohomail.com; s=zohoarc; b=VaBz3qfgUzTdJ0QAS10eliSq4pm7EZ9kJJ4xf43CwVDpHnfE5gFi778RGuYxqCsqeCCmFOXRpRmjwrNlmObCBz/GM3S4wAiyEZnhN5sb/cqRX2SL3paE95Xtd6yRIea8gPTV2yaG4NCnL1UU7Pb5FO9AVyh1vvpnKTIcommoYgM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616763437; 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=e0KQjon6DYSw7rzNJPTaUajbh8VbHC3day+fWXsDf3Y=; b=HUURwKWLpc9Y02JyLMM07JgktEJrxrBHeGjNacPCebkVsvwGFOciZvxLDjnWFTREDn3dNPl4ZIDdqtQ8x/Lm8negqNzrSk0dnH38r+VHDyJLus+ASjqm3MLTiFgvjqA9mCoDejhMhbP8smptkPcHR0mIEKuleBOqVdFoyhTewaM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616763437553177.20230083268325; Fri, 26 Mar 2021 05:57:17 -0700 (PDT) Received: from localhost ([::1]:58940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPm1c-0005Dd-JB for importer@patchew.org; Fri, 26 Mar 2021 08:57:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPlvW-00066h-L7 for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60042) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPlvF-0004Am-LF for qemu-devel@nongnu.org; Fri, 26 Mar 2021 08:50:57 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-175-ajj2HsDhMxuq3XkjRKxXsw-1; Fri, 26 Mar 2021 08:50:36 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6BD4F80006E; Fri, 26 Mar 2021 12:50:35 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-102.ams2.redhat.com [10.36.112.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7DD3719727; Fri, 26 Mar 2021 12:50:24 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 273691800396; Fri, 26 Mar 2021 13:49:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616763040; 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=e0KQjon6DYSw7rzNJPTaUajbh8VbHC3day+fWXsDf3Y=; b=i3SLNDBo6fJCsvnkEgrqIAeQD3pr0bA77+d9LYtWW7dXzYCVu4RBKMIVHrmsaibeuO9O5v lCAnPsbMjHcyeLS1tZ/MunP/tegOlSeLMoYBg0sMmzqFPIA09I91YABooiMPXqCZzkBe1c hdweD1OoJle3AQ6GcYJplWBwyMshxP0= X-MC-Unique: ajj2HsDhMxuq3XkjRKxXsw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 9/9] hw/usb/hcd-ehci: Fix crash when showing help of EHCI devices Date: Fri, 26 Mar 2021 13:49:32 +0100 Message-Id: <20210326124932.481942-10-kraxel@redhat.com> In-Reply-To: <20210326124932.481942-1-kraxel@redhat.com> References: <20210326124932.481942-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Richard Henderson , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, "Michael S. Tsirkin" , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Thomas Huth QEMU crashes with certain targets when trying to show the help output of EHCI devices: $ ./qemu-system-aarch64 -device ich9-usb-ehci1,help qemu-system-aarch64: ../../devel/qemu/softmmu/physmem.c:1154: phys_section_= add: Assertion `map->sections_nb < TARGET_PAGE_SIZE' failed. Aborted (core dumped) This happens because the device is doing things at "instance_init" time that should be done at "realize" time instead. So move the related code to the realize() function instead. (NB: This now also matches the memory_region_del_subregion() calls which are done in usb_ehci_unrealize(), and not during finalize()). Suggested-by: Richard Henderson Signed-off-by: Thomas Huth Message-Id: <20210326095155.1994604-1-thuth@redhat.com> Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index f71af0ad2d8f..6caa7ac6c28f 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -2514,6 +2514,11 @@ void usb_ehci_realize(EHCIState *s, DeviceState *dev= , Error **errp) return; } =20 + memory_region_add_subregion(&s->mem, s->capsbase, &s->mem_caps); + memory_region_add_subregion(&s->mem, s->opregbase, &s->mem_opreg); + memory_region_add_subregion(&s->mem, s->opregbase + s->portscbase, + &s->mem_ports); + usb_bus_new(&s->bus, sizeof(s->bus), s->companion_enable ? &ehci_bus_ops_companion : &ehci_bus_ops_standalone, dev); for (i =3D 0; i < s->portnr; i++) { @@ -2581,11 +2586,6 @@ void usb_ehci_init(EHCIState *s, DeviceState *dev) "operational", s->portscbase); memory_region_init_io(&s->mem_ports, OBJECT(dev), &ehci_mmio_port_ops,= s, "ports", 4 * s->portnr); - - memory_region_add_subregion(&s->mem, s->capsbase, &s->mem_caps); - memory_region_add_subregion(&s->mem, s->opregbase, &s->mem_opreg); - memory_region_add_subregion(&s->mem, s->opregbase + s->portscbase, - &s->mem_ports); } =20 void usb_ehci_finalize(EHCIState *s) --=20 2.30.2