From nobody Fri May 3 08:58:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635870413; cv=none; d=zohomail.com; s=zohoarc; b=mdFZsUKVp3Y08/TjVUMoh9M/jsw8NwaiobC8FCJT0YX1tzgCcdIPErDRkXBaslkMA7yTFfW+N/mg5P6tkQsgdXSa9UzL4dDhnDzYVWgkRXRdAChyYNiHeKp60TIKXMYnXb/I38fo3zZPbPLnmw51n8nQKvuLeB2LPDRL2jAdjbM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635870413; 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=2XvVkv7KUHOFgDGeEcXEIkQkV3iJ9SBy5y3Ftt/QZyY=; b=ZxLRGVVTYf1dguqAxGNsYEs+6amleCx7Ykr7/4Hf1GS4YKIMLqdNgabzCm29bSHt7emJD/dyO8ae+4PAOP3MMcXV+Hcr3XNaYZn6r1cpkiNJ77t7HwP9UGAI0/1hPEwLfNkNTGLa659Bmc0VZo0/F0wEH2ZmIH+03teR7rvkxC8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1635870413933604.5865180355943; Tue, 2 Nov 2021 09:26:53 -0700 (PDT) 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-536-ntMGIaKCMBqnmARBlU9ygg-1; Tue, 02 Nov 2021 12:26:48 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 347B21005E68; Tue, 2 Nov 2021 16:26:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1A04D1002D71; Tue, 2 Nov 2021 16:26:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id DD79A4EA38; Tue, 2 Nov 2021 16:26:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A2GQNR7005371 for ; Tue, 2 Nov 2021 12:26:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3F80560D30; Tue, 2 Nov 2021 16:26:23 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2AED413ABD; Tue, 2 Nov 2021 16:26:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8A1D9180098D; Tue, 2 Nov 2021 17:26:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635870412; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=2XvVkv7KUHOFgDGeEcXEIkQkV3iJ9SBy5y3Ftt/QZyY=; b=coUBWqpy9f/PkXdmqtgi3WWyodeIekrqtPPUqZBS8LTJ+ilSl0bNQTfjbyF7jha6IywWWo VTH7f8FSnfDWu3vOGeicL2EbBKZSqTwhhG6QKfNR1uLskhpqoPYDTi6kNX6wYNo5CHGkU3 WG2l34GwtfbO/hOtzKezJjm1rlXe1Y8= X-MC-Unique: ntMGIaKCMBqnmARBlU9ygg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 01/10] MAINTAINERS: Add myself as a reviewer for SDL audio Date: Tue, 2 Nov 2021 17:26:10 +0100 Message-Id: <20211102162619.2760593-2-kraxel@redhat.com> In-Reply-To: <20211102162619.2760593-1-kraxel@redhat.com> References: <20211102162619.2760593-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Thomas Huth , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , libvir-list@redhat.com, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Willian Rampazzo , Thomas Huth , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635870415200100003 From: Thomas Huth I've got some experience with the SDL library, so I can help reviewing patches here. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211030062106.46024-1-huth@tuxfamily.org> Signed-off-by: Gerd Hoffmann --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 310a9512ea18..99618e6d9906 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2315,6 +2315,7 @@ F: audio/paaudio.c =20 SDL Audio backend M: Gerd Hoffmann +R: Thomas Huth S: Odd Fixes F: audio/sdlaudio.c =20 --=20 2.31.1 From nobody Fri May 3 08:58:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635870422; cv=none; d=zohomail.com; s=zohoarc; b=Nkj+Xgxq1EVHm4WJrBv/mo+o9FIqNIeAGpLVQrD2uefo4hBrzch0fU8HmNnvFY30JMcoc9Ql5aNodvHTMXM4sIEMpl4Q5Gy8I2mf3Xcv1hqTOUhYpyW8UGgcu3Y8qCU/QrNKGP50Fr4bPNUH1BkvOWAREcv9JuvGEykjH0tvSV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635870422; 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=Zv4POPaDroXSr5MvhbVI8JBiagkh4t5htrL42TCz/wc=; b=fDafPyfgb713blCsPCk0EvZ4HIZySimpjCjDC3k+59mgZ7p5SdYGg3EI4GFt8At7zGKfsDHxCNUMRg6XlDKvqZGwGWCzXpqbfEBxTiMsjz1PtpFg9mI54Q65vCHzRd4MR7CWTMEAf0MguvKtmhta3HIJIUPOFIL9j5lOqGlyxAA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1635870422880184.0615362189577; Tue, 2 Nov 2021 09:27:02 -0700 (PDT) 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-535-vAiNCuReME2irs7m3QIR_w-1; Tue, 02 Nov 2021 12:26:37 -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 947E0EC1C0; Tue, 2 Nov 2021 16:26:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4191B1B5C0; Tue, 2 Nov 2021 16:26:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A9E5D4EA2F; Tue, 2 Nov 2021 16:26:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A2GQPIv005387 for ; Tue, 2 Nov 2021 12:26:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id E36C71B472; Tue, 2 Nov 2021 16:26:25 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F62813ABD; Tue, 2 Nov 2021 16:26:25 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 952421801AA7; Tue, 2 Nov 2021 17:26:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635870421; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Zv4POPaDroXSr5MvhbVI8JBiagkh4t5htrL42TCz/wc=; b=IPXmCr1FV3FK+yZrARJMPCxRiMBi80YNkMfXYghm0LV4RD/6UiNoIZazx193nDDOFsRxXz ux+fo6WrtXL3dAlKyEiFmOEltNrZiIXiVUTr3AmnSq1+CowZ+A66PEoH0XWFdKSR1evhKi xgItgHvTnwqbALaCTaDAmHZ7IeTWlc0= X-MC-Unique: vAiNCuReME2irs7m3QIR_w-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 02/10] MAINTAINERS: add myself as partial audio reviewer Date: Tue, 2 Nov 2021 17:26:11 +0100 Message-Id: <20211102162619.2760593-3-kraxel@redhat.com> In-Reply-To: <20211102162619.2760593-1-kraxel@redhat.com> References: <20211102162619.2760593-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Thomas Huth , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , libvir-list@redhat.com, Christian Schoenebeck , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Willian Rampazzo , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635870423802100001 From: Christian Schoenebeck Volunteering as reviewer for some of the audio backends; namely ALSA, CoreAudio and JACK. Signed-off-by: Christian Schoenebeck Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: Signed-off-by: Gerd Hoffmann --- MAINTAINERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 99618e6d9906..9ddba68701b5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2285,11 +2285,13 @@ F: qapi/audio.json =20 ALSA Audio backend M: Gerd Hoffmann +R: Christian Schoenebeck S: Odd Fixes F: audio/alsaaudio.c =20 Core Audio framework backend M: Gerd Hoffmann +R: Christian Schoenebeck S: Odd Fixes F: audio/coreaudio.c =20 @@ -2300,6 +2302,7 @@ F: audio/dsound* =20 JACK Audio Connection Kit backend M: Gerd Hoffmann +R: Christian Schoenebeck S: Odd Fixes F: audio/jackaudio.c =20 --=20 2.31.1 From nobody Fri May 3 08:58:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635870414; cv=none; d=zohomail.com; s=zohoarc; b=O3qd5GFM7V3B+S6rK2WXaIiGxmvfbgp+aWSWGad8M1602POmGXd+XvuCiV5Zn4QuS4ayROBNKMx9v8k9leKt4fhLQQ6nTVPCWdb0vJutOymV+0dZ8avu0MFkc8k8NgrWyLU9PmP/iD4MhuQ1CZZRWLRmGH0ikO5AvngZW0CZ528= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635870414; 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=tsi2My5XXdeCuf7g7TOXfBruTMn20sP+YMYltNBg7pc=; b=meb20B0U73iAZ/IjaX5j4IjpIKkuAjGOkcfq3ejcv90ze8DDzRMiRABaXhYSJi5QgXMasxLd8SlgMcZ3zA5JcEj34W93Kwq8hPWUrrUX6F6V+EeGrCuqbR6IlPvN/a9t6VYK55ZMJgwxe4m/VQq8drcmLXgVIqw2f7IoJyPIIu4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 163587041471262.66330331646088; Tue, 2 Nov 2021 09:26:54 -0700 (PDT) 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-244-BRwslPfXMCuWYOHnFIZKxg-1; Tue, 02 Nov 2021 12:26:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EBF54806690; Tue, 2 Nov 2021 16:26:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CBFEC5DF35; Tue, 2 Nov 2021 16:26:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A0323180BAD1; Tue, 2 Nov 2021 16:26:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A2GQR5a005397 for ; Tue, 2 Nov 2021 12:26:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id AF6871972D; Tue, 2 Nov 2021 16:26:27 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 883C619C59; Tue, 2 Nov 2021 16:26:25 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B19A31801AB5; Tue, 2 Nov 2021 17:26:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635870413; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=tsi2My5XXdeCuf7g7TOXfBruTMn20sP+YMYltNBg7pc=; b=Fx9rsgaKyLX6fMe+tSLlYBFko8Z3yPOl5NqPb7R/CFDrreBicE+DJ87eoKH+RNtFOhOe45 9a6oaI+E60IiDIoQis34PL8ocpMKlaZbDJFr3Ag39KhbOZ9wMJvXEWklq/PH5dr1E7+uE4 MGfxMarxeMuY8d86OkUkDGvPrgHqFp4= X-MC-Unique: BRwslPfXMCuWYOHnFIZKxg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 03/10] microvm: add device tree support. Date: Tue, 2 Nov 2021 17:26:12 +0100 Message-Id: <20211102162619.2760593-4-kraxel@redhat.com> In-Reply-To: <20211102162619.2760593-1-kraxel@redhat.com> References: <20211102162619.2760593-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Thomas Huth , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , libvir-list@redhat.com, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Willian Rampazzo , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635870417151100005 Content-Type: text/plain; charset="utf-8" Allows edk2 detect virtio-mmio devices and pcie ecam. See comment in hw/i386/microvm-dt.c for more details. Signed-off-by: Gerd Hoffmann Reviewed-by: Sergio Lopez Message-Id: <20211014193617.2475578-1-kraxel@redhat.com> --- hw/i386/microvm-dt.h | 8 + include/hw/i386/microvm.h | 4 + hw/i386/microvm-dt.c | 341 +++++++++++++++++++++++++++++ hw/i386/microvm.c | 2 + .gitlab-ci.d/buildtest.yml | 1 - configs/targets/i386-softmmu.mak | 1 + configs/targets/x86_64-softmmu.mak | 1 + hw/i386/meson.build | 2 +- 8 files changed, 358 insertions(+), 2 deletions(-) create mode 100644 hw/i386/microvm-dt.h create mode 100644 hw/i386/microvm-dt.c diff --git a/hw/i386/microvm-dt.h b/hw/i386/microvm-dt.h new file mode 100644 index 000000000000..77c79cbdd9fb --- /dev/null +++ b/hw/i386/microvm-dt.h @@ -0,0 +1,8 @@ +#ifndef HW_I386_MICROVM_DT_H +#define HW_I386_MICROVM_DT_H + +#include "hw/i386/microvm.h" + +void dt_setup_microvm(MicrovmMachineState *mms); + +#endif diff --git a/include/hw/i386/microvm.h b/include/hw/i386/microvm.h index f25f8374413f..4d9c732d4b2b 100644 --- a/include/hw/i386/microvm.h +++ b/include/hw/i386/microvm.h @@ -104,6 +104,10 @@ struct MicrovmMachineState { Notifier machine_done; Notifier powerdown_req; struct GPEXConfig gpex; + + /* device tree */ + void *fdt; + uint32_t ioapic_phandle[2]; }; =20 #define TYPE_MICROVM_MACHINE MACHINE_TYPE_NAME("microvm") diff --git a/hw/i386/microvm-dt.c b/hw/i386/microvm-dt.c new file mode 100644 index 000000000000..875ba9196394 --- /dev/null +++ b/hw/i386/microvm-dt.c @@ -0,0 +1,341 @@ +/* + * microvm device tree support + * + * This generates an device tree for microvm and exports it via fw_cfg + * as "etc/fdt" to the firmware (edk2 specifically). + * + * The use case is to allow edk2 find the pcie ecam and the virtio + * devices, without adding an ACPI parser, reusing the fdt parser + * which is needed anyway for the arm platform. + * + * Note 1: The device tree is incomplete. CPUs and memory is missing + * for example, those can be detected using other fw_cfg files. + * Also pci ecam irq routing is not there, edk2 doesn't use + * interrupts. + * + * Note 2: This is for firmware only. OSes should use the more + * complete ACPI tables for hardware discovery. + * + * ---------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2 or later, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License f= or + * more details. + * + * You should have received a copy of the GNU General Public License along= with + * this program. If not, see . + */ +#include "qemu/osdep.h" +#include "qemu/cutils.h" +#include "sysemu/device_tree.h" +#include "hw/char/serial.h" +#include "hw/i386/fw_cfg.h" +#include "hw/rtc/mc146818rtc.h" +#include "hw/sysbus.h" +#include "hw/virtio/virtio-mmio.h" +#include "hw/usb/xhci.h" + +#include "microvm-dt.h" + +static bool debug; + +static void dt_add_microvm_irq(MicrovmMachineState *mms, + const char *nodename, uint32_t irq) +{ + int index =3D 0; + + if (irq >=3D IO_APIC_SECONDARY_IRQBASE) { + irq -=3D IO_APIC_SECONDARY_IRQBASE; + index++; + } + + qemu_fdt_setprop_cell(mms->fdt, nodename, "interrupt-parent", + mms->ioapic_phandle[index]); + qemu_fdt_setprop_cells(mms->fdt, nodename, "interrupts", irq, 0); +} + +static void dt_add_virtio(MicrovmMachineState *mms, VirtIOMMIOProxy *mmio) +{ + SysBusDevice *dev =3D SYS_BUS_DEVICE(mmio); + VirtioBusState *mmio_virtio_bus =3D &mmio->bus; + BusState *mmio_bus =3D &mmio_virtio_bus->parent_obj; + char *nodename; + + if (QTAILQ_EMPTY(&mmio_bus->children)) { + return; + } + + hwaddr base =3D dev->mmio[0].addr; + hwaddr size =3D 512; + unsigned index =3D (base - VIRTIO_MMIO_BASE) / size; + uint32_t irq =3D mms->virtio_irq_base + index; + + nodename =3D g_strdup_printf("/virtio_mmio@%" PRIx64, base); + qemu_fdt_add_subnode(mms->fdt, nodename); + qemu_fdt_setprop_string(mms->fdt, nodename, "compatible", "virtio,mmio= "); + qemu_fdt_setprop_sized_cells(mms->fdt, nodename, "reg", 2, base, 2, si= ze); + qemu_fdt_setprop(mms->fdt, nodename, "dma-coherent", NULL, 0); + dt_add_microvm_irq(mms, nodename, irq); + g_free(nodename); +} + +static void dt_add_xhci(MicrovmMachineState *mms) +{ + const char compat[] =3D "generic-xhci"; + uint32_t irq =3D MICROVM_XHCI_IRQ; + hwaddr base =3D MICROVM_XHCI_BASE; + hwaddr size =3D XHCI_LEN_REGS; + char *nodename; + + nodename =3D g_strdup_printf("/usb@%" PRIx64, base); + qemu_fdt_add_subnode(mms->fdt, nodename); + qemu_fdt_setprop(mms->fdt, nodename, "compatible", compat, sizeof(comp= at)); + qemu_fdt_setprop_sized_cells(mms->fdt, nodename, "reg", 2, base, 2, si= ze); + qemu_fdt_setprop(mms->fdt, nodename, "dma-coherent", NULL, 0); + dt_add_microvm_irq(mms, nodename, irq); + g_free(nodename); +} + +static void dt_add_pcie(MicrovmMachineState *mms) +{ + hwaddr base =3D PCIE_MMIO_BASE; + int nr_pcie_buses; + char *nodename; + + nodename =3D g_strdup_printf("/pcie@%" PRIx64, base); + qemu_fdt_add_subnode(mms->fdt, nodename); + qemu_fdt_setprop_string(mms->fdt, nodename, + "compatible", "pci-host-ecam-generic"); + qemu_fdt_setprop_string(mms->fdt, nodename, "device_type", "pci"); + qemu_fdt_setprop_cell(mms->fdt, nodename, "#address-cells", 3); + qemu_fdt_setprop_cell(mms->fdt, nodename, "#size-cells", 2); + qemu_fdt_setprop_cell(mms->fdt, nodename, "linux,pci-domain", 0); + qemu_fdt_setprop(mms->fdt, nodename, "dma-coherent", NULL, 0); + + qemu_fdt_setprop_sized_cells(mms->fdt, nodename, "reg", + 2, PCIE_ECAM_BASE, 2, PCIE_ECAM_SIZE); + if (mms->gpex.mmio64.size) { + qemu_fdt_setprop_sized_cells(mms->fdt, nodename, "ranges", + + 1, FDT_PCI_RANGE_MMIO, + 2, mms->gpex.mmio32.base, + 2, mms->gpex.mmio32.base, + 2, mms->gpex.mmio32.size, + + 1, FDT_PCI_RANGE_MMIO_64BIT, + 2, mms->gpex.mmio64.base, + 2, mms->gpex.mmio64.base, + 2, mms->gpex.mmio64.size); + } else { + qemu_fdt_setprop_sized_cells(mms->fdt, nodename, "ranges", + + 1, FDT_PCI_RANGE_MMIO, + 2, mms->gpex.mmio32.base, + 2, mms->gpex.mmio32.base, + 2, mms->gpex.mmio32.size); + } + + nr_pcie_buses =3D PCIE_ECAM_SIZE / PCIE_MMCFG_SIZE_MIN; + qemu_fdt_setprop_cells(mms->fdt, nodename, "bus-range", 0, + nr_pcie_buses - 1); +} + +static void dt_add_ioapic(MicrovmMachineState *mms, SysBusDevice *dev) +{ + hwaddr base =3D dev->mmio[0].addr; + char *nodename; + uint32_t ph; + int index; + + switch (base) { + case IO_APIC_DEFAULT_ADDRESS: + index =3D 0; + break; + case IO_APIC_SECONDARY_ADDRESS: + index =3D 1; + break; + default: + fprintf(stderr, "unknown ioapic @ %" PRIx64 "\n", base); + return; + } + + nodename =3D g_strdup_printf("/ioapic%d@%" PRIx64, index + 1, base); + qemu_fdt_add_subnode(mms->fdt, nodename); + qemu_fdt_setprop_string(mms->fdt, nodename, + "compatible", "intel,ce4100-ioapic"); + qemu_fdt_setprop(mms->fdt, nodename, "interrupt-controller", NULL, 0); + qemu_fdt_setprop_cell(mms->fdt, nodename, "#interrupt-cells", 0x2); + qemu_fdt_setprop_cell(mms->fdt, nodename, "#address-cells", 0x2); + qemu_fdt_setprop_sized_cells(mms->fdt, nodename, "reg", + 2, base, 2, 0x1000); + + ph =3D qemu_fdt_alloc_phandle(mms->fdt); + qemu_fdt_setprop_cell(mms->fdt, nodename, "phandle", ph); + qemu_fdt_setprop_cell(mms->fdt, nodename, "linux,phandle", ph); + mms->ioapic_phandle[index] =3D ph; + + g_free(nodename); +} + +static void dt_add_isa_serial(MicrovmMachineState *mms, ISADevice *dev) +{ + const char compat[] =3D "ns16550"; + uint32_t irq =3D object_property_get_int(OBJECT(dev), "irq", NULL); + hwaddr base =3D object_property_get_int(OBJECT(dev), "iobase", NULL); + hwaddr size =3D 8; + char *nodename; + + nodename =3D g_strdup_printf("/serial@%" PRIx64, base); + qemu_fdt_add_subnode(mms->fdt, nodename); + qemu_fdt_setprop(mms->fdt, nodename, "compatible", compat, sizeof(comp= at)); + qemu_fdt_setprop_sized_cells(mms->fdt, nodename, "reg", 2, base, 2, si= ze); + dt_add_microvm_irq(mms, nodename, irq); + + if (base =3D=3D 0x3f8 /* com1 */) { + qemu_fdt_setprop_string(mms->fdt, "/chosen", "stdout-path", nodena= me); + } + + g_free(nodename); +} + +static void dt_add_isa_rtc(MicrovmMachineState *mms, ISADevice *dev) +{ + const char compat[] =3D "motorola,mc146818"; + uint32_t irq =3D RTC_ISA_IRQ; + hwaddr base =3D RTC_ISA_BASE; + hwaddr size =3D 8; + char *nodename; + + nodename =3D g_strdup_printf("/rtc@%" PRIx64, base); + qemu_fdt_add_subnode(mms->fdt, nodename); + qemu_fdt_setprop(mms->fdt, nodename, "compatible", compat, sizeof(comp= at)); + qemu_fdt_setprop_sized_cells(mms->fdt, nodename, "reg", 2, base, 2, si= ze); + dt_add_microvm_irq(mms, nodename, irq); + g_free(nodename); +} + +static void dt_setup_isa_bus(MicrovmMachineState *mms, DeviceState *bridge) +{ + BusState *bus =3D qdev_get_child_bus(bridge, "isa.0"); + BusChild *kid; + Object *obj; + + QTAILQ_FOREACH(kid, &bus->children, sibling) { + DeviceState *dev =3D kid->child; + + /* serial */ + obj =3D object_dynamic_cast(OBJECT(dev), TYPE_ISA_SERIAL); + if (obj) { + dt_add_isa_serial(mms, ISA_DEVICE(obj)); + continue; + } + + /* rtc */ + obj =3D object_dynamic_cast(OBJECT(dev), TYPE_MC146818_RTC); + if (obj) { + dt_add_isa_rtc(mms, ISA_DEVICE(obj)); + continue; + } + + if (debug) { + fprintf(stderr, "%s: unhandled: %s\n", __func__, + object_get_typename(OBJECT(dev))); + } + } +} + +static void dt_setup_sys_bus(MicrovmMachineState *mms) +{ + BusState *bus; + BusChild *kid; + Object *obj; + + /* sysbus devices */ + bus =3D sysbus_get_default(); + QTAILQ_FOREACH(kid, &bus->children, sibling) { + DeviceState *dev =3D kid->child; + + /* ioapic */ + obj =3D object_dynamic_cast(OBJECT(dev), TYPE_IOAPIC); + if (obj) { + dt_add_ioapic(mms, SYS_BUS_DEVICE(obj)); + continue; + } + } + + QTAILQ_FOREACH(kid, &bus->children, sibling) { + DeviceState *dev =3D kid->child; + + /* virtio */ + obj =3D object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MMIO); + if (obj) { + dt_add_virtio(mms, VIRTIO_MMIO(obj)); + continue; + } + + /* xhci */ + obj =3D object_dynamic_cast(OBJECT(dev), TYPE_XHCI_SYSBUS); + if (obj) { + dt_add_xhci(mms); + continue; + } + + /* pcie */ + obj =3D object_dynamic_cast(OBJECT(dev), TYPE_GPEX_HOST); + if (obj) { + dt_add_pcie(mms); + continue; + } + + /* isa */ + obj =3D object_dynamic_cast(OBJECT(dev), "isabus-bridge"); + if (obj) { + dt_setup_isa_bus(mms, DEVICE(obj)); + continue; + } + + if (debug) { + obj =3D object_dynamic_cast(OBJECT(dev), TYPE_IOAPIC); + if (obj) { + /* ioapic already added in first pass */ + continue; + } + fprintf(stderr, "%s: unhandled: %s\n", __func__, + object_get_typename(OBJECT(dev))); + } + } +} + +void dt_setup_microvm(MicrovmMachineState *mms) +{ + X86MachineState *x86ms =3D X86_MACHINE(mms); + int size =3D 0; + + mms->fdt =3D create_device_tree(&size); + + /* root node */ + qemu_fdt_setprop_string(mms->fdt, "/", "compatible", "linux,microvm"); + qemu_fdt_setprop_cell(mms->fdt, "/", "#address-cells", 0x2); + qemu_fdt_setprop_cell(mms->fdt, "/", "#size-cells", 0x2); + + qemu_fdt_add_subnode(mms->fdt, "/chosen"); + dt_setup_sys_bus(mms); + + /* add to fw_cfg */ + fprintf(stderr, "%s: add etc/fdt to fw_cfg\n", __func__); + fw_cfg_add_file(x86ms->fw_cfg, "etc/fdt", mms->fdt, size); + + if (debug) { + fprintf(stderr, "%s: writing microvm.fdt\n", __func__); + g_file_set_contents("microvm.fdt", mms->fdt, size, NULL); + int ret =3D system("dtc -I dtb -O dts microvm.fdt"); + if (ret !=3D 0) { + fprintf(stderr, "%s: oops, dtc not installed?\n", __func__); + } + } +} diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index f257ec5a0bc1..8d6ebea3414d 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -28,6 +28,7 @@ #include "sysemu/reset.h" #include "sysemu/runstate.h" #include "acpi-microvm.h" +#include "microvm-dt.h" =20 #include "hw/loader.h" #include "hw/irq.h" @@ -626,6 +627,7 @@ static void microvm_machine_done(Notifier *notifier, vo= id *data) machine_done); =20 acpi_setup_microvm(mms); + dt_setup_microvm(mms); } =20 static void microvm_powerdown_req(Notifier *notifier, void *data) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 5c378e35f91f..6c1301e91287 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -575,7 +575,6 @@ build-without-default-features: CONFIGURE_ARGS: --without-default-features --disable-capstone - --disable-fdt --disable-pie --disable-qom-cast-debug --disable-slirp diff --git a/configs/targets/i386-softmmu.mak b/configs/targets/i386-softmm= u.mak index 5babf71895db..6b3c99fc86c5 100644 --- a/configs/targets/i386-softmmu.mak +++ b/configs/targets/i386-softmmu.mak @@ -1,3 +1,4 @@ TARGET_ARCH=3Di386 TARGET_SUPPORTS_MTTCG=3Dy +TARGET_NEED_FDT=3Dy TARGET_XML_FILES=3D gdb-xml/i386-32bit.xml diff --git a/configs/targets/x86_64-softmmu.mak b/configs/targets/x86_64-so= ftmmu.mak index 75e42bc84047..197817c94346 100644 --- a/configs/targets/x86_64-softmmu.mak +++ b/configs/targets/x86_64-softmmu.mak @@ -1,4 +1,5 @@ TARGET_ARCH=3Dx86_64 TARGET_BASE_ARCH=3Di386 TARGET_SUPPORTS_MTTCG=3Dy +TARGET_NEED_FDT=3Dy TARGET_XML_FILES=3D gdb-xml/i386-64bit.xml diff --git a/hw/i386/meson.build b/hw/i386/meson.build index c502965219d6..213e2e82b3d7 100644 --- a/hw/i386/meson.build +++ b/hw/i386/meson.build @@ -11,7 +11,7 @@ i386_ss.add(when: 'CONFIG_X86_IOMMU', if_true: files('x86= -iommu.c'), if_false: files('x86-iommu-stub.c')) i386_ss.add(when: 'CONFIG_AMD_IOMMU', if_true: files('amd_iommu.c')) i386_ss.add(when: 'CONFIG_I440FX', if_true: files('pc_piix.c')) -i386_ss.add(when: 'CONFIG_MICROVM', if_true: files('microvm.c', 'acpi-micr= ovm.c')) +i386_ss.add(when: 'CONFIG_MICROVM', if_true: files('microvm.c', 'acpi-micr= ovm.c', 'microvm-dt.c')) i386_ss.add(when: 'CONFIG_Q35', if_true: files('pc_q35.c')) i386_ss.add(when: 'CONFIG_VMMOUSE', if_true: files('vmmouse.c')) i386_ss.add(when: 'CONFIG_VMPORT', if_true: files('vmport.c')) --=20 2.31.1 From nobody Fri May 3 08:58:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635870417; cv=none; d=zohomail.com; s=zohoarc; b=HQyEDC5tIYrxunvgZPrsRWgFyh4akeC/QXCpn85hGBQUGay9EnJ1Lrf8hue2eD+byO/1qwrVy1K2CSxnGUWAVNwmr+KImfo0k3lDgsg57eKrsMREmFdX6MCKCN5AiQFeW8C0KoJsXPD7VbF0h3bQwwqDlD2FGuXXQDlvLij8C+U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635870417; 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=nOf3JrKwfBbvuoGjnuKLN/jynInZWgZjD85m1I5Rioc=; b=CTPZcOb0iXpnoO2HUgegDdxzOc292FS0JTBE+OioOw45ExFgP/fGTYVaVN6PHkes3HYA/Qjd510YUDBg5NOgfB+csbVEd4SxjMldNkZwKkKXPLxH1b3jAzldQA5hn4KsE5vYsjtChBpAa1CNUQxovp/AUrkqbtiUeJs7sqcimuk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 163587041758126.786040753444922; Tue, 2 Nov 2021 09:26:57 -0700 (PDT) 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-40-REHGk0hCOE2Wn0cyxJJYOA-1; Tue, 02 Nov 2021 12:26:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8991C100B792; Tue, 2 Nov 2021 16:26:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 66DD35D705; Tue, 2 Nov 2021 16:26:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0F8AF1819AC2; Tue, 2 Nov 2021 16:26:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A2GQTXQ005409 for ; Tue, 2 Nov 2021 12:26:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id EB8F860CC4; Tue, 2 Nov 2021 16:26:29 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71F4D60BE5; Tue, 2 Nov 2021 16:26:29 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BCF011801AB7; Tue, 2 Nov 2021 17:26:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635870416; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=nOf3JrKwfBbvuoGjnuKLN/jynInZWgZjD85m1I5Rioc=; b=gx823eG3cC585OuRji8bheshviwQlRKtvwJAfrIjwcgbKMugQxP1VIRhLYevd7d0KsflS2 JRP8WlE6IerEzVqi9q7lcwJeQm/Le42xhibzKC3lN44rAq1F/Q7NMrEoRraIiwsYRq4alc A1G5JiQWRNSsd77LVkI/0x4uP/en/ts= X-MC-Unique: REHGk0hCOE2Wn0cyxJJYOA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 04/10] ui/gtk: Update the refresh rate for gl-area too Date: Tue, 2 Nov 2021 17:26:13 +0100 Message-Id: <20211102162619.2760593-5-kraxel@redhat.com> In-Reply-To: <20211102162619.2760593-1-kraxel@redhat.com> References: <20211102162619.2760593-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Thomas Huth , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , libvir-list@redhat.com, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Willian Rampazzo , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Nikola Pavlica X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635870419354100001 Content-Type: text/plain; charset="utf-8" From: Nikola Pavlica This is a bugfix that stretches all the way back to January 2020, where I initially introduced this problem and potential solutions. A quick recap of the issue: QEMU did not sync up with the monitors refresh rate causing the VM to render frames that were NOT displayed to the user. That "fix" allowed QEMU to obtain the screen refreshrate information from the system using GDK API's and was for GTK only. Well, I'm back with the same issue again. But this time on Wayland. And I did NOT realize there was YET another screen refresh rate function, this time for Wayland specifically. Thankfully the fix was simple and without much hassle. Thanks, Nikola PS: It seems that my patch has gone missing from the mailing list, hence I'm sending it again. Sorry for any inconveniences. Signed-off-by: Nikola Pavlica Message-Id: <20211024143110.704296-1-pavlica.nikola@gmail.com> Signed-off-by: Gerd Hoffmann --- ui/gtk-gl-area.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c index b23523748e7f..afcb29f65823 100644 --- a/ui/gtk-gl-area.c +++ b/ui/gtk-gl-area.c @@ -112,6 +112,9 @@ void gd_gl_area_refresh(DisplayChangeListener *dcl) { VirtualConsole *vc =3D container_of(dcl, VirtualConsole, gfx.dcl); =20 + vc->gfx.dcl.update_interval =3D gd_monitor_update_interval( + vc->window ? vc->window : vc->gfx.drawing_area); + if (!vc->gfx.gls) { if (!gtk_widget_get_realized(vc->gfx.drawing_area)) { return; --=20 2.31.1 From nobody Fri May 3 08:58:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635870420; cv=none; d=zohomail.com; s=zohoarc; b=g/SiGDQ00FdZEZ0A7cJZgZAS/L0aJXzhrLzsJuNrs6/VcbCfGKcDz6u30GDPIBq58HqzNnTYDbbTNFPb6B8RwK1usJ7yAxWeNmilvsLfqIKq0NFHVAokB7PqI5vbBVDsTrxaQiXLXcusFvpP2u7DnsUor6NfDCMYPjL/cE7z7L8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635870420; 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=OSsGgs5Jo4tIUzNzGDQe9LzsGenMwsKHMGXR5WSVwbo=; b=AF24iJnNlvzf61iYHZIXHcLyKAePOab6KV5fQrWqFOU/ExXKt5hiqifIPqPLWBNjrGM3NxTC5gsw7WtlG/TvxMxXUOfPtd2ZrKdrqv5Dr0746ZlZHc1LD6Vxtw4VSY0FX7WoSz1wmytSx+CwxNMUsbXKJb1a+Cut5Ki411hxaOY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1635870420651966.419625583152; Tue, 2 Nov 2021 09:27:00 -0700 (PDT) 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-502-hUxJIiGbOy2v_gXudKjEaA-1; Tue, 02 Nov 2021 12:26:58 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F295F8030B7; Tue, 2 Nov 2021 16:26:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D7706100E12C; Tue, 2 Nov 2021 16:26:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A15E14EA38; Tue, 2 Nov 2021 16:26:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A2GQVlL005414 for ; Tue, 2 Nov 2021 12:26:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 211DB5BAFF; Tue, 2 Nov 2021 16:26:31 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 10D051B5C2; Tue, 2 Nov 2021 16:26:30 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CF4F91801AB8; Tue, 2 Nov 2021 17:26:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635870419; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=OSsGgs5Jo4tIUzNzGDQe9LzsGenMwsKHMGXR5WSVwbo=; b=htvl7rEaS7VLtzMCW4etpDgFL75+ib1nHnU+ljljccvlYKvFBkZKo44ps9pfgb/Lwwr0Uf 8bOQ36v5CqzA2UZc4vMHSkgo/g3f1QrlkqgtafRrMLCmZooJFG4jsVvQRmKC28FEnscQ5o qeSbTlir8dSm4GFXkaWtWihaiMNZmqU= X-MC-Unique: hUxJIiGbOy2v_gXudKjEaA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 05/10] ui/gtk: skip any extra draw of same guest scanout blob res Date: Tue, 2 Nov 2021 17:26:14 +0100 Message-Id: <20211102162619.2760593-6-kraxel@redhat.com> In-Reply-To: <20211102162619.2760593-1-kraxel@redhat.com> References: <20211102162619.2760593-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Thomas Huth , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , libvir-list@redhat.com, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Vivek Kasireddy , Willian Rampazzo , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Dongwon Kim X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635870421670100006 Content-Type: text/plain; charset="utf-8" From: Dongwon Kim Any extra draw call for the same blob resource representing guest scanout before the previous drawing is not finished can break synchronous draw sequence. To prevent this, drawing is now done only once for each draw submission (when draw_submitted =3D=3D true). v2: - removed mutex - updated commit msg Cc: Gerd Hoffmann Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim Message-Id: <20210924225105.24930-1-dongwon.kim@intel.com> Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 1 + hw/display/virtio-gpu-udmabuf.c | 2 +- ui/gtk-egl.c | 40 ++++++++++++++++++--------- ui/gtk-gl-area.c | 49 ++++++++++++++++++++------------- 4 files changed, 59 insertions(+), 33 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index 244664d727a4..b6bedc5f4152 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -171,6 +171,7 @@ typedef struct QemuDmaBuf { void *sync; int fence_fd; bool allow_fences; + bool draw_submitted; } QemuDmaBuf; =20 typedef struct DisplayState DisplayState; diff --git a/hw/display/virtio-gpu-udmabuf.c b/hw/display/virtio-gpu-udmabu= f.c index c6f7f587847f..60ea7f8f4972 100644 --- a/hw/display/virtio-gpu-udmabuf.c +++ b/hw/display/virtio-gpu-udmabuf.c @@ -186,7 +186,7 @@ static VGPUDMABuf dmabuf->buf.fourcc =3D qemu_pixman_to_drm_format(fb->format); dmabuf->buf.fd =3D res->dmabuf_fd; dmabuf->buf.allow_fences =3D true; - + dmabuf->buf.draw_submitted =3D false; dmabuf->scanout_id =3D scanout_id; QTAILQ_INSERT_HEAD(&g->dmabuf.bufs, dmabuf, next); =20 diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index 72ce5e1f8f41..e912b200755a 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -63,6 +63,9 @@ void gd_egl_init(VirtualConsole *vc) void gd_egl_draw(VirtualConsole *vc) { GdkWindow *window; +#ifdef CONFIG_GBM + QemuDmaBuf *dmabuf =3D vc->gfx.guest_fb.dmabuf; +#endif int ww, wh; =20 if (!vc->gfx.gls) { @@ -74,10 +77,31 @@ void gd_egl_draw(VirtualConsole *vc) wh =3D gdk_window_get_height(window); =20 if (vc->gfx.scanout_mode) { +#ifdef CONFIG_GBM + if (dmabuf) { + if (!dmabuf->draw_submitted) { + return; + } else { + dmabuf->draw_submitted =3D false; + } + } +#endif gd_egl_scanout_flush(&vc->gfx.dcl, 0, 0, vc->gfx.w, vc->gfx.h); =20 vc->gfx.scale_x =3D (double)ww / vc->gfx.w; vc->gfx.scale_y =3D (double)wh / vc->gfx.h; + + glFlush(); +#ifdef CONFIG_GBM + if (dmabuf) { + egl_dmabuf_create_fence(dmabuf); + if (dmabuf->fence_fd > 0) { + qemu_set_fd_handler(dmabuf->fence_fd, gd_hw_gl_flushed, NU= LL, vc); + return; + } + graphic_hw_gl_block(vc->gfx.dcl.con, false); + } +#endif } else { if (!vc->gfx.ds) { return; @@ -92,21 +116,10 @@ void gd_egl_draw(VirtualConsole *vc) =20 vc->gfx.scale_x =3D (double)ww / surface_width(vc->gfx.ds); vc->gfx.scale_y =3D (double)wh / surface_height(vc->gfx.ds); - } - - glFlush(); -#ifdef CONFIG_GBM - if (vc->gfx.guest_fb.dmabuf) { - QemuDmaBuf *dmabuf =3D vc->gfx.guest_fb.dmabuf; =20 - egl_dmabuf_create_fence(dmabuf); - if (dmabuf->fence_fd > 0) { - qemu_set_fd_handler(dmabuf->fence_fd, gd_hw_gl_flushed, NULL, = vc); - return; - } - graphic_hw_gl_block(vc->gfx.dcl.con, false); + glFlush(); } -#endif + graphic_hw_gl_flushed(vc->gfx.dcl.con); } =20 @@ -317,6 +330,7 @@ void gd_egl_flush(DisplayChangeListener *dcl, =20 if (vc->gfx.guest_fb.dmabuf) { graphic_hw_gl_block(vc->gfx.dcl.con, true); + vc->gfx.guest_fb.dmabuf->draw_submitted =3D true; gtk_widget_queue_draw_area(area, x, y, w, h); return; } diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c index afcb29f65823..461da7712f4f 100644 --- a/ui/gtk-gl-area.c +++ b/ui/gtk-gl-area.c @@ -38,6 +38,9 @@ static void gtk_gl_area_set_scanout_mode(VirtualConsole *= vc, bool scanout) =20 void gd_gl_area_draw(VirtualConsole *vc) { +#ifdef CONFIG_GBM + QemuDmaBuf *dmabuf =3D vc->gfx.guest_fb.dmabuf; +#endif int ww, wh, y1, y2; =20 if (!vc->gfx.gls) { @@ -53,6 +56,16 @@ void gd_gl_area_draw(VirtualConsole *vc) return; } =20 +#ifdef CONFIG_GBM + if (dmabuf) { + if (!dmabuf->draw_submitted) { + return; + } else { + dmabuf->draw_submitted =3D false; + } + } +#endif + glBindFramebuffer(GL_READ_FRAMEBUFFER, vc->gfx.guest_fb.framebuffe= r); /* GtkGLArea sets GL_DRAW_FRAMEBUFFER for us */ =20 @@ -62,6 +75,22 @@ void gd_gl_area_draw(VirtualConsole *vc) glBlitFramebuffer(0, y1, vc->gfx.w, y2, 0, 0, ww, wh, GL_COLOR_BUFFER_BIT, GL_NEAREST); +#ifdef CONFIG_GBM + if (dmabuf) { + egl_dmabuf_create_sync(dmabuf); + } +#endif + glFlush(); +#ifdef CONFIG_GBM + if (dmabuf) { + egl_dmabuf_create_fence(dmabuf); + if (dmabuf->fence_fd > 0) { + qemu_set_fd_handler(dmabuf->fence_fd, gd_hw_gl_flushed, NU= LL, vc); + return; + } + graphic_hw_gl_block(vc->gfx.dcl.con, false); + } +#endif } else { if (!vc->gfx.ds) { return; @@ -72,25 +101,6 @@ void gd_gl_area_draw(VirtualConsole *vc) surface_gl_render_texture(vc->gfx.gls, vc->gfx.ds); } =20 -#ifdef CONFIG_GBM - if (vc->gfx.guest_fb.dmabuf) { - egl_dmabuf_create_sync(vc->gfx.guest_fb.dmabuf); - } -#endif - - glFlush(); -#ifdef CONFIG_GBM - if (vc->gfx.guest_fb.dmabuf) { - QemuDmaBuf *dmabuf =3D vc->gfx.guest_fb.dmabuf; - - egl_dmabuf_create_fence(dmabuf); - if (dmabuf->fence_fd > 0) { - qemu_set_fd_handler(dmabuf->fence_fd, gd_hw_gl_flushed, NULL, = vc); - return; - } - graphic_hw_gl_block(vc->gfx.dcl.con, false); - } -#endif graphic_hw_gl_flushed(vc->gfx.dcl.con); } =20 @@ -237,6 +247,7 @@ void gd_gl_area_scanout_flush(DisplayChangeListener *dc= l, =20 if (vc->gfx.guest_fb.dmabuf) { graphic_hw_gl_block(vc->gfx.dcl.con, true); + vc->gfx.guest_fb.dmabuf->draw_submitted =3D true; } gtk_gl_area_queue_render(GTK_GL_AREA(vc->gfx.drawing_area)); } --=20 2.31.1 From nobody Fri May 3 08:58:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635870405; cv=none; d=zohomail.com; s=zohoarc; b=I1fr7efZ7etdD+naCTaG+jJIQeq4avTO810+pvCkFDHvDJSNp21n9T15flPOiTiCOiKaF3NQf9JmPCSf4JJ86+pmmEsaDR1FNMm+CBThQK+XpSAK4/gJ4N9zOnJXRJZBPsbfxmIKwCreY+I0H+9CeaALD2JnzBvvpDo8hCqMHdg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635870405; 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=YnuyxSC9Hd75TnRtGuijJ3AaAdsHqZa/sQ+weo7o7Ng=; b=XbGk4yu8fGAUyYj6ThYZn9XV44PZD3U63BtTRpoA6yucm1OyX5Bj/uCYycheCBoIAvKP5bonvdbCvfzLIZMkWLWDcBoKa9DtoaBntXKN/hOcm/7bEZpd8W0E1KXsPs4h55LjI7Vv/JG22HNxgeZWXMri96+1OFvk1hK+mw9TpDY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 163587040562943.302177803097834; Tue, 2 Nov 2021 09:26:45 -0700 (PDT) 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-148-IP5BB_rlNUKPLByvvwBW7Q-1; Tue, 02 Nov 2021 12:26:41 -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 2A5DE806699; Tue, 2 Nov 2021 16:26:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CDF219EF9; Tue, 2 Nov 2021 16:26:36 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D35F11800FDD; Tue, 2 Nov 2021 16:26:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A2GQYqF005425 for ; Tue, 2 Nov 2021 12:26:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0025660C17; Tue, 2 Nov 2021 16:26:34 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B83E060BE5; Tue, 2 Nov 2021 16:26:32 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DB8741801ABC; Tue, 2 Nov 2021 17:26:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635870404; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=YnuyxSC9Hd75TnRtGuijJ3AaAdsHqZa/sQ+weo7o7Ng=; b=OqAVxZTmmfJ/UmkvYtZ4NFD4eGNw0X//iJEBb3/byYDGgAmu/fFxl+EmTSWRqMlaZT3mbm KPtdjdU/FiKbl0XJUhoha7Cah0mm2lC0BxHH7cZkHWwVwCuaVpknFR9i827U/McWF7FpWz UkIqJzhzRK3ERNsqDQBMLXYA7YgZdQI= X-MC-Unique: IP5BB_rlNUKPLByvvwBW7Q-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 06/10] ui/console: replace QEMUFIFO with Fifo8 Date: Tue, 2 Nov 2021 17:26:15 +0100 Message-Id: <20211102162619.2760593-7-kraxel@redhat.com> In-Reply-To: <20211102162619.2760593-1-kraxel@redhat.com> References: <20211102162619.2760593-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Thomas Huth , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , libvir-list@redhat.com, =?UTF-8?q?Volker=20R=C3=BCmelin?= , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Willian Rampazzo , Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635870407788100001 From: Volker R=C3=BCmelin One of the two FIFO implementations QEMUFIFO and Fifo8 is redundant. Replace QEMUFIFO with Fifo8. Signed-off-by: Volker R=C3=BCmelin Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20210916192239.18742-1-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- ui/console.c | 86 ++++++++++++---------------------------------------- 1 file changed, 20 insertions(+), 66 deletions(-) diff --git a/ui/console.c b/ui/console.c index eabbbc951c5f..d2433c0636d0 100644 --- a/ui/console.c +++ b/ui/console.c @@ -27,6 +27,7 @@ #include "hw/qdev-core.h" #include "qapi/error.h" #include "qapi/qapi-commands-ui.h" +#include "qemu/fifo8.h" #include "qemu/module.h" #include "qemu/option.h" #include "qemu/timer.h" @@ -62,57 +63,6 @@ enum TTYState { TTY_STATE_CSI, }; =20 -typedef struct QEMUFIFO { - uint8_t *buf; - int buf_size; - int count, wptr, rptr; -} QEMUFIFO; - -static int qemu_fifo_write(QEMUFIFO *f, const uint8_t *buf, int len1) -{ - int l, len; - - l =3D f->buf_size - f->count; - if (len1 > l) - len1 =3D l; - len =3D len1; - while (len > 0) { - l =3D f->buf_size - f->wptr; - if (l > len) - l =3D len; - memcpy(f->buf + f->wptr, buf, l); - f->wptr +=3D l; - if (f->wptr >=3D f->buf_size) - f->wptr =3D 0; - buf +=3D l; - len -=3D l; - } - f->count +=3D len1; - return len1; -} - -static int qemu_fifo_read(QEMUFIFO *f, uint8_t *buf, int len1) -{ - int l, len; - - if (len1 > f->count) - len1 =3D f->count; - len =3D len1; - while (len > 0) { - l =3D f->buf_size - f->rptr; - if (l > len) - l =3D len; - memcpy(buf, f->buf + f->rptr, l); - f->rptr +=3D l; - if (f->rptr >=3D f->buf_size) - f->rptr =3D 0; - buf +=3D l; - len -=3D l; - } - f->count -=3D len1; - return len1; -} - typedef enum { GRAPHIC_CONSOLE, TEXT_CONSOLE, @@ -165,8 +115,7 @@ struct QemuConsole { =20 Chardev *chr; /* fifo for key pressed */ - QEMUFIFO out_fifo; - uint8_t out_fifo_buf[16]; + Fifo8 out_fifo; QEMUTimer *kbd_timer; CoQueue dump_queue; =20 @@ -1160,21 +1109,25 @@ static int vc_chr_write(Chardev *chr, const uint8_t= *buf, int len) static void kbd_send_chars(void *opaque) { QemuConsole *s =3D opaque; - int len; - uint8_t buf[16]; + uint32_t len, avail; =20 len =3D qemu_chr_be_can_write(s->chr); - if (len > s->out_fifo.count) - len =3D s->out_fifo.count; - if (len > 0) { - if (len > sizeof(buf)) - len =3D sizeof(buf); - qemu_fifo_read(&s->out_fifo, buf, len); - qemu_chr_be_write(s->chr, buf, len); + avail =3D fifo8_num_used(&s->out_fifo); + if (len > avail) { + len =3D avail; + } + while (len > 0) { + const uint8_t *buf; + uint32_t size; + + buf =3D fifo8_pop_buf(&s->out_fifo, len, &size); + qemu_chr_be_write(s->chr, (uint8_t *)buf, size); + len -=3D size; + avail -=3D size; } /* characters are pending: we send them a bit later (XXX: horrible, should change char device API) */ - if (s->out_fifo.count > 0) { + if (avail > 0) { timer_mod(s->kbd_timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + 1= ); } } @@ -1185,6 +1138,7 @@ void kbd_put_keysym_console(QemuConsole *s, int keysy= m) uint8_t buf[16], *q; CharBackend *be; int c; + uint32_t num_free; =20 if (!s || (s->console_type =3D=3D GRAPHIC_CONSOLE)) return; @@ -1228,7 +1182,8 @@ void kbd_put_keysym_console(QemuConsole *s, int keysy= m) } be =3D s->chr->be; if (be && be->chr_read) { - qemu_fifo_write(&s->out_fifo, buf, q - buf); + num_free =3D fifo8_num_free(&s->out_fifo); + fifo8_push_all(&s->out_fifo, buf, MIN(num_free, q - buf)); kbd_send_chars(s); } break; @@ -2233,8 +2188,7 @@ static void text_console_do_init(Chardev *chr, Displa= yState *ds) int g_width =3D 80 * FONT_WIDTH; int g_height =3D 24 * FONT_HEIGHT; =20 - s->out_fifo.buf =3D s->out_fifo_buf; - s->out_fifo.buf_size =3D sizeof(s->out_fifo_buf); + fifo8_create(&s->out_fifo, 16); s->kbd_timer =3D timer_new_ms(QEMU_CLOCK_REALTIME, kbd_send_chars, s); s->ds =3D ds; =20 --=20 2.31.1 From nobody Fri May 3 08:58:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635870493; cv=none; d=zohomail.com; s=zohoarc; b=LJOtp+ekYpxVJVrRYSiirEk+USX7FnT37lyowObpiQjWn2xLAFNtOwo2ImrF9uurb9IJUcd0t0y95pppmQEXJURFu5pUyFPUR8JTZtqSHK8a1kj4GQshESuw0um8DdWTJMv9TbBamh8y2/VJevYejiMOWWLCsFfIrDJASB60Lxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635870493; 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=g6Ov4Y0MJFmq1qaH7RsUjq1nr4TjTqLuO/wHnfMydGA=; b=PnijwuFI8X/5pDEWPtXuSTeWB1qqd7Gd5U8iE+prLzKiv16frOtzNtErDvxd/y94SC5LQ4tVAa+ZrBbqm/Hvu62M7xAl94rqbg3ihM7bSwvOGi++X1EiV55twYjDy2KdnA7pg0BUXCydiTtl2cGYeCe+XfzbYY+PjE3a9djjYVg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1635870493421754.3251102102375; Tue, 2 Nov 2021 09:28:13 -0700 (PDT) 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-421-xGdtMTUaMMmZKWkkjsoaDw-1; Tue, 02 Nov 2021 12:26:58 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EFC618125E0; Tue, 2 Nov 2021 16:26:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C334C10016F5; Tue, 2 Nov 2021 16:26:51 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 798621806D04; Tue, 2 Nov 2021 16:26:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A2GQYjW005433 for ; Tue, 2 Nov 2021 12:26:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6E21B60C17; Tue, 2 Nov 2021 16:26:34 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C75BE60C05; Tue, 2 Nov 2021 16:26:33 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id E6E811801ABD; Tue, 2 Nov 2021 17:26:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635870492; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=g6Ov4Y0MJFmq1qaH7RsUjq1nr4TjTqLuO/wHnfMydGA=; b=QY/MrC+Qu8uGXr5X1JuK8VwPQ6RQB2ZAO5i/bO1haqz0iPh1rLJ+xo5HdxvfabHEnVVN/+ BX2sVjroMV7XblWZYfmzB3hDDkXeJA4lJ8eC5Si6Be9A3lwFK6PbwSN6eRe1iDjTroYvWL ZlS4CbRsXqbk7LA8PCeTYg7+wxlvSJE= X-MC-Unique: xGdtMTUaMMmZKWkkjsoaDw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 07/10] ui/console: replace kbd_timer with chr_accept_input callback Date: Tue, 2 Nov 2021 17:26:16 +0100 Message-Id: <20211102162619.2760593-8-kraxel@redhat.com> In-Reply-To: <20211102162619.2760593-1-kraxel@redhat.com> References: <20211102162619.2760593-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Thomas Huth , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , libvir-list@redhat.com, =?UTF-8?q?Volker=20R=C3=BCmelin?= , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Willian Rampazzo , Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635870494304100001 From: Volker R=C3=BCmelin There's a ChardevClass chr_accept_input() callback function that can replace the write retry timer. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Volker R=C3=BCmelin Message-Id: <20210916192239.18742-2-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- ui/console.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/ui/console.c b/ui/console.c index d2433c0636d0..dda1e6861d6a 100644 --- a/ui/console.c +++ b/ui/console.c @@ -116,7 +116,6 @@ struct QemuConsole { Chardev *chr; /* fifo for key pressed */ Fifo8 out_fifo; - QEMUTimer *kbd_timer; CoQueue dump_queue; =20 QTAILQ_ENTRY(QemuConsole) next; @@ -1106,30 +1105,21 @@ static int vc_chr_write(Chardev *chr, const uint8_t= *buf, int len) return len; } =20 -static void kbd_send_chars(void *opaque) +static void kbd_send_chars(QemuConsole *s) { - QemuConsole *s =3D opaque; uint32_t len, avail; =20 len =3D qemu_chr_be_can_write(s->chr); avail =3D fifo8_num_used(&s->out_fifo); - if (len > avail) { - len =3D avail; - } - while (len > 0) { + while (len > 0 && avail > 0) { const uint8_t *buf; uint32_t size; =20 - buf =3D fifo8_pop_buf(&s->out_fifo, len, &size); + buf =3D fifo8_pop_buf(&s->out_fifo, MIN(len, avail), &size); qemu_chr_be_write(s->chr, (uint8_t *)buf, size); - len -=3D size; + len =3D qemu_chr_be_can_write(s->chr); avail -=3D size; } - /* characters are pending: we send them a bit later (XXX: - horrible, should change char device API) */ - if (avail > 0) { - timer_mod(s->kbd_timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + 1= ); - } } =20 /* called when an ascii key is pressed */ @@ -2141,6 +2131,14 @@ int qemu_console_get_height(QemuConsole *con, int fa= llback) return con ? surface_height(con->surface) : fallback; } =20 +static void vc_chr_accept_input(Chardev *chr) +{ + VCChardev *drv =3D VC_CHARDEV(chr); + QemuConsole *s =3D drv->console; + + kbd_send_chars(s); +} + static void vc_chr_set_echo(Chardev *chr, bool echo) { VCChardev *drv =3D VC_CHARDEV(chr); @@ -2189,7 +2187,6 @@ static void text_console_do_init(Chardev *chr, Displa= yState *ds) int g_height =3D 24 * FONT_HEIGHT; =20 fifo8_create(&s->out_fifo, 16); - s->kbd_timer =3D timer_new_ms(QEMU_CLOCK_REALTIME, kbd_send_chars, s); s->ds =3D ds; =20 s->y_displayed =3D 0; @@ -2439,6 +2436,7 @@ static void char_vc_class_init(ObjectClass *oc, void = *data) cc->parse =3D qemu_chr_parse_vc; cc->open =3D vc_chr_open; cc->chr_write =3D vc_chr_write; + cc->chr_accept_input =3D vc_chr_accept_input; cc->chr_set_echo =3D vc_chr_set_echo; } =20 --=20 2.31.1 From nobody Fri May 3 08:58:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635870414; cv=none; d=zohomail.com; s=zohoarc; b=MezTftilXo8iOMYfs509X7+sqDfiH2kUSnO42Zs6BjvXnmtCxstGPZ389tIb7QNecFQfsumMHjuQ87TIZkJaj8/V5WpIbsKP9TzAioL40i4pRlJrtPLcaFNnoRd6Ln8j/zglU5s1f4mw8BA2J5IcNm7xzIwpx6naUrXvA2PxaKM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635870414; 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=Ut8NfEL2xC3MAi3C01zupa2EuTIP39swd/L1JHDpcAo=; b=Iu/Dmf7xYnkijOJPXoivJC+AxX595zKc/bAzPNWs2l5J6FqDLnfKZgb41ojTjQx7SnwjLCqenJWF0tjYsyWnh2gRdbg5ga/8s7DDNttm/YlfdhKPZM1uTkZof1yKyGrrgATWcdaXF+M4VGOwnPpFjID1dNwhBQUzfJJXC4KlCe8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1635870414325350.61861326536916; Tue, 2 Nov 2021 09:26:54 -0700 (PDT) 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-74-J0nKQX_RNgCsJAlghx5E6g-1; Tue, 02 Nov 2021 12:26:49 -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 AD5CDEC1A7; Tue, 2 Nov 2021 16:26:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D93D60C05; Tue, 2 Nov 2021 16:26:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 58ACF4EA3A; Tue, 2 Nov 2021 16:26:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A2GQbP0005450 for ; Tue, 2 Nov 2021 12:26:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 05C26100751A; Tue, 2 Nov 2021 16:26:37 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7528310016F2; Tue, 2 Nov 2021 16:26:36 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id F23101801B2D; Tue, 2 Nov 2021 17:26:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635870413; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Ut8NfEL2xC3MAi3C01zupa2EuTIP39swd/L1JHDpcAo=; b=Pk6iQf+SQD9kkmwzo/f7+Lz1hMKXm0fw/zITHlPLA3iP46THwRiVkUR+QifmR+8qXN1xA8 vsD8wPcg87sdKqhcaWIJSKP4HlASvmSzl/zjlWveEpzuC+ynJjoxXeg7N6zAYRjubzthE0 1MLjy7mtfRlJgU7aH5G3e4/MUE1AHXU= X-MC-Unique: J0nKQX_RNgCsJAlghx5E6g-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 08/10] ui/console: remove chardev frontend connected test Date: Tue, 2 Nov 2021 17:26:17 +0100 Message-Id: <20211102162619.2760593-9-kraxel@redhat.com> In-Reply-To: <20211102162619.2760593-1-kraxel@redhat.com> References: <20211102162619.2760593-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Thomas Huth , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , libvir-list@redhat.com, =?UTF-8?q?Volker=20R=C3=BCmelin?= , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Willian Rampazzo , Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635870414945100001 From: Volker R=C3=BCmelin The test if the chardev frontend is connected in kbd_put_keysym_console() is redundant, because the call to qemu_chr_be_can_write() in kbd_send_chars() tests the connected condition again. Remove the redundant test whether the chardev frontend is connected. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Volker R=C3=BCmelin Message-Id: <20210916192239.18742-3-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- ui/console.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ui/console.c b/ui/console.c index dda1e6861d6a..29a3e3f0f51c 100644 --- a/ui/console.c +++ b/ui/console.c @@ -28,10 +28,11 @@ #include "qapi/error.h" #include "qapi/qapi-commands-ui.h" #include "qemu/fifo8.h" +#include "qemu/main-loop.h" #include "qemu/module.h" #include "qemu/option.h" #include "qemu/timer.h" -#include "chardev/char-fe.h" +#include "chardev/char.h" #include "trace.h" #include "exec/memory.h" #include "io/channel-file.h" @@ -1126,7 +1127,6 @@ static void kbd_send_chars(QemuConsole *s) void kbd_put_keysym_console(QemuConsole *s, int keysym) { uint8_t buf[16], *q; - CharBackend *be; int c; uint32_t num_free; =20 @@ -1170,12 +1170,9 @@ void kbd_put_keysym_console(QemuConsole *s, int keys= ym) if (s->echo) { vc_chr_write(s->chr, buf, q - buf); } - be =3D s->chr->be; - if (be && be->chr_read) { - num_free =3D fifo8_num_free(&s->out_fifo); - fifo8_push_all(&s->out_fifo, buf, MIN(num_free, q - buf)); - kbd_send_chars(s); - } + num_free =3D fifo8_num_free(&s->out_fifo); + fifo8_push_all(&s->out_fifo, buf, MIN(num_free, q - buf)); + kbd_send_chars(s); break; } } --=20 2.31.1 From nobody Fri May 3 08:58:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635870419; cv=none; d=zohomail.com; s=zohoarc; b=kXq9nQV34rRHTDkkEOWbUQfG/m9V431yF+oSFRl2Kz02Z44C4aTeiRt3nHyPs09JPpgl8osETpY8tJJzVZ24MWzeOSq9SbSAWVA1GR0MtqpFx1uzNQFR/UO0x12M8ug0izKjX+huelpaizVarFdb+f2AQJe/AghhArpULLLDsx4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635870419; 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=PO+K1n8lNHJsRPOY2iY3bSK66+tYW/HTXAOPTrvGSKg=; b=nQ28GX+at/qyYeMaNMPU6LKq1rccGY/qQ909cPUlKHarmX0Z0UJr4r/AfwdwdmdrZJyoOJoQrDHGrGiUhp61dmtryZG9D/Y58ZSTXBPb8YiPYek5PnfWufmVSI8DD9xFFTK/QITB/h1fa352FBBpsX6ml+1xf6ARPNyQDG+kHj0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1635870419550191.97229322289945; Tue, 2 Nov 2021 09:26:59 -0700 (PDT) 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-310-40scC2GMPA2XT8Qp_gfW-g-1; Tue, 02 Nov 2021 12:26:56 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9207D1006AAB; Tue, 2 Nov 2021 16:26:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7312E1017CE8; Tue, 2 Nov 2021 16:26:46 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3F371181A1CF; Tue, 2 Nov 2021 16:26:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A2GQbJO005455 for ; Tue, 2 Nov 2021 12:26:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3D5F918432; Tue, 2 Nov 2021 16:26:37 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 804B95F4EB; Tue, 2 Nov 2021 16:26:36 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0B8AC1801B3A; Tue, 2 Nov 2021 17:26:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635870418; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=PO+K1n8lNHJsRPOY2iY3bSK66+tYW/HTXAOPTrvGSKg=; b=YGgUULVz1ywDSRSu/u7KQvDQgWKfM8tbCuAWeLh2/YxftVwIwPiVviVkXvHvxNi1r+pWsu lyNDBI2uC8AiMq6w0oatiPpZTyeN1YL1xqx894iHXyawS5Y/IubSVxG7JJZNT72piE0LYG sLI9+AQ1Z0AZdL7BpLYO8e8TNv3A3qs= X-MC-Unique: 40scC2GMPA2XT8Qp_gfW-g-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 09/10] hw/misc: deprecate the 'sga' device Date: Tue, 2 Nov 2021 17:26:18 +0100 Message-Id: <20211102162619.2760593-10-kraxel@redhat.com> In-Reply-To: <20211102162619.2760593-1-kraxel@redhat.com> References: <20211102162619.2760593-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Thomas Huth , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , libvir-list@redhat.com, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Willian Rampazzo , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635870421457100003 From: Daniel P. Berrang=C3=A9 This is obsolete since SeaBIOS 1.11.0 introduced native support for sending messages to the serial console. The new support can be activated using -machine graphics=3Doff on x86 targets. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Gerd Hoffmann Message-Id: <20210909123219.862652-1-berrange@redhat.com> Signed-off-by: Gerd Hoffmann --- hw/misc/sga.c | 2 ++ docs/about/deprecated.rst | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/hw/misc/sga.c b/hw/misc/sga.c index 4dbe6d78f9e5..1d04672b013b 100644 --- a/hw/misc/sga.c +++ b/hw/misc/sga.c @@ -30,6 +30,7 @@ #include "hw/loader.h" #include "qemu/module.h" #include "qom/object.h" +#include "qemu/error-report.h" =20 #define SGABIOS_FILENAME "sgabios.bin" =20 @@ -42,6 +43,7 @@ struct ISASGAState { =20 static void sga_realizefn(DeviceState *dev, Error **errp) { + warn_report("-device sga is deprecated, use -machine graphics=3Doff"); rom_add_vga(SGABIOS_FILENAME); } =20 diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index be19317470a1..25b7ec8d92d9 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -313,6 +313,16 @@ full SCSI support. Use virtio-scsi instead when SCSI = passthrough is required. Note this also applies to ``-device virtio-blk-pci,scsi=3Don|off``, which = is an alias. =20 +``-device sga`` (since 6.2) +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``sga`` device loads an option ROM for x86 targets which enables +SeaBIOS to send messages to the serial console. SeaBIOS 1.11.0 onwards +contains native support for this feature and thus use of the option +ROM approach is obsolete. The native SeaBIOS support can be activated +by using ``-machine graphics=3Doff``. + + Block device options '''''''''''''''''''' =20 --=20 2.31.1 From nobody Fri May 3 08:58:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635870420; cv=none; d=zohomail.com; s=zohoarc; b=GRiB0QPs5w/PtObBlezV2T6I611BCaN2vIDevuDxlOaVYKeYCtxHG9gHoPXBCb9gPjnVhun0zPffXu0FfJcEJM+JVQaRcCzY31wJkBssBrsXMcNYfYcFk9s6aMqx0uHGw4JJv8DMxsILnUcotaqwhsMaaAV0PSGYw9qgikPuAg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635870420; 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=Ss/Hz3Amunh7qd04Lf0rLRk/NM7TeE6BsChzCFgfXdg=; b=DMf53VF/cxr9aRPTgsF+w2EuJDXohxqTTeCKYRhWtqf3waSGjNJbb0m+J4i0mN2xcSPPqbTGzKINoItFw7MYzGuDf+SgqWXKbpUFzYcwAZiyPAoGbXMPP96fAA0iv/DCDaFjcwqHlBC95QXghSBELYcjzvYfnMqsePHSUwF9jJU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 163587042030338.14988095956244; Tue, 2 Nov 2021 09:27:00 -0700 (PDT) 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-101-jV2poLgqNL2h2Z2NeSMbNg-1; Tue, 02 Nov 2021 12:26:55 -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 1319418125D0; Tue, 2 Nov 2021 16:26:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DD0952271F; Tue, 2 Nov 2021 16:26:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A3ECE4EA39; Tue, 2 Nov 2021 16:26:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A2GQdHh005471 for ; Tue, 2 Nov 2021 12:26:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 960E0100763D; Tue, 2 Nov 2021 16:26:39 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 35F38100751A; Tue, 2 Nov 2021 16:26:39 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 16A881805CB8; Tue, 2 Nov 2021 17:26:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635870419; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Ss/Hz3Amunh7qd04Lf0rLRk/NM7TeE6BsChzCFgfXdg=; b=feR9mbhXY0IbuaTD3TbIrEREKhm3d1chXDkT49fC/7BJy5Dqct/mPbHxUuKlSZN4Fc1FWM SF2B2awZwlFPeJc1DxfrHX3gKdtPlCYIPouIbA1tlr5G7i38UWRkTHN1SdmvOzS2uWz7kC K1sIqEEVHZ6k75OVnDWbte27MsggKg8= X-MC-Unique: jV2poLgqNL2h2Z2NeSMbNg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 10/10] usb-storage: tag usb_msd_csw as packed struct Date: Tue, 2 Nov 2021 17:26:19 +0100 Message-Id: <20211102162619.2760593-11-kraxel@redhat.com> In-Reply-To: <20211102162619.2760593-1-kraxel@redhat.com> References: <20211102162619.2760593-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Thomas Huth , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , vintagepc404@protonmail.com, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Willian Rampazzo , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635870421634100005 Without this the struct has the wrong size: sizeof() evaluates to 16 instead of 13. In most cases the bug is hidden by the fact that guests submits a buffer which is exactly 13 bytes long, so the padding added by the compiler is simply ignored. But sometimes guests submit a larger buffer and expect a short transfer, which does not work properly with the wrong struct size. Cc: vintagepc404@protonmail.com Signed-off-by: Gerd Hoffmann Fixes: a917d384ac0 ("SCSI TCQ support.") Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210906045523.1259629-1-kraxel@redhat.com> --- include/hw/usb/msd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/usb/msd.h b/include/hw/usb/msd.h index 7538c54569bf..54e9f38bda46 100644 --- a/include/hw/usb/msd.h +++ b/include/hw/usb/msd.h @@ -17,7 +17,7 @@ enum USBMSDMode { USB_MSDM_CSW /* Command Status. */ }; =20 -struct usb_msd_csw { +struct QEMU_PACKED usb_msd_csw { uint32_t sig; uint32_t tag; uint32_t residue; --=20 2.31.1