From patchwork Wed Jun 28 14:18:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9814395 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 B7B91603F2 for ; Wed, 28 Jun 2017 14:20:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9173284C7 for ; Wed, 28 Jun 2017 14:20:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DF4328575; Wed, 28 Jun 2017 14:20:44 +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 03B2B284C7 for ; Wed, 28 Jun 2017 14:20:44 +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 1dQDne-00026F-Mh; Wed, 28 Jun 2017 14:18:34 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQDnc-00020Z-OS for xen-devel@lists.xenproject.org; Wed, 28 Jun 2017 14:18:32 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id 56/0E-03044-8BAB3595; Wed, 28 Jun 2017 14:18:32 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphkeJIrShJLcpLzFFi42JxWrrBXnfHruB Ig9O7WCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oyvp5YyFmxXqzh04jxbA+NDmS5GTg4JAX+J VZt7mEFsNgFliZ+dvWwgtoiAnkTTgeeMIDazQJ7E2dWLWEFsYQF9iZM73oPFWQRUJWb1dIPFe QUsJB7fnMoEMVNeYlfbRbA4p4ClxP6PG1lAbCGgmqa7B6FsBYmO6ceYIHoFJU7OfMICsUtC4u CLF8wTGHlnIUnNQpJawMi0ilG9OLWoLLVI11gvqSgzPaMkNzEzR9fQwEwvN7W4ODE9NScxqVg vOT93EyMwdBiAYAdjxz+nQ4ySHExKorx7vwRFCvEl5adUZiQWZ8QXleakFh9ilOHgUJLgDdsZ HCkkWJSanlqRlpkDDGKYtAQHj5II766tQGne4oLE3OLMdIjUKUZFKXHeqSB9AiCJjNI8uDZY5 FxilJUS5mUEOkSIpyC1KDezBFX+FaM4B6OSMO+cHUBTeDLzSuCmvwJazAS0mGVeAMjikkSElF QDo1zzyu3t6QYHD0S7LCvvYhJXe2rSZmso9+Ff1zbLX7fX6Pb83KKi75F7oLJpwrvb8RWifvW bl+/WF/Ce8bxYIrLN+dBFdRVuVwONaQtOmNRFLjJUcnl0qot1s/18x3CuleUPtypeDfz3xyVi /pp5k1aYXs74/FFSVC+BJfrQUUnu0w9CvfVtlFiKMxINtZiLihMB46YsuJcCAAA= X-Env-Sender: prvs=3451ee960=wei.liu2@citrix.com X-Msg-Ref: server-7.tower-21.messagelabs.com!1498659508!70765393!3 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22781 invoked from network); 28 Jun 2017 14:18:31 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 28 Jun 2017 14:18:31 -0000 X-IronPort-AV: E=Sophos;i="5.40,275,1496102400"; d="scan'208";a="438140915" From: Wei Liu To: Xen-devel Date: Wed, 28 Jun 2017 15:18:25 +0100 Message-ID: <20170628141827.19046-7-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170628141827.19046-1-wei.liu2@citrix.com> References: <20170628141827.19046-1-wei.liu2@citrix.com> MIME-Version: 1.0 Cc: Andrew Cooper , Wei Liu , Jan Beulich Subject: [Xen-devel] [PATCH 6/8] x86/time.c: use plain bool 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 Signed-off-by: Wei Liu --- xen/arch/x86/time.c | 28 ++++++++++++++-------------- xen/include/asm-x86/domain.h | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 655af33cb3..75ea695ac5 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -82,7 +82,7 @@ static struct timer calibration_timer; static DEFINE_SPINLOCK(pit_lock); static u16 pit_stamp16; static u32 pit_stamp32; -static bool_t __read_mostly using_pit; +static bool __read_mostly using_pit; /* Boot timestamp, filled in head.S */ u64 __initdata boot_tsc_stamp; @@ -304,7 +304,7 @@ static s64 __init init_pit(struct platform_timesource *pts) u64 start, end; unsigned long count; - using_pit = 1; + using_pit = true; /* Set the Gate high, disable speaker. */ outb((portb & ~0x02) | 0x01, 0x61); @@ -577,7 +577,7 @@ static void plt_overflow(void *unused) } if ( i != 0 ) { - static bool_t warned_once; + static bool warned_once; if ( !test_and_set_bool(warned_once) ) printk("Platform timer appears to have unexpectedly wrapped " "%u%s times.\n", i, (i == 10) ? " or more" : ""); @@ -809,7 +809,7 @@ static unsigned long get_cmos_time(void) unsigned long res, flags; struct rtc_time rtc; unsigned int seconds = 60; - static bool_t __read_mostly cmos_rtc_probe; + static bool __read_mostly cmos_rtc_probe; boolean_param("cmos-rtc-probe", cmos_rtc_probe); if ( efi_enabled(EFI_RS) ) @@ -820,7 +820,7 @@ static unsigned long get_cmos_time(void) } if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) ) - cmos_rtc_probe = 0; + cmos_rtc_probe = false; else if ( system_state < SYS_STATE_smp_boot && !cmos_rtc_probe ) panic("System with no CMOS RTC advertised must be booted from EFI" " (or with command line option \"cmos-rtc-probe\")"); @@ -858,7 +858,7 @@ static unsigned long get_cmos_time(void) if ( seconds < 60 ) { if ( rtc.sec != seconds ) - cmos_rtc_probe = 0; + cmos_rtc_probe = false; break; } @@ -987,15 +987,15 @@ static void __update_vcpu_system_time(struct vcpu *v, int force) v->arch.pv_vcpu.pending_system_time = _u; } -bool_t update_secondary_system_time(struct vcpu *v, - struct vcpu_time_info *u) +bool update_secondary_system_time(struct vcpu *v, + struct vcpu_time_info *u) { XEN_GUEST_HANDLE(vcpu_time_info_t) user_u = v->arch.time_info_guest; struct guest_memory_policy policy = { .smap_policy = SMAP_CHECK_ENABLED, .nested_guest_mode = false }; if ( guest_handle_is_null(user_u) ) - return 1; + return true; update_guest_memory_policy(v, &policy); @@ -1003,7 +1003,7 @@ bool_t update_secondary_system_time(struct vcpu *v, if ( __copy_field_to_guest(user_u, u, version) == sizeof(u->version) ) { update_guest_memory_policy(v, &policy); - return 0; + return false; } wmb(); /* 2. Update all other userspace fields. */ @@ -1015,7 +1015,7 @@ bool_t update_secondary_system_time(struct vcpu *v, update_guest_memory_policy(v, &policy); - return 1; + return true; } void update_vcpu_system_time(struct vcpu *v) @@ -1951,8 +1951,8 @@ void tsc_get_info(struct domain *d, uint32_t *tsc_mode, uint64_t *elapsed_nsec, uint32_t *gtsc_khz, uint32_t *incarnation) { - bool_t enable_tsc_scaling = is_hvm_domain(d) && - hvm_tsc_scaling_supported && !d->arch.vtsc; + bool enable_tsc_scaling = is_hvm_domain(d) && + hvm_tsc_scaling_supported && !d->arch.vtsc; *incarnation = d->arch.incarnation; *tsc_mode = d->arch.tsc_mode; @@ -2017,7 +2017,7 @@ void tsc_set_info(struct domain *d, switch ( d->arch.tsc_mode = tsc_mode ) { - bool_t enable_tsc_scaling; + bool enable_tsc_scaling; case TSC_MODE_DEFAULT: case TSC_MODE_ALWAYS_EMULATE: diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h index 398193eefb..c10522b7f5 100644 --- a/xen/include/asm-x86/domain.h +++ b/xen/include/asm-x86/domain.h @@ -593,8 +593,8 @@ void update_guest_memory_policy(struct vcpu *v, #define hvm_svm hvm_vcpu.u.svm bool update_runstate_area(struct vcpu *); -bool_t update_secondary_system_time(struct vcpu *, - struct vcpu_time_info *); +bool update_secondary_system_time(struct vcpu *, + struct vcpu_time_info *); void vcpu_show_execution_state(struct vcpu *); void vcpu_show_registers(const struct vcpu *);