From patchwork Wed Oct 17 12:22:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Artem Pisarenko X-Patchwork-Id: 10645393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35FD3109C for ; Wed, 17 Oct 2018 12:25:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AB5E2AE98 for ; Wed, 17 Oct 2018 12:25:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E6B42AEC0; Wed, 17 Oct 2018 12:25:08 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AC9222AE98 for ; Wed, 17 Oct 2018 12:25:07 +0000 (UTC) Received: from localhost ([::1]:36332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCkss-0002n7-Ao for patchwork-qemu-devel@patchwork.kernel.org; Wed, 17 Oct 2018 08:25:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCkrx-0002Dy-Hh for qemu-devel@nongnu.org; Wed, 17 Oct 2018 08:24:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCkrt-0006Jh-9X for qemu-devel@nongnu.org; Wed, 17 Oct 2018 08:24:09 -0400 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]:44172) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCkrt-0006If-0h for qemu-devel@nongnu.org; Wed, 17 Oct 2018 08:24:05 -0400 Received: by mail-lf1-x143.google.com with SMTP id m18-v6so19631357lfl.11 for ; Wed, 17 Oct 2018 05:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=S12wo7i37AXRRM0gnL2yDPMCRGjuhOZefdX4Mr2ug/g=; b=UzA7aGOGaacrUKXkjxRtFn1FQqd0pBWtfW+RuIHAwRve8x0nKXzkF+TdmVA5UWLJxR o5uQPf59p+qpRJj5MRerVLOmLj12aSjrw2yf0zNlw1yBWR7bduqGe0gHaaaAheW5m9tG +HBP7pROL07G01m/jFfaqwS6uLTbf9XhkKiyWJOa5Oq+R2PFnUnROY/YA2CEUQHX/vyP J913WCXGnGI3wKadBur7lvrFRWpTYIfrvshpdiH/bVukXBLh6Sr7FQZ8O+rIMaEAL0gO qkQ7tBYUl6DukcqmCMmtNkt6HK66UH1qaA+hNyI9EkfyGyFFLD5X5PfPBdnHLqf61t/W LN0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=S12wo7i37AXRRM0gnL2yDPMCRGjuhOZefdX4Mr2ug/g=; b=OxSKLJaao6amXx2wXhxhWxznV1d1icVQQPaW8F9hKYFsmS9sXDG/2mjUIPUBaaWC98 +oxMOAJnzhua8I5ee6QvcQoRzMRA/12grLR7dQ4OzO1quBbcS+LaSd7myMosBxhE9oQO A3qWFHMWHjDpM9Do/kjORK4rqh/9wXlmLbiHPuq/Y/H1POmo7a0GAFs99BDSESq+bGz9 wl4laNHwDGV/OSzIWs+r1FqH3KcGLcLXdNd6fSkecOaw0Eud4QXvibJa5Wd0gfFAgt93 q+jUAwJGipEQL7Btu1zmyoP2bAbJlX5N+35Bx1O7gYlDfSTISv04BY3vpnngR8yP/FbY fPQw== X-Gm-Message-State: ABuFfojt6YWa75f2mfJPWLPxYJNcjmw+BL1zqIqNu+0Cc3C64odpCPCp Dx11TE52yAE7kSvsp4sZ2G/KFxRdasY= X-Google-Smtp-Source: ACcGV63Dh6nsklSntqD5Sa/F8DbX2qYe1tQ9d21J8BJKNmZo81pzh8g95dsC9v0IO3v3T7k1a3kFzA== X-Received: by 2002:a19:f817:: with SMTP id a23-v6mr15130553lff.67.1539779043042; Wed, 17 Oct 2018 05:24:03 -0700 (PDT) Received: from localhost.localdomain ([77.221.221.49]) by smtp.gmail.com with ESMTPSA id z67-v6sm3704118lfa.14.2018.10.17.05.24.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Oct 2018 05:24:02 -0700 (PDT) From: Artem Pisarenko To: qemu-devel@nongnu.org Date: Wed, 17 Oct 2018 18:22:59 +0600 Message-Id: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::143 Subject: [Qemu-devel] [PATCH v2 0/4] Fix and improve core RTC function and documentation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Artem Pisarenko Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Modifications are motivated by bug https://bugs.launchpad.net/qemu/+bug/1797033 I've encountered recently. Trying to fix it and analyzing its effect on all use cases (not covered in bug report) revealed much deeper problems. This is my first patch to QEMU and I'm not sure whether the way I addressed them is proper. They definitely require either modifications to current implementation (breaking compability), or adding clarifications to user documentation. I've tried to find compromise. Changes I propose are driven mostly by my interpretation of user documentation and comments in code, rather than by existing implementation. I've splitted patches in a way that at least some of them may be accepted. Following subsets are make sense on their own: - 1 - 1,2,3 I limited refactoring only to vl.c, although it leads to reworking of all hw/* rtc models which have unreasonable duplications of actions performed by vl.c. I'm sure such kind of rework will reveal more hidden bugs/features, but so far I've had enough (it's a long story how muсh effort and pain cost me to find that tricky bug above). I suppose just to draw attention of relevant hw/* maintainers. v2 changes: - fixed compiler warning caused non-debug build fail Artem Pisarenko (4): vl: improve/fix documentation related to RTC function vl: refactor -rtc option references Fixes RTC bug with base datetime shifts in clock=vm vl,qapi: offset value calculation in RTC_CHANGE event reverted to match behavior before #1797033 bugfix and documented qapi/misc.json | 3 +- qemu-options.hx | 14 +++++--- vl.c | 105 +++++++++++++++++++++++++++++++++++++------------------- 3 files changed, 80 insertions(+), 42 deletions(-)