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: 9711745 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 9F7C960362 for ; Thu, 4 May 2017 12:00:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81CE62623C for ; Thu, 4 May 2017 12:00:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 766C328689; Thu, 4 May 2017 12:00:21 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28C6A2623C for ; Thu, 4 May 2017 12:00:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752907AbdEDMAT (ORCPT ); Thu, 4 May 2017 08:00:19 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34179 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753082AbdEDMAQ (ORCPT ); Thu, 4 May 2017 08:00:16 -0400 Received: by mail-pg0-f65.google.com with SMTP id t7so2027153pgt.1 for ; Thu, 04 May 2017 05:00:15 -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=uO7mqUO/oUUh5FBiQ9qy8kxEB5hOnNOjFw2jDhyS43dQZW6m0FP8QdciJhC73T3N8P 0mLNQ2LO6l72GBVdXFCGOp6nbkpJ1J10yEfYh8o2BnT8AXtsBCQiO3N/qgO0EVC1U0K4 srg+Lm2heL15UCw9hBQTjz/ES1czvBpdHyvP9nXeS/bZGucsx3nD2SHuy8AmYW0Y56sl mrk0n3DItWhO2LH7cI6NJzduSVfoNdi66Kzz04aXNDlOpxo5WKTGrZQouYzP6xPtwnD1 kiZLWNInL7btfQr3sEdb7tmwav+mjPwxy7yi63XgswkNy1QqER4Cq1Ft9bsPlC8MgHIG 4WGA== X-Gm-Message-State: AN3rC/7wOZP3UTzKXWxHxi5/IDppGHIjLfzWmRDjeeZjfmuv37BzxbUW CpKd5DfEh+4TPDFF 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 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, yunfangtai@tencent.com, Xiao Guangrong Subject: [PATCH v2 3/5] mc146818rtc: ensure LOST_TICK_POLICY_SLEW is only enabled on TARGET_I386 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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);