From nobody Tue May 14 13:00:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1645472031; cv=none; d=zohomail.com; s=zohoarc; b=OWAvtXzILuOAvUm0sNpzScpUYNaxjGSzx2BTt96xcbbUXKXgdPCaj8+qdbciwidlu/aR7KBIWSHMjYbE+USLAaE4GMAT/rgDyjwtFS10gaSvoc6SqjoCKTTm94of5ew+GyVDMjGFqfj6a2IjLlPEuqgJgoFFmoDbVxWrdgazuTQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645472031; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Jqn0Eq5OamN94rTvkdU2cs5J2LDtszOeBtkgps6SOt0=; b=S6cU7/q0MgUXnVJ+EM/WhLrw4J0yh2kdv913sPOSEaJBm8/OpzXh/n1ytO0Su8hGxoC1Jdy9FS2KMYsJ6/pfLYqIsjBZUAO6vCEaRlTQ3qhXDUyrvyzk4pJ9JmD2MMUoyxQUFUpfzY+RHCXMftxZ9VwgGaDnKSQTMVOk1fgjjgc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164547203176666.16256571431029; Mon, 21 Feb 2022 11:33:51 -0800 (PST) Received: from localhost ([::1]:40356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMERS-0000ZR-Ef for importer@patchew.org; Mon, 21 Feb 2022 14:33:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMEFo-0007j5-Cp for qemu-devel@nongnu.org; Mon, 21 Feb 2022 14:21:48 -0500 Received: from [2a00:1450:4864:20::335] (port=39673 helo=mail-wm1-x335.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nMEFi-0002dM-4L for qemu-devel@nongnu.org; Mon, 21 Feb 2022 14:21:47 -0500 Received: by mail-wm1-x335.google.com with SMTP id j9-20020a05600c190900b0037bff8a24ebso53800wmq.4 for ; Mon, 21 Feb 2022 11:21:27 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id j6sm38958226wrt.70.2022.02.21.11.21.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 11:21:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jqn0Eq5OamN94rTvkdU2cs5J2LDtszOeBtkgps6SOt0=; b=nst600r9RjZ4URbxu2yxmyWpDU18SN1XtJKR7g1fOeDy/l2dYTazCwCShARi5G5e8u CaauuwcTYtc+WBf1TIBRNitgIGIsU7Mu3AmzVsdydouAADB54fTwO92cNVxCg7Ktt8ee Bk8lW4smPw3UZeg96qV6r4fA+HMP3PWky4A1n0ubjtnGgR0GAeUyWXW2LVBcJnd0bWBb ZhU9IydmqwA+Sw413oVdAgq+7uGerjMwfxnnbYlKjHlXpjfC/1EmQ17xvoNz2OX68su2 qv56v9Ij0mCmhYrnYdcyHBWpROwLKwvm4EOSqAMO/GtjAlw4BpSa4FHwb74ET63VVpNX 5yDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jqn0Eq5OamN94rTvkdU2cs5J2LDtszOeBtkgps6SOt0=; b=zNj5rTpu2wKxEKoGBv8CnX8X35GlW4ZVQoNbNR70x+Mxf6X0TfMt/6DP3QXIzL21Zj P7wStB4rlz9wU7uZTLtNG0XQfmv35dwN62PPs/rWeDUxBFx10GsQ4RZB2gSIQJAsj3ci VcdnGCoeuW8VUVWZF67yVUbnTSj59h4cp9rl/eX8h8U7YvND88FO/1rnetOdTuz9B7vX N2qmX3ni2x6Fk0IWSW0tfiocX+I/P+dsfqfXBnYBBYWROUzejzVK0Pg5SFDiIpRxJ+ep dd6cHVcuvR9d+HT4EqkfoUDbut2YHnBSd3gQ2FAZObbC6j+ME1kLnIqPb146HO3BoPqw u6vQ== X-Gm-Message-State: AOAM531c3iKrmhg5S0K33MrzUcfQqvrwRGwEu6mTITvOWb2hbKl3y0ch 2QOzKDCVuhyzBibQ1jP3bez/hA== X-Google-Smtp-Source: ABdhPJyiMZLajiBoOx6cdXd76ZM7XzJB9FjCIM7T8tN5IVow8gKfmH7lQ8kvBu/BmZfBUAhi7Pw37w== X-Received: by 2002:a7b:c8c2:0:b0:37b:b742:a9de with SMTP id f2-20020a7bc8c2000000b0037bb742a9demr386010wml.37.1645471286546; Mon, 21 Feb 2022 11:21:26 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 1/3] qapi: Move RTC_CHANGE back out of target schema Date: Mon, 21 Feb 2022 19:21:21 +0000 Message-Id: <20220221192123.749970-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221192123.749970-1-peter.maydell@linaro.org> References: <20220221192123.749970-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::335 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: Eric Blake , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1645472032637100001 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Eric Auger Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 4bc45d24741..036c5e4a914 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -2,39 +2,6 @@ # vim: filetype=3Dpython # =20 -## -# @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 e8054f415b2..7a70eaa3ffc 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 94a5510e4eb..79677cf5503 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" =20 diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index e61a0cced4c..57c514e15c5 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" =20 diff --git a/hw/rtc/pl031.c b/hw/rtc/pl031.c index 38d9d3c2f38..60167c778f2 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" =20 #define RTC_DR 0x00 /* Data read register */ #define RTC_MR 0x04 /* Match register */ --=20 2.25.1 From nobody Tue May 14 13:00:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1645471549; cv=none; d=zohomail.com; s=zohoarc; b=LDXENRNrxYC95D4XNKNY+zHRJyMil6rxBb3BHS9Ww9nYkOgD7DbHO+QZuNGwCpYA6NCVvNHoaSUfK2JNGb4VDKYrNIKqkYt898PIWorGk9XmeHPBzxk8EgB1Zc/fYriyrkyAe0G4S+EWnqxLOd6sxXT+zI4oc9n7kvrm8PoC0QU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645471549; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8LxaYHsGrP1n2gu8fs/oq2UgPzeDfx1gMnABjk6F6VA=; b=CBSCH34A2iV8laSRvYY19EuyhChUfI7KBRjAahGGo/MkhxDI9M/+txTvxJwEBmHrS41U4lU3PlO3f+1RMd0TWay8VXdL4LGah4PrW8yj3xrCIGVI2/VxvIvCLw7CIYETR4OPsuD1rfIC7p/7UYQQ9MQVmIgA8vn+TzzF2Zzoxy0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645471549200512.7383040536992; Mon, 21 Feb 2022 11:25:49 -0800 (PST) Received: from localhost ([::1]:58450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMEJg-0001ov-6M for importer@patchew.org; Mon, 21 Feb 2022 14:25:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMEFn-0007hs-Ta for qemu-devel@nongnu.org; Mon, 21 Feb 2022 14:21:47 -0500 Received: from [2a00:1450:4864:20::434] (port=46914 helo=mail-wr1-x434.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nMEFi-0002dV-D8 for qemu-devel@nongnu.org; Mon, 21 Feb 2022 14:21:47 -0500 Received: by mail-wr1-x434.google.com with SMTP id j22so2706407wrb.13 for ; Mon, 21 Feb 2022 11:21:28 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id j6sm38958226wrt.70.2022.02.21.11.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 11:21:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8LxaYHsGrP1n2gu8fs/oq2UgPzeDfx1gMnABjk6F6VA=; b=pHj45sD9BdDX+F8PmIuOVjwWItzcDJ8z1k0UjUrQlfyau25fDmU5KaXu59FsJ+ISK2 V8LX1NG3ceuyFmW0DGHsWjkIHmZ/F8YiXuAAWPdzwTBR31szOXiJQxE/aDnl+bbEYhLS NL5QXtzcDtwPgiqiXUttaHzm9cH0GtwQVf7ebS3rCuSu93gnuXHdM0cntQXa3WRaIrh2 D8C9xsriTZaeWdYibV0/toSeOxDRFTePg1XD0STPWfINxIXXu8y+6RsM47rGuKRNe4v6 R+3bGwK6qUcFD/QUD+UAEzTr9g7R+YHeCdNX/fvHfd/XQwzikWAsVCU/Mw8XqyAYirhf 1+yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8LxaYHsGrP1n2gu8fs/oq2UgPzeDfx1gMnABjk6F6VA=; b=KBvIUH7WPJgYENeWPKo10+krqw0H2OBtJsGa7O9qM1c/Y0SI95kMhHJbTXJkJVK03P ZMEepPC5ngo4N2gAkMu0SfmBIF42AnApLOkTSYo0PkaSvdtIg+apAKxbz2oEeuSvNyjV s5pa6wGjd7CQJ3aBTVWdtqrjSpa6qSr6u8F6BYbKG9zJst+PgwhRTflw6cnFlKk5O4cp keyN6v7E35n9toDF457c//krunOLybKnTA/7XahcZjlmvp7D7ksYOFT1J2+3yCAlXcx4 t8hpMdQAf1BX775pG+EwdxjgbV46IAECpvBJjxPgkUq8+EKrA43ShMbnm+Eq+qcXvanC wLig== X-Gm-Message-State: AOAM53310DrIT4kxDkz9pJm12wNpN4L2pB9l+15oC3HliLesMPAjluUu 05XkFJ5oQaf9AArLa72dl3hZc48PWzWSNw== X-Google-Smtp-Source: ABdhPJyTCrU7o2fMb8cLtxQh3esqckZPKoPzjZM+JxtvFXWDsDdv68mxOhcabirXSN2itG1L79NRfA== X-Received: by 2002:a5d:6d8c:0:b0:1ea:7d52:c05c with SMTP id l12-20020a5d6d8c000000b001ea7d52c05cmr1510354wrs.663.1645471287507; Mon, 21 Feb 2022 11:21:27 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 2/3] qapi: Document some missing details of RTC_CHANGE event Date: Mon, 21 Feb 2022 19:21:22 +0000 Message-Id: <20220221192123.749970-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221192123.749970-1-peter.maydell@linaro.org> References: <20220221192123.749970-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::434 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: Eric Blake , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1645471551357100001 Content-Type: text/plain; charset="utf-8" The RTC_CHANGE event's documentation is missing some details: * the offset argument is in units of seconds * it isn't guaranteed that the RTC will implement the event Signed-off-by: Peter Maydell Reviewed-by: Eric Auger Reviewed-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v1->v2: add the "RTC might not implement this" note --- qapi/misc.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qapi/misc.json b/qapi/misc.json index 7a70eaa3ffc..0ab235e41f7 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -533,10 +533,12 @@ # # Emitted when the guest changes the RTC time. # -# @offset: offset between base RTC clock (as specified by -rtc base), and -# new RTC clock value +# @offset: offset in seconds between base RTC clock (as specified +# by -rtc base), and new RTC clock value # # Note: This event is rate-limited. +# It is not guaranteed that the RTC in the system implements +# this event, or even that the system has an RTC at all. # # Since: 0.13 # --=20 2.25.1 From nobody Tue May 14 13:00:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1645471722; cv=none; d=zohomail.com; s=zohoarc; b=d6yRoo94hNs8jzDaHNY1TLB6bwrSZL/A7lsJejSC79cI+HcDJfwe2oIbWTdEltmHHetg4noy0g754tJOVURt/uYsd3QQLVUMJMLtUNiq6e1pOUpcTGkqkv+ZjsWkCruyK2XbzBg+KkX33d1q3j0cpUop95nsGfYaggCSxg8OZbk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645471722; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FYwSuEjvQcSL/9thHK2sjrgtlkbwAqldrJkzTwEeRVg=; b=Yvv0cSxHBDfpLMl5EJkxvkPW3U12nGK+alxrS6487OWt7ghljHnOUadUFCEnh2tBgFdutaC6lIc9NKAnv3uoMs+iigG1udJsfpgGgKuUb8B5/ItbADKvog7ZT0cRGDfzhapR6OFqkVlWmQEsjFPLO2x09nRTykWt7wMaOqbK4eA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645471722949651.8006773632313; Mon, 21 Feb 2022 11:28:42 -0800 (PST) Received: from localhost ([::1]:33762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMEMT-0004Jr-Md for importer@patchew.org; Mon, 21 Feb 2022 14:28:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMEFo-0007ik-5A for qemu-devel@nongnu.org; Mon, 21 Feb 2022 14:21:48 -0500 Received: from [2a00:1450:4864:20::32b] (port=37774 helo=mail-wm1-x32b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nMEFi-0002de-4Q for qemu-devel@nongnu.org; Mon, 21 Feb 2022 14:21:47 -0500 Received: by mail-wm1-x32b.google.com with SMTP id p14-20020a05600c1d8e00b0037f881182a8so67782wms.2 for ; Mon, 21 Feb 2022 11:21:29 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id j6sm38958226wrt.70.2022.02.21.11.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 11:21:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FYwSuEjvQcSL/9thHK2sjrgtlkbwAqldrJkzTwEeRVg=; b=LVbumPSyaX7TrpD3kP5p4S/v9/R/teBm5aN9HJCEeQ5n3ogBXzFU0kiXJNokDn7UzU O3x9H3IVqA3jlxR5Tl9DDKJoVrcbQOlWwY5ymX7a9BAkpwRNPvFGJRtjuJlqCyIisxsM zN4VLc+tQL6C2Lb4ktpta4qnmBRFanQ18mKGDm2ayc5CMdkf0TbXUfhoTkWCeV/EGvBR 2VdXB8LpTeqMriKKzhc84dmILW8k0aqJKJM/Isu0QwiyKTxpb+nImGMl+2IwI+zQ9Gce bdFUnzFvnM1pKlPewqCkzAE4CvqJmw7zjByFvjUsgfN1pbZNdHUHJPLJub32sRTaMguQ i0kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FYwSuEjvQcSL/9thHK2sjrgtlkbwAqldrJkzTwEeRVg=; b=6U5qeVkUsvkwAbqkEqHPRtNwp18jpiByFVV8cuY5+CwUW2YMbchv6lcW5GreOlRWMI nWEwYtIiZwrLfNiLS3T3TWc8B2bBzAIPWes57HrJAfxZIKwro3wzwBRbLZsPcNpdoGvH 3+sMjPKg0KaDgB50lBBmhk5V8r3E5y+DpAPc2ss38G3pQYYOLIQOeTbvZI2KpRoVSHkb grdzt+FJm3+jtU/N7QDLzl8860tjsqIu1yWWP3aDsEG9aJ9RgGD0s1gWj+XjgCysCI8u NvXLrEQSg5YZdS5fwp6x/z7Q2vmI/c3ozhwIZAA+MQ2DUTxZa+oU5272S6Qci6+y7ERe zNlQ== X-Gm-Message-State: AOAM5317a3oSjDud/2KO8/KW3kIACE4nhv1URLTNZl9AyHanI1LCrZ/E ibAsj1O58OQH3gKLHi9wCQVDZw== X-Google-Smtp-Source: ABdhPJyjNH7OqnZ1hQOub41nAN4tt0b546sUv2EQFIzbJLUGbIM6aR69qI0m763BSiCARFuPhB4r9w== X-Received: by 2002:a1c:2742:0:b0:37b:b481:321f with SMTP id n63-20020a1c2742000000b0037bb481321fmr400745wmn.56.1645471288400; Mon, 21 Feb 2022 11:21:28 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 3/3] hw/rtc: Compile pl031 once-only Date: Mon, 21 Feb 2022 19:21:23 +0000 Message-Id: <20220221192123.749970-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221192123.749970-1-peter.maydell@linaro.org> References: <20220221192123.749970-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32b (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: Eric Blake , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1645471724498100001 Content-Type: text/plain; charset="utf-8" Now that the RTC_CHANGE event is no longer target-specific, we can move the pl031 back to a compile-once source file rather than a compile-per-target one. Signed-off-by: Peter Maydell Reviewed-by: Eric Auger Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/rtc/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/rtc/meson.build b/hw/rtc/meson.build index 8fd8d8f9a71..7cecdee5ddb 100644 --- a/hw/rtc/meson.build +++ b/hw/rtc/meson.build @@ -2,7 +2,7 @@ softmmu_ss.add(when: 'CONFIG_DS1338', if_true: files('ds1338.c')) softmmu_ss.add(when: 'CONFIG_M41T80', if_true: files('m41t80.c')) softmmu_ss.add(when: 'CONFIG_M48T59', if_true: files('m48t59.c')) -specific_ss.add(when: 'CONFIG_PL031', if_true: files('pl031.c')) +softmmu_ss.add(when: 'CONFIG_PL031', if_true: files('pl031.c')) softmmu_ss.add(when: 'CONFIG_TWL92230', if_true: files('twl92230.c')) softmmu_ss.add(when: ['CONFIG_ISA_BUS', 'CONFIG_M48T59'], if_true: files('= m48t59-isa.c')) softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP', if_true: files('xlnx-zynqmp-rtc= .c')) --=20 2.25.1 From nobody Tue May 14 13:00:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645531724005919.9794900569103; Tue, 22 Feb 2022 04:08:44 -0800 (PST) Received: from localhost ([::1]:38706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMTyE-0006Rw-8y for importer@patchew.org; Tue, 22 Feb 2022 07:08:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMTsR-0003gc-Sz for qemu-devel@nongnu.org; Tue, 22 Feb 2022 07:03:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:53610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMTsK-0007PD-4U for qemu-devel@nongnu.org; Tue, 22 Feb 2022 07:02:39 -0500 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-627-JnX63StzMMmTQN_Aa6HuXA-1; Tue, 22 Feb 2022 07:02:14 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7D8471800D50; Tue, 22 Feb 2022 12:02:12 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.36.112.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD80E7C0DA; Tue, 22 Feb 2022 12:02:08 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4EEE821A736E; Tue, 22 Feb 2022 13:02:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645531335; 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: in-reply-to:in-reply-to:references:references; bh=MRn/UueCSRqWV+WZjoRqNv6PQkOrFk+efUhVrJy/jnQ=; b=Pv1k3MDK2jpv9tneb4DN5ZmL77nwSybsXULI/NZZY2zxxkGGoGH0UB+OcMNHvSR4SnSEQy 4jbwvrXoXFVvblXQMxPYRt/BxHV8Z6gceLgAs8OQ25z+y+4zC5Ux8qFpm4pm7rvzBFsVNJ zUIf+haAiNa1+YrGv+3A6O8aIEXk5v4= X-MC-Unique: JnX63StzMMmTQN_Aa6HuXA-1 From: Markus Armbruster To: Peter Maydell Subject: [PATCH RFC 4/4] rtc: Have event RTC_CHANGE identify the RTC by QOM path References: <20220221192123.749970-1-peter.maydell@linaro.org> Date: Tue, 22 Feb 2022 13:02:07 +0100 In-Reply-To: <20220221192123.749970-1-peter.maydell@linaro.org> (Peter Maydell's message of "Mon, 21 Feb 2022 19:21:20 +0000") Message-ID: <87a6ejnm80.fsf@pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=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 , "Michael S. Tsirkin" , Daniel Henrique Barboza , qemu-devel@nongnu.org, Greg Kurz , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?Q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , Eric Blake , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1645531725563100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Event RTC_CHANGE is "emitted when the guest changes the RTC time" (and the RTC supports the event). What if there's more than one RTC? Which one changed? New @qom-path identifies it. Signed-off-by: Markus Armbruster Reviewed-by: Eric Auger Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- RFC because it's compile-tested only. Worthwhile? Let me know what you think. qapi/misc.json | 4 +++- hw/ppc/spapr_rtc.c | 4 +++- hw/rtc/mc146818rtc.c | 3 ++- hw/rtc/pl031.c | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/qapi/misc.json b/qapi/misc.json index 0ab235e41f..b83cc39029 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -536,6 +536,8 @@ # @offset: offset in seconds between base RTC clock (as specified # by -rtc base), and new RTC clock value # +# @qom-path: path to the RTC object in the QOM tree +# # Note: This event is rate-limited. # It is not guaranteed that the RTC in the system implements # this event, or even that the system has an RTC at all. @@ -550,4 +552,4 @@ # ## { 'event': 'RTC_CHANGE', - 'data': { 'offset': 'int' } } + 'data': { 'offset': 'int', 'qom-path': 'str' } } diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c index 79677cf550..d55b4b0c50 100644 --- a/hw/ppc/spapr_rtc.c +++ b/hw/ppc/spapr_rtc.c @@ -97,6 +97,7 @@ static void rtas_set_time_of_day(PowerPCCPU *cpu, SpaprMa= chineState *spapr, uint32_t nret, target_ulong rets) { SpaprRtcState *rtc =3D &spapr->rtc; + g_autofree const char *qom_path =3D NULL; struct tm tm; time_t new_s; int64_t host_ns; @@ -120,7 +121,8 @@ static void rtas_set_time_of_day(PowerPCCPU *cpu, Spapr= MachineState *spapr, } =20 /* Generate a monitor event for the change */ - qapi_event_send_rtc_change(qemu_timedate_diff(&tm)); + qom_path =3D object_get_canonical_path(OBJECT(rtc)); + qapi_event_send_rtc_change(qemu_timedate_diff(&tm), qom_path); =20 host_ns =3D qemu_clock_get_ns(rtc_clock); =20 diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index 57c514e15c..ac9a60c90e 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -611,12 +611,13 @@ static void rtc_get_time(RTCState *s, struct tm *tm) static void rtc_set_time(RTCState *s) { struct tm tm; + g_autofree const char *qom_path =3D object_get_canonical_path(OBJECT(s= )); =20 rtc_get_time(s, &tm); s->base_rtc =3D mktimegm(&tm); s->last_update =3D qemu_clock_get_ns(rtc_clock); =20 - qapi_event_send_rtc_change(qemu_timedate_diff(&tm)); + qapi_event_send_rtc_change(qemu_timedate_diff(&tm), qom_path); } =20 static void rtc_set_cmos(RTCState *s, const struct tm *tm) diff --git a/hw/rtc/pl031.c b/hw/rtc/pl031.c index 60167c778f..b01d0e75d1 100644 --- a/hw/rtc/pl031.c +++ b/hw/rtc/pl031.c @@ -138,12 +138,13 @@ static void pl031_write(void * opaque, hwaddr offset, =20 switch (offset) { case RTC_LR: { + g_autofree const char *qom_path =3D object_get_canonical_path(opaq= ue); struct tm tm; =20 s->tick_offset +=3D value - pl031_get_count(s); =20 qemu_get_timedate(&tm, s->tick_offset); - qapi_event_send_rtc_change(qemu_timedate_diff(&tm)); + qapi_event_send_rtc_change(qemu_timedate_diff(&tm), qom_path); =20 pl031_set_alarm(s); break; --=20 2.35.1