From patchwork Wed Aug 23 13:25:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Lagerwall X-Patchwork-Id: 9917361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8B265602CB for ; Wed, 23 Aug 2017 13:27:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D728280CF for ; Wed, 23 Aug 2017 13:27:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7243528943; Wed, 23 Aug 2017 13:27:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0C839280CF for ; Wed, 23 Aug 2017 13:27:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkVel-0002XJ-VS; Wed, 23 Aug 2017 13:25:15 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkVel-0002Wz-1U for xen-devel@lists.xenproject.org; Wed, 23 Aug 2017 13:25:15 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id 53/32-03937-A328D995; Wed, 23 Aug 2017 13:25:14 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNLMWRWlGSWpSXmKPExsXitHRDpK5l09x Igys3DC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oyH7d/ZCxZwV6x/8pixgXEaZxcjJ4eEgL/E nP47bCA2m4CBxK1L35lBbBEBaYn+Oe3sXYxcHMwCqxklrr9ewNTFyMEhLGAnceZ7EEgNi4Cqx P6J91hAwrwCthLP75hBjJST2HNxBjuILSSgJvF2+RkWEJtXQFDi5MwnYDazgITEwRcvmCcwcs 9CkpqFJLWAkWkVo3pxalFZapGuhV5SUWZ6RkluYmaOrqGBmV5uanFxYnpqTmJSsV5yfu4mRmA gMADBDsbZl/0PMUpyMCmJ8mrqzI0U4kvKT6nMSCzOiC8qzUktPsQow8GhJMF7rAEoJ1iUmp5a kZaZAwxJmLQEB4+SCO9KkDRvcUFibnFmOkTqFKOilDjvW5CEAEgiozQPrg0WB5cYZaWEeRmBD hHiKUgtys0sQZV/xSjOwagkzGvdCDSFJzOvBG76K6DFTECLJ52YA7K4JBEhJdXAmPZU32R5Ye WtEKPDvxMrGNNXWHj5HZy9gNNkk4PSjuPOzzacKOhvPbyymTVy5UWtHbkHPp7RnxJ++10UW+l E040Nb7++meS0J0F16u62l8qSba1Pu1Wv9eQ4SYp+bVjX55ywP3JjHf/byWwu2o9luIqm/OB+ ufyz1+u7wjsF9VU73dJ1P2kZKLEUZyQaajEXFScCABtWeT5+AgAA X-Env-Sender: prvs=401f64dd5=ross.lagerwall@citrix.com X-Msg-Ref: server-9.tower-27.messagelabs.com!1503494712!113189252!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26079 invoked from network); 23 Aug 2017 13:25:13 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 23 Aug 2017 13:25:13 -0000 X-IronPort-AV: E=Sophos;i="5.41,417,1498521600"; d="scan'208";a="436559175" From: Ross Lagerwall To: Date: Wed, 23 Aug 2017 14:25:05 +0100 Message-ID: <20170823132505.1505-1-ross.lagerwall@citrix.com> X-Mailer: git-send-email 2.9.5 MIME-Version: 1.0 Cc: Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , Ross Lagerwall Subject: [Xen-devel] [PATCH v2] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP When the guest writes to the RTC, Xen emulates it and broadcasts a TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP event to all QMP monitors when this happens rather than ignoring it so that something useful can be done with the information. This is the same event that QEMU generates when it emulates the RTC. This patch by itself doesn't affect any of the toolstacks that I checked; the libxl toolstack doesn't currently handle this event nor does the XAPI toolstack. If nothing handles the event, it is simply ignored. We plan on modifying XAPI to handle it. Signed-off-by: Ross Lagerwall Reviewed-by: Stefano Stabellini --- Changed in v2: * Expanded commit message. hw/i386/xen/xen-hvm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index d9ccd5d..ffd20dc 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -16,6 +16,7 @@ #include "hw/i386/apic-msidef.h" #include "hw/xen/xen_common.h" #include "hw/xen/xen_backend.h" +#include "qapi-event.h" #include "qmp-commands.h" #include "qemu/error-report.h" @@ -967,6 +968,7 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req) handle_vmport_ioreq(state, req); break; case IOREQ_TYPE_TIMEOFFSET: + qapi_event_send_rtc_change((int64_t)req->data, &error_abort); break; case IOREQ_TYPE_INVALIDATE: xen_invalidate_map_cache();