From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (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 A859940315F for ; Tue, 30 Jun 2026 10:51:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782816705; cv=none; b=RR8XpmquoM6W/9cpaJ17O3+XOk+3VClIXJ06nuCvJFEUYWsiLMX9wn0ZHdnAcKX+h25gKPSCKH9bpHV03L03PthdfmhHQVkYvrhM1kSZto0JdjPFd94/YSTWafK9MgyCC69CZB6cItdhWFdMHTQ6d0fVYxg3fQK8xfiVihHO7ZI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782816705; c=relaxed/simple; bh=yGSNY7ynCyxDKuTp4xxjgFhwFrvrYfhdKsV0cp+Yjgg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LgDe0tFzzj0ZVg+xPdcm0NVXI/irRWlFCaBb9bkI39SahgCKE25R1T4WEnmhdqiDN41d943azrwH9nv3hXMzyCsvhG8PoGO9luMXFkrFUoCPF/mFZvPxgmnJpb4g4Djcl30eB6yL3lTEOJPiGEwdqoItimTm6AlpVtltqXoVHag= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=tLKtQvIH; arc=none smtp.client-ip=91.218.175.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="tLKtQvIH" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1782816692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H9n7ZDpIccfmSH+LPnECjmP2B4EEr/9E/8XqHFTUfhY=; b=tLKtQvIHPPZ3b4rEERovDRJqgbHmYlhXaOm/EjNtjomCDmMj6tjE2wn/lOcMdKOiEY14Jj zL6gUZijwI6higGOLymEzIvrbMCPe0Jp4XrWn2dW7Y89drmKG/QUJg/hUUL7FrFUXMlFpc 8Mkflnqg2HFcRyKSPVmvqsJPelqBkBw= From: Usama Arif To: Kiryl Shutsemau Cc: Usama Arif , Catalin Marinas , Will Deacon , James Morse , Mark Rutland , Marc Zyngier , Doug Anderson , Petr Mladek , Thomas Gleixner , Andrew Morton , Baoquan He , Puranjay Mohan , 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, "Kiryl Shutsemau (Meta)" Subject: Re: [PATCH v5 2/4] firmware: arm_sdei: add SDEI_EVENT_SIGNAL support Date: Tue, 30 Jun 2026 03:51:24 -0700 Message-ID: <20260630105125.4006859-1-usama.arif@linux.dev> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On Mon, 29 Jun 2026 16:07:16 +0100 Kiryl Shutsemau wrote: > From: "Kiryl Shutsemau (Meta)" > > Add sdei_event_signal(), a thin wrapper over the SDEI_EVENT_SIGNAL call > (DEN0054) that makes the software-signalled event (event 0) pending on a > target PE -- delivered NMI-like even when that PE has interrupts masked. > It takes no locks, so it is safe to call from NMI / crash context. > > Signed-off-by: Kiryl Shutsemau (Meta) > Reviewed-by: Douglas Anderson > --- > drivers/firmware/arm_sdei.c | 12 ++++++++++++ > include/linux/arm_sdei.h | 6 ++++++ > include/uapi/linux/arm_sdei.h | 1 + > 3 files changed, 19 insertions(+) > > diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c > index c161cf263547..e8dd2f0f3919 100644 > --- a/drivers/firmware/arm_sdei.c > +++ b/drivers/firmware/arm_sdei.c > @@ -339,6 +339,18 @@ static void _ipi_unmask_cpu(void *ignored) > sdei_unmask_local_cpu(); > } > > +/* > + * Signal the software-signalled event (event 0) to @mpidr. Does nothing > + * but the SMC -- no locks, no event lookup -- so it is safe from NMI / > + * crash context (e.g. the cross-CPU NMI service). > + */ > +int sdei_event_signal(u32 event_num, u64 mpidr) > +{ > + return invoke_sdei_fn(SDEI_1_0_FN_SDEI_EVENT_SIGNAL, event_num, > + mpidr, 0, 0, 0, NULL); > +} > +NOKPROBE_SYMBOL(sdei_event_signal); > + Same as patch 1, can this be merged in patch 3? Its good to keep functions where they are used. > /* > * Was SDEI firmware probed and is it usable? Lets optional consumers skip > * registering an event -- and the warning a failed registration emits -- on > diff --git a/include/linux/arm_sdei.h b/include/linux/arm_sdei.h > index b07113eeeff7..b9dc21c241be 100644 > --- a/include/linux/arm_sdei.h > +++ b/include/linux/arm_sdei.h > @@ -37,6 +37,12 @@ int sdei_event_unregister(u32 event_num); > int sdei_event_enable(u32 event_num); > int sdei_event_disable(u32 event_num); > > +/* > + * Signal the software-signalled event (event 0) to another PE, NMI-like. > + * @mpidr is the target's MPIDR affinity. > + */ > +int sdei_event_signal(u32 event_num, u64 mpidr); > + > /* Was SDEI firmware probed and usable? */ > bool sdei_is_present(void); > > diff --git a/include/uapi/linux/arm_sdei.h b/include/uapi/linux/arm_sdei.h > index af0630ba5437..22eb61612673 100644 > --- a/include/uapi/linux/arm_sdei.h > +++ b/include/uapi/linux/arm_sdei.h > @@ -22,6 +22,7 @@ > #define SDEI_1_0_FN_SDEI_PE_UNMASK SDEI_1_0_FN(0x0C) > #define SDEI_1_0_FN_SDEI_INTERRUPT_BIND SDEI_1_0_FN(0x0D) > #define SDEI_1_0_FN_SDEI_INTERRUPT_RELEASE SDEI_1_0_FN(0x0E) > +#define SDEI_1_0_FN_SDEI_EVENT_SIGNAL SDEI_1_0_FN(0x0F) > #define SDEI_1_0_FN_SDEI_PRIVATE_RESET SDEI_1_0_FN(0x11) > #define SDEI_1_0_FN_SDEI_SHARED_RESET SDEI_1_0_FN(0x12) > > -- > 2.54.0 > >