From patchwork Thu May 4 11:59:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Guangrong X-Patchwork-Id: 9711787 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 B1B6760362 for ; Thu, 4 May 2017 12:04:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97C8E28614 for ; Thu, 4 May 2017 12:04:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C9E928677; Thu, 4 May 2017 12:04:04 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 36EE328614 for ; Thu, 4 May 2017 12:04:04 +0000 (UTC) Received: from localhost ([::1]:41341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6FUJ-00051r-I0 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 04 May 2017 08:04:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6FQk-0002j4-HA for qemu-devel@nongnu.org; Thu, 04 May 2017 08:00:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6FQe-0006iM-Gw for qemu-devel@nongnu.org; Thu, 04 May 2017 08:00:22 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:35225) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d6FQe-0006gv-BY for qemu-devel@nongnu.org; Thu, 04 May 2017 08:00:16 -0400 Received: by mail-pg0-x242.google.com with SMTP id i63so2023777pgd.2 for ; Thu, 04 May 2017 05:00:16 -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:in-reply-to:references; bh=GwcARz/o9a9Fjifns/6C2cRWjAODO2E3LU9WQhqoBsI=; b=Rytd0rmvD8CvYiNLgcHz1w8Zzg2CYIbKW5d+AEwMQNo/7ziTkTJDW5HzA0k792hkNO v8UXri2czqn9MudCIrlQskvLDdGD5XZENYUmS+QEsQbRI6G+svWQdIT5J78OdO1ywIVb 9tRz8fCya/pDoAvNd3a9KV2N4SbkTczfEnE9vZSUZ1emZRNQJXK82k5PVg3DaVrH9EMI hlVMFEvGIO4HUXz1MJEFH/U9EyRt0J61N8Z0Aog630eW7k169ZFp9n6scw/7va8W4Pq2 bZJ8JRNldUbnhMlvCXen7l7jQmevX7S5vfEV0LLrrfa0/eWbN6l+kVnKdDZrGQb1Ll2J Z63g== 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:in-reply-to :references; bh=GwcARz/o9a9Fjifns/6C2cRWjAODO2E3LU9WQhqoBsI=; b=IJIzFg0FNcS7UmptCYZvIsXIuj175hy6LdwvQKmbBfqbNM1U382Cl+/6XNbejntYBy AaXzIGjUG4ostxcQJsEGqj4XEdspqSiPHwHREqFhS8G2bED1Jc5aKzdmqiQB2+85vrX4 0QnYpa/MzL/szx0PtB5UwRTv9KjopSNGZXTjisY3Z3O2IryNWFkuUSAEkCpadQUaY9GY MDzcW+DrBFEThILV20Zj/YAX87D/QuY5Y2x1wS+DFyeq/WwPacMl/PxQRqQvBbBdyL4B oizcAJk860Lhrr+80zot0rouHmDx+jIvXAl80RXFGFrPY3P9NdTGdu8sWmPNjmjOGLwJ H9mQ== X-Gm-Message-State: AN3rC/6m0WGVoveBU1hG9RUaTrYAkgOCi/QALasbjZk5iCb0bb6sq2AB 2TPLqRmLnH3/5A== X-Received: by 10.98.67.8 with SMTP id q8mr10584570pfa.67.1493899215337; Thu, 04 May 2017 05:00:15 -0700 (PDT) Received: from eric.tencent.com ([203.205.141.37]) by smtp.gmail.com with ESMTPSA id p7sm3698261pfb.125.2017.05.04.05.00.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 May 2017 05:00:14 -0700 (PDT) From: guangrong.xiao@gmail.com X-Google-Original-From: xiaoguangrong@tencent.com To: pbonzini@redhat.com, mst@redhat.com, mtosatti@redhat.com Date: Thu, 4 May 2017 19:59:46 +0800 Message-Id: <20170504115948.3048-4-xiaoguangrong@tencent.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170504115948.3048-1-xiaoguangrong@tencent.com> References: <20170504115948.3048-1-xiaoguangrong@tencent.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::242 Subject: [Qemu-devel] [PATCH v2 3/5] mc146818rtc: ensure LOST_TICK_POLICY_SLEW is only enabled on TARGET_I386 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: Xiao Guangrong , yunfangtai@tencent.com, qemu-devel@nongnu.org, kvm@vger.kernel.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Xiao Guangrong Any tick policy specified on other platforms rather on TARGET_I386 will fall back to LOST_TICK_POLICY_DISCARD silently, this patch makes sure only TARGET_I386 can enable LOST_TICK_POLICY_SLEW After that, we can enable LOST_TICK_POLICY_SLEW in the common code which need not use '#ifdef TARGET_I386' to make these code be x86 specific anymore Signed-off-by: Xiao Guangrong --- hw/timer/mc146818rtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 14bde1a..7f2e975 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -976,19 +976,19 @@ static void rtc_realizefn(DeviceState *dev, Error **errp) rtc_set_date_from_host(isadev); -#ifdef TARGET_I386 switch (s->lost_tick_policy) { +#ifdef TARGET_I386 case LOST_TICK_POLICY_SLEW: s->coalesced_timer = timer_new_ns(rtc_clock, rtc_coalesced_timer, s); break; +#endif case LOST_TICK_POLICY_DISCARD: break; default: error_setg(errp, "Invalid lost tick policy."); return; } -#endif s->periodic_timer = timer_new_ns(rtc_clock, rtc_periodic_timer, s); s->update_timer = timer_new_ns(rtc_clock, rtc_update_timer, s);