linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Olaf Hering <[mailto:olaf@aepfle.de]@vger.kernel.org>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:x86/hyperv] x86: Hyper-V: register clocksource only if its advertised
Date: Tue, 12 Feb 2013 16:56:07 -0800	[thread overview]
Message-ID: <tip-32068f6527b8f1822a30671dedaf59c567325026@git.kernel.org> (raw)
In-Reply-To: <1359940959-32168-1-git-send-email-kys@microsoft.com>

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 <hpa@linux.intel.com>
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 <olaf@aepfle.de>
Link: http://lkml.kernel.org/r/1359940959-32168-1-git-send-email-kys@microsoft.com
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: <stable@vger.kernel.org>
Cc: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 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 = {

  parent reply	other threads:[~2013-02-13  0:57 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-04  1:21 [PATCH 0/3] X86: Deliver Hyper-V interrupts on a seperate IDT vector K. Y. Srinivasan
2013-02-04  1:22 ` [PATCH 1/3] x86: Hyper-V: register clocksource only if its advertised K. Y. Srinivasan
2013-02-04  1:22   ` [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V K. Y. Srinivasan
2013-02-13  0:57     ` [tip:x86/hyperv] " tip-bot for K. Y. Srinivasan
2013-04-17  7:06     ` [PATCH 2/3] " Michael S. Tsirkin
2013-04-17  9:10       ` KVM "Hyper-V emulation" -- this can be related "Linux on Hyper-V" ? Or "KVM emulates Hyper-V" as "Hyper-V emulates Hyper-V" ? " Victor Miasnikov
2013-04-17 10:16         ` Michael S. Tsirkin
2013-04-17 12:12           ` Jan Beulich
2013-04-17 12:15             ` Michael S. Tsirkin
     [not found]             ` <CAP2xkNqGgbYz1gdS85xjA8gwROGY89fAsiaRiGSE90xnzjJ4Xw@mail.gmail.com>
2013-04-17 12:43               ` Michael S. Tsirkin
2013-04-17 14:08                 ` Victor Miasnikov
2013-04-17 13:20       ` KY Srinivasan
2013-04-17 12:48         ` Michael S. Tsirkin
2013-04-17 14:12           ` KY Srinivasan
2013-04-17 13:25             ` Michael S. Tsirkin
2013-04-17 14:34               ` KY Srinivasan
2013-04-17 13:48                 ` Michael S. Tsirkin
2013-04-17 15:31                   ` KY Srinivasan
2013-04-17 15:50                     ` Jan Beulich
2013-04-17 16:28                       ` KY Srinivasan
2013-04-18  7:48                         ` Michael S. Tsirkin
2013-04-18 13:23                           ` KY Srinivasan
2013-04-18 13:30                             ` KY Srinivasan
2013-04-17 13:52         ` Jan Beulich
2013-04-17 13:01           ` Michael S. Tsirkin
2013-04-17 13:11             ` Michael S. Tsirkin
2013-04-17 14:09             ` Jan Beulich
2013-04-17 15:17               ` H. Peter Anvin
2013-02-04  1:22   ` [PATCH 3/3] X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts K. Y. Srinivasan
2013-02-13  0:58     ` [tip:x86/hyperv] " tip-bot for K. Y. Srinivasan
2013-02-13  1:58       ` [tip:x86/hyperv] x86, hyperv: HYPERV depends on X86_LOCAL_APIC tip-bot for H. Peter Anvin
2013-02-13  2:05         ` KY Srinivasan
2013-02-13  2:56       ` [tip:x86/hyperv] X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts Yinghai Lu
2013-02-13  3:32         ` KY Srinivasan
2013-02-13  3:46           ` H. Peter Anvin
2013-02-13  3:49             ` KY Srinivasan
2013-02-13  3:54               ` H. Peter Anvin
2013-02-13  3:58                 ` KY Srinivasan
2013-02-13  4:42                   ` Yinghai Lu
2013-02-13 12:47                     ` KY Srinivasan
2013-02-13  0:56   ` tip-bot for Olaf Hering [this message]
2013-02-05 11:16 ` [PATCH 0/3] X86: Deliver Hyper-V interrupts on a seperate IDT vector KY Srinivasan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-32068f6527b8f1822a30671dedaf59c567325026@git.kernel.org \
    --to=linux-tip-commits@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=olaf@aepfle.de \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).