From patchwork Wed May 10 08:32:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xiao Guangrong X-Patchwork-Id: 9719443 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 BEE3960236 for ; Wed, 10 May 2017 08:33:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1A8528552 for ; Wed, 10 May 2017 08:33:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A69D128576; Wed, 10 May 2017 08:33:37 +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 2C92D28552 for ; Wed, 10 May 2017 08:33:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752200AbdEJIde (ORCPT ); Wed, 10 May 2017 04:33:34 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:36718 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752085AbdEJId1 (ORCPT ); Wed, 10 May 2017 04:33:27 -0400 Received: by mail-pg0-f68.google.com with SMTP id 64so3227263pgb.3 for ; Wed, 10 May 2017 01:33:27 -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=CMKvEvxEPV2HQ6E5xzmI+od/cl4K9BS75KvwKWEV1+A=; b=gl/9sVKEcOC15qKpzm5MmVcIQz6kvFN4eIGdm2/hu7K+ZVSLz1XFXmBpJtJIT9qkmX Szj9LaEbL1zhSZMW6Q+SQvYmaBL3HJiIkbTbqAadi4EVSieJ5j3XYWXntEYu5wSsTxk/ qT1lYxzter9gJZCIJJw7HT5nuGn81GlbWYdfAguhmWLDVa870UV8j5ELmqi41UdMeemj LAH7FVwOTAKsFXVoPfcx9kYMN3s2qnpzsNhzvry3he1FwtUP88+QTPb45ugOq9wLpGXy IS0m+5XlmHf7JEZLJwVFXal636mGIEx0OOkVZTpOFLwYtXYzcKqQt7CeGfPQbEdyK8wP tWyg== 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=CMKvEvxEPV2HQ6E5xzmI+od/cl4K9BS75KvwKWEV1+A=; b=plumqKkPfYKqp81KwnVBb5wrJxXBPBloI9E2Ic1z/wSiQbYq0WzgG9Vwx3Hg0g6Mud v75tr7PQ9pOPZyYPvgLBGO0xgop2plORuNhzZFsvwjmEV8QJHzEDt5fzixDJVE/yhv20 soWOJUxSwO53LF0glU4rMtYiF8NXYwZoB0HkA8atPoIrQ04xS1fCPElH/HgsoKy4lEUP Jzbm4UaXIJdpFA1oLNgOPMYijE1S9YvnhpUnLcO8JR65HAZ9Pp/iLP+xMwPmDl+TrZ0G fRXOCr+eKhNePxbTJBojTGWo97by4qrdJrFj7s+hJ4QRtbUfCjT0Ox1W7GkX7m/LHYrF 2oHg== X-Gm-Message-State: AODbwcBUH8aNF646O4sFa1dGn4xG9S6Tag+fC7ulQBKzEHoXsgK3/Npx T9+PWEv8UZhK6A== X-Received: by 10.98.67.8 with SMTP id q8mr4727326pfa.67.1494405207046; Wed, 10 May 2017 01:33:27 -0700 (PDT) Received: from eric.tencent.com ([203.205.141.37]) by smtp.gmail.com with ESMTPSA id z125sm3829043pfb.64.2017.05.10.01.33.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 May 2017 01:33:26 -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 v3 3/5] mc146818rtc: ensure LOST_TICK_POLICY_SLEW is only enabled on TARGET_I386 Date: Wed, 10 May 2017 16:32:57 +0800 Message-Id: <20170510083259.3900-4-xiaoguangrong@tencent.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170510083259.3900-1-xiaoguangrong@tencent.com> References: <20170510083259.3900-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 Reviewed-by: Philippe Mathieu-Daudé --- 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 dac6744..9810bd5 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -980,19 +980,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);