From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 811FD4315F for ; Fri, 26 Jun 2026 19:46:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782503179; cv=none; b=m+w9p6Ap3uNbmIFrAT5wHMn5d0YeE92Z4B/TVermTeRkNSOI+bgnd5fS8fD/9YUZ6GbicKhGRUR0c5xE2HlkJbj7B5kwAR8opgy7EbK3pD+VvACieV2nktWdVTD5kyRKWwKFsht6wAsrdNRiz/VvsmQluuo64BH7mrPK72XHAno= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782503179; c=relaxed/simple; bh=PZpHygO4PN3M1EhENR8YauqOa4TC8dD/Bv/VVKNWQAw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=o4+K4OIb2Y6ynisS8Y1ybCqFthif3H8tegOAEdpX0xDVfLAuz13GYFBkSPgDUcK3ioAG1QqdUwiKXyJi1illnjKrnBXf0lNli67XWOMk86TQwNAa6Im/Rmear546eoXWsy2H6+awWMx0BaAntB62evC2x+VjWhFvoDTESWjRVyM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name; spf=pass smtp.mailfrom=shutemov.name; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b=t9ECNG12; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=A1/J9Oon; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shutemov.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b="t9ECNG12"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="A1/J9Oon" Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfout.phl.internal (Postfix) with ESMTP id A130EEC01A0; Fri, 26 Jun 2026 15:46:17 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Fri, 26 Jun 2026 15:46:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1782503177; x= 1782589577; bh=mQDS3FNwFL0olJLot7xWeYkpD2cNzX+ab2vKP1ejTJU=; b=t 9ECNG12Gkha5phnwc9I7S2T1DyIPXeHMEcvsBweZlljW5+SXaTIOih4G5wZTJuzd PySi38CO2ScjpjP2gCLRUCdzG/d6MU6a9npchfk9QuwLA5zHMnjLS3Opq0Kw84vW vsUzyfzdc+qx7C+FJWYlU8k+RRWK6DLeXyofeAxfnahKFMx/at89oqDIWh5iTCHc Pg33NRQlEqK43CqC8mGNuFjMTt324ymR6Mj9waw9EXHczqRZWJcYXlXs51zo5iDb +DCOcMAAGYI8bcMX0q+9wU5JLr6s6+8USpgznd8xavTduI/cZmAnGVvcchu6r4VM g1Zsg5n7kZl9hNuxrv+mw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1782503177; x=1782589577; bh=mQDS3FNwFL0olJLot7xWeYkpD2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nzMy4KBXH1Rzbc1Q X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 26 Jun 2026 15:46:16 -0400 (EDT) Date: Fri, 26 Jun 2026 20:46:15 +0100 From: Kiryl Shutsemau To: Catalin Marinas 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 4/4] arm64: escalate smp_send_stop() to an SDEI NMI as a last resort Message-ID: References: <97a870d0670b7e1c2fb9f5142f6e36c594282017.1781709543.git.kas@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Jun 26, 2026 at 06:08:41PM +0100, Catalin Marinas wrote: > On Wed, Jun 17, 2026 at 08:20:05PM +0100, Kiryl Shutsemau wrote: > > +void sdei_nmi_stop_cpus(const cpumask_t *mask) > > +{ > > + unsigned int cpu; > > + > > + WRITE_ONCE(sdei_nmi_stopping, true); > > + > > + /* > > + * Publish the flag before signalling. The SMC is a context-sync > > + * event, not a barrier, so WRITE_ONCE() alone could let the store be > > + * observed after the event it triggers. The barrier is cumulative: a > > + * target that sees the event is guaranteed to see the flag. > > + */ > > + smp_wmb(); > > + > > + for_each_cpu(cpu, mask) > > + sdei_nmi_fire(cpu); > > +} > > The smp_wmb() is not sufficient here. In the GIC IPI code we use a > dsb(ishst). It should be similar here. I think TF-A does this already > but it's unclear from the SDEI spec that it is mandated. You're right, I'll switch it to dsb(ishst) to match gic_ipi_send_mask(). And as you pointed, the xame fix is needed in 3/4: the backtrace path publishes backtrace_mask before signalling and currently has no barrier at all (as the bot spotted), so it needs the dsb(ishst) there too. I'll also drop the now-incorrect "cumulative wmb" comment. -- Kiryl Shutsemau / Kirill A. Shutemov