From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17964C43458 for ; Mon, 29 Jun 2026 15:54:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QadHf/c4nC9yt2VwHXLTFiroUss5lFXWZ9eyxJMcwGc=; b=KdD0sbGPcOUFknLUpGr/3kpgb7 P/w7r1+17sAkhdEUlttFXvoOST5gy03vFljPRdF9QOb13g6fId8SEDxPl120tw8uzPBG4xgjFoh5o uKRcMpdWSmUrHXvLIWcPA0euEBtQOX4RQ4MFn9u/VQFRnq4qqUY3kyu5WdAViZuOWHOsbnAPLPyT7 /ysJ18B2HG4yEwdvdliJHhPMrXKaxk0TnRufIzjCbhB7JpqFb5Sw+c64Zl66uqI7BOZdXtexXrmQg y2QvIaEjK9LIQ8hrVZRujPXtUTwrY6vaY6DL73/uBtAYgQYv8Esr8/C53wvOkfD5ROoPZ0jPpUJGh 3UUBvUag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1weEJZ-0000000F8SD-1dd4; Mon, 29 Jun 2026 15:54:29 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1weEJW-0000000F8RT-3Qgw; Mon, 29 Jun 2026 15:54:28 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 56B93339; Mon, 29 Jun 2026 08:54:19 -0700 (PDT) Received: from arm.com (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E9C053F673; Mon, 29 Jun 2026 08:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1782748463; bh=PEmFDKBgCksf81j7VvtfZ7vWMDUHtqYjKsy1c3eLLHc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q1Ds7g8LQm/f/sRY3aU8CRxFBcAhXW5+3DKKrIdJnaV+H333kFK30OtA740u8lsQq 2IpCqmDqJNRRLqAChO9LN4I1enJxHu5S2gEbGoT7vbXJxNI84W4Tq+RT22YtWNWJXj F2D2POYOIFlmQpXS7/BHGFY3vpHzOTb0vAudG+hU= Date: Mon, 29 Jun 2026 16:54:18 +0100 From: Catalin Marinas To: Kiryl Shutsemau Cc: Will Deacon , James Morse , Mark Rutland , Marc Zyngier , Doug Anderson , Petr Mladek , Thomas Gleixner , Andrew Morton , Baoquan He , Puranjay Mohan , Usama Arif , Breno Leitao , Julien Thierry , Lecopzer Chen , Sumit Garg , kernel-team@meta.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 0/4] arm64: cross-CPU NMI via SDEI Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260629_085427_043741_14D6010E X-CRM114-Status: GOOD ( 25.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 29, 2026 at 02:05:14PM +0100, Kiryl Shutsemau wrote: > On Fri, Jun 26, 2026 at 08:40:57PM +0100, Kiryl Shutsemau wrote: > > But I have not tried calling CPU_OFF directly, without completing the > > event. I assumed it is required. Will give it a try when I have time. > > Tried it now, and it doesn't work either -- in a more interesting way. > > Calling PSCI CPU_OFF directly from the SDEI handler (event left > uncompleted) reproducibly breaks the kdump capture kernel, and this > reproduces under QEMU's TF-A, not just on Grace -- so it isn't a Grace > firmware quirk. I had a quick grep (with the help of claude) through the TF-A code and it doesn't seem to be compliant with the spec. It should subscribe to the PSCI CPU_OFF event and complete the SDEI but it doesn't. It seems to handle CPU_ON but that may not be sufficient. It only EIOs the SGI once the OS completed the event, which doesn't happen if you issue CPU_OFF. > The test: a CPU wedged with interrupts masked is stopped via the SDEI > rung; its handler calls __cpu_try_die() instead of parking. A/B in QEMU, > changing only that wedged CPU's handling (everything else identical): > > - park it (current series): capture kernel boots fully to a shell. > - CPU_OFF from the handler: capture kernel hangs in early boot, around > SDEI re-init, never reaches a shell. > > Powering the PE off while its SDEI event is still active leaves EL3's > dispatch state dangling, and the capture kernel trips over it. Completing > the event first and then CPU_OFF -- what I tried originally -- silently > wedges EL3 on Grace instead. > > So both routes off fail, and the CPU stays parked. The dump is complete > either way; only re-onlining the stopped CPU in an SMP capture kernel is > lost. It's a cheap QEMU repro now if anyone wants to dig into the EL3 > side. Have you tried SDEI_EVENT_COMPLETE_AND_RESUME instead? Just COMPLETE won't return to the kernel. We have sdei_handler_abort() to complete the event and, hopefully, you can continue with the CPU_OFF. It's a work around the TF-A non-compliance but I think this is useful even if you don't issue the CPU_OFF (e.g. no CPU hotplug, just the park loop). -- Catalin