public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
From: Shivang Upadhyay <shivangu@linux.ibm.com>
To: Vishal Chourasia <vishalc@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>,
	Michael Ellerman	 <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Srikar Dronamraju <srikar@linux.ibm.com>,
	Shrikanth Hegde <sshegde@linux.ibm.com>,
	"Nysal Jan K.A." <nysal@linux.ibm.com>,
	Ritesh Harjani	 <ritesh.list@gmail.com>,
	Sourabh Jain <sourabhjain@linux.ibm.com>,
	Anushree Mathur <anushree.mathur@linux.vnet.ibm.com>
Subject: Re: [PATCH v2] pseries/kexec: skip resetting CPUs added by firmware but not started by the kernel
Date: Tue, 07 Apr 2026 15:49:56 +0530	[thread overview]
Message-ID: <3075019f74969b25e3ab7f6b3f51ee54ed455aaf.camel@linux.ibm.com> (raw)
In-Reply-To: <da6f75a7-8a68-46a9-9897-1aef11d33829@linux.ibm.com>

Hi, 
Thanks for your review.

On Mon, 2026-04-06 at 14:22 +0530, Vishal Chourasia wrote:
> Hi Shivang,
> 
> Thanks for working on this issue.
> A few questions and concerns about the approach:
> 
> 1. Was this issue only observed with QEMU-based virtualization, or
> does 
> it also reproduce on PowerVM/phyp? The commit message and sample logs
> don't clarify this. If this is QEMU-specific, I think we should fix
> this 
> in QEMU rather than working around it in the kernel.

Currently this is only happening in Qemu (both tcg and kvm mode). But I
think this should be reproducible on phyp also. Ill confirm wheather it
is really the case or not. 

> 2. The approach taken here moves away from the PAPR interface. The 
> kernel currently uses H_SIGNAL_SYS_RESET_ALL_OTHERS, which is the 
> architecturally defined hcall for this purpose. Replacing it with a 
> per-CPU loop that checks internal kernel state (paca cpu_start)
> breaks 
> the clean abstraction between guest and 
> QEMU's sPAPR implementation should behave the same way. The
> hypervisor 

Yeah it is a valid concern about ownership for this resets. Ill try to
see if this fix is possible in qemu itself.

> (QEMU) should maintain a list of CPUs that have been 
> activated/online/started and given to the guest. When 
> H_SIGNAL_SYS_RESET_ALL_OTHERS is called, QEMU should only reset those
> CPUs that the guest has actually started. Unless the guest makes the 
> RTAS start-cpu call for a CPU, QEMU should not include that CPU in
> the 
> set of CPUs to be reset.
> 
> I think discussing this would help determine the right fix location.
> 
> Can you refer to the following commit in QEMU to see if help in this
> case.
> 
> commit fb802acdc8b162084e9e60d42aeba79097d14d2b
> Author: Nicholas Piggin <npiggin@gmail.com>
> Date:   Tue Mar 18 15:03:48 2025 +1000
> 
>      ppc/spapr: Fix RTAS stopped state
> 

Thanks for this reference. cpu->quiesced state was introduced in this
patch, for modelling "RTAS stopped" state. 

as per the commit message: 
A KVM spapr guest boots with all secondary CPUs defined to be in the
RTAS stopped" state. In this state, the CPU is only responsive to the
start-cpu RTAS call.

So, we should be able to use this to check wheather cpu is started or
not. Only other concern here would be about phyp's implementation for
this.

Thanks.
~Shivang.





  reply	other threads:[~2026-04-07 10:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30  6:22 [PATCH v2] pseries/kexec: skip resetting CPUs added by firmware but not started by the kernel Shivang Upadhyay
2026-03-30  8:49 ` Shrikanth Hegde
2026-03-31  2:59   ` Shivang Upadhyay
2026-03-31  4:33 ` Srikar Dronamraju
2026-03-31  6:44   ` Shivang Upadhyay
2026-04-06  8:52 ` Vishal Chourasia
2026-04-07 10:19   ` Shivang Upadhyay [this message]
2026-04-07 10:25     ` Vishal Chourasia

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=3075019f74969b25e3ab7f6b3f51ee54ed455aaf.camel@linux.ibm.com \
    --to=shivangu@linux.ibm.com \
    --cc=anushree.mathur@linux.vnet.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=nysal@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    --cc=sourabhjain@linux.ibm.com \
    --cc=srikar@linux.ibm.com \
    --cc=sshegde@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox