diff options
author | Michael Kelley <mikelley@microsoft.com> | 2018-11-03 23:48:57 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2018-11-04 05:04:46 -0500 |
commit | 1de72c706488b7be664a601cf3843bd01e327e58 (patch) | |
tree | 9541096f9fec1f07998816bbdbc8d4c289e48df9 | |
parent | 35b69a420bfb56b7b74cb635ea903db05e357bec (diff) |
x86/hyper-v: Enable PIT shutdown quirk
Hyper-V emulation of the PIT has a quirk such that the normal PIT shutdown
path doesn't work, because clearing the counter register restarts the
timer.
Disable the counter clearing on PIT shutdown.
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "devel@linuxdriverproject.org" <devel@linuxdriverproject.org>
Cc: "daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>
Cc: "virtualization@lists.linux-foundation.org" <virtualization@lists.linux-foundation.org>
Cc: "jgross@suse.com" <jgross@suse.com>
Cc: "akataria@vmware.com" <akataria@vmware.com>
Cc: "olaf@aepfle.de" <olaf@aepfle.de>
Cc: "apw@canonical.com" <apw@canonical.com>
Cc: vkuznets <vkuznets@redhat.com>
Cc: "jasowang@redhat.com" <jasowang@redhat.com>
Cc: "marcelo.cerri@canonical.com" <marcelo.cerri@canonical.com>
Cc: KY Srinivasan <kys@microsoft.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/1541303219-11142-3-git-send-email-mikelley@microsoft.com
-rw-r--r-- | arch/x86/kernel/cpu/mshyperv.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 1c72f3819eb1..e81a2db42df7 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/irq.h> | 21 | #include <linux/irq.h> |
22 | #include <linux/kexec.h> | 22 | #include <linux/kexec.h> |
23 | #include <linux/i8253.h> | ||
23 | #include <asm/processor.h> | 24 | #include <asm/processor.h> |
24 | #include <asm/hypervisor.h> | 25 | #include <asm/hypervisor.h> |
25 | #include <asm/hyperv-tlfs.h> | 26 | #include <asm/hyperv-tlfs.h> |
@@ -295,6 +296,16 @@ static void __init ms_hyperv_init_platform(void) | |||
295 | if (efi_enabled(EFI_BOOT)) | 296 | if (efi_enabled(EFI_BOOT)) |
296 | x86_platform.get_nmi_reason = hv_get_nmi_reason; | 297 | x86_platform.get_nmi_reason = hv_get_nmi_reason; |
297 | 298 | ||
299 | /* | ||
300 | * Hyper-V VMs have a PIT emulation quirk such that zeroing the | ||
301 | * counter register during PIT shutdown restarts the PIT. So it | ||
302 | * continues to interrupt @18.2 HZ. Setting i8253_clear_counter | ||
303 | * to false tells pit_shutdown() not to zero the counter so that | ||
304 | * the PIT really is shutdown. Generation 2 VMs don't have a PIT, | ||
305 | * and setting this value has no effect. | ||
306 | */ | ||
307 | i8253_clear_counter_on_shutdown = false; | ||
308 | |||
298 | #if IS_ENABLED(CONFIG_HYPERV) | 309 | #if IS_ENABLED(CONFIG_HYPERV) |
299 | /* | 310 | /* |
300 | * Setup the hook to get control post apic initialization. | 311 | * Setup the hook to get control post apic initialization. |