mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] arch/powerpc/pseries: Fix KVM guest detection for disabling hardlockup detector
@ 2024-11-08  9:48 Gautam Menghani
  2024-11-17 12:09 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Gautam Menghani @ 2024-11-08  9:48 UTC (permalink / raw)
  To: mpe, npiggin, christophe.leroy, naveen, maddy, vaibhav
  Cc: Gautam Menghani, linuxppc-dev, linux-kernel

As per the kernel documentation[1], hardlockup detector should be
disabled in KVM guests as it may give false positives. On PPC, hardlockup
detector is enabled inside KVM guests because disable_hardlockup_detector()
is marked as early_initcall and it relies on kvm_guest static key 
(is_kvm_guest()) which is initialized later during boot by 
check_kvm_guest(), which is a core_initcall. check_kvm_guest() is also 
called in pSeries_smp_probe(), which is called before initcalls, but it is
skipped if KVM guest does not have doorbell support or if the guest is 
launched with SMT=1.

Call check_kvm_guest() in disable_hardlockup_detector() so that
is_kvm_guest() check goes through fine and hardlockup detector can be
disabled inside the KVM guest.

[1]: Documentation/admin-guide/sysctl/kernel.rst

Fixes: 633c8e9800f3 ("powerpc/pseries: Enable hardlockup watchdog for PowerVM partitions")
Cc: stable@vger.kernel.org # v5.14+
Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
---
v1 -> v2:
1. Call check_kvm_guest() call in disable_hardlockup_detector() instead
of relying on pSeries_smp_probe()
2. Add the fixes and stable tags
3. Some changes in patch description

 arch/powerpc/kernel/setup_64.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 22f83fbbc762..1edc7cd68c10 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -920,6 +920,7 @@ static int __init disable_hardlockup_detector(void)
 	hardlockup_detector_disable();
 #else
 	if (firmware_has_feature(FW_FEATURE_LPAR)) {
+		check_kvm_guest();
 		if (is_kvm_guest())
 			hardlockup_detector_disable();
 	}
-- 
2.47.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] arch/powerpc/pseries: Fix KVM guest detection for disabling hardlockup detector
  2024-11-08  9:48 [PATCH v2] arch/powerpc/pseries: Fix KVM guest detection for disabling hardlockup detector Gautam Menghani
@ 2024-11-17 12:09 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2024-11-17 12:09 UTC (permalink / raw)
  To: mpe, npiggin, christophe.leroy, naveen, maddy, vaibhav, Gautam Menghani
  Cc: linuxppc-dev, linux-kernel

On Fri, 08 Nov 2024 15:18:37 +0530, Gautam Menghani wrote:
> As per the kernel documentation[1], hardlockup detector should be
> disabled in KVM guests as it may give false positives. On PPC, hardlockup
> detector is enabled inside KVM guests because disable_hardlockup_detector()
> is marked as early_initcall and it relies on kvm_guest static key
> (is_kvm_guest()) which is initialized later during boot by
> check_kvm_guest(), which is a core_initcall. check_kvm_guest() is also
> called in pSeries_smp_probe(), which is called before initcalls, but it is
> skipped if KVM guest does not have doorbell support or if the guest is
> launched with SMT=1.
> 
> [...]

Applied to powerpc/next.

[1/1] arch/powerpc/pseries: Fix KVM guest detection for disabling hardlockup detector
      https://git.kernel.org/powerpc/c/44e5d21e6d3fd2a1fed7f0327cf72e99397e2eaf

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-17 12:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-08  9:48 [PATCH v2] arch/powerpc/pseries: Fix KVM guest detection for disabling hardlockup detector Gautam Menghani
2024-11-17 12:09 ` Michael Ellerman

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®