All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harsh Prateek Bora <harshpb@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: Shivang Upadhyay <shivangu@linux.ibm.com>,
	Sourabh Jain <sourabhjain@linux.ibm.com>,
	Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
	Anushree Mathur <anushree.mathur@linux.vnet.ibm.com>,
	Vishal Chourasia <vishalc@linux.ibm.com>
Subject: [PULL 1/5] ppc/spapr: Skip system reset for quiesced CPUs
Date: Sat, 23 May 2026 21:57:20 +0530	[thread overview]
Message-ID: <20260523162724.95229-2-harshpb@linux.ibm.com> (raw)
In-Reply-To: <20260523162724.95229-1-harshpb@linux.ibm.com>

From: Shivang Upadhyay <shivangu@linux.ibm.com>

During DLPAR CPU hotplug, newly added CPUs start in RTAS stopped state
(quiesced). If a kexec crash occurs before the guest starts these CPUs
via start-cpu RTAS call, H_SIGNAL_SYS_RESET_ALL_OTHERS will reset them
anyway, causing the kdump kernel to hang:

  [    5.519483][    T1] Processor 0 is stuck.
  [   11.089481][    T1] Processor 1 is stuck.

The hypervisor should only reset CPUs that the guest has started. The
cpu->env.quiesced flag tracks RTAS stopped state - CPUs in this state
are already inactive and should not be reset.

Skip system reset for quiesced CPUs to prevent kdump hangs during CPU
hotplug operations.

Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: Harsh Prateek Bora <harshpb@linux.ibm.com>
Cc: Mahesh J Salgaonkar <mahesh@linux.ibm.com>
Reported-by: Anushree Mathur <anushree.mathur@linux.vnet.ibm.com>
Suggested-by: Vishal Chourasia <vishalc@linux.ibm.com>
Reviewed-by: Vishal Chourasia <vishalc@linux.ibm.com>
Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260511095055.82495-1-shivangu@linux.ibm.com
[harshpb: expanded comment to elobarate more on the rationale]
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
 hw/ppc/spapr_hcall.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 032805a8d0..60ba215e86 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -1105,6 +1105,15 @@ static target_ulong h_signal_sys_reset(PowerPCCPU *cpu,
                     continue;
                 }
             }
+
+            /* Skip quiesced CPUs - they are in RTAS stopped state and
+             * should not be reset. This prevents kdump hangs when CPUs
+             * are hotplugged but not yet started by the guest.
+             */
+            if (c->env.quiesced) {
+                continue;
+            }
+
             run_on_cpu(cs, spapr_do_system_reset_on_cpu, RUN_ON_CPU_NULL);
         }
         return H_SUCCESS;
-- 
2.52.0



  reply	other threads:[~2026-05-23 16:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-23 16:27 [PULL 0/5] PPC Queue for 2026-05-23 Harsh Prateek Bora
2026-05-23 16:27 ` Harsh Prateek Bora [this message]
2026-05-23 16:27 ` [PULL 2/5] ppc/pnv: Fix uninitialized MpiplProcDumpArea struct Harsh Prateek Bora
2026-05-23 16:27 ` [PULL 3/5] target/ppc/kvm: Fix const violation when trimming CPU alias suffix Harsh Prateek Bora
2026-05-23 16:27 ` [PULL 4/5] ppc/pnv: Make PowerNV11 as the default powernv machine Harsh Prateek Bora
2026-05-23 16:27 ` [PULL 5/5] ppc/spapr: Make Power11 as default cpu for pseries Harsh Prateek Bora
2026-05-26 14:58 ` [PULL 0/5] PPC Queue for 2026-05-23 Stefan Hajnoczi

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=20260523162724.95229-2-harshpb@linux.ibm.com \
    --to=harshpb@linux.ibm.com \
    --cc=anushree.mathur@linux.vnet.ibm.com \
    --cc=mahesh@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=shivangu@linux.ibm.com \
    --cc=sourabhjain@linux.ibm.com \
    --cc=vishalc@linux.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.