From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759563Ab3BMA5Y (ORCPT ); Tue, 12 Feb 2013 19:57:24 -0500 Received: from terminus.zytor.com ([198.137.202.10]:59220 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752751Ab3BMA5W (ORCPT ); Tue, 12 Feb 2013 19:57:22 -0500 Date: Tue, 12 Feb 2013 16:56:07 -0800 From: tip-bot for Olaf Hering <[mailto:olaf@aepfle.de]@vger.kernel.org> Message-ID: Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org, olaf@aepfle.de, kys@microsoft.com, stable@vger.kernel.org, gregkh@linuxfoundation.org, tglx@linutronix.de, hpa@linux.intel.com Reply-To: mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, olaf@aepfle.de, kys@microsoft.com, stable@vger.kernel.org, gregkh@linuxfoundation.org, tglx@linutronix.de, hpa@linux.intel.com In-Reply-To: <1359940959-32168-1-git-send-email-kys@microsoft.com> References: <1359940959-32168-1-git-send-email-kys@microsoft.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/hyperv] x86: Hyper-V: register clocksource only if its advertised Git-Commit-ID: 32068f6527b8f1822a30671dedaf59c567325026 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (terminus.zytor.com [127.0.0.1]); Tue, 12 Feb 2013 16:56:13 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 32068f6527b8f1822a30671dedaf59c567325026 Gitweb: http://git.kernel.org/tip/32068f6527b8f1822a30671dedaf59c567325026 Author: Olaf Hering <[mailto:olaf@aepfle.de]> AuthorDate: Sun, 3 Feb 2013 17:22:37 -0800 Committer: H. Peter Anvin CommitDate: Tue, 12 Feb 2013 16:25:48 -0800 x86: Hyper-V: register clocksource only if its advertised Enable hyperv_clocksource only if its advertised as a feature. XenServer 6 returns the signature which is checked in ms_hyperv_platform(), but it does not offer all features. Currently the clocksource is enabled unconditionally in ms_hyperv_init_platform(), and the result is a hanging guest. Hyper-V spec Bit 1 indicates the availability of Partition Reference Counter. Register the clocksource only if this bit is set. The guest in question prints this in dmesg: [ 0.000000] Hypervisor detected: Microsoft HyperV [ 0.000000] HyperV: features 0x70, hints 0x0 This bug can be reproduced easily be setting 'viridian=1' in a HVM domU .cfg file. A workaround without this patch is to boot the HVM guest with 'clocksource=jiffies'. Signed-off-by: Olaf Hering Link: http://lkml.kernel.org/r/1359940959-32168-1-git-send-email-kys@microsoft.com Signed-off-by: K. Y. Srinivasan Cc: Cc: Greg KH Signed-off-by: H. Peter Anvin --- arch/x86/kernel/cpu/mshyperv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 0a630dd..646d192 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -68,7 +68,8 @@ static void __init ms_hyperv_init_platform(void) printk(KERN_INFO "HyperV: features 0x%x, hints 0x%x\n", ms_hyperv.features, ms_hyperv.hints); - clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100); + if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE) + clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100); } const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {