From patchwork Mon Feb 28 11:26:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 546685 Delivered-To: patch@linaro.org Received: by 2002:ac0:9f50:0:0:0:0:0 with SMTP id l16csp2654122imf; Mon, 28 Feb 2022 03:39:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKpi4oBP4prXGxlgQECJeLk7cYx/jnuth4J/uXUTqUTrGPh5bBkmsF6Gozhimptj9+s+U2 X-Received: by 2002:a25:180b:0:b0:61a:a60:e7b0 with SMTP id 11-20020a25180b000000b0061a0a60e7b0mr18129714yby.454.1646048348264; Mon, 28 Feb 2022 03:39:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646048348; cv=none; d=google.com; s=arc-20160816; b=gHyUifAUxwlFX+45VZO4qoDPZW8t/JU0wR90mamaePswxAhPnQzAKpIRIy1h7wAc/6 1ftNjhnkMtTXwT/EeqGRxpYoknZgyG7m4exqGDZx/YcytzTTodKH2skunk5fcnmEJRin 1BradhHRaB61fNKxtucbPYk51pJrbHMyRpQkkGxyNyu6l/aiW+5M3TIxfEeugevsNQjT nK6G53Hf27aLtNcaAFQwlL7xDCBthZjLljpNGC9+axWJyVR9MrbjKdXT4ZN2vocQAobu VU/lnv2i4g3FBUs/iNtqx47xmh8b+IJdMxYE679scC+rZrP1mNQoAoKF/+m2iWq9fp9G us2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=wZgvseUMY2ncLr03zcIwzZc5vE1TTgn8IXYBQV0Kly4=; b=lhb9xzCrfsAW0KBYaVTnQnYTBKNWLP2mzfP6JKFWIHbrcqUF7ynzl5s3FoZrxLMDRV VsJjvFymbeSCkQoEcycVcv5lR8TeeET35jf7F12oeXLYN3VO3s8rIR4WIX10uk9L8zHV gEwXvSAnZLFLBCKS8mWadxQW850GlHNgszjCaXyEEmEDAjE8dcVV4tNXTgp+YzSkded2 RCKkiirtOOSnKhZYhYp6GWxNrYwuEr+k3ht8FKLPF55/5ThnRHd+pFdweojdc3Mphegt So19SYYhDmlYOgagze+xeWJ6yX7GEdOxvz5qoPXUHNGqTtrcbGUxu4w2nICSn4guWrYT HyOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TegrRXnx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y194-20020a2532cb000000b00624406aa2ddsi9139754yby.596.2022.02.28.03.39.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Feb 2022 03:39:08 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TegrRXnx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:57818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOeMt-0008QO-09 for patch@linaro.org; Mon, 28 Feb 2022 06:39:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOeAg-00047S-TI for qemu-devel@nongnu.org; Mon, 28 Feb 2022 06:26:32 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32391) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOeAc-00078v-1o for qemu-devel@nongnu.org; Mon, 28 Feb 2022 06:26:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646047583; 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=wZgvseUMY2ncLr03zcIwzZc5vE1TTgn8IXYBQV0Kly4=; b=TegrRXnxaosIOAAylLrhE3ww4c29h31Lsy8qFrwd8LaGMm3pz+DDAdQQTD/o7RcpBlvpX5 fDVutv5X13dBF38BLfAjjs+OcqThyfout42QZ+qerV8EwDk3oxBLEM0nW/d5GBMdU+VtHn Qm0sx00XFkMLAfCGqdgYkt3bK/GG2ew= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-384-shEG5upuPuq0JlOCtmxHNQ-1; Mon, 28 Feb 2022 06:26:18 -0500 X-MC-Unique: shEG5upuPuq0JlOCtmxHNQ-1 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 4A253520F; Mon, 28 Feb 2022 11:26:17 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.36.112.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CFE1D4E2A6; Mon, 28 Feb 2022 11:26:16 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CF26F21E691B; Mon, 28 Feb 2022 12:26:13 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 5/9] qapi: Move RTC_CHANGE back out of target schema Date: Mon, 28 Feb 2022 12:26:09 +0100 Message-Id: <20220228112613.520040-6-armbru@redhat.com> In-Reply-To: <20220228112613.520040-1-armbru@redhat.com> References: <20220228112613.520040-1-armbru@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=armbru@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Greg Kurz , =?utf-8?q?Philippe?= =?utf-8?q?_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell This commit effectively reverts commit 183e4281a30962, which moved the RTC_CHANGE event to the target schema. That change was an attempt to make the event target-specific to improve introspection, but the event isn't really target-specific: it's machine or device specific. Putting RTC_CHANGE in the target schema with an ifdef list reduces maintainability (by adding an if: list with a long list of targets that needs to be manually updated as architectures are added or removed or as new devices gain the RTC_CHANGE functionality) and increases compile time (by preventing RTC devices which emit the event from being "compile once" rather than "compile once per target", because qapi-events-misc-target.h uses TARGET_* ifdefs, which are poisoned in "compile once" files.) Move RTC_CHANGE back to misc.json. Signed-off-by: Peter Maydell Reviewed-by: Markus Armbruster Acked-by: Greg Kurz Message-Id: <20220221192123.749970-2-peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Markus Armbruster --- qapi/misc-target.json | 33 --------------------------------- qapi/misc.json | 22 ++++++++++++++++++++++ hw/ppc/spapr_rtc.c | 2 +- hw/rtc/mc146818rtc.c | 2 +- hw/rtc/pl031.c | 2 +- 5 files changed, 25 insertions(+), 36 deletions(-) diff --git a/qapi/misc-target.json b/qapi/misc-target.json index 4bc45d2474..036c5e4a91 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -2,39 +2,6 @@ # vim: filetype=python # -## -# @RTC_CHANGE: -# -# Emitted when the guest changes the RTC time. -# -# @offset: offset between base RTC clock (as specified by -rtc base), and -# new RTC clock value -# -# Note: This event is rate-limited. -# -# Since: 0.13 -# -# Example: -# -# <- { "event": "RTC_CHANGE", -# "data": { "offset": 78 }, -# "timestamp": { "seconds": 1267020223, "microseconds": 435656 } } -# -## -{ 'event': 'RTC_CHANGE', - 'data': { 'offset': 'int' }, - 'if': { 'any': [ 'TARGET_ALPHA', - 'TARGET_ARM', - 'TARGET_HPPA', - 'TARGET_I386', - 'TARGET_MIPS', - 'TARGET_MIPS64', - 'TARGET_PPC', - 'TARGET_PPC64', - 'TARGET_S390X', - 'TARGET_SH4', - 'TARGET_SPARC' ] } } - ## # @rtc-reset-reinjection: # diff --git a/qapi/misc.json b/qapi/misc.json index e8054f415b..7a70eaa3ff 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -527,3 +527,25 @@ 'data': { '*option': 'str' }, 'returns': ['CommandLineOptionInfo'], 'allow-preconfig': true } + +## +# @RTC_CHANGE: +# +# Emitted when the guest changes the RTC time. +# +# @offset: offset between base RTC clock (as specified by -rtc base), and +# new RTC clock value +# +# Note: This event is rate-limited. +# +# Since: 0.13 +# +# Example: +# +# <- { "event": "RTC_CHANGE", +# "data": { "offset": 78 }, +# "timestamp": { "seconds": 1267020223, "microseconds": 435656 } } +# +## +{ 'event': 'RTC_CHANGE', + 'data': { 'offset': 'int' } } diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c index 94a5510e4e..79677cf550 100644 --- a/hw/ppc/spapr_rtc.c +++ b/hw/ppc/spapr_rtc.c @@ -32,7 +32,7 @@ #include "hw/ppc/spapr.h" #include "migration/vmstate.h" #include "qapi/error.h" -#include "qapi/qapi-events-misc-target.h" +#include "qapi/qapi-events-misc.h" #include "qemu/cutils.h" #include "qemu/module.h" diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index e61a0cced4..57c514e15c 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -40,7 +40,7 @@ #include "hw/rtc/mc146818rtc_regs.h" #include "migration/vmstate.h" #include "qapi/error.h" -#include "qapi/qapi-events-misc-target.h" +#include "qapi/qapi-events-misc.h" #include "qapi/visitor.h" #include "hw/rtc/mc146818rtc_regs.h" diff --git a/hw/rtc/pl031.c b/hw/rtc/pl031.c index 38d9d3c2f3..60167c778f 100644 --- a/hw/rtc/pl031.c +++ b/hw/rtc/pl031.c @@ -24,7 +24,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "trace.h" -#include "qapi/qapi-events-misc-target.h" +#include "qapi/qapi-events-misc.h" #define RTC_DR 0x00 /* Data read register */ #define RTC_MR 0x04 /* Match register */