* [PATCH 1/1] x86/hyperv: Disable hardlockup detector by default in Hyper-V guests
@ 2022-05-09 15:44 Michael Kelley
2022-05-11 14:42 ` Wei Liu
0 siblings, 1 reply; 2+ messages in thread
From: Michael Kelley @ 2022-05-09 15:44 UTC (permalink / raw)
To: kys, haiyangz, sthemmin, wei.liu, tglx, mingo, bp, dave.hansen,
x86, hpa, linux-kernel, linux-hyperv
Cc: mikelley
In newer versions of Hyper-V, the x86/x64 PMU can be virtualized
into guest VMs by explicitly enabling it. Linux kernels are typically
built to automatically enable the hardlockup detector if the PMU is
found. To prevent the possibility of false positives due to the
vagaries of VM scheduling, disable the PMU-based hardlockup detector
by default in a VM on Hyper-V. The hardlockup detector can still be
enabled by overriding the default with the nmi_watchdog=1 option on
the kernel boot line or via sysctl at runtime.
This change mimics the approach taken with KVM guests in
commit 692297d8f968 ("watchdog: introduce the hardlockup_detector_disable()
function").
Linux on ARM64 does not provide a PMU-based hardlockup detector, so
there's no corresponding disable in the Hyper-V init code on ARM64.
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
---
arch/x86/kernel/cpu/mshyperv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 5b8f2c3..8316139 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -457,6 +457,8 @@ static void __init ms_hyperv_init_platform(void)
*/
if (!(ms_hyperv.features & HV_ACCESS_TSC_INVARIANT))
mark_tsc_unstable("running on Hyper-V");
+
+ hardlockup_detector_disable();
}
static bool __init ms_hyperv_x2apic_available(void)
--
1.8.3.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] x86/hyperv: Disable hardlockup detector by default in Hyper-V guests
2022-05-09 15:44 [PATCH 1/1] x86/hyperv: Disable hardlockup detector by default in Hyper-V guests Michael Kelley
@ 2022-05-11 14:42 ` Wei Liu
0 siblings, 0 replies; 2+ messages in thread
From: Wei Liu @ 2022-05-11 14:42 UTC (permalink / raw)
To: Michael Kelley
Cc: kys, haiyangz, sthemmin, wei.liu, tglx, mingo, bp, dave.hansen,
x86, hpa, linux-kernel, linux-hyperv
On Mon, May 09, 2022 at 08:44:23AM -0700, Michael Kelley wrote:
> In newer versions of Hyper-V, the x86/x64 PMU can be virtualized
> into guest VMs by explicitly enabling it. Linux kernels are typically
> built to automatically enable the hardlockup detector if the PMU is
> found. To prevent the possibility of false positives due to the
> vagaries of VM scheduling, disable the PMU-based hardlockup detector
> by default in a VM on Hyper-V. The hardlockup detector can still be
> enabled by overriding the default with the nmi_watchdog=1 option on
> the kernel boot line or via sysctl at runtime.
>
> This change mimics the approach taken with KVM guests in
> commit 692297d8f968 ("watchdog: introduce the hardlockup_detector_disable()
> function").
>
> Linux on ARM64 does not provide a PMU-based hardlockup detector, so
> there's no corresponding disable in the Hyper-V init code on ARM64.
>
> Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Applied to hyperv-next. Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-11 14:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 15:44 [PATCH 1/1] x86/hyperv: Disable hardlockup detector by default in Hyper-V guests Michael Kelley
2022-05-11 14:42 ` Wei Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®