From patchwork Wed Jun 28 14:18:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9814399 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 7BA47603F2 for ; Wed, 28 Jun 2017 14:20:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DEDB284C7 for ; Wed, 28 Jun 2017 14:20:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62B5A28575; Wed, 28 Jun 2017 14:20:49 +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 E914628517 for ; Wed, 28 Jun 2017 14:20:48 +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-00024j-3x; 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-00020x-AX for xen-devel@lists.xenproject.org; Wed, 28 Jun 2017 14:18:32 +0000 Received: from [193.109.254.147] by server-2.bemta-6.messagelabs.com id DD/17-03032-7BAB3595; Wed, 28 Jun 2017 14:18:31 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplkeJIrShJLcpLzFFi42JxWrrBXnf7ruB IgzkzBSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oyWw7vYCl6oVkzdN4G5gfGkTBcjJ4eEgL/E 5P7TTCA2m4CyxM/OXjYQW0RAT6LpwHNGEJtZIE/i7OpFrCC2MFD839XzLCA2i4CqxNuGm2A1v AIWEkuu3GSBmCkvsavtIlg9p4ClxP6PG8HiQkA1TXcPQtkKEh3TjzFB9ApKnJz5hAVil4TEwR cvmCcw8s5CkpqFJLWAkWkVo0ZxalFZapGusaFeUlFmekZJbmJmjq6hgZlebmpxcWJ6ak5iUrF ecn7uJkZg8DAAwQ7GpkWBhxglOZiURHn3fgmKFOJLyk+pzEgszogvKs1JLT7EKMPBoSTBG7Yz OFJIsCg1PbUiLTMHGMYwaQkOHiUR3l1bgdK8xQWJucWZ6RCpU4yKUuK8U0H6BEASGaV5cG2w2 LnEKCslzMsIdIgQT0FqUW5mCar8K0ZxDkYlYd45O4Cm8GTmlcBNfwW0mAloMcu8AJDFJYkIKa kGxr1SBepHSq88nhHvVb3p2/bKKdFvus03Lhe4spFJMGjBwY4+9QXnG66VKk96/nz/vvkLZl3 9+/fetaNP6m9xTTlWUfDzSMTVE9y7HNUYhKRDp9/rUvE4celkisrLxhq2eQ82Pju6bJLGdK8d HkbS/UddBTbcXLHbZV3rbntBlRe77809fuYjQ5iPEktxRqKhFnNRcSIA4USzGpgCAAA= X-Env-Sender: prvs=3451ee960=wei.liu2@citrix.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1498659508!92178088!2 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 45215 invoked from network); 28 Jun 2017 14:18:30 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 28 Jun 2017 14:18:30 -0000 X-IronPort-AV: E=Sophos;i="5.40,275,1496102400"; d="scan'208";a="438140914" From: Wei Liu To: Xen-devel Date: Wed, 28 Jun 2017 15:18:26 +0100 Message-ID: <20170628141827.19046-8-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 7/8] x86/nmi.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 While at it, change check_nmi_watchdog to return void because its return value is not used anyway. Signed-off-by: Wei Liu --- xen/arch/x86/nmi.c | 34 +++++++++++++++++----------------- xen/include/asm-x86/apic.h | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c index ced61fd17e..8914581f66 100644 --- a/xen/arch/x86/nmi.c +++ b/xen/arch/x86/nmi.c @@ -41,31 +41,31 @@ static DEFINE_PER_CPU(struct timer, nmi_timer); static DEFINE_PER_CPU(unsigned int, nmi_timer_ticks); /* opt_watchdog: If true, run a watchdog NMI on each processor. */ -bool_t __initdata opt_watchdog = 0; +bool __initdata opt_watchdog; /* watchdog_force: If true, process unknown NMIs when running the watchdog. */ -bool_t watchdog_force = 0; +bool watchdog_force; static void __init parse_watchdog(char *s) { if ( !*s ) { - opt_watchdog = 1; + opt_watchdog = true; return; } switch ( parse_bool(s) ) { case 0: - opt_watchdog = 0; + opt_watchdog = false; return; case 1: - opt_watchdog = 1; + opt_watchdog = true; return; } if ( !strcmp(s, "force") ) - watchdog_force = opt_watchdog = 1; + watchdog_force = opt_watchdog = true; } custom_param("watchdog", parse_watchdog); @@ -152,14 +152,14 @@ static void __init wait_for_nmis(void *p) } while( e - s < ticks ); } -int __init check_nmi_watchdog (void) +void __init check_nmi_watchdog(void) { static unsigned int __initdata prev_nmi_count[NR_CPUS]; int cpu; - bool_t ok = 1; + bool ok = true; if ( nmi_watchdog == NMI_NONE ) - return 0; + return; printk("Testing NMI watchdog on all CPUs:"); @@ -178,7 +178,7 @@ int __init check_nmi_watchdog (void) if ( nmi_count(cpu) - prev_nmi_count[cpu] < 2 ) { printk(" %d", cpu); - ok = 0; + ok = false; } } @@ -196,7 +196,7 @@ int __init check_nmi_watchdog (void) if ( nmi_watchdog == NMI_LOCAL_APIC ) nmi_hz = max(1ul, cpu_khz >> 20); - return 0; + return; } static void nmi_timer_fn(void *unused) @@ -448,7 +448,7 @@ void watchdog_enable(void) atomic_dec(&watchdog_disable_count); } -bool_t watchdog_enabled(void) +bool watchdog_enabled(void) { return !atomic_read(&watchdog_disable_count); } @@ -470,9 +470,9 @@ int __init watchdog_setup(void) } /* Returns false if this was not a watchdog NMI, true otherwise */ -bool_t nmi_watchdog_tick(const struct cpu_user_regs *regs) +bool nmi_watchdog_tick(const struct cpu_user_regs *regs) { - bool_t watchdog_tick = 1; + bool watchdog_tick = true; unsigned int sum = this_cpu(nmi_timer_ticks); if ( (this_cpu(last_irq_sums) == sum) && watchdog_enabled() ) @@ -505,7 +505,7 @@ bool_t nmi_watchdog_tick(const struct cpu_user_regs *regs) { rdmsrl(MSR_P4_IQ_CCCR0, msr_content); if ( !(msr_content & P4_CCCR_OVF) ) - watchdog_tick = 0; + watchdog_tick = false; /* * P4 quirks: @@ -521,7 +521,7 @@ bool_t nmi_watchdog_tick(const struct cpu_user_regs *regs) { rdmsrl(MSR_P6_PERFCTR(0), msr_content); if ( msr_content & (1ULL << P6_EVENT_WIDTH) ) - watchdog_tick = 0; + watchdog_tick = false; /* * Only P6 based Pentium M need to re-unmask the apic vector but @@ -533,7 +533,7 @@ bool_t nmi_watchdog_tick(const struct cpu_user_regs *regs) { rdmsrl(MSR_K7_PERFCTR0, msr_content); if ( msr_content & (1ULL << K7_EVENT_WIDTH) ) - watchdog_tick = 0; + watchdog_tick = false; } write_watchdog_counter(NULL); } diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h index 342db73a9d..ea675b7f0a 100644 --- a/xen/include/asm-x86/apic.h +++ b/xen/include/asm-x86/apic.h @@ -186,7 +186,7 @@ extern void release_lapic_nmi(void); extern void self_nmi(void); extern void disable_timer_nmi_watchdog(void); extern void enable_timer_nmi_watchdog(void); -extern bool_t nmi_watchdog_tick (const struct cpu_user_regs *regs); +extern bool nmi_watchdog_tick(const struct cpu_user_regs *regs); extern int APIC_init_uniprocessor (void); extern void disable_APIC_timer(void); extern void enable_APIC_timer(void); @@ -196,7 +196,7 @@ extern void record_boot_APIC_mode(void); extern enum apic_mode current_local_apic_mode(void); extern void check_for_unexpected_msi(unsigned int vector); -extern int check_nmi_watchdog (void); +extern void check_nmi_watchdog(void); extern unsigned int nmi_watchdog; #define NMI_NONE 0